Go to the documentation of this file.
6 #ifndef CNOID_BASE_GL_SCENE_RENDERER_H
7 #define CNOID_BASE_GL_SCENE_RENDERER_H
9 #include <cnoid/SceneRenderer>
10 #include "exportdecl.h"
19 static void initializeClass();
22 static int rendererType();
28 virtual void setOutputStream(std::ostream& os);
30 virtual SgGroup* sceneRoot()
override;
31 virtual SgGroup* scene()
override;
33 virtual bool initializeGL() = 0;
34 virtual void flushGL() = 0;
44 virtual void clearGL();
46 virtual void setDefaultFramebufferObject(
unsigned int id);
48 virtual const std::string& glVendor()
const = 0;
50 virtual void setViewport(
int x,
int y,
int width,
int height) = 0;
53 virtual void updateViewportInformation(
int x,
int y,
int width,
int height);
55 Array4i viewport()
const;
56 void getViewport(
int& out_x,
int& out_y,
int& out_width,
int& out_height)
const;
57 double aspectRatio()
const;
59 void getPerspectiveProjectionMatrix(
60 double fovy,
double aspect,
double zNear,
double zFar,
Matrix4& out_matrix);
61 void getOrthographicProjectionMatrix(
62 double left,
double right,
double bottom,
double top,
double nearVal,
double farVal,
Matrix4& out_matrix);
64 void getViewFrustum(
const SgPerspectiveCamera* camera,
double& left,
double& right,
double& bottom,
double& top)
const;
65 void getViewVolume(
const SgOrthographicCamera* camera,
float& out_left,
float& out_right,
float& out_bottom,
float& out_top)
const;
67 bool unproject(
double x,
double y,
double z,
Vector3& out_projected)
const;
69 const Vector3f& backgroundColor()
const;
70 void setBackgroundColor(
const Vector3f& color);
71 const Vector3f& defaultColor()
const;
72 void setDefaultColor(
const Vector3f& color);
81 virtual void setLightingMode(LightingMode mode) = 0;
82 virtual LightingMode lightingMode()
const = 0;
84 virtual void clearShadows();
85 virtual void enableShadowOfLight(
int index,
bool on =
true);
86 virtual void enableShadowAntiAliasing(
bool on);
87 virtual void setDefaultSmoothShading(
bool on) = 0;
89 virtual void enableTexture(
bool on) = 0;
90 virtual void setDefaultPointSize(
double size) = 0;
91 virtual void setDefaultLineWidth(
double width) = 0;
92 virtual void showNormalVectors(
double length) = 0;
93 virtual void requestToClearResources() = 0;
94 virtual void enableUnusedResourceCheck(
bool on) = 0;
95 virtual const Vector3& pickedPoint()
const = 0;
96 virtual const SgNodePath& pickedNodePath()
const = 0;
97 virtual void setColor(
const Vector3f& color) = 0;
98 virtual void setUpsideDown(
bool on);
107 virtual void setBackFaceCullingMode(
int mode) = 0;
108 virtual int backFaceCullingMode()
const = 0;
110 virtual void setBoundingBoxRenderingForLightweightRenderingGroupEnabled(
bool on);
112 virtual void setPickingImageOutputEnabled(
bool on);
113 virtual bool getPickingImage(
Image& out_image);
115 virtual bool isShadowCastingAvailable()
const;
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
@ MinimumLighting
Definition: GLSceneRenderer.h:76
Definition: SceneCameras.h:56
LightingMode
Definition: GLSceneRenderer.h:74
Definition: SceneGraph.h:220
RendererType
Definition: GLSceneRenderer.h:21
@ NormalLighting
Definition: GLSceneRenderer.h:75
Definition: GLSceneRenderer.h:16
Eigen::Matrix4d Matrix4
Definition: EigenTypes.h:58
Definition: AbstractSceneLoader.h:11
@ ENABLE_BACK_FACE_CULLING
Definition: GLSceneRenderer.h:101
@ FORCE_BACK_FACE_CULLING
Definition: GLSceneRenderer.h:103
std::vector< SgNode * > SgNodePath
Definition: SceneGraph.h:24
@ NoLighting
Definition: GLSceneRenderer.h:78
@ DISABLE_BACK_FACE_CULLING
Definition: GLSceneRenderer.h:102
Definition: SceneDrawables.h:18
Definition: SceneCameras.h:83
@ SolidColorLighting
Definition: GLSceneRenderer.h:77
Definition: SceneRenderer.h:15
CullingMode
Definition: GLSceneRenderer.h:100