Simbody  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimTK::DecorativeBrick Class Reference

This defines a rectangular solid centered at the origin and aligned with the local frame axes. More...

#include <DecorativeGeometry.h>

+ Inheritance diagram for SimTK::DecorativeBrick:

Public Member Functions

 DecorativeBrick (const Vec3 &halfLengths=Vec3(Real(0.5)))
DecorativeBricksetHalfLengths (const Vec3 &)
const Vec3getHalfLengths () const
DecorativeBricksetBodyId (int b)
 By default the geometry should be placed relative to the Ground frame.
DecorativeBricksetIndexOnBody (int x)
 For selection or other purposes, you may want to use this method to store an index that can identify this particular piece of geometry.
DecorativeBricksetUserRef (void *p)
 Use this method to store an arbitrary reference pointer with this DecorativeGeometry object.
DecorativeBricksetTransform (const Transform &X_BD)
 This transform shifts the generated polygons with respect to this object's local frame.
DecorativeBricksetResolution (Real r)
 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".
DecorativeBricksetScaleFactors (const Vec3 &s)
 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.
DecorativeBricksetColor (const Vec3 &rgb)
 Request a specific color for this DecorativeGeometry object.
DecorativeBricksetOpacity (Real o)
 Request a level of transparency for this DecorativeGeometry.
DecorativeBricksetLineThickness (Real t)
 Request an adjustment to the default rendering of lines and curves.
DecorativeBricksetRepresentation (const Representation &r)
 Request a particular rendering representation of this DecorativeGeometry object.
 SimTK_PIMPL_DOWNCAST (DecorativeBrick, DecorativeGeometry)
- Public Member Functions inherited from SimTK::DecorativeGeometry
 DecorativeGeometry ()
 Default constructor creates an empty handle.
 ~DecorativeGeometry ()
 DecorativeGeometry (const DecorativeGeometry &source)
 Copy construction is deep; the source object will be cloned to create an independent copy.
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.
DecorativeGeometrysetScale (Real scale)
 Convenience method to set all three scale factors to the same value.
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.
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.
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.
Real getResolution () const
 Return the current setting of the "resolution" factor.
const TransformgetTransform () const
 Return the current value of the object's transform.
const Vec3getScaleFactors () const
 Return the current setting of the "scale" factors.
const Vec3getColor () const
 Return the color specified for this object, if any, otherwise Vec3(-1) indicating that the default color will be used.
Real getOpacity () const
 Return the opacity specified for this object.
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.
DecorativeGeometrysetFaceCamera (int shouldFace)
 Set whether the geometry acts as a billboard, always rotating to face the camera.
int getFaceCamera () const
 Get whether the geometry acts as a billboard, always rotating to face the camera.
Representation getRepresentation () const
 Returns drawing mode: -1 means "use default"; see above for others.
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 {
  DrawPoints = 1,
  DrawWireframe = 2,
  DrawSurface = 3,
  DrawDefault = -1
}
 Drawing modes. More...
- Protected Attributes inherited from SimTK::DecorativeGeometry
DecorativeGeometryRep * rep

Detailed Description

This defines a rectangular solid centered at the origin and aligned with the local frame axes.

The default constructor creates a cube of length 1 on each side.

Constructor & Destructor Documentation

SimTK::DecorativeBrick::DecorativeBrick ( const Vec3 halfLengths = Vec3(Real(0.5)))
explicit

Member Function Documentation

DecorativeBrick& SimTK::DecorativeBrick::setHalfLengths ( const Vec3 )
const Vec3& SimTK::DecorativeBrick::getHalfLengths ( ) const
DecorativeBrick& SimTK::DecorativeBrick::setBodyId ( int  bodyId)
inline

By default the geometry should be placed relative to the Ground frame.

If you want it attached to another reference frame (body), say so here. The geometry should be rendered with respect to the indicated body frame; however, the interpretation of this integer Id is left to the implementation. If you don't set the bodyId yourself it will be zero. For use in Simbody, the bodyId is interpreted as a MobilizedBodyIndex that can be mapped to a MobilizedBody that carries a reference frame.

The bodyId is copied if you copy the DecorativeGeometry object. If you are copying to a different body you'll need to change the bodyId afterwards.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setIndexOnBody ( int  index)
inline

For selection or other purposes, you may want to use this method to store an index that can identify this particular piece of geometry.

As an alternative, or addition, see setUserRef(). In any case the index is simply stored with the object and returned if you ask for it. If you don't set it the value is -1. The index is copied if you copy the DecorativeGeometry object. Be sure to change it afterwards if that is not the correct index for the copy.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setUserRef ( void *  userRef)
inline

Use this method to store an arbitrary reference pointer with this DecorativeGeometry object.

This is particularly useful in selection operations where the rendering of this object has been picked by a user and you want to map it back to some meaningful object in your model. You can also use the setIndexOnBody() method to store some additional identifying information. If you don't set this pointer it will be set to zero (nullptr). This value is stored and returned only; no interpretation is done and the pointed-to object will not be deleted when the DecorativeGeometry object is deleted.

Warning
The value of the userRef pointer is copied if you make a copy of the DecorativeGeometry object. That is likely to be incorrect in many circumstances, depending on how you are using this value. Be sure to clear or change the pointer if necessary after you make a copy.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setTransform ( const Transform X_BG)
inline

This transform shifts the generated polygons with respect to this object's local frame.

Subsequent calls with other transforms simply replace the earlier one; they do not accumulate. The default transform is identity and you can call setTransform(Transform()) to put the transform back into its original state. This value affects the generated polygonal data.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setResolution ( Real  )
inline

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".

The resolution parameter here scales that default up or down. The face density in the displayed representation is roughly proportional to this value. 1.0 means to use the default resolution. Values less than 1.0 are lower resolution, and values greater than 1.0 are higher resolution. A value less than or equal to zero here is interpreted as an instruction to "use the default".

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setScaleFactors ( const Vec3 scale)
inline

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.

The x,y,z scale factors here are given in the object's coordinate frame, and apply to the object as the user built it, or to the default if the user didn't specify a size. The default scaling is 1,1,1 and any value less than or equal to zero here is interpreted as a request to "use the default" in that direction.

Reimplemented from SimTK::DecorativeGeometry.

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

Request a specific color for this DecorativeGeometry object.

The default is that the color is determined elsewhere. To explicitly request the default, set the color to Vec3(-1). The implementation will check the 0'th element (that is, the "R" element) and if it is less than zero will ignore the other two elements and use the default for all three.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setOpacity ( Real  )
inline

Request a level of transparency for this DecorativeGeometry.

This does NOT affect the generated geometry here. The default is that opacity is determined elsewhere.

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setLineThickness ( Real  )
inline

Request an adjustment to the default rendering of lines and curves.

This does NOT affect geometry generated here; it is a request passed on to the renderer which will probably pass it on to the hardware. A value less than or equal to zero here is interpreted as "use the default".

Reimplemented from SimTK::DecorativeGeometry.

DecorativeBrick& SimTK::DecorativeBrick::setRepresentation ( const Representation )
inline

Request a particular rendering representation of this DecorativeGeometry object.

The default is that the rendering representation choice is made elsewhere.

Reimplemented from SimTK::DecorativeGeometry.

SimTK::DecorativeBrick::SimTK_PIMPL_DOWNCAST ( DecorativeBrick  ,
DecorativeGeometry   
)

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