6 #ifndef CNOID_BASE_GL_SCENE_RENDERER_H 7 #define CNOID_BASE_GL_SCENE_RENDERER_H 9 #include <cnoid/SceneGraph> 10 #include <cnoid/SceneRenderer> 11 #include <boost/function.hpp> 16 class GLSceneRendererImpl;
29 virtual void clearScene();
31 virtual int numCameras()
const;
33 virtual const SgNodePath& cameraPath(
int index)
const;
36 virtual SgCamera* currentCamera()
const;
37 virtual int currentCameraIndex()
const;
38 virtual void setCurrentCamera(
int index);
39 virtual bool setCurrentCamera(
SgCamera* camera);
42 virtual void setViewport(
int x,
int y,
int width,
int height);
43 virtual Array4i viewport()
const;
44 void getViewport(
int& out_x,
int& out_y,
int& out_width,
int& out_height)
const;
45 virtual double aspectRatio()
const;
47 virtual const Affine3& currentModelTransform()
const;
48 virtual const Affine3& currentCameraPosition()
const;
49 virtual const Matrix4& projectionMatrix()
const;
52 double& left,
double& right,
double& bottom,
double& top)
const;
54 double& left,
double& right,
double& bottom,
double& top)
const;
59 bool setSwapInterval(
int interval);
60 int getSwapInterval()
const;
70 virtual void initializeRendering();
74 void extractPreprocessedNodes();
76 virtual void beginRendering();
77 virtual void endRendering();
78 virtual void render();
81 bool pick(
int x,
int y);
82 const Vector3& pickedPoint()
const;
85 const Vector3f& backgroundColor()
const;
86 void setBackgroundColor(
const Vector3f& color);
89 virtual void setHeadLight(
SgLight* light);
90 void setHeadLightLightingFromBackEnabled(
bool on);
92 void setAsDefaultLight(
SgLight* light);
93 void unsetDefaultLight(
SgLight* light);
95 void enableAdditionalLights(
bool on);
100 void setDefaultLighting(
bool on);
101 void setDefaultSmoothShading(
bool on);
103 void setDefaultColor(
const Vector4f& color);
104 void enableTexture(
bool on);
105 void setDefaultPointSize(
double size);
106 void setDefaultLineWidth(
double width);
107 void enableFog(
bool on);
110 void setNewDisplayListDoubleRenderingEnabled(
bool on);
112 void showNormalVectors(
double length);
114 void requestToClearCache();
121 virtual void enableUnusedCacheCheck(
bool on);
123 virtual void visitGroup(
SgGroup* group);
125 virtual void visitTransform(
SgTransform* transform);
127 virtual void visitShape(
SgShape* shape);
128 virtual void visitPointSet(
SgPointSet* pointSet);
129 virtual void visitLineSet(
SgLineSet* lineSet);
131 virtual void visitLight(
SgLight* light);
132 virtual void visitOverlay(
SgOverlay* overlay);
137 void setColor(
const Vector4f& color);
138 void enableColorMaterial(
bool on);
139 void setDiffuseColor(
const Vector4f& color);
140 void setAmbientColor(
const Vector4f& color);
141 void setEmissionColor(
const Vector4f& color);
142 void setSpecularColor(
const Vector4f& color);
143 void setShininess(
float shininess);
144 void enableCullFace(
bool on);
145 void setFrontCCW(
bool on);
146 void enableLighting(
bool on);
147 void setLightModelTwoSide(
bool on);
148 void enableBlend(
bool on);
149 void enableDepthMask(
bool on);
150 void setPointSize(
float size);
151 void setLineWidth(
float width);
154 GLSceneRendererImpl* impl;
169 void setRenderingFunction(RenderingFunction f);
175 RenderingFunction renderingFunction;
Definition: SceneLights.h:14
Definition: SceneGraph.h:381
SgCustomGLNode(const SgCustomGLNode &org, SgCloneMap &cloneMap)
Definition: GLSceneRenderer.h:172
Definition: GLSceneRenderer.h:159
Definition: SceneGraph.h:394
Eigen::Matrix4d Matrix4
Definition: EigenTypes.h:60
Definition: SceneDrawables.h:17
SgCustomGLNode(RenderingFunction f)
Definition: GLSceneRenderer.h:165
Definition: SceneEffects.h:36
Definition: SceneCameras.h:14
Definition: SceneDrawables.h:509
Eigen::Affine3d Affine3
Definition: EigenTypes.h:64
Definition: SceneGraph.h:56
Definition: SceneEffects.h:14
std::vector< SgNode * > SgNodePath
Definition: SceneGraph.h:140
Definition: SceneRenderer.h:15
Definition: SceneCameras.h:58
Definition: SceneGraph.h:160
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
Definition: SceneDrawables.h:590
boost::function< void(GLSceneRenderer &renderer)> RenderingFunction
Definition: GLSceneRenderer.h:162
Definition: SceneCameras.h:81
Definition: SceneDrawables.h:420
ref_ptr< SgCustomGLNode > SgCustomGLNodePtr
Definition: GLSceneRenderer.h:177
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
PolygonMode
Definition: GLSceneRenderer.h:97
Definition: SceneDrawables.h:532
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Definition: GLSceneRenderer.h:20
Definition: SceneVisitor.h:15
Definition: SceneGraph.h:249
Definition: SceneGraph.h:79
SgCustomGLNode()
Definition: GLSceneRenderer.h:164