Castor3D  ..
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::ObjectManager< Key, Elem > Class Template Reference

Base class for a scene element manager. More...

+ Inheritance diagram for Castor3D::ObjectManager< Key, Elem >:
+ Collaboration diagram for Castor3D::ObjectManager< Key, Elem >:

Public Member Functions

EngineGetEngine () const
 
void Cleanup ()
 Sets all the elements to be cleaned up. More...
 
void Remove (Key const &p_name)
 Removes an object, given a name. More...
 
void MergeInto (ObjectManager< Key, Elem > &p_destination)
 
template<typename ... Parameters>
std::shared_ptr< Elem > Create (Key const &p_name, SceneNodeSPtr p_parent=nullptr, Parameters &&... p_params)
 Creates an object. More...
 
uint32_t GetObjectCount () const
 
- Public Member Functions inherited from Castor3D::Manager< Key, Elem, Scene, ObjectManagerEngineGetter >
void Cleanup ()
 Sets all the elements to be cleaned up. More...
 
void Clear ()
 Flushes the collection. More...
 
bool IsEmpty ()
 
void Insert (Key const &p_name, std::shared_ptr< Elem > p_element)
 Removes an object, given a name. More...
 
void Remove (Key const &p_name)
 Removes an object, given a name. More...
 
void SetRenderSystem (RenderSystem *p_renderSystem)
 
RenderSystemSetRenderSystem () const
 
EngineGetEngine () const
 
Castor::String const & GetObjectTypeName () const
 
bool Has (Key const &p_name) const
 
std::shared_ptr< Elem > Find (Key const &p_name) const
 Looks for an element with given name. More...
 
void lock () const
 Locks the collection mutex. More...
 
void unlock () const
 Unlocks the collection mutex. More...
 
Collection::TObjPtrMapIt begin ()
 Returns an iterator to the first element of the collection. More...
 
Collection::TObjPtrMapConstIt begin () const
 Returns an constant iterator to the first element of the collection. More...
 
Collection::TObjPtrMapIt end ()
 Returns an iterator to the after last element of the collection. More...
 
Collection::TObjPtrMapConstIt end () const
 Returns an constant iterator to the after last element of the collection. More...
 
std::shared_ptr< Elem > Create (Key const &p_name, Parameters &&... p_params)
 Creates an object. More...
 

Protected Member Functions

 ObjectManager (Scene &p_owner, SceneNodeSPtr p_rootNode, SceneNodeSPtr p_rootCameraNode, SceneNodeSPtr p_rootObjectNode)
 Constructor. More...
 
 ~ObjectManager ()
 Destructor. More...
 
- Protected Member Functions inherited from Castor3D::Manager< Key, Elem, Scene, ObjectManagerEngineGetter >
 Manager (Scene &p_owner)
 Constructor. More...
 
 ~Manager ()
 Destructor. More...
 

Protected Attributes

SceneNodeWPtr m_rootNode
 The root node. More...
 
SceneNodeWPtr m_rootCameraNode
 The root node used only for cameras (used to ease the use of cameras) More...
 
SceneNodeWPtr m_rootObjectNode
 The root node for every object other than camera (used to ease the use of cameras) More...
 
- Protected Attributes inherited from Castor3D::Manager< Key, Elem, Scene, ObjectManagerEngineGetter >
RenderSystemm_renderSystem
 The RenderSystem. More...
 
Collection m_elements
 The elements collection. More...
 

Additional Inherited Members

- Public Types inherited from Castor3D::Manager< Key, Elem, Scene, ObjectManagerEngineGetter >
typedef Castor::Collection< Elem, Key > Collection
 

Detailed Description

template<typename Key, typename Elem>
class Castor3D::ObjectManager< Key, Elem >

Base class for a scene element manager.

Author
Sylvain DOREMUS
Date
13/10/2015
Version
0.8.0

Constructor & Destructor Documentation

◆ ObjectManager()

template<typename Key, typename Elem>
Castor3D::ObjectManager< Key, Elem >::ObjectManager ( Scene p_owner,
SceneNodeSPtr  p_rootNode,
SceneNodeSPtr  p_rootCameraNode,
SceneNodeSPtr  p_rootObjectNode 
)
inlineprotected

Constructor.

Parameters
[in]p_ownerThe owner.
[in]p_rootNodeThe root node.
[in]p_rootCameraNodeThe cameras root node.
[in]p_rootObjectNodeThe objects root node.

◆ ~ObjectManager()

template<typename Key, typename Elem>
Castor3D::ObjectManager< Key, Elem >::~ObjectManager ( )
inlineprotected

Destructor.

Member Function Documentation

◆ Cleanup()

template<typename Key, typename Elem>
void Castor3D::ObjectManager< Key, Elem >::Cleanup ( void  )
inline

Sets all the elements to be cleaned up.

◆ Create()

template<typename Key, typename Elem>
template<typename ... Parameters>
std::shared_ptr< Elem > Castor3D::ObjectManager< Key, Elem >::Create ( Key const &  p_name,
SceneNodeSPtr  p_parent = nullptr,
Parameters &&...  p_params 
)
inline

Creates an object.

Parameters
[in]p_nameThe object name.
[in]p_parentThe parent scene node.
[in]p_paramsThe other constructor parameters.
Returns
The created object.

◆ GetEngine()

template<typename Key, typename Elem>
Engine* Castor3D::ObjectManager< Key, Elem >::GetEngine ( ) const
inline
Returns
The Engine.

◆ GetObjectCount()

template<typename Key, typename Elem>
uint32_t Castor3D::ObjectManager< Key, Elem >::GetObjectCount ( ) const
inline
Returns
The objects count.

◆ MergeInto()

template<typename Key, typename Elem>
void Castor3D::ObjectManager< Key, Elem >::MergeInto ( ObjectManager< Key, Elem > &  p_destination)
inline
Returns
Merges this manager's elements to the one given.
Parameters
[out]p_destinationThe destination manager.

◆ Remove()

template<typename Key, typename Elem>
void Castor3D::ObjectManager< Key, Elem >::Remove ( Key const &  p_name)
inline

Removes an object, given a name.

Parameters
[in]p_nameThe object name.

Member Data Documentation

◆ m_rootCameraNode

template<typename Key, typename Elem>
SceneNodeWPtr Castor3D::ObjectManager< Key, Elem >::m_rootCameraNode
protected

◆ m_rootNode

template<typename Key, typename Elem>
SceneNodeWPtr Castor3D::ObjectManager< Key, Elem >::m_rootNode
protected

◆ m_rootObjectNode

template<typename Key, typename Elem>
SceneNodeWPtr Castor3D::ObjectManager< Key, Elem >::m_rootObjectNode
protected

The root node for every object other than camera (used to ease the use of cameras)

Referenced by Castor3D::ObjectManager< Castor::String, AnimatedObjectGroup >::Create(), and Castor3D::ObjectManager< Castor::String, AnimatedObjectGroup >::MergeInto().


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