Simbody
Public Types | Public Member Functions | Protected Attributes

SimTK::DecorativeGeometry Class Reference

This is an abstract handle class using the PIMPL design pattern to hide the private implementation. More...

#include <DecorativeGeometry.h>

Inheritance diagram for SimTK::DecorativeGeometry:

List of all members.

Public Types

enum  Representation { DrawPoints = 1, DrawWireframe = 2, DrawSurface = 3, DrawDefault = -1 }

Public Member Functions

 DecorativeGeometry ()
 ~DecorativeGeometry ()
 DecorativeGeometry (const DecorativeGeometry &)
DecorativeGeometryoperator= (const DecorativeGeometry &)
 DecorativeGeometry (const AnalyticGeometry &)
 Implicit conversion.
DecorativeGeometrysetBodyId (int)
 By default the geometry will be placed on ground.
DecorativeGeometrysetTransform (const Transform &X_BG)
 This transform shifts the generated polygons with respect to this object's local frame.
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".
DecorativeGeometrysetScale (Real)
 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.
int getBodyId () const
 Return the body to which this geometry is attached.
Real getResolution () const
 Return the current setting of the "resolution" factor.
const TransformgetTransform () const
 Return the current value of the object's transform.
Real getScale () const
 Return the current setting of the "scale" factor.
DecorativeGeometrysetColor (const Vec3 &rgb)
 Request a specific color for this DecorativeGeometry object.
DecorativeGeometrysetOpacity (Real)
 Request a level of transparency for this DecorativeGeometry.
DecorativeGeometrysetLineThickness (Real)
 Request an adjustment to the default rendering of lines and curves.
const Vec3getColor () const
Real getOpacity () const
Real getLineThickness () const
DecorativeGeometrysetFaceCamera (bool face)
 Set whether the geometry acts as a billboard, always rotating to face the camera.
bool getFaceCamera () const
 Get whether the geometry acts as a billboard, always rotating to face the camera.
DecorativeGeometrysetRepresentation (const Representation &)
 Request a particular rendering representation of this DecorativeGeometry object.
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 ()

Protected Attributes

DecorativeGeometryRep * rep

Detailed Description

This is an abstract handle class using the PIMPL design pattern to hide the private implementation.

This is effectively an abstract class although the virtual function table is hidden in the private part.


Member Enumeration Documentation

Enumerator:
DrawPoints 
DrawWireframe 
DrawSurface 
DrawDefault 

Constructor & Destructor Documentation

SimTK::DecorativeGeometry::DecorativeGeometry ( ) [inline]
SimTK::DecorativeGeometry::~DecorativeGeometry ( )
SimTK::DecorativeGeometry::DecorativeGeometry ( const DecorativeGeometry )
SimTK::DecorativeGeometry::DecorativeGeometry ( const AnalyticGeometry )

Implicit conversion.

SimTK::DecorativeGeometry::DecorativeGeometry ( class DecorativeGeometryRep *  r) [inline, explicit]

Member Function Documentation

DecorativeGeometry& SimTK::DecorativeGeometry::operator= ( const DecorativeGeometry )
DecorativeGeometry& SimTK::DecorativeGeometry::setBodyId ( int  )

By default the geometry will be placed on ground.

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.

Reimplemented in SimTK::DecorativeLine.

DecorativeGeometry& SimTK::DecorativeGeometry::setTransform ( const Transform X_BG)

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 in SimTK::DecorativeLine.

DecorativeGeometry& SimTK::DecorativeGeometry::setResolution ( 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".

The resolution parameter here scales that default up or down. The number of faces 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 in SimTK::DecorativeLine.

DecorativeGeometry& SimTK::DecorativeGeometry::setScale ( Real  )

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 scale factor here applies 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, and any value less than or equal to zero here is interpreted as a request to "use the default". This value affects the generated polygonal data.

Reimplemented in SimTK::DecorativeLine.

int SimTK::DecorativeGeometry::getBodyId ( ) const

Return the body to which this geometry is attached.

The geometry's placement is interpreted relative to the body's frame.

Real SimTK::DecorativeGeometry::getResolution ( ) const

Return the current setting of the "resolution" factor.

A return value of -1 means "use the default".

const Transform& SimTK::DecorativeGeometry::getTransform ( ) const

Return the current value of the object's transform.

If none has been set this will be the identity transform. Note that this transform specifies how the polygons are placed with respect to the object's local frame.

Real SimTK::DecorativeGeometry::getScale ( ) const

Return the current setting of the "scale" factor.

A return value of -1 means "use the default" (which is typically 1).

DecorativeGeometry& SimTK::DecorativeGeometry::setColor ( const Vec3 rgb)

Request a specific color for this DecorativeGeometry object.

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

Reimplemented in SimTK::DecorativeLine.

DecorativeGeometry& SimTK::DecorativeGeometry::setOpacity ( Real  )

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 in SimTK::DecorativeLine.

DecorativeGeometry& SimTK::DecorativeGeometry::setLineThickness ( Real  )

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 in SimTK::DecorativeLine.

const Vec3& SimTK::DecorativeGeometry::getColor ( ) const
Real SimTK::DecorativeGeometry::getOpacity ( ) const
Real SimTK::DecorativeGeometry::getLineThickness ( ) const
DecorativeGeometry& SimTK::DecorativeGeometry::setFaceCamera ( bool  face)

Set whether the geometry acts as a billboard, always rotating to face the camera.

bool SimTK::DecorativeGeometry::getFaceCamera ( ) const

Get whether the geometry acts as a billboard, always rotating to face the camera.

DecorativeGeometry& SimTK::DecorativeGeometry::setRepresentation ( const Representation )

Request a particular rendering representation of this DecorativeGeometry object.

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

Reimplemented in SimTK::DecorativeLine.

Representation SimTK::DecorativeGeometry::getRepresentation ( ) const

returns drawing mode: -1 means "use default"; see above for others

void SimTK::DecorativeGeometry::implementGeometry ( DecorativeGeometryImplementation ) const
bool SimTK::DecorativeGeometry::isOwnerHandle ( ) const
bool SimTK::DecorativeGeometry::isEmptyHandle ( ) const
bool SimTK::DecorativeGeometry::hasRep ( ) const [inline]
const DecorativeGeometryRep& SimTK::DecorativeGeometry::getRep ( ) const [inline]
DecorativeGeometryRep& SimTK::DecorativeGeometry::updRep ( ) [inline]

Member Data Documentation

DecorativeGeometryRep* SimTK::DecorativeGeometry::rep [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines