Choreonoid
1.8
|
#include <GLSceneRenderer.h>
Public Types | |
enum | RendererType { GL1_RENDERER, GLSL_RENDERER } |
enum | LightingMode { NormalLighting, MinimumLighting, SolidColorLighting, NoLighting, NumLightingModes } |
enum | CullingMode { ENABLE_BACK_FACE_CULLING, DISABLE_BACK_FACE_CULLING, FORCE_BACK_FACE_CULLING, N_CULLING_MODES } |
Public Types inherited from cnoid::SceneRenderer | |
typedef PolymorphicSceneNodeFunctionSet | NodeFunctionSet |
typedef std::function< SgNode *(SgNode *targetNode)> | NodeDecorationFunction |
Public Member Functions | |
GLSceneRenderer (SgGroup *root=nullptr) | |
virtual | ~GLSceneRenderer () |
virtual void | setOutputStream (std::ostream &os) |
virtual SgGroup * | sceneRoot () override |
virtual SgGroup * | scene () override |
virtual bool | initializeGL ()=0 |
virtual void | flushGL ()=0 |
virtual void | clearGL () |
virtual void | setDefaultFramebufferObject (unsigned int id) |
virtual const std::string & | glVendor () const =0 |
virtual void | setViewport (int x, int y, int width, int height)=0 |
virtual void | updateViewportInformation (int x, int y, int width, int height) |
Array4i | viewport () const |
void | getViewport (int &out_x, int &out_y, int &out_width, int &out_height) const |
double | aspectRatio () const |
void | getPerspectiveProjectionMatrix (double fovy, double aspect, double zNear, double zFar, Matrix4 &out_matrix) |
void | getOrthographicProjectionMatrix (double left, double right, double bottom, double top, double nearVal, double farVal, Matrix4 &out_matrix) |
void | getViewFrustum (const SgPerspectiveCamera *camera, double &left, double &right, double &bottom, double &top) const |
void | getViewVolume (const SgOrthographicCamera *camera, float &out_left, float &out_right, float &out_bottom, float &out_top) const |
bool | unproject (double x, double y, double z, Vector3 &out_projected) const |
const Vector3f & | backgroundColor () const |
void | setBackgroundColor (const Vector3f &color) |
const Vector3f & | defaultColor () const |
void | setDefaultColor (const Vector3f &color) |
virtual void | setLightingMode (LightingMode mode)=0 |
virtual LightingMode | lightingMode () const =0 |
virtual void | clearShadows () |
virtual void | enableShadowOfLight (int index, bool on=true) |
virtual void | enableShadowAntiAliasing (bool on) |
virtual void | setDefaultSmoothShading (bool on)=0 |
virtual SgMaterial * | defaultMaterial ()=0 |
virtual void | enableTexture (bool on)=0 |
virtual void | setDefaultPointSize (double size)=0 |
virtual void | setDefaultLineWidth (double width)=0 |
virtual void | showNormalVectors (double length)=0 |
virtual void | requestToClearResources ()=0 |
virtual void | enableUnusedResourceCheck (bool on)=0 |
virtual const Vector3 & | pickedPoint () const =0 |
virtual const SgNodePath & | pickedNodePath () const =0 |
virtual void | setColor (const Vector3f &color)=0 |
virtual void | setUpsideDown (bool on) |
virtual void | setBackFaceCullingMode (int mode)=0 |
virtual int | backFaceCullingMode () const =0 |
virtual void | setBoundingBoxRenderingForLightweightRenderingGroupEnabled (bool on) |
virtual void | setPickingImageOutputEnabled (bool on) |
virtual bool | getPickingImage (Image &out_image) |
virtual bool | isShadowCastingAvailable () const |
Public Member Functions inherited from cnoid::SceneRenderer | |
SceneRenderer () | |
virtual | ~SceneRenderer () |
void | setName (const std::string &name) |
const std::string & | name () const |
virtual void | applyExtensions () |
virtual bool | applyNewExtensions () |
virtual void | clearScene () |
virtual PolymorphicSceneNodeFunctionSet * | renderingFunctions ()=0 |
virtual void | renderCustomGroup (SgGroup *group, std::function< void()> traverseFunction)=0 |
virtual void | renderCustomTransform (SgTransform *transform, std::function< void()> traverseFunction)=0 |
virtual void | renderNode (SgNode *node)=0 |
virtual void | addNodeDecoration (SgNode *targetNode, NodeDecorationFunction func, int id)=0 |
virtual void | clearNodeDecorations (int id)=0 |
int | numCameras () const |
SgCamera * | camera (int index) |
const SgNodePath & | cameraPath (int index) const |
const Isometry3 & | cameraPosition (int index) const |
const Isometry3 & | currentCameraPosition () const |
SignalProxy< void()> | sigCamerasChanged () const |
SgCamera * | currentCamera () const |
int | currentCameraIndex () const |
void | setCurrentCamera (int index) |
bool | setCurrentCamera (SgCamera *camera) |
SignalProxy< void()> | sigCurrentCameraChanged () |
std::vector< std::string > | simplifiedCameraPathStrings (int cameraIndex) |
bool | getSimplifiedCameraPathStrings (int cameraIndex, std::vector< std::string > &out_pathStrings) |
int | findCameraPath (const std::vector< std::string > &simplifiedPathStrings) |
bool | setCurrentCameraPath (const std::vector< std::string > &simplifiedPathStrings) |
void | setCurrentCameraAutoRestorationMode (bool on) |
int | numLights () const |
void | getLightInfo (int index, SgLight *&out_light, Isometry3 &out_position) const |
void | setAsDefaultLight (SgLight *light) |
void | unsetDefaultLight (SgLight *light) |
SgLight * | headLight () |
void | setHeadLight (SgLight *light) |
void | enableAdditionalLights (bool on) |
void | enableFog (bool on) |
bool | isFogEnabled () const |
int | numFogs () const |
SgFog * | fog (int index) const |
virtual const Affine3 & | currentModelTransform () const =0 |
virtual const Matrix4 & | projectionMatrix () const =0 |
virtual double | projectedPixelSizeRatio (const Vector3 &position) const =0 |
void | extractPreprocessedNodes () |
void | setFlagVariableToUpdatePreprocessedNodeTree (bool &flag) |
void | render () |
bool | pick (int x, int y) |
virtual bool | isRenderingPickingImage () const |
void | setProperty (PropertyKey key, bool value) |
void | setProperty (PropertyKey key, int value) |
void | setProperty (PropertyKey key, double value) |
bool | property (PropertyKey key, bool defaultValue) const |
int | property (PropertyKey key, int defaultValue) const |
double | property (PropertyKey key, double defaultValue) const |
Static Public Member Functions | |
static void | initializeClass () |
static int | rendererType () |
static GLSceneRenderer * | create (SgGroup *root=nullptr) |
Static Public Member Functions inherited from cnoid::SceneRenderer | |
static void | addExtension (std::function< void(SceneRenderer *renderer)> func) |
Additional Inherited Members | |
Protected Member Functions inherited from cnoid::SceneRenderer | |
virtual void | doRender ()=0 |
virtual bool | doPick (int x, int y) |
GLSceneRenderer::GLSceneRenderer | ( | SgGroup * | root = nullptr | ) |
|
virtual |
double GLSceneRenderer::aspectRatio | ( | ) | const |
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
const Vector3f & GLSceneRenderer::backgroundColor | ( | ) | const |
|
virtual |
This function clears all the OpenGL resourses used in the renderer. The function should be called when the renderer is deleted. The function must be called when the OpenGL context is changed, and then the initializeGL function must be called again for the new OpenGL context. Note that the corresponding OpenGL context must be made current when the function is called.
Reimplemented in cnoid::GLSLSceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
static |
const Vector3f & GLSceneRenderer::defaultColor | ( | ) | const |
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
void GLSceneRenderer::getOrthographicProjectionMatrix | ( | double | left, |
double | right, | ||
double | bottom, | ||
double | top, | ||
double | nearVal, | ||
double | farVal, | ||
Matrix4 & | out_matrix | ||
) |
void GLSceneRenderer::getPerspectiveProjectionMatrix | ( | double | fovy, |
double | aspect, | ||
double | zNear, | ||
double | zFar, | ||
Matrix4 & | out_matrix | ||
) |
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
void GLSceneRenderer::getViewFrustum | ( | const SgPerspectiveCamera * | camera, |
double & | left, | ||
double & | right, | ||
double & | bottom, | ||
double & | top | ||
) | const |
void GLSceneRenderer::getViewport | ( | int & | out_x, |
int & | out_y, | ||
int & | out_width, | ||
int & | out_height | ||
) | const |
void GLSceneRenderer::getViewVolume | ( | const SgOrthographicCamera * | camera, |
float & | out_left, | ||
float & | out_right, | ||
float & | out_bottom, | ||
float & | out_top | ||
) | const |
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
static |
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
static |
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
overridevirtual |
Implements cnoid::SceneRenderer.
|
overridevirtual |
Implements cnoid::SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
void GLSceneRenderer::setBackgroundColor | ( | const Vector3f & | color | ) |
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
void GLSceneRenderer::setDefaultColor | ( | const Vector3f & | color | ) |
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
|
pure virtual |
Implemented in cnoid::GLSLSceneRenderer, and cnoid::GL1SceneRenderer.
bool GLSceneRenderer::unproject | ( | double | x, |
double | y, | ||
double | z, | ||
Vector3 & | out_projected | ||
) | const |
|
virtual |
Reimplemented in cnoid::GLSLSceneRenderer.
Array4i GLSceneRenderer::viewport | ( | ) | const |