Castor3D  ..
Public Types | Public Member Functions | List of all members
Castor3D::OverlayManager Class Reference

Overlay collection, with additional add and remove functions to manage Z-Index. More...

+ Inheritance diagram for Castor3D::OverlayManager:
+ Collaboration diagram for Castor3D::OverlayManager:

Public Types

typedef Castor::Collection< Overlay, Castor::String >::TObjPtrMapIt iterator
 
typedef Castor::Collection< Overlay, Castor::String >::TObjPtrMapConstIt const_iterator
 
typedef std::set< OverlayCategorySPtr, OverlayCategorySortOverlayCategorySet
 
- Public Types inherited from Castor3D::Manager< Castor::String, Overlay, Engine, ResourceManagerEngineGetter >
typedef Castor::Collection< Overlay, Castor::String > Collection
 

Public Member Functions

 DECLARE_MAP (Castor::String, FontTextureSPtr, FontTextureStr)
 
C3D_API OverlayManager (Engine &p_engine)
 Constructor. More...
 
C3D_API ~OverlayManager ()
 Destructor. More...
 
C3D_API void Clear ()
 Clears all overlays lists. More...
 
C3D_API void Cleanup ()
 Cleans all overlays up. More...
 
C3D_API void Remove (Castor::String const &p_name)
 Removes an overlay from the lists. More...
 
C3D_API OverlaySPtr Create (Castor::String const &p_name, eOVERLAY_TYPE p_type, OverlaySPtr p_parent, SceneSPtr p_scene)
 Creates an overlay, given a type and the overlay definitions. More...
 
C3D_API PanelOverlaySPtr CreatePanel (Castor::String const &p_name, Castor::Point2d const &p_position, Castor::Point2d const &p_size, MaterialSPtr p_material, OverlaySPtr p_parent=nullptr)
 Creates a panel overlay. More...
 
C3D_API PanelOverlaySPtr CreatePanel (Castor::String const &p_name, Castor::Position const &p_position, Castor::Size const &p_size, MaterialSPtr p_material, OverlaySPtr p_parent=nullptr)
 Creates a panel overlay. More...
 
C3D_API BorderPanelOverlaySPtr CreateBorderPanel (Castor::String const &p_name, Castor::Point2d const &p_position, Castor::Point2d const &p_size, MaterialSPtr p_material, Castor::Point4d const &p_bordersSize, MaterialSPtr p_bordersMaterial, OverlaySPtr p_parent=nullptr)
 Creates a border panel overlay. More...
 
C3D_API BorderPanelOverlaySPtr CreateBorderPanel (Castor::String const &p_name, Castor::Position const &p_position, Castor::Size const &p_size, MaterialSPtr p_material, Castor::Rectangle const &p_bordersSize, MaterialSPtr p_bordersMaterial, OverlaySPtr p_parent=nullptr)
 Creates a panel overlay. More...
 
C3D_API TextOverlaySPtr CreateText (Castor::String const &p_name, Castor::Point2d const &p_position, Castor::Point2d const &p_size, MaterialSPtr p_material, Castor::FontSPtr p_font, OverlaySPtr p_parent=nullptr)
 Creates a text overlay. More...
 
C3D_API TextOverlaySPtr CreateText (Castor::String const &p_name, Castor::Position const &p_position, Castor::Size const &p_size, MaterialSPtr p_material, Castor::FontSPtr p_font, OverlaySPtr p_parent=nullptr)
 Creates a text overlay. More...
 
C3D_API void UpdateRenderer ()
 Initialises or cleans up the OverlayRenderer, according to engine rendering status. More...
 
C3D_API void Update ()
 Updates overlays. More...
 
C3D_API void Render (Scene const &p_scene, Castor::Size const &p_size)
 Renders all visible overlays. More...
 
C3D_API bool Write (Castor::TextFile &p_file) const
 Writes overlays in a text file. More...
 
C3D_API bool Read (Castor::TextFile &p_file)
 Reads overlays from a text file. More...
 
C3D_API bool Save (Castor::BinaryFile &p_file) const
 Writes overlays in a binary file. More...
 
C3D_API bool Load (Castor::BinaryFile &p_file)
 Reads overlays from a binary file. More...
 
C3D_API FontTextureSPtr GetFontTexture (Castor::String const &p_name)
 Retrieves a FontTexture given a font name. More...
 
C3D_API FontTextureSPtr CreateFontTexture (Castor::FontSPtr p_font)
 Creates a FontTexture from a font. More...
 
OverlayRendererSPtr GetRenderer () const
 Retrieves the overlay renderer. More...
 
OverlayCategorySet::iterator begin ()
 Retrieves an iterator to the first overlay. More...
 
OverlayCategorySet::const_iterator begin () const
 Retrieves an iterator to the first overlay. More...
 
OverlayCategorySet::iterator end ()
 Retrieves an iterator to after the last overlay. More...
 
OverlayCategorySet::const_iterator end () const
 Retrieves an iterator to after the last overlay. More...
 
OverlayFactory const & GetOverlayFactory () const
 Retrieves the Overlay factory. More...
 
OverlayFactoryGetFactory ()
 Retrieves the Overlay factory. More...
 
- Public Member Functions inherited from Castor3D::Manager< Castor::String, Overlay, Engine, ResourceManagerEngineGetter >
void Cleanup ()
 Sets all the elements to be cleaned up. More...
 
void Clear ()
 Flushes the collection. More...
 
bool IsEmpty ()
 
void Insert (Castor::String const &p_name, std::shared_ptr< Overlay > p_element)
 Removes an object, given a name. More...
 
void Remove (Castor::String 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 (Castor::String const &p_name) const
 
std::shared_ptr< OverlayFind (Castor::String 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< OverlayCreate (Castor::String const &p_name, Parameters &&... p_params)
 Creates an object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Castor3D::ResourceManager< Castor::String, Overlay >
 ResourceManager (Engine &p_owner)
 Constructor. More...
 
 ~ResourceManager ()
 Destructor. More...
 
- Protected Member Functions inherited from Castor3D::Manager< Castor::String, Overlay, Engine, ResourceManagerEngineGetter >
 Manager (Engine &p_owner)
 Constructor. More...
 
 ~Manager ()
 Destructor. More...
 
- Protected Attributes inherited from Castor3D::Manager< Castor::String, Overlay, Engine, ResourceManagerEngineGetter >
RenderSystemm_renderSystem
 The RenderSystem. More...
 
Collection m_elements
 The elements collection. More...
 

Detailed Description

Overlay collection, with additional add and remove functions to manage Z-Index.

Author
Sylvain DOREMUS
Date
09/02/2010
Version
0.1

Member Typedef Documentation

◆ const_iterator

typedef Castor::Collection< Overlay, Castor::String >::TObjPtrMapConstIt Castor3D::OverlayManager::const_iterator

◆ iterator

typedef Castor::Collection< Overlay, Castor::String >::TObjPtrMapIt Castor3D::OverlayManager::iterator

◆ OverlayCategorySet

typedef std::set< OverlayCategorySPtr, OverlayCategorySort > Castor3D::OverlayManager::OverlayCategorySet

Constructor & Destructor Documentation

◆ OverlayManager()

C3D_API Castor3D::OverlayManager::OverlayManager ( Engine p_engine)

Constructor.

◆ ~OverlayManager()

C3D_API Castor3D::OverlayManager::~OverlayManager ( )

Destructor.

Member Function Documentation

◆ begin() [1/2]

OverlayCategorySet::iterator Castor3D::OverlayManager::begin ( )
inline

Retrieves an iterator to the first overlay.

Returns
The value

◆ begin() [2/2]

OverlayCategorySet::const_iterator Castor3D::OverlayManager::begin ( ) const
inline

Retrieves an iterator to the first overlay.

Returns
The value

◆ Cleanup()

C3D_API void Castor3D::OverlayManager::Cleanup ( )

Cleans all overlays up.

◆ Clear()

C3D_API void Castor3D::OverlayManager::Clear ( )

Clears all overlays lists.

◆ Create()

C3D_API OverlaySPtr Castor3D::OverlayManager::Create ( Castor::String const &  p_name,
eOVERLAY_TYPE  p_type,
OverlaySPtr  p_parent,
SceneSPtr  p_scene 
)

Creates an overlay, given a type and the overlay definitions.

Remarks
If an overlay with the given name already exists, no creation is done, the return is the existing overlay
Parameters
[in]p_typeThe overlay type (panel, text ...)
[in]p_nameThe overlay name
[in]p_parentThe parent overlay, nullptr if none
[in]p_sceneThe scene that holds the overlay
Returns
The created overlay

◆ CreateBorderPanel() [1/2]

C3D_API BorderPanelOverlaySPtr Castor3D::OverlayManager::CreateBorderPanel ( Castor::String const &  p_name,
Castor::Point2d const &  p_position,
Castor::Point2d const &  p_size,
MaterialSPtr  p_material,
Castor::Point4d const &  p_bordersSize,
MaterialSPtr  p_bordersMaterial,
OverlaySPtr  p_parent = nullptr 
)

Creates a border panel overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position, relative to parent, or screen, if no parent.
[in]p_sizeThe size, relative to parent, or screen, if no parent.
[in]p_materialThe overlay material.
[in]p_bordersSizeThe overlay borders size.
[in]p_bordersMaterialThe overlay borders material.
[in]p_parentThe parent overlay.
Returns
The created overlay.

◆ CreateBorderPanel() [2/2]

C3D_API BorderPanelOverlaySPtr Castor3D::OverlayManager::CreateBorderPanel ( Castor::String const &  p_name,
Castor::Position const &  p_position,
Castor::Size const &  p_size,
MaterialSPtr  p_material,
Castor::Rectangle const &  p_bordersSize,
MaterialSPtr  p_bordersMaterial,
OverlaySPtr  p_parent = nullptr 
)

Creates a panel overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position in pixels, inside the parent, or screen if no parent.
[in]p_sizeThe absolute size in pixels.
[in]p_materialThe overlay material.
[in]p_bordersSizeThe overlay borders pixel size.
[in]p_bordersMaterialThe overlay borders material.
[in]p_parentThe parent overlay.
Returns
The created overlay. Crée une incrustation panneau borduré.
Remarks
Poste l'évènement d'initialisation au moteur.
Parameters
[in]p_nameLe nom de l'incrustation.
[in]p_positionLa position en pixels, dans le parent, ou l'écran, si pas de parent.
[in]p_sizeLa taille absolue, en pixels.
[in]p_materialLe matériau de l'incrustation.
[in]p_bordersSizeLes dimensions des bords de l'incrustation.
[in]p_bordersMaterialLe matériau des bordures de l'incrustation.
[in]p_parentL'incrustation parente.
Returns
L'incrustation ainsi créée.

◆ CreateFontTexture()

C3D_API FontTextureSPtr Castor3D::OverlayManager::CreateFontTexture ( Castor::FontSPtr  p_font)

Creates a FontTexture from a font.

Parameters
[in]p_fontThe font.
Returns
The created FontTexture.

◆ CreatePanel() [1/2]

C3D_API PanelOverlaySPtr Castor3D::OverlayManager::CreatePanel ( Castor::String const &  p_name,
Castor::Point2d const &  p_position,
Castor::Point2d const &  p_size,
MaterialSPtr  p_material,
OverlaySPtr  p_parent = nullptr 
)

Creates a panel overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position, relative to parent, or screen, if no parent.
[in]p_sizeThe size, relative to parent, or screen, if no parent.
[in]p_materialThe overlay material.
[in]p_parentThe parent overlay.
Returns
The created overlay.

◆ CreatePanel() [2/2]

C3D_API PanelOverlaySPtr Castor3D::OverlayManager::CreatePanel ( Castor::String const &  p_name,
Castor::Position const &  p_position,
Castor::Size const &  p_size,
MaterialSPtr  p_material,
OverlaySPtr  p_parent = nullptr 
)

Creates a panel overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position in pixels, inside the parent, or screen if no parent.
[in]p_sizeThe absolute size in pixels.
[in]p_materialThe overlay material.
[in]p_parentThe parent overlay.
Returns
The created overlay.

◆ CreateText() [1/2]

C3D_API TextOverlaySPtr Castor3D::OverlayManager::CreateText ( Castor::String const &  p_name,
Castor::Point2d const &  p_position,
Castor::Point2d const &  p_size,
MaterialSPtr  p_material,
Castor::FontSPtr  p_font,
OverlaySPtr  p_parent = nullptr 
)

Creates a text overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position, relative to parent, or screen, if no parent.
[in]p_sizeThe size, relative to parent, or screen, if no parent.
[in]p_materialThe overlay material.
[in]p_fontThe font used to display the text.
[in]p_parentThe parent overlay.
Returns
The created overlay.

◆ CreateText() [2/2]

C3D_API TextOverlaySPtr Castor3D::OverlayManager::CreateText ( Castor::String const &  p_name,
Castor::Position const &  p_position,
Castor::Size const &  p_size,
MaterialSPtr  p_material,
Castor::FontSPtr  p_font,
OverlaySPtr  p_parent = nullptr 
)

Creates a text overlay.

Remarks
Posts the intialisation event to the engine.
Parameters
[in]p_nameThe overlay name.
[in]p_positionThe position in pixels, inside the parent, or screen if no parent.
[in]p_sizeThe absolute size in pixels.
[in]p_materialThe overlay material.
[in]p_fontThe font used to display the text.
[in]p_parentThe parent overlay.
Returns
The created overlay.

◆ DECLARE_MAP()

Castor3D::OverlayManager::DECLARE_MAP ( Castor::String  ,
FontTextureSPtr  ,
FontTextureStr   
)

◆ end() [1/2]

OverlayCategorySet::iterator Castor3D::OverlayManager::end ( )
inline

Retrieves an iterator to after the last overlay.

Returns
The value

◆ end() [2/2]

OverlayCategorySet::const_iterator Castor3D::OverlayManager::end ( ) const
inline

Retrieves an iterator to after the last overlay.

Returns
The value

◆ GetFactory()

OverlayFactory& Castor3D::OverlayManager::GetFactory ( )
inline

Retrieves the Overlay factory.

Returns
The factory

◆ GetFontTexture()

C3D_API FontTextureSPtr Castor3D::OverlayManager::GetFontTexture ( Castor::String const &  p_name)

Retrieves a FontTexture given a font name.

Parameters
[in]p_nameThe font name.
Returns
The FontTexture if it exist, nullptr if not.

◆ GetOverlayFactory()

OverlayFactory const& Castor3D::OverlayManager::GetOverlayFactory ( ) const
inline

Retrieves the Overlay factory.

Returns
The factory

◆ GetRenderer()

OverlayRendererSPtr Castor3D::OverlayManager::GetRenderer ( ) const
inline

Retrieves the overlay renderer.

Returns
The overlay renderer

◆ Load()

C3D_API bool Castor3D::OverlayManager::Load ( Castor::BinaryFile &  p_file)

Reads overlays from a binary file.

Parameters
[in]p_fileThe file
Returns
true if ok

◆ Read()

C3D_API bool Castor3D::OverlayManager::Read ( Castor::TextFile &  p_file)

Reads overlays from a text file.

Parameters
[in]p_fileThe file
Returns
true if ok

◆ Remove()

C3D_API void Castor3D::OverlayManager::Remove ( Castor::String const &  p_name)

Removes an overlay from the lists.

Parameters
[in]p_nameThe overlay name.

◆ Render()

C3D_API void Castor3D::OverlayManager::Render ( Scene const &  p_scene,
Castor::Size const &  p_size 
)

Renders all visible overlays.

Parameters
[in]p_sceneThe scene displayed, to display its overlays and the global ones
[in]p_sizeThe render target size

◆ Save()

C3D_API bool Castor3D::OverlayManager::Save ( Castor::BinaryFile &  p_file) const

Writes overlays in a binary file.

Parameters
[out]p_fileThe file
Returns
true if ok

◆ Update()

C3D_API void Castor3D::OverlayManager::Update ( )

Updates overlays.

◆ UpdateRenderer()

C3D_API void Castor3D::OverlayManager::UpdateRenderer ( )

Initialises or cleans up the OverlayRenderer, according to engine rendering status.

◆ Write()

C3D_API bool Castor3D::OverlayManager::Write ( Castor::TextFile &  p_file) const

Writes overlays in a text file.

Parameters
[out]p_fileThe file
Returns
true if ok

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