Simox  2.3.62
VirtualRobot::VisualizationNode Class Reference
Inheritance diagram for VirtualRobot::VisualizationNode:

Public Member Functions

 VisualizationNode ()
virtual ~VisualizationNode ()
virtual TriMeshModelPtr getTriMeshModel ()
virtual void setGlobalPose (const Eigen::Matrix4f &m)
const Eigen::Matrix4f & getGlobalPose () const
virtual VisualizationNodePtr clone (bool deepCopy=true, float scaling=1.0f)
virtual void attachVisualization (const std::string &name, VisualizationNodePtr v)
virtual void detachVisualization (const std::string &name)
virtual bool hasAttachedVisualization (const std::string &name)
virtual VisualizationNodePtr getAttachedVisualization (const std::string &name)
virtual void setupVisualization (bool showVisualization, bool showAttachedVisualizations)
void setUpdateVisualization (bool enable)
bool getUpdateVisualizationStatus ()
virtual void print ()
 print information about this visualization object. More...
virtual int getNumFaces ()
 get number of faces (i.e. triangles) of this object More...
std::string getFilename ()
 optional filename tag More...
bool usedBoundingBoxVisu ()
void setFilename (const std::string &filename, bool boundingBox)
 Just stores the filename, no loading is performed! More...
virtual std::string getType ()
std::string toXML (const std::string &basePath, int tabs)
std::string toXML (const std::string &basePath, const std::string &filename, int tabs)
BoundingBox getBoundingBox ()
virtual bool saveModel (const std::string &modelPath, const std::string &filename)
virtual void scale (Eigen::Vector3f &scaleFactor)
virtual void shrinkFatten (float offset)
virtual void createTriMeshModel ()
 update trimesh model More...

Static Public Member Functions

static VisualizationNodePtr CreateUnitedVisualization (const std::vector< VisualizationNodePtr > &visualizations)

Data Fields

EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::vector< Primitive::PrimitivePtrprimitives

Protected Attributes

bool boundingBox
 Indicates, if the bounding box model was used. More...
std::string filename
 if the visualization was build from a file, the filename is stored here More...
Eigen::Matrix4f globalPose
bool updateVisualization
bool showVisualization
bool showAttachedVisualizations
std::map< std::string, VisualizationNodePtrattachedVisualizations

Constructor & Destructor Documentation

VirtualRobot::VisualizationNode::VisualizationNode ( )


VirtualRobot::VisualizationNode::~VisualizationNode ( )

Member Function Documentation

void VirtualRobot::VisualizationNode::attachVisualization ( const std::string &  name,
VisualizationNodePtr  v 

Attach an optional visualization to this VisualizationNode. The attached visualizations will not show up in the TriMeshModel. If there is already a visualization attached with the given name, it is quietly replaced.

Reimplemented in VirtualRobot::CoinVisualizationNode.

VirtualRobot::VisualizationNodePtr VirtualRobot::VisualizationNode::clone ( bool  deepCopy = true,
float  scaling = 1.0f 

Clone this visualization.

deepCopyWhen true, the underlying visualization is copied, otherwise a reference to the existing visualization is passed.
scalingScale Can be set to create a scaled version of this visual data. Since the underlying implementation may be able to re-use the visualization data, a deep copy may not be necessary in some cases.

Reimplemented in VirtualRobot::CoinVisualizationNode.

void VirtualRobot::VisualizationNode::createTriMeshModel ( )

update trimesh model

Reimplemented in VirtualRobot::CoinVisualizationNode.

VirtualRobot::VisualizationNodePtr VirtualRobot::VisualizationNode::CreateUnitedVisualization ( const std::vector< VisualizationNodePtr > &  visualizations)

Create a united visualization. Behavior depends on the derived implementation, but usually the visualizations are copied and united to one object.

void VirtualRobot::VisualizationNode::detachVisualization ( const std::string &  name)

Remove an attached visualization.

Reimplemented in VirtualRobot::CoinVisualizationNode.

VisualizationNodePtr VirtualRobot::VisualizationNode::getAttachedVisualization ( const std::string &  name)

Get for an attached visualization.

VirtualRobot::BoundingBox VirtualRobot::VisualizationNode::getBoundingBox ( )

Returns (current) bounding box in global coordinate system.

std::string VirtualRobot::VisualizationNode::getFilename ( )

optional filename tag

const Eigen::Matrix4f& VirtualRobot::VisualizationNode::getGlobalPose ( ) const
int VirtualRobot::VisualizationNode::getNumFaces ( )

get number of faces (i.e. triangles) of this object

VirtualRobot::TriMeshModelPtr VirtualRobot::VisualizationNode::getTriMeshModel ( )

Creates a triangulated model.

Reimplemented in VirtualRobot::CoinVisualizationNode.

virtual std::string VirtualRobot::VisualizationNode::getType ( )
bool VirtualRobot::VisualizationNode::getUpdateVisualizationStatus ( )
bool VirtualRobot::VisualizationNode::hasAttachedVisualization ( const std::string &  name)

Check for an attached visualization.

void VirtualRobot::VisualizationNode::print ( )

print information about this visualization object.

Reimplemented in VirtualRobot::CoinVisualizationNode.

bool VirtualRobot::VisualizationNode::saveModel ( const std::string &  modelPath,
const std::string &  filename 

Saves model file to model path.

modelPathThe directory.

Reimplemented in VirtualRobot::CoinVisualizationNode.

void VirtualRobot::VisualizationNode::scale ( Eigen::Vector3f &  scaleFactor)
void VirtualRobot::VisualizationNode::setFilename ( const std::string &  filename,
bool  boundingBox 

Just stores the filename, no loading is performed!

virtual void VirtualRobot::VisualizationNode::setGlobalPose ( const Eigen::Matrix4f &  m)

Sets the position of the internal data structure.

Reimplemented in VirtualRobot::CoinVisualizationNode.

void VirtualRobot::VisualizationNode::setUpdateVisualization ( bool  enable)

Enables/Disables the visualization updates. Usually if a SceneObject or a RobotNode changes its state, the visualization is automatically updated. This behavior can be changed here.

void VirtualRobot::VisualizationNode::setupVisualization ( bool  showVisualization,
bool  showAttachedVisualizations 

Setup the visualization of this object.

showVisualizationIf false, the visualization is disabled.
showAttachedVisualizationsIf false, the visualization of any attached optional visualizations is disabled.

Reimplemented in VirtualRobot::CoinVisualizationNode.

void VirtualRobot::VisualizationNode::shrinkFatten ( float  offset)
std::string VirtualRobot::VisualizationNode::toXML ( const std::string &  basePath,
int  tabs 
std::string VirtualRobot::VisualizationNode::toXML ( const std::string &  basePath,
const std::string &  filename,
int  tabs 

Ctreate XML string and replace filename

bool VirtualRobot::VisualizationNode::usedBoundingBoxVisu ( )

Field Documentation

std::map< std::string, VisualizationNodePtr > VirtualRobot::VisualizationNode::attachedVisualizations
bool VirtualRobot::VisualizationNode::boundingBox

Indicates, if the bounding box model was used.

std::string VirtualRobot::VisualizationNode::filename

if the visualization was build from a file, the filename is stored here

Eigen::Matrix4f VirtualRobot::VisualizationNode::globalPose
EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::vector<Primitive::PrimitivePtr> VirtualRobot::VisualizationNode::primitives
bool VirtualRobot::VisualizationNode::showAttachedVisualizations
bool VirtualRobot::VisualizationNode::showVisualization
bool VirtualRobot::VisualizationNode::updateVisualization