Simbody  3.7
SimTK::DecorativeMeshFile Class Reference

This defines a displayable mesh by referencing a file name containing the mesh. More...

+ Inheritance diagram for SimTK::DecorativeMeshFile:

Public Member Functions

 DecorativeMeshFile (const std::string &meshFileName)
 
const std::string & getMeshFile () const
 
const PolygonalMeshgetMesh () const
 Load the mesh from file and return a reference. More...
 
DecorativeMeshFilesetBodyId (int b)
 
DecorativeMeshFilesetIndexOnBody (int x)
 
DecorativeMeshFilesetUserRef (void *p)
 
DecorativeMeshFilesetTransform (const Transform &X_BD)
 
DecorativeMeshFilesetResolution (Real r)
 
DecorativeMeshFilesetScaleFactors (const Vec3 &s)
 
DecorativeMeshFilesetColor (const Vec3 &rgb)
 
DecorativeMeshFilesetOpacity (Real o)
 
DecorativeMeshFilesetLineThickness (Real t)
 
DecorativeMeshFilesetRepresentation (const Representation &r)
 
 SimTK_PIMPL_DOWNCAST (DecorativeMeshFile, DecorativeGeometry)
 
- Public Member Functions inherited from SimTK::DecorativeGeometry
 DecorativeGeometry ()
 Default constructor creates an empty handle. More...
 
 ~DecorativeGeometry ()
 
 DecorativeGeometry (const DecorativeGeometry &source)
 Copy construction is deep; the source object will be cloned to create an independent copy. More...
 
DecorativeGeometryoperator= (const DecorativeGeometry &source)
 Copy assignment is deep; the handle will be cleared if necessary and then the source object will be cloned to create an independent copy. More...
 
DecorativeGeometrysetBodyId (int bodyId)
 By default the geometry should be placed relative to the Ground frame. More...
 
DecorativeGeometrysetIndexOnBody (int index)
 For selection or other purposes, you may want to use this method to store an index that can identify this particular piece of geometry. More...
 
DecorativeGeometrysetUserRef (void *userRef)
 Use this method to store an arbitrary reference pointer with this DecorativeGeometry object. More...
 
DecorativeGeometrysetTransform (const Transform &X_BG)
 This transform shifts the generated polygons with respect to this object's local frame. More...
 
DecorativeGeometrysetResolution (Real)
 Each concrete DecorativeGeometry object is expected to have a default resolution that gets the point across but is cheap to draw and hence probably somewhat "chunky". More...
 
DecorativeGeometrysetScaleFactors (const Vec3 &scale)
 Each concrete DecorativeGeometry object is expected to have a default size around "1", whatever that means for a particular object, and most objects also allow a user-specified size on construction. More...
 
DecorativeGeometrysetScale (Real scale)
 Convenience method to set all three scale factors to the same value. More...
 
int getBodyId () const
 Return the bodyId that was supplied to the most recent setBodyId() call for this DecorativeGeometry object, or zero if that method has not been called. More...
 
int getIndexOnBody () const
 Return the index that was supplied to the most recent setIndexOnBody() call for this DecorativeGeometry object, or -1 if that method has not been called. More...
 
void * getUserRef () const
 Return the pointer value that was supplied to the most recent setUserRef() call for this DecorativeGeometry object, or zero (nullptr) if that method has not been called. More...
 
Real getResolution () const
 Return the current setting of the "resolution" factor. More...
 
const TransformgetTransform () const
 Return the current value of the object's transform. More...
 
const Vec3getScaleFactors () const
 Return the current setting of the "scale" factors. More...
 
DecorativeGeometrysetColor (const Vec3 &rgb)
 Request a specific color for this DecorativeGeometry object. More...
 
DecorativeGeometrysetOpacity (Real)
 Request a level of transparency for this DecorativeGeometry. More...
 
DecorativeGeometrysetLineThickness (Real)
 Request an adjustment to the default rendering of lines and curves. More...
 
const Vec3getColor () const
 Return the color specified for this object, if any, otherwise Vec3(-1) indicating that the default color will be used. More...
 
Real getOpacity () const
 Return the opacity specified for this object. More...
 
Real getLineThickness () const
 Return the line thickness specified for this object, if any, otherwise return -1 to indicate that the default line thickness should be used. More...
 
DecorativeGeometrysetFaceCamera (int shouldFace)
 Set whether the geometry acts as a billboard, always rotating to face the camera. More...
 
int getFaceCamera () const
 Get whether the geometry acts as a billboard, always rotating to face the camera. More...
 
DecorativeGeometrysetRepresentation (const Representation &)
 Request a particular rendering representation of this DecorativeGeometry object. More...
 
Representation getRepresentation () const
 Returns drawing mode: -1 means "use default"; see above for others. More...
 
void implementGeometry (DecorativeGeometryImplementation &) const
 
bool isOwnerHandle () const
 
bool isEmptyHandle () const
 
 DecorativeGeometry (class DecorativeGeometryRep *r)
 
bool hasRep () const
 
const DecorativeGeometryRep & getRep () const
 
DecorativeGeometryRep & updRep ()
 

Additional Inherited Members

- Public Types inherited from SimTK::DecorativeGeometry
enum  Representation {
  Hide = 0,
  DrawPoints = 1,
  DrawWireframe = 2,
  DrawSurface = 3,
  DrawDefault = -1
}
 Drawing modes. More...
 
- Protected Attributes inherited from SimTK::DecorativeGeometry
DecorativeGeometryRep * rep
 

Detailed Description

This defines a displayable mesh by referencing a file name containing the mesh.

If format is not supported by visualizer it will be ignored. The mesh is lazy-loaded and cached to avoid reloading on each frame. If the file fails to load, the call to getMesh will fail. If you already have a PolygonalMesh you can use DecorativeMesh directly

See also
DecorativeMesh above.

Constructor & Destructor Documentation

◆ DecorativeMeshFile()

SimTK::DecorativeMeshFile::DecorativeMeshFile ( const std::string &  meshFileName)
explicit

Member Function Documentation

◆ getMeshFile()

const std::string& SimTK::DecorativeMeshFile::getMeshFile ( ) const

◆ getMesh()

const PolygonalMesh& SimTK::DecorativeMeshFile::getMesh ( ) const

Load the mesh from file and return a reference.

Mesh is cached for future calls. This method can throw an exception if the file fails to open or load.

◆ setBodyId()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setBodyId ( int  b)
inline

◆ setIndexOnBody()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setIndexOnBody ( int  x)
inline

◆ setUserRef()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setUserRef ( void *  p)
inline

◆ setTransform()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setTransform ( const Transform X_BD)
inline

◆ setResolution()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setResolution ( Real  r)
inline

◆ setScaleFactors()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setScaleFactors ( const Vec3 s)
inline

◆ setColor()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setColor ( const Vec3 rgb)
inline

◆ setOpacity()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setOpacity ( Real  o)
inline

◆ setLineThickness()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setLineThickness ( Real  t)
inline

◆ setRepresentation()

DecorativeMeshFile& SimTK::DecorativeMeshFile::setRepresentation ( const Representation r)
inline

◆ SimTK_PIMPL_DOWNCAST()

SimTK::DecorativeMeshFile::SimTK_PIMPL_DOWNCAST ( DecorativeMeshFile  ,
DecorativeGeometry   
)

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