ModifierGroup Class Reference

A Group of Modifiers. More...

Inheritance diagram for ModifierGroup:
Modifier Registerable Transformable BufferHandler

List of all members.

Public Member Functions

 ModifierGroup (Zone *zone=NULL, ModifierTrigger trigger=INSIDE_ZONE)
 Constructor of ModifierGroup.
void useGlobalGroup (bool useIntersection=false, bool useNormal=false)
 Uses this ModifierGroup as a global group.
void usePartitionGroup (bool handleWrongSide=false)
 Uses this ModifierGroup as a partition group.
size_t getNb () const
 Gets the number of modifiers in this ModifierGroup.
const std::vector< Modifier * > & getModifiers () const
 Gets the vector containing all the children modifiers.
bool isGlobalGroup () const
 Tells whether this ModifierGroup is a global group.
bool isPartitionGroup () const
 Tells whether this ModifierGroup is a partition group.
bool handlesWrongSide () const
 Tells whether this partition group handles wrong side.
bool usesIntersection () const
 Tells whether this global group computes the intersection.
bool usesNormal () const
 Tells whether this global group computes the normal.
void addModifier (Modifier *modifier)
 Adds a Modifier to this ModifierGroup.
bool removeModifier (const Modifier *modifier)
 Removes a Modifier from this ModifierGroup.
void clear ()
 Removes all Modifier children from this ModifierGroup.
virtual void createBuffers (const Group &group)
 Creates the buffers for this buffer handler in the given group.
virtual void destroyBuffers (const Group &group)
 Destroys the buffers for this buffer handler in the given group.
virtual RegisterablefindByName (const std::string &name)
 Finds a registerable with its name recursively from this registerable.

Static Public Member Functions

static ModifierGroupcreate (Zone *zone=NULL, ModifierTrigger trigger=INSIDE_ZONE)
 Creates and registers a new ModifierGroup.

Protected Member Functions

virtual void registerChildren (bool registerAll)
 Registers the children of this Registerable.
virtual void destroyChildren (bool keepChildren)
 Destroys the children of this Registerable.
virtual bool checkBuffers (const Group &group)
 checks the buffers and prepare them

Detailed Description

A Group of Modifiers.

This modifier can be used in 2 ways :

By default a ModifierGroup is used as a partition group. the user can change it by calling useGlobalGroup(bool,bool) or usePartitionGroup(bool).

Since:
1.02.00

Definition at line 44 of file SPK_ModifierGroup.h.


Constructor & Destructor Documentation

ModifierGroup ( Zone zone = NULL,
ModifierTrigger  trigger = INSIDE_ZONE 
)

Constructor of ModifierGroup.

Parameters:
zone : the Zone of this ModifierGroup
trigger : the trigger of the ModifierGroup

Member Function Documentation

void addModifier ( Modifier modifier  ) 

Adds a Modifier to this ModifierGroup.

Parameters:
modifier : the Modifier to add to this ModifierGroup
virtual bool checkBuffers ( const Group group  )  [protected, virtual]

checks the buffers and prepare them

This method has to be implemented in derived class that uses buffers.
true must be returned if the buffers are found and initialized, false otherwise.

Parameters:
group : the group in which to check the buffers
Returns:
true if buffers are ready, false otherwise

Reimplemented from BufferHandler.

void clear (  ) 

Removes all Modifier children from this ModifierGroup.

ModifierGroup * create ( Zone zone = NULL,
ModifierTrigger  trigger = INSIDE_ZONE 
) [static]

Creates and registers a new ModifierGroup.

Parameters:
zone : the Zone of this ModifierGroup
trigger : the trigger of the ModifierGroup
Returns:
A new registered ModifierGroup
Since:
1.04.00

Definition at line 231 of file SPK_ModifierGroup.h.

virtual void createBuffers ( const Group group  )  [virtual]

Creates the buffers for this buffer handler in the given group.

If the buffers for this type of buffer handler already exists within the Group, they are priorly destroyed.
The type of buffers created depends on the state of the buffer handler at the time this method is called.

This method has to be overridden in derived classes that use buffers

Parameters:
group : the Group in which to create the buffers for this buffer handler

Reimplemented from BufferHandler.

virtual void destroyBuffers ( const Group group  )  [virtual]

Destroys the buffers for this buffer handler in the given group.

if the buffers dont exist, nothing happens.

This method has to be overridden in derived classes that use buffers

Parameters:
group : the Group in which to destroy the buffers for this buffer handler

Reimplemented from BufferHandler.

virtual void destroyChildren ( bool  keepChildren  )  [protected, virtual]

Destroys the children of this Registerable.

This method has to be implemented in derived classes of Registerable which hold pointers or references of Registerable children.
The destroyChild(Registerable*,bool) has to be called within it for each child to destroy.
The keepChildren parameter of destroyChild is simply the keepChildren parameter of destroyChildren.

Parameters:
keepChildren : true to keep the children (used when destroying all registered Registerable)

Reimplemented from Modifier.

virtual Registerable* findByName ( const std::string &  name  )  [virtual]

Finds a registerable with its name recursively from this registerable.

If the name is not found, NULL is returned.
If the several objects with the same name exists, only the first one is returned.

Note that the name of the registerable itself is already tested.

Parameters:
name : the name of the registerable to find
Returns:
: the first registerable with that name within this registerable or NULL if none is found
Since:
1.05.00

Reimplemented from Modifier.

const std::vector< Modifier * > & getModifiers (  )  const

Gets the vector containing all the children modifiers.

Returns:
the vector containing all the children modifiers

Definition at line 256 of file SPK_ModifierGroup.h.

size_t getNb (  )  const

Gets the number of modifiers in this ModifierGroup.

Returns:
the number of modifiers in this ModifierGroup

Definition at line 251 of file SPK_ModifierGroup.h.

bool handlesWrongSide (  )  const

Tells whether this partition group handles wrong side.

If this ModifierGroup is a global group, the return value is not used.
For more information about partition groups, see usePartitionGroup(bool).

Note that the wrong side can only be used with the following triggers :

  • ModifierTrigger::INSIDE_ZONE
  • ModifierTrigger::OUTSIDE_ZONE
  • ModifierTrigger::ENTER_ZONE
  • ModifierTrigger::EXIT_ZONE
Returns:
true if this ModifierGroup handles wrong size, false if not

Definition at line 271 of file SPK_ModifierGroup.h.

bool isGlobalGroup (  )  const

Tells whether this ModifierGroup is a global group.

For more information about global groups, see useGlobalGroup(bool,bool).

Returns:
true if this ModifierGroup is a global group, false if not

Definition at line 261 of file SPK_ModifierGroup.h.

bool isPartitionGroup (  )  const

Tells whether this ModifierGroup is a partition group.

For more information about partition groups, see usePartitionGroup(bool).

Returns:
true if this ModifierGroup is a partition group, false if not

Definition at line 266 of file SPK_ModifierGroup.h.

virtual void registerChildren ( bool  registerAll  )  [protected, virtual]

Registers the children of this Registerable.

This method has to be implemented in derived classes of Registerable which hold pointers or references of Registerable children.
The registerChild(Registerable*,bool) has to be called within it for each child to copy from object.
The registerAll parameter of registerChild is simply the registerAll parameter of registerChildren.

Parameters:
registerAll : true to register unregistered children, false to only increment ref counts of already registered children
Since:
1.04.00

Reimplemented from Modifier.

bool removeModifier ( const Modifier modifier  ) 

Removes a Modifier from this ModifierGroup.

Parameters:
modifier : the Modifier to remove from this ModifierGroup
Returns:
true if the Modifier has been found and removed, false if not
void useGlobalGroup ( bool  useIntersection = false,
bool  useNormal = false 
)

Uses this ModifierGroup as a global group.

A global group allows to use only one trigger for many modifiers. It works as follow :

  • If the trigger of the partition group is activated, then the all children modifiers are activated no matter their Zone.
  • The same happens for the wrong side.

Note that if a child Modifier needs intersection or normal computation (the Modifier Obstacle for instance), the variables have to be set.

Parameters:
useIntersection : true to enable intersection computation in this ModifierGroup
useNormal : true to enable normal computation in this ModifierGroup

Definition at line 238 of file SPK_ModifierGroup.h.

void usePartitionGroup ( bool  handleWrongSide = false  ) 

Uses this ModifierGroup as a partition group.

A partition group allows to partition the space in order to have faster tests. It works as follow :

  • If the trigger of the partition group is activated, then modifiers within are tested to check if they are triggered.
  • If yes, the Modifier is activated, if no, nothing happens.
  • If handleWrongSize if set, the isWrongSide() method of the partition group calls the isWrongSide() of its children if it has to.
Parameters:
handleWrongSide : true to enable intersection computation in this ModifierGroup

Definition at line 245 of file SPK_ModifierGroup.h.

bool usesIntersection (  )  const

Tells whether this global group computes the intersection.

If this ModifierGroup is a partition group, the return value is not used.
For more information about global groups, see useGlobalGroup(bool,bool).

Note that the intersection can only be used with the following triggers :

  • ModifierTrigger::INTERSECT_ZONE
  • ModifierTrigger::ENTER_ZONE
  • ModifierTrigger::EXIT_ZONE
Returns:
true if this ModifierGroup computes the intersection, false if not

Definition at line 276 of file SPK_ModifierGroup.h.

bool usesNormal (  )  const

Tells whether this global group computes the normal.

If this ModifierGroup is a partition group, the return value is not used.
For more information about global groups, see useGlobalGroup(bool,bool).

Note that the normal can only be used with the following triggers :

  • ModifierTrigger::INTERSECT_ZONE
  • ModifierTrigger::ENTER_ZONE
  • ModifierTrigger::EXIT_ZONE
Returns:
true if this ModifierGroup computes the normal, false if not

Definition at line 281 of file SPK_ModifierGroup.h.


Generated on Wed Apr 27 21:09:26 2011 for SPARK Particle Engine by  doxygen 1.6.1