osgParticle::Operator Class Reference

An abstract base class used by ModularProgram to perform operations on particles before they are updated. More...

Inheritance diagram for osgParticle::Operator:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Operator ()
 Operator (const Operator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual const char * libraryName () const
 return the name of the object's library.
virtual const char * className () const
 return the name of the object's class type.
virtual bool isSameKindAs (const osg::Object *obj) const
bool isEnabled () const
 Get whether this operator is enabled.
void setEnabled (bool v)
 Enable or disable this operator.
virtual void operate (Particle *P, double dt)=0
 Do something on a particle.
virtual void beginOperate (Program *)
 Do something before processing particles via the operate() method.
virtual void endOperate ()
 Do something after all particles have been processed.

Protected Member Functions

virtual ~Operator ()
Operatoroperator= (const Operator &)


Detailed Description

An abstract base class used by ModularProgram to perform operations on particles before they are updated.

To implement a new operator, derive from this class and override the operate() method. You should also override the beginOperate() method to query the calling program for the reference frame used, and initialize the right transformations if needed.


Constructor & Destructor Documentation

osgParticle::Operator::Operator (  )  [inline]

osgParticle::Operator::Operator ( const Operator copy,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
) [inline]

virtual osgParticle::Operator::~Operator (  )  [inline, protected, virtual]


Member Function Documentation

virtual const char* osgParticle::Operator::libraryName (  )  const [inline, virtual]

return the name of the object's library.

Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Implements osg::Object.

virtual const char* osgParticle::Operator::className (  )  const [inline, virtual]

return the name of the object's class type.

Must be defined by derived classes.

Implements osg::Object.

virtual bool osgParticle::Operator::isSameKindAs ( const osg::Object obj  )  const [inline, virtual]

Reimplemented from osg::Object.

bool osgParticle::Operator::isEnabled (  )  const [inline]

Get whether this operator is enabled.

void osgParticle::Operator::setEnabled ( bool  v  )  [inline]

Enable or disable this operator.

virtual void osgParticle::Operator::operate ( Particle P,
double  dt 
) [pure virtual]

Do something on a particle.

This method is called by ModularProgram objects to perform some operations on the particles. You must override it in descendant classes. Common operations consist of modifying the particle's velocity vector. The dt parameter is the time elapsed from last operation.

Implemented in osgParticle::AccelOperator, osgParticle::AngularAccelOperator, osgParticle::FluidFrictionOperator, and osgParticle::ForceOperator.

virtual void osgParticle::Operator::beginOperate ( Program  )  [inline, virtual]

Do something before processing particles via the operate() method.

Overriding this method could be necessary to query the calling Program object for the current reference frame. If the reference frame is RELATIVE_RF, then your class should prepare itself to do all operations in local coordinates.

Reimplemented in osgParticle::AccelOperator, osgParticle::AngularAccelOperator, osgParticle::FluidFrictionOperator, and osgParticle::ForceOperator.

virtual void osgParticle::Operator::endOperate (  )  [inline, virtual]

Do something after all particles have been processed.

Operator& osgParticle::Operator::operator= ( const Operator  )  [inline, protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:43 2007 for the OpenSceneGraph by doxygen 1.5.3.