Simbody
3.4 (development)
|
This defines a rectangular solid centered at the origin and aligned with the local frame axes. More...
#include <DecorativeGeometry.h>
Public Member Functions | |
DecorativeBrick (const Vec3 &halfLengths=Vec3(Real(0.5))) | |
DecorativeBrick & | setHalfLengths (const Vec3 &) |
const Vec3 & | getHalfLengths () const |
DecorativeBrick & | setBodyId (int b) |
By default the geometry should be placed relative to the Ground frame. | |
DecorativeBrick & | setIndexOnBody (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. | |
DecorativeBrick & | setUserRef (void *p) |
Use this method to store an arbitrary reference pointer with this DecorativeGeometry object. | |
DecorativeBrick & | setTransform (const Transform &X_BD) |
This transform shifts the generated polygons with respect to this object's local frame. | |
DecorativeBrick & | setResolution (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". | |
DecorativeBrick & | setScaleFactors (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. | |
DecorativeBrick & | setColor (const Vec3 &rgb) |
Request a specific color for this DecorativeGeometry object. | |
DecorativeBrick & | setOpacity (Real o) |
Request a level of transparency for this DecorativeGeometry. | |
DecorativeBrick & | setLineThickness (Real t) |
Request an adjustment to the default rendering of lines and curves. | |
DecorativeBrick & | setRepresentation (const Representation &r) |
Request a particular rendering representation of this DecorativeGeometry object. | |
SimTK_PIMPL_DOWNCAST (DecorativeBrick, DecorativeGeometry) |
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.
SimTK::DecorativeBrick::DecorativeBrick | ( | const Vec3 & | halfLengths = Vec3(Real(0.5)) | ) | [explicit] |
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.
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.