Simox  2.3.74.0
VirtualRobot::CoinVisualization Class Reference
Inheritance diagram for VirtualRobot::CoinVisualization:
VirtualRobot::Visualization

Public Member Functions

 CoinVisualization (const VisualizationNodePtr visualizationNode)
 
 CoinVisualization (const std::vector< VisualizationNodePtr > &visualizationNodes)
 
 ~CoinVisualization () override
 
bool highlight (VisualizationNodePtr visualizationNode, bool enable) override
 
bool highlight (unsigned int which, bool enable) override
 
virtual bool highlight (bool enable)
 
virtual bool highlight (SoNode *visu, bool enable)
 
void colorize (VisualizationFactory::Color c) override
 
void setTransparency (float transparency) override
 
VisualizationPtr clone () override
 
SoNode * getCoinVisualization (bool selectable=true)
 
void exportToVRML2 (std::string filename, bool useRotation=true)
 
- Public Member Functions inherited from VirtualRobot::Visualization
 Visualization (const VisualizationNodePtr visualizationNode)
 
 Visualization (const std::vector< VisualizationNodePtr > &visualizationNodes)
 
virtual ~Visualization ()
 
virtual bool isVisualizationNodeRegistered (VisualizationNodePtr visualizationNode)
 
virtual int getNumFaces ()
 get total number of faces (i.e. triangles) of all visualizations that are stored in this object More...
 
std::vector< VisualizationNodePtrgetVisualizationNodes ()
 

Static Public Member Functions

static std::string getFactoryName ()
 
- Static Public Member Functions inherited from VirtualRobot::Visualization
static std::string getFactoryName ()
 

Protected Member Functions

bool buildVisualization ()
 

Protected Attributes

bool isSelectable
 
SoSelection * selection
 
SoSeparator * visuRoot
 
SoMaterial * color
 
- Protected Attributes inherited from VirtualRobot::Visualization
std::vector< VisualizationNodePtrvisualizationNodes
 

Detailed Description

A Coin3D based implementation of a visualization.

Constructor & Destructor Documentation

◆ CoinVisualization() [1/2]

VirtualRobot::CoinVisualization::CoinVisualization ( const VisualizationNodePtr  visualizationNode)

◆ CoinVisualization() [2/2]

VirtualRobot::CoinVisualization::CoinVisualization ( const std::vector< VisualizationNodePtr > &  visualizationNodes)

◆ ~CoinVisualization()

VirtualRobot::CoinVisualization::~CoinVisualization ( )
override

Member Function Documentation

◆ buildVisualization()

bool VirtualRobot::CoinVisualization::buildVisualization ( )
protected

◆ clone()

VirtualRobot::VisualizationPtr VirtualRobot::CoinVisualization::clone ( )
overridevirtual
Returns
new instance of VirtualRobot::CoinVisualization with the same set of robot nodes.

Reimplemented from VirtualRobot::Visualization.

◆ colorize()

void VirtualRobot::CoinVisualization::colorize ( VisualizationFactory::Color  c)
overridevirtual

Colorize this visualization.

Parameters
cThe color to apply. To disable the colorization apply Color::None()

Reimplemented from VirtualRobot::Visualization.

◆ exportToVRML2()

void VirtualRobot::CoinVisualization::exportToVRML2 ( std::string  filename,
bool  useRotation = true 
)

◆ getCoinVisualization()

SoNode * VirtualRobot::CoinVisualization::getCoinVisualization ( bool  selectable = true)

This method iterates over the entries in member CoinVisualization::visualizationNodes and stores the return value of CoinVisualizationNode::getCoinVisualization() in an SoSeparator if the processed node is of type CoinVisualizationNode. Afterwards the SoSeparator is returned.

◆ getFactoryName()

static std::string VirtualRobot::CoinVisualization::getFactoryName ( )
inlinestatic

◆ highlight() [1/4]

bool VirtualRobot::CoinVisualization::highlight ( VisualizationNodePtr  visualizationNode,
bool  enable 
)
overridevirtual

To see the visualizations in an SoExaminerViewer enable an highlight render action e.g. viewer->setGLRenderAction(new SoLineHighlightRenderAction);

Reimplemented from VirtualRobot::Visualization.

◆ highlight() [2/4]

bool VirtualRobot::CoinVisualization::highlight ( unsigned int  which,
bool  enable 
)
overridevirtual

Highlight a visualization node.

Parameters
whichThe index of the visualionNodes, passed to the constructor.
enableDo/Undo highlighting.

Reimplemented from VirtualRobot::Visualization.

◆ highlight() [3/4]

bool VirtualRobot::CoinVisualization::highlight ( bool  enable)
virtual

◆ highlight() [4/4]

bool VirtualRobot::CoinVisualization::highlight ( SoNode *  visu,
bool  enable 
)
virtual

◆ setTransparency()

void VirtualRobot::CoinVisualization::setTransparency ( float  transparency)
overridevirtual

Colorize this visualization, but just set the transparency flag (no additional colorization is performed).

Parameters
transparencyThe transparent value in [0..1].

Reimplemented from VirtualRobot::Visualization.

Field Documentation

◆ color

SoMaterial* VirtualRobot::CoinVisualization::color
protected

◆ isSelectable

bool VirtualRobot::CoinVisualization::isSelectable
protected

◆ selection

SoSelection* VirtualRobot::CoinVisualization::selection
protected

◆ visuRoot

SoSeparator* VirtualRobot::CoinVisualization::visuRoot
protected