Simox  2.3.49
VirtualRobot::VisualizationNode Class Reference
Inheritance diagram for VirtualRobot::VisualizationNode:
VirtualRobot::CoinVisualizationNode

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 ( )

Constructor

VirtualRobot::VisualizationNode::~VisualizationNode ( )
virtual

Member Function Documentation

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

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 
)
virtual

Clone this visualization.

Parameters
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 ( )
virtual

update trimesh model

Reimplemented in VirtualRobot::CoinVisualizationNode.

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

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)
virtual

Remove an attached visualization.

Reimplemented in VirtualRobot::CoinVisualizationNode.

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

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
inline
int VirtualRobot::VisualizationNode::getNumFaces ( )
virtual

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

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

Creates a triangulated model.

Reimplemented in VirtualRobot::CoinVisualizationNode.

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

Check for an attached visualization.

void VirtualRobot::VisualizationNode::print ( )
virtual

print information about this visualization object.

Reimplemented in VirtualRobot::CoinVisualizationNode.

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

Saves model file to model path.

Parameters
modelPathThe directory.

Reimplemented in VirtualRobot::CoinVisualizationNode.

void VirtualRobot::VisualizationNode::scale ( Eigen::Vector3f &  scaleFactor)
virtual
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)
inlinevirtual

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 
)
virtual

Setup the visualization of this object.

Parameters
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)
virtual
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
protected
bool VirtualRobot::VisualizationNode::boundingBox
protected

Indicates, if the bounding box model was used.

std::string VirtualRobot::VisualizationNode::filename
protected

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

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