osgParticle::DomainOperator Class Reference

`#include <DomainOperator>`

Inheritance diagram for osgParticle::DomainOperator:

## Classes

struct | Domain

## Public Member Functions

| DomainOperator ()
| DomainOperator (const DomainOperator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| META_Object (osgParticle, DomainOperator)
void | addPointDomain (const osg::Vec3 &p)
| Add a point domain.
void | addLineSegmentDomain (const osg::Vec3 &v1, const osg::Vec3 &v2)
| Add a line segment domain.
void | addTriangleDomain (const osg::Vec3 &v1, const osg::Vec3 &v2, const osg::Vec3 &v3)
| Add a triangle domain.
void | addRectangleDomain (const osg::Vec3 &corner, const osg::Vec3 &w, const osg::Vec3 &h)
| Add a rectangle domain.
void | addPlaneDomain (const osg::Plane &plane)
| Add a plane domain.
void | addSphereDomain (const osg::Vec3 &c, float r)
| Add a sphere domain.
void | addBoxDomain (const osg::Vec3 &min, const osg::Vec3 &max)
| Add a box domain.
void | addDiskDomain (const osg::Vec3 &c, const osg::Vec3 &n, float r1, float r2=0.0f)
| Add a disk domain.
void | addDomain (const Domain &domain)
| Add a domain object directly, used by the .osg wrappers and serializers.
const Domain & | getDomain (unsigned int i) const
| Get a domain object directly, used by the .osg wrappers and serializers.
void | removeDomain (unsigned int i)
| Remove a domain at specific index.
void | removeAllDomains ()
| Remove all existing domains.
unsigned int | getNumDomains () const
| Get number of domains.
void | operate (Particle *P, double dt)
| Apply the acceleration to a particle. Do not call this method manually.
void | beginOperate (Program *prg)
| Perform some initializations. Do not call this method manually.
void | endOperate ()
| Perform some post-operations. Do not call this method manually.
Public Member Functions inherited from osgParticle::Operator
| Operator ()
| Operator (const Operator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual const char * | libraryName () const
virtual const char * | className () const
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 | operateParticles (ParticleSystem *ps, double dt)
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * | cloneType () const =0
virtual Object * | clone (const CopyOp &) const =0
std::string | getCompoundClassName () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
virtual void | resizeGLObjectBuffers (unsigned int)
virtual void | releaseGLObjects (osg::State *=0) const
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Member Functions

virtual | ~DomainOperator ()
DomainOperator & | operator= (const DomainOperator &)
virtual void | handlePoint (const Domain &, Particle *, double)
virtual void | handleLineSegment (const Domain &, Particle *, double)
virtual void | handleTriangle (const Domain &, Particle *, double)
virtual void | handleRectangle (const Domain &, Particle *, double)
virtual void | handlePlane (const Domain &, Particle *, double)
virtual void | handleSphere (const Domain &, Particle *, double)
virtual void | handleBox (const Domain &, Particle *, double)
virtual void | handleDisk (const Domain &, Particle *, double)
void | computeNewBasis (const osg::Vec3 &, const osg::Vec3 &, osg::Vec3 &, osg::Vec3 &)
void | ignore (const std::string &func)
Protected Member Functions inherited from osgParticle::Operator
virtual | ~Operator ()
Operator & | operator= (const Operator &)
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

std::vector< Domain > | _domains
std::vector< Domain > | _backupDomains
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

A domain operator which accepts different domain shapes as the parameter. It can be derived to implement operators that require particles interacting with domains. Refer to David McAllister's Particle System API (http://www.particlesystems.org)

## Constructor & Destructor Documentation

## DomainOperator() [1/2]

osgParticle::DomainOperator::DomainOperator | ( |  | ) |

inline

References osgParticle::Operator::Operator().

Referenced by osgParticle::BounceOperator::BounceOperator(), osgParticle::BounceOperator::BounceOperator(), DomainOperator(), META_Object(), operator=(), osgParticle::SinkOperator::SinkOperator(), and osgParticle::SinkOperator::SinkOperator().

## DomainOperator() [2/2]

osgParticle::DomainOperator::DomainOperator | ( | const DomainOperator & | copy,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

inline

References _backupDomains, _domains, DomainOperator(), osgParticle::Operator::Operator(), and osg::CopyOp::SHALLOW_COPY.

## ~DomainOperator()

virtual osgParticle::DomainOperator::~DomainOperator | ( |  | ) |

inline protected virtual

## Member Function Documentation

## addBoxDomain()

void osgParticle::DomainOperator::addBoxDomain | ( | const osg::Vec3 & | min,
|  | const osg::Vec3 & | max )

inline

Add a box domain.

References _domains, osgParticle::DomainOperator::Domain::BOX_DOMAIN, osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.

Referenced by META_Object().

## addDiskDomain()

void osgParticle::DomainOperator::addDiskDomain | ( | const osg::Vec3 & | c,
|  | const osg::Vec3 & | n,
|  | float | r1,
|  | float | r2 = 0.0f )

inline

Add a disk domain.

References _domains, osgParticle::DomainOperator::Domain::DISK_DOMAIN, osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::r2, osg::Plane::set(), osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.

Referenced by META_Object().

## addDomain()

void osgParticle::DomainOperator::addDomain | ( | const Domain & | domain | ) |

inline

Add a domain object directly, used by the .osg wrappers and serializers.

References _domains.

## addLineSegmentDomain()

void osgParticle::DomainOperator::addLineSegmentDomain | ( | const osg::Vec3 & | v1,
|  | const osg::Vec3 & | v2 )

inline

Add a line segment domain.

References _domains, osgParticle::DomainOperator::Domain::LINE_DOMAIN, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::v1, and osgParticle::DomainOperator::Domain::v2.

Referenced by META_Object().

## addPlaneDomain()

void osgParticle::DomainOperator::addPlaneDomain | ( | const osg::Plane & | plane | ) |

inline

Add a plane domain.

References _domains, osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::PLANE_DOMAIN, and osg::Plane::set().

Referenced by META_Object().

## addPointDomain()

void osgParticle::DomainOperator::addPointDomain | ( | const osg::Vec3 & | p | ) |

inline

Add a point domain.

References _domains, osgParticle::DomainOperator::Domain::POINT_DOMAIN, and osgParticle::DomainOperator::Domain::v1.

Referenced by META_Object().

## addRectangleDomain()

void osgParticle::DomainOperator::addRectangleDomain | ( | const osg::Vec3 & | corner,
|  | const osg::Vec3 & | w,
|  | const osg::Vec3 & | h )

inline

Add a rectangle domain.

References _domains, computeNewBasis(), osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::RECT_DOMAIN, osgParticle::DomainOperator::Domain::s1, osgParticle::DomainOperator::Domain::s2, osg::Plane::set(), osgParticle::DomainOperator::Domain::v1, osgParticle::DomainOperator::Domain::v2, and osgParticle::DomainOperator::Domain::v3.

Referenced by META_Object().

## addSphereDomain()

void osgParticle::DomainOperator::addSphereDomain | ( | const osg::Vec3 & | c,
|  | float | r )

inline

Add a sphere domain.

References _domains, osgParticle::DomainOperator::Domain::r1, osgParticle::DomainOperator::Domain::SPHERE_DOMAIN, and osgParticle::DomainOperator::Domain::v1.

Referenced by META_Object().

## addTriangleDomain()

void osgParticle::DomainOperator::addTriangleDomain | ( | const osg::Vec3 & | v1,
|  | const osg::Vec3 & | v2,
|  | const osg::Vec3 & | v3 )

inline

Add a triangle domain.

References _domains, computeNewBasis(), osgParticle::DomainOperator::Domain::plane, osgParticle::DomainOperator::Domain::s1, osgParticle::DomainOperator::Domain::s2, osg::Plane::set(), osgParticle::DomainOperator::Domain::TRI_DOMAIN, osgParticle::DomainOperator::Domain::v1, osgParticle::DomainOperator::Domain::v2, and osgParticle::DomainOperator::Domain::v3.

Referenced by META_Object().

## beginOperate()

void osgParticle::DomainOperator::beginOperate | ( | Program * | prg | ) |

virtual

Perform some initializations. Do not call this method manually.

Reimplemented from osgParticle::Operator.

Reimplemented in osgParticle::SinkOperator.

## computeNewBasis()

void osgParticle::DomainOperator::computeNewBasis | ( | const osg::Vec3 & | u,
|  | const osg::Vec3 & | v,
|  | osg::Vec3 & | s1,
|  | osg::Vec3 & | s2 )

inline protected

References osg::Vec3f::set(), osg::Vec3f::x(), osg::Vec3f::y(), and osg::Vec3f::z().

Referenced by addRectangleDomain(), and addTriangleDomain().

## endOperate()

void osgParticle::DomainOperator::endOperate | ( |  | ) |

virtual

Perform some post-operations. Do not call this method manually.

Reimplemented from osgParticle::Operator.

## getDomain()

const Domain & osgParticle::DomainOperator::getDomain | ( | unsigned int | i | ) | const

inline

Get a domain object directly, used by the .osg wrappers and serializers.

References _domains.

## getNumDomains()

unsigned int osgParticle::DomainOperator::getNumDomains | ( |  | ) | const

inline

Get number of domains.

References _domains.

## handleBox()

virtual void osgParticle::DomainOperator::handleBox | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::SinkOperator.

References ignore().

## handleDisk()

virtual void osgParticle::DomainOperator::handleDisk | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::BounceOperator, and osgParticle::SinkOperator.

References ignore().

## handleLineSegment()

virtual void osgParticle::DomainOperator::handleLineSegment | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::SinkOperator.

References ignore().

## handlePlane()

virtual void osgParticle::DomainOperator::handlePlane | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::BounceOperator, and osgParticle::SinkOperator.

References ignore().

## handlePoint()

virtual void osgParticle::DomainOperator::handlePoint | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::SinkOperator.

References ignore().

## handleRectangle()

virtual void osgParticle::DomainOperator::handleRectangle | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::BounceOperator, and osgParticle::SinkOperator.

References ignore().

## handleSphere()

virtual void osgParticle::DomainOperator::handleSphere | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::BounceOperator, and osgParticle::SinkOperator.

References ignore().

## handleTriangle()

virtual void osgParticle::DomainOperator::handleTriangle | ( | const Domain & | ,
|  | Particle * | ,
|  | double | )

inline protected virtual

Reimplemented in osgParticle::BounceOperator, and osgParticle::SinkOperator.

References ignore().

## ignore()

void osgParticle::DomainOperator::ignore | ( | const std::string & | func | ) |

inline protected

References osgParticle::Operator::className(), and OSG_NOTICE.

Referenced by handleBox(), handleDisk(), handleLineSegment(), handlePlane(), handlePoint(), handleRectangle(), handleSphere(), and handleTriangle().

## META_Object()

osgParticle::DomainOperator::META_Object | ( | osgParticle | ,
|  | DomainOperator | )

References addBoxDomain(), addDiskDomain(), addLineSegmentDomain(), addPlaneDomain(), addPointDomain(), addRectangleDomain(), addSphereDomain(), addTriangleDomain(), and DomainOperator().

## operate()

void osgParticle::DomainOperator::operate | ( | Particle * | P,
|  | double | dt )

virtual

Apply the acceleration to a particle. Do not call this method manually.

Implements osgParticle::Operator.

## operator=()

DomainOperator & osgParticle::DomainOperator::operator= | ( | const DomainOperator & |  | ) |

inline protected

References DomainOperator().

## removeAllDomains()

void osgParticle::DomainOperator::removeAllDomains | ( |  | ) |

inline

Remove all existing domains.

References _domains.

## removeDomain()

void osgParticle::DomainOperator::removeDomain | ( | unsigned int | i | ) |

inline

Remove a domain at specific index.

References _domains.

## Member Data Documentation

## _backupDomains

std::vector<Domain> osgParticle::DomainOperator::_backupDomains

protected

Referenced by DomainOperator().

## _domains

std::vector<Domain> osgParticle::DomainOperator::_domains

protected

Referenced by addBoxDomain(), addDiskDomain(), addDomain(), addLineSegmentDomain(), addPlaneDomain(), addPointDomain(), addRectangleDomain(), addSphereDomain(), addTriangleDomain(), DomainOperator(), getDomain(), getNumDomains(), removeAllDomains(), and removeDomain().

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

- DomainOperator