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 Registerable * | findByName (const std::string &name) |
Finds a registerable with its name recursively from this registerable. | |
Static Public Member Functions | |
static ModifierGroup * | create (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 |
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).
Definition at line 44 of file SPK_ModifierGroup.h.
ModifierGroup | ( | Zone * | zone = NULL , |
|
ModifierTrigger | trigger = INSIDE_ZONE | |||
) |
Constructor of ModifierGroup.
zone | : the Zone of this ModifierGroup | |
trigger | : the trigger of the ModifierGroup |
void addModifier | ( | Modifier * | modifier | ) |
Adds a Modifier to this ModifierGroup.
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.
group | : the group in which to check the buffers |
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.
zone | : the Zone of this ModifierGroup | |
trigger | : the trigger of the ModifierGroup |
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
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
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.
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.
name | : the name of the registerable to find |
Reimplemented from Modifier.
const std::vector< Modifier * > & getModifiers | ( | ) | const |
Gets 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.
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 :
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).
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).
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.
registerAll | : true to register unregistered children, false to only increment ref counts of already registered children |
Reimplemented from Modifier.
bool removeModifier | ( | const Modifier * | modifier | ) |
Removes a Modifier from this ModifierGroup.
modifier | : the Modifier to remove from this ModifierGroup |
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 :
Note that if a child Modifier needs intersection or normal computation (the Modifier Obstacle for instance), the variables have to be set.
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 :
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 :
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 :
Definition at line 281 of file SPK_ModifierGroup.h.