Choreonoid  1.8
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
cnoid::SceneRenderer Class Referenceabstract

#include <SceneRenderer.h>

Inheritance diagram for cnoid::SceneRenderer:
cnoid::GLSceneRenderer cnoid::GL1SceneRenderer cnoid::GLSLSceneRenderer

Classes

class  PropertyKey
 

Public Types

typedef PolymorphicSceneNodeFunctionSet NodeFunctionSet
 
typedef std::function< SgNode *(SgNode *targetNode)> NodeDecorationFunction
 

Public Member Functions

 SceneRenderer ()
 
virtual ~SceneRenderer ()
 
void setName (const std::string &name)
 
const std::string & name () const
 
virtual void applyExtensions ()
 
virtual bool applyNewExtensions ()
 
virtual SgGroupsceneRoot ()=0
 
virtual SgGroupscene ()=0
 
virtual void clearScene ()
 
virtual PolymorphicSceneNodeFunctionSetrenderingFunctions ()=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
 
SgCameracamera (int index)
 
const SgNodePathcameraPath (int index) const
 
const Isometry3cameraPosition (int index) const
 
const Isometry3currentCameraPosition () const
 
SignalProxy< void()> sigCamerasChanged () const
 
SgCameracurrentCamera () 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)
 
SgLightheadLight ()
 
void setHeadLight (SgLight *light)
 
void enableAdditionalLights (bool on)
 
void enableFog (bool on)
 
bool isFogEnabled () const
 
int numFogs () const
 
SgFogfog (int index) const
 
virtual const Affine3currentModelTransform () const =0
 
virtual const Matrix4projectionMatrix () 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 addExtension (std::function< void(SceneRenderer *renderer)> func)
 

Protected Member Functions

virtual void doRender ()=0
 
virtual bool doPick (int x, int y)
 

Member Typedef Documentation

◆ NodeDecorationFunction

typedef std::function<SgNode*(SgNode* targetNode)> cnoid::SceneRenderer::NodeDecorationFunction

◆ NodeFunctionSet

Constructor & Destructor Documentation

◆ SceneRenderer()

SceneRenderer::SceneRenderer ( )

◆ ~SceneRenderer()

SceneRenderer::~SceneRenderer ( )
virtual

Member Function Documentation

◆ addExtension()

void SceneRenderer::addExtension ( std::function< void(SceneRenderer *renderer)>  func)
static

◆ addNodeDecoration()

virtual void cnoid::SceneRenderer::addNodeDecoration ( SgNode targetNode,
NodeDecorationFunction  func,
int  id 
)
pure virtual

◆ applyExtensions()

void SceneRenderer::applyExtensions ( )
virtual

Reimplemented in cnoid::GLSLSceneRenderer.

◆ applyNewExtensions()

bool SceneRenderer::applyNewExtensions ( )
virtual

Reimplemented in cnoid::GLSLSceneRenderer.

◆ camera()

SgCamera * SceneRenderer::camera ( int  index)

◆ cameraPath()

const SgNodePath & SceneRenderer::cameraPath ( int  index) const

◆ cameraPosition()

const Isometry3 & SceneRenderer::cameraPosition ( int  index) const

◆ clearNodeDecorations()

virtual void cnoid::SceneRenderer::clearNodeDecorations ( int  id)
pure virtual

◆ clearScene()

void SceneRenderer::clearScene ( )
virtual

◆ currentCamera()

SgCamera * SceneRenderer::currentCamera ( ) const

◆ currentCameraIndex()

int SceneRenderer::currentCameraIndex ( ) const

◆ currentCameraPosition()

const Isometry3 & SceneRenderer::currentCameraPosition ( ) const

◆ currentModelTransform()

virtual const Affine3& cnoid::SceneRenderer::currentModelTransform ( ) const
pure virtual

◆ doPick()

bool SceneRenderer::doPick ( int  x,
int  y 
)
protectedvirtual

◆ doRender()

virtual void cnoid::SceneRenderer::doRender ( )
protectedpure virtual

◆ enableAdditionalLights()

void SceneRenderer::enableAdditionalLights ( bool  on)

◆ enableFog()

void SceneRenderer::enableFog ( bool  on)

◆ extractPreprocessedNodes()

void SceneRenderer::extractPreprocessedNodes ( )

This function updates the information on preprocessed nodes such as cameras, lights, and fogs.

◆ findCameraPath()

int SceneRenderer::findCameraPath ( const std::vector< std::string > &  simplifiedPathStrings)
Returns
Camera index, or -1 if the path is not found.

◆ fog()

SgFog * SceneRenderer::fog ( int  index) const

◆ getLightInfo()

void SceneRenderer::getLightInfo ( int  index,
SgLight *&  out_light,
Isometry3 out_position 
) const

◆ getSimplifiedCameraPathStrings()

bool SceneRenderer::getSimplifiedCameraPathStrings ( int  cameraIndex,
std::vector< std::string > &  out_pathStrings 
)

◆ headLight()

SgLight * SceneRenderer::headLight ( )

◆ isFogEnabled()

bool SceneRenderer::isFogEnabled ( ) const

◆ isRenderingPickingImage()

bool SceneRenderer::isRenderingPickingImage ( ) const
virtual

◆ name()

const std::string & SceneRenderer::name ( ) const

◆ numCameras()

int SceneRenderer::numCameras ( ) const

◆ numFogs()

int SceneRenderer::numFogs ( ) const

◆ numLights()

int SceneRenderer::numLights ( ) const

◆ pick()

bool SceneRenderer::pick ( int  x,
int  y 
)

◆ projectedPixelSizeRatio()

virtual double cnoid::SceneRenderer::projectedPixelSizeRatio ( const Vector3 position) const
pure virtual

◆ projectionMatrix()

virtual const Matrix4& cnoid::SceneRenderer::projectionMatrix ( ) const
pure virtual

◆ property() [1/3]

bool SceneRenderer::property ( PropertyKey  key,
bool  defaultValue 
) const

◆ property() [2/3]

double SceneRenderer::property ( PropertyKey  key,
double  defaultValue 
) const

◆ property() [3/3]

int SceneRenderer::property ( PropertyKey  key,
int  defaultValue 
) const

◆ render()

void SceneRenderer::render ( )

◆ renderCustomGroup()

virtual void cnoid::SceneRenderer::renderCustomGroup ( SgGroup group,
std::function< void()>  traverseFunction 
)
pure virtual

◆ renderCustomTransform()

virtual void cnoid::SceneRenderer::renderCustomTransform ( SgTransform transform,
std::function< void()>  traverseFunction 
)
pure virtual

◆ renderingFunctions()

virtual PolymorphicSceneNodeFunctionSet* cnoid::SceneRenderer::renderingFunctions ( )
pure virtual

◆ renderNode()

virtual void cnoid::SceneRenderer::renderNode ( SgNode node)
pure virtual

◆ scene()

virtual SgGroup* cnoid::SceneRenderer::scene ( )
pure virtual

Implemented in cnoid::GLSceneRenderer.

◆ sceneRoot()

virtual SgGroup* cnoid::SceneRenderer::sceneRoot ( )
pure virtual

Implemented in cnoid::GLSceneRenderer.

◆ setAsDefaultLight()

void SceneRenderer::setAsDefaultLight ( SgLight light)

◆ setCurrentCamera() [1/2]

void SceneRenderer::setCurrentCamera ( int  index)

◆ setCurrentCamera() [2/2]

bool SceneRenderer::setCurrentCamera ( SgCamera camera)

◆ setCurrentCameraAutoRestorationMode()

void SceneRenderer::setCurrentCameraAutoRestorationMode ( bool  on)

◆ setCurrentCameraPath()

bool SceneRenderer::setCurrentCameraPath ( const std::vector< std::string > &  simplifiedPathStrings)

◆ setFlagVariableToUpdatePreprocessedNodeTree()

void SceneRenderer::setFlagVariableToUpdatePreprocessedNodeTree ( bool &  flag)

◆ setHeadLight()

void SceneRenderer::setHeadLight ( SgLight light)

◆ setName()

void SceneRenderer::setName ( const std::string &  name)

◆ setProperty() [1/3]

void SceneRenderer::setProperty ( PropertyKey  key,
bool  value 
)

◆ setProperty() [2/3]

void SceneRenderer::setProperty ( PropertyKey  key,
double  value 
)

◆ setProperty() [3/3]

void SceneRenderer::setProperty ( PropertyKey  key,
int  value 
)

◆ sigCamerasChanged()

SignalProxy< void()> SceneRenderer::sigCamerasChanged ( ) const

◆ sigCurrentCameraChanged()

SignalProxy< void()> SceneRenderer::sigCurrentCameraChanged ( )

◆ simplifiedCameraPathStrings()

std::vector< std::string > SceneRenderer::simplifiedCameraPathStrings ( int  cameraIndex)

◆ unsetDefaultLight()

void SceneRenderer::unsetDefaultLight ( SgLight light)

The documentation for this class was generated from the following files: