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

Public Member Functions

 VisualizationNode (const TriMeshModelPtr &triMeshModel=nullptr)
 
 VisualizationNode (const TriMeshModel &triMeshModel)
 
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 (const Eigen::Vector3f &scaleFactor)
 
virtual void scale (float 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
 
TriMeshModelPtr triMeshModel
 
std::map< std::string, VisualizationNodePtrattachedVisualizations
 

Constructor & Destructor Documentation

◆ VisualizationNode() [1/2]

VirtualRobot::VisualizationNode::VisualizationNode ( const TriMeshModelPtr triMeshModel = nullptr)

Constructor

◆ VisualizationNode() [2/2]

VirtualRobot::VisualizationNode::VisualizationNode ( const TriMeshModel triMeshModel)

◆ ~VisualizationNode()

VirtualRobot::VisualizationNode::~VisualizationNode ( )
virtual

Member Function Documentation

◆ attachVisualization()

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.

◆ clone()

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.

◆ createTriMeshModel()

void VirtualRobot::VisualizationNode::createTriMeshModel ( )
virtual

update trimesh model

Reimplemented in VirtualRobot::CoinVisualizationNode.

◆ CreateUnitedVisualization()

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.

◆ detachVisualization()

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

Remove an attached visualization.

Reimplemented in VirtualRobot::CoinVisualizationNode.

◆ getAttachedVisualization()

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

Get for an attached visualization.

◆ getBoundingBox()

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

Returns (current) bounding box in global coordinate system.

◆ getFilename()

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

optional filename tag

◆ getGlobalPose()

const Eigen::Matrix4f& VirtualRobot::VisualizationNode::getGlobalPose ( ) const
inline

◆ getNumFaces()

int VirtualRobot::VisualizationNode::getNumFaces ( )
virtual

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

◆ getTriMeshModel()

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

Creates a triangulated model.

Reimplemented in VirtualRobot::CoinVisualizationNode.

◆ getType()

virtual std::string VirtualRobot::VisualizationNode::getType ( )
inlinevirtual

◆ getUpdateVisualizationStatus()

bool VirtualRobot::VisualizationNode::getUpdateVisualizationStatus ( )

◆ hasAttachedVisualization()

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

Check for an attached visualization.

◆ print()

void VirtualRobot::VisualizationNode::print ( )
virtual

print information about this visualization object.

Reimplemented in VirtualRobot::CoinVisualizationNode.

◆ saveModel()

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.

◆ scale() [1/2]

void VirtualRobot::VisualizationNode::scale ( const Eigen::Vector3f &  scaleFactor)
virtual

◆ scale() [2/2]

void VirtualRobot::VisualizationNode::scale ( float  scaleFactor)
virtual

◆ setFilename()

void VirtualRobot::VisualizationNode::setFilename ( const std::string &  filename,
bool  boundingBox 
)

Just stores the filename, no loading is performed!

◆ setGlobalPose()

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

Sets the position of the internal data structure.

Reimplemented in VirtualRobot::CoinVisualizationNode.

◆ setUpdateVisualization()

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.

◆ setupVisualization()

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.

◆ shrinkFatten()

void VirtualRobot::VisualizationNode::shrinkFatten ( float  offset)
virtual

◆ toXML() [1/2]

std::string VirtualRobot::VisualizationNode::toXML ( const std::string &  basePath,
int  tabs 
)

◆ toXML() [2/2]

std::string VirtualRobot::VisualizationNode::toXML ( const std::string &  basePath,
const std::string &  filename,
int  tabs 
)

Ctreate XML string and replace filename

◆ usedBoundingBoxVisu()

bool VirtualRobot::VisualizationNode::usedBoundingBoxVisu ( )

Field Documentation

◆ attachedVisualizations

std::map< std::string, VisualizationNodePtr > VirtualRobot::VisualizationNode::attachedVisualizations
protected

◆ boundingBox

bool VirtualRobot::VisualizationNode::boundingBox
protected

Indicates, if the bounding box model was used.

◆ filename

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

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

◆ globalPose

Eigen::Matrix4f VirtualRobot::VisualizationNode::globalPose
protected

◆ primitives

EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::vector<Primitive::PrimitivePtr> VirtualRobot::VisualizationNode::primitives

◆ showAttachedVisualizations

bool VirtualRobot::VisualizationNode::showAttachedVisualizations
protected

◆ showVisualization

bool VirtualRobot::VisualizationNode::showVisualization
protected

◆ triMeshModel

TriMeshModelPtr VirtualRobot::VisualizationNode::triMeshModel
protected

◆ updateVisualization

bool VirtualRobot::VisualizationNode::updateVisualization
protected