Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

osgHaptics::Shape Class Reference

Class that store a Haptic shape id as a StateAttribute. More...

#include <Shape.h>

Inherited by osgHaptics::ShapeComposite.

Inheritance diagram for osgHaptics::Shape:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Shape (HapticDevice *device, int enabled=1)
 Default constructor.
virtual void setEnable (bool flag)
 Enable the haptic rendering of this shape.
bool getEnable () const
 Return if this shape is enabled for haptic rendering.
void setName (const std::string &name)
 Set the name of the shape.
std::string getName () const
 Return the name of the shape.
 Shape (const Shape &trans, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
HLint getShapeID () const
 Return the HL shape id of this Shape.
virtual int compare (const osg::StateAttribute &sa) const
virtual void postDraw () const
virtual void preDraw () const
virtual void apply (osg::State &state) const
 Apply this StateAttribute. Will actually do nothing as we explicitly will call pre/postDraw().
void setNode (osg::Node *node)
osg::Node * getNode ()

Static Public Member Functions

static osg::StateAttribute::Type getSAType ()
 Get the StateAttribute type of this Shape.

Detailed Description

Class that store a Haptic shape id as a StateAttribute.

This class stores a shape id as a osg StateAttribute. When a drawable is rendered in the HapticRenderBin, the shape id of the current applied Shape will be used.


Constructor & Destructor Documentation

osgHaptics::Shape::Shape const Shape trans,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY
[inline]
 

Copy constructor using CopyOp to manage deep vs shallow copy.


Member Function Documentation

virtual int osgHaptics::Shape::compare const osg::StateAttribute &  sa  )  const [inline, virtual]
 

Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Reimplemented in osgHaptics::ShapeComposite.

osg::Node* osgHaptics::Shape::getNode  )  [inline]
 

Return the associated node

virtual void osgHaptics::Shape::postDraw  )  const [virtual]
 

Make this shape id the current one. Any openGL primitive will then be drawn into the HL buffer Should be called just before any drawable is drawn (but after any modelview/projection matrix is modified).

Reimplemented in osgHaptics::ShapeComposite.

virtual void osgHaptics::Shape::preDraw  )  const [virtual]
 

Ends the current hl shape Should be called just after any drawable is drawn.

Reimplemented in osgHaptics::ShapeComposite.

void osgHaptics::Shape::setNode osg::Node *  node  )  [inline]
 

During contact, it can be handy to have a node associated to the shape. By using setNode()/getNode() a node can be set and later retrieved from a shape.


The documentation for this class was generated from the following file:
Generated on Wed May 10 16:29:46 2006 for osgHaptics by  doxygen 1.4.4