40 #ifndef _debrismanager_cpp
41 #define _debrismanager_cpp
50 #include "Physics/physicsmanager.h"
66 TargetManager(Target) { }
125 this->
Debriss.push_back( Ret );
140 this->
Debriss.push_back( Ret );
155 this->
Debriss.push_back( Ret );
167 this->
Debriss.push_back( Ret );
182 this->
Debriss.push_back( Ret );
196 Debris* Ret = (*DebFactIt).second->CreateDebris( InstanceName, this->
ParentWorld, Params );
197 this->
Debriss.push_back( Ret );
212 this->
Debriss.push_back( Ret );
221 return this->
Debriss.at(Index);
228 if( (*DebIt)->GetName() == Name )
242 if( DebIt != this->
Debriss.end() )
246 (*DebFactIt).second->DestroyDebris( (*DebIt) );
258 if( DebIt != this->
Debriss.end() )
262 (*DebFactIt).second->DestroyDebris( (*DebIt) );
277 (*DebFactIt).second->DestroyDebris( (*DebIt) );
286 {
return this->
Debriss.begin(); }
289 {
return this->
Debriss.end(); }
292 {
return this->
Debriss.begin(); }
295 {
return this->
Debriss.end(); }
326 delete DebFactIt->second;
334 {
delete (*DebFactIt).second; }
405 {
delete ToBeDestroyed; }
DebrisManager * TargetManager
A pointer to the manager this work unit is processing.
virtual void AddDependency(iWorkUnit *NewDependency)
Force this WorkUnit to Start after another has completed.
This is the base class for all collision shapes.
virtual void DestroyDebrisFactory(DebrisFactory *ToBeDestroyed)
Removes and destroys a Debris factory in this manager.
WorldManager * GetManager(const Whole ManagerToGet)
This is will find the manager of a given type.
DebrisManager(World *Creator)
Class constructor.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
DebrisUpdateWorkUnit & operator=(const DebrisUpdateWorkUnit &Other)
Protected assignment operator. THIS IS NOT ALLOWED.
bool Boole
Generally acts a single bit, true or false.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
virtual void AddToWorld()=0
Adds the object to the World.
virtual void AddWorkUnitMain(iWorkUnit *MoreWork, const String &WorkUnitName)
Add a normal Mezzanine::Threading::iWorkUnit to this For fcheduling.
This file contains the declaration for the manager that manages debris objects in a world...
ManagerType
A listing of Manager Types.
virtual String GetTypeName() const =0
Gets the name of the Debris that is created by this factory.
DebrisContainer::iterator DebrisIterator
Iterator type for Debris instances stored by this class.
virtual ~DefaultDebrisManagerFactory()
Class destructor.
virtual void DestroyDebris(const Whole Index)
Destroys an Debris at the specified index.
virtual void RemoveWorkUnitMain(iWorkUnit *LessWork)
Remove a WorkUnit from the main pool of WorkUnits (and not from the groups of Affinity or MonpolyWork...
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
This class is used to check and modify the properties of a graphics mesh.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
virtual void Pause(const UInt32 PL)
Sets the pause state of this manager, or has no effect depending on the value passed in...
DebrisIterator EndDebris()
Gets an iterator to one passed the last Debris in this manager.
A base factory type for the creation of Debris objects.
Threading::FrameScheduler & GetScheduler()
Gets the core structure responsible for scheduling work in the Entresol main loop.
virtual void AddToWorld()
Adds the object to the World.
A base factory type for the creation of non-deformable Debris objects.
float Real
A Datatype used to represent a real floating point number.
A thread specific collection of double-buffered and algorithm specific resources. ...
virtual void DestroyAllDebris()
Destroys all Debriss currently within this manager.
This file contains the declaration for the debris class that does not deform.
virtual Whole GetNumDebris() const
Gets the number of Debriss stored in this manager.
A manager responsible for the storage and management of all Debris that exist in a world...
virtual Debris * GetDebris(const Whole Index) const
Gets an Debris by Index.
A light-weight handle for manipulating nodes in DOM tree.
A simple world object without a large structure ideal for representing loose small objects...
DebrisContainer Debriss
Container storing all Debris belonging to this manager.
DebrisUpdateWorkUnit * GetDebrisUpdateWork()
Gets the work unit responsible for updating Debriss stored by this manager.
uint32_t UInt32
An 32-bit unsigned integer.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
FactoryMap::iterator FactoryIterator
Iterator type for DebrisFactory instances stored by this class.
virtual void DoWork(Threading::DefaultThreadSpecificStorage::Type &CurrentThreadStorage)
This does any required update of the Debris stored by it's manager.
Entresol * TheEntresol
The actual pointer to the Entresol core class.
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
virtual void RemoveDebrisFactory(DebrisFactory *ToBeRemoved)
Removes a Debris factory from this manager.
DebrisUpdateWorkUnit * DebrisUpdateWork
The work unit that updates all the Debris stored by this manager.
FactoryMap DebrisFactories
A map containing all registered Debris type factories.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
DebrisIterator BeginDebris()
Gets an iterator to the first Debris in this manager.
Thrown when the available information should have worked but failed for unknown reasons.
This is the base class for all managers that belong to a single world instance.
virtual void ClearDependencies()
Drop any information about what work units this one depends on.
virtual void DestroyAllDebrisFactories()
Destroys all Debris factories in this manager.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
This is simply a place for storing all the Physics Related functions.
This is a Mezzanine::Threading::iWorkUnit for the updating of Debris.
virtual ManagerType GetInterfaceType() const
This returns the type of this manager.
virtual ~DebrisManager()
Class destructor.
Threading::DefaultWorkUnit * GetSimulationWork()
Gets a pointer to the work unit that steps the simulation.
World * ParentWorld
A pointer to the world that created this manager.
virtual void AddDebrisFactory(DebrisFactory *ToBeAdded)
Adds/registers a Debris factory with this manager, allowing it to be constructed through this API...
The bulk of the engine components go in this namspace.
Debris * CreateDebris(const String &TypeName, const String &InstanceName, const NameValuePairMap &Params, const Boole AddToWorld=true)
Creates a new Debris.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
This class represents a world for objects to interact within.
DebrisUpdateWorkUnit(const DebrisUpdateWorkUnit &Other)
Protected copy constructor. THIS IS NOT ALLOWED.
A base factory type for the creation of deformable Debris objects.
RigidDebris * CreateRigidDebris(const String &Name, const Real Mass, const Boole AddToWorld=true)
Creates a new RigidDebris.
virtual void AddToWorld()
Adds the object to the World.
virtual ~DebrisUpdateWorkUnit()
Class destructor.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
static const String ImplementationName
A String containing the name of this manager implementation.
SoftDebris * CreateSoftDebris(const String &Name, const Real Mass, const Boole AddToWorld=true)
Creates a new SoftDebris.
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
DefaultDebrisManagerFactory()
Class constructor.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
void DestroyManager(WorldManager *ToBeDestroyed)
Destroys a Manager created by this factory.
DebrisContainer::const_iterator ConstDebrisIterator
Const Iterator type for Debris instances stored by this class.
WorldManager * CreateManager(World *Creator, const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
std::string String
A datatype used to a series of characters.
SoftDebris * CreateSoftDebris(const XML::Node &SelfRoot)
Creates a new SoftDebris.
This file contains the declaration for the debris class that will compress and deform.
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...