- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# 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:

[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 ()
Operator & | operator= (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 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 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 void osgParticle::Operator::endOperate | ( |  | ) | `[inline, virtual]`

| Do something after all particles have been processed.

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

| Get whether this operator is enabled.

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

| Reimplemented from osg::Object.

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

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

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

| Enable or disable this operator.

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

- Operator