Physsim::Visualizable Class Reference

Class that allows for visualizing simulation data. More...

#include <Visualizable.h>

Inheritance diagram for Physsim::Visualizable:

Physsim::Base Physsim::DynamicBody Physsim::Joint Physsim::ArticulatedBody Physsim::RigidBody Physsim::PrismaticJoint Physsim::RevoluteJoint Physsim::SphericalJoint Physsim::UniversalJoint Physsim::MCArticulatedBody Physsim::RCArticulatedBody List of all members.

Public Member Functions

 Visualizable (const Visualizable *v)
virtual void clone (BasePtr &cloned, bimap< BasePtr, BasePtr > *obj_map=NULL) const
 Implements Base::clone().
virtual void load_state (BaseConstPtr object, bimap< BasePtr, BasePtr > *correspondence=NULL)
 Implements Base::load_state().
virtual void save_state (BasePtr object, bimap< BasePtr, BasePtr > *correspondence=NULL) const
 Implements Base::save_state().
virtual void update_visualization ()
 Updates the visualization using the appropriate transform.
virtual void set_visualization_data (SoNode *vdata)
 Sets the visualization data from a node.
virtual void set_visualization_data (SoSeparatorWrapperPtr vdata)
 Sets the visualization data from a SoSeparatorWrapper.
virtual void save_to_xml (XMLTreePtr node, std::list< BaseConstPtr > &shared_objects) const
 Implements Base::save_to_xml().
virtual void load_from_xml (XMLTreeConstPtr node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml().
void set_visualization_transform (const Matrix4 &T)
 Sets the transform for this visualization data.
SoNode * get_visualization_data () const
 Gets the visualization data for this object.

Static Public Member Functions

static SoSeparator * construct_from_node (XMLTreeConstPtr node, const std::map< std::string, BasePtr > &id_map)
 Utility method for load_from_xml().

Protected Attributes

SoSeparatorWrapperPtr _vizdata
 The underlying visualization data.
SoSeparator * _separator
 The top-level separator (containing _vtransform and _vizdata).
SoTransform * _vtransform
 The transform applied to _vizdata.

Detailed Description

Class that allows for visualizing simulation data.

This class uses the SoSeparatorWrapper class to permit sharing and serialization of visualization data.


Member Function Documentation

void Visualizable::update_visualization (  )  [virtual]

Updates the visualization using the appropriate transform.

Note:
in contrast to set_visualization_transform(), this method actually sets the transform in the scenegraph, thereby updating the display.

derived classes may override this method to set the transform right before it is updated, if desired

See also:
set_visualization_transform()

Reimplemented in Physsim::MCArticulatedBody, and Physsim::RCArticulatedBody.

SoSeparator * Visualizable::construct_from_node ( XMLTreeConstPtr  node,
const std::map< std::string, BasePtr > &  id_map 
) [static]

Utility method for load_from_xml().

This method searches for visualization-filename, visualization-separator-id, and visualization-primitive-id attributes for a given node and creates a separator based on the attribute found.

void Physsim::Visualizable::set_visualization_transform ( const Matrix4 T  )  [inline]

Sets the transform for this visualization data.

Note:
this method does not update the display; update_visualization() must be called for this change to take effect


The documentation for this class was generated from the following files:
Generated on Wed Oct 24 14:54:23 2007 for Physsim by  doxygen 1.5.1