dart
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::gui::osg::SupportPolygonVisual Class Reference

Attach this to a Viewer in order to visualize the support polygon of a Skeleton. More...

#include <SupportPolygonVisual.hpp>

Inheritance diagram for dart::gui::osg::SupportPolygonVisual:
Inheritance graph
[legend]
Collaboration diagram for dart::gui::osg::SupportPolygonVisual:
Collaboration graph
[legend]

Public Member Functions

 SupportPolygonVisual (const dart::dynamics::SkeletonPtr &skeleton=nullptr, double elevation=0.02)
 Visualize the support polygon of an entire Skeleton.
 
 SupportPolygonVisual (const dart::dynamics::SkeletonPtr &skeleton, std::size_t treeIndex, double elevation=0.02)
 Visualize the support polygon of a specific tree in a Skeleton.
 
void setSkeleton (const dart::dynamics::SkeletonPtr &skeleton)
 Change the Skeleton that is being visualized.
 
dart::dynamics::SkeletonPtr getSkeleton () const
 Get the Skeleton associated with this visual.
 
void visualizeWholeSkeleton ()
 Visualize the entire Skeleton.
 
void visualizeTree (std::size_t treeIndex)
 Visualize a specific tree in the Skeleton.
 
void setDisplayElevation (double elevation)
 Change the elevation height at which the polygon is displayed.
 
double getDisplayElevation () const
 Get the elevation of display for the support polygon.
 
void displayPolygon (bool display)
 Display the support polygon.
 
bool isPolygonDisplayed () const
 Returns true if the support polygon is being displayed.
 
void setPolygonColor (const Eigen::Vector4d &color)
 Set the color of the support polygon.
 
Eigen::Vector4d getPolygonColor () const
 Get the color of the support polygon.
 
void displayCentroid (bool display)
 Display the centroid.
 
bool isCentroidDisplayed () const
 Returns true if the centroid is being displayed.
 
void setCentroidRadius (double radius)
 Set the radius of the centroid visualization.
 
double getCentroidRadius () const
 Get the radius of the centroid visualization.
 
void displayCenterOfMass (bool display)
 Display the center of mass.
 
bool isCenterOfMassDisplayed () const
 Returns true if the center of mass is being displayed.
 
void setCenterOfMassRadius (double radius)
 Set the radius of the center of mass visualization.
 
double getCenterOfMassRadius () const
 Get the radius of the center of mass visualization.
 
void setValidCOMColor (const Eigen::Vector4d &color)
 Set the color that will be used for the center of mass if its projection is on the support polygon.
 
const Eigen::Vector4d & getValidCOMColor () const
 Get the color that will be used for the center of mass if its projection is on the support polygon.
 
void setInvalidCOMColor (const Eigen::Vector4d &color)
 Set the color that will be used for the center of mass if its projection is NOT on the support polygon.
 
const Eigen::Vector4d & getInvalidCOMColor () const
 Get the color that will be used for the center of mass if its projection is NOT on the support polygon.
 
void refresh () override final
 Update the support polygon visual.
 
- Public Member Functions inherited from dart::gui::osg::ViewerAttachment
 ViewerAttachment ()
 Default constructor.
 
virtual ~ViewerAttachment ()
 Virtual destructor.
 
ViewergetViewer ()
 
const ViewergetViewer () const
 

Protected Member Functions

void initialize ()
 Initialize the memory used by this visual.
 
- Protected Member Functions inherited from dart::gui::osg::ViewerAttachment
virtual void customAttach (Viewer *newViewer)
 This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes. More...
 
virtual void attach (Viewer *newViewer)
 This function will get called when the visual is attached to a new Viewer. More...
 

Protected Attributes

dart::dynamics::WeakSkeletonPtr mSkeleton
 Skeleton for this visual.
 
std::size_t mTreeIndex
 Tree index for this visual.
 
double mElevation
 Elevation that this visual should use.
 
bool mDisplayPolygon
 Whether to display the polygon.
 
bool mDisplayCentroid
 Whether to display the centroid.
 
dart::dynamics::SimpleFramePtr mCentroid
 SimpleFrame for the centroid.
 
double mCentroidRadius
 Radius to be used by the centroid.
 
bool mDisplayCOM
 Whether to display the center of mass.
 
dart::dynamics::SimpleFramePtr mCom
 SimpleFrame for the center of mass.
 
double mComRadius
 Radius to be used by the center of mass.
 
Eigen::Vector4d mValidColor
 Color to be used when COM is valid.
 
Eigen::Vector4d mInvalidColor
 Color to be used when COM is invalid.
 
::osg::ref_ptr<::osg::Vec4Array > mPolygonColor
 Color for the polygon.
 
::osg::ref_ptr<::osg::Geode > mPolygonGeode
 Geode to hold the polygon.
 
::osg::ref_ptr<::osg::Geometry > mPolygonGeom
 Geometry to describe the polygon.
 
::osg::ref_ptr<::osg::Vec3Array > mVertices
 Vertices of the polygon.
 
::osg::ref_ptr<::osg::DrawElementsUShort > mFaces
 Faces of the polygon.
 
::osg::ref_ptr< ShapeFrameNodemCentroidNode
 Node to render the centroid.
 
::osg::ref_ptr< ShapeFrameNodemComNode
 Node to render the COM.
 

Detailed Description

Attach this to a Viewer in order to visualize the support polygon of a Skeleton.


The documentation for this class was generated from the following files: