Castor3D 0.12.0
Multiplatform 3D engine
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
castor3d::OverlayCategory Class Referenceabstract

#include <OverlayCategory.hpp>

Inheritance diagram for castor3d::OverlayCategory:
Inheritance graph
[legend]
Collaboration diagram for castor3d::OverlayCategory:
Collaboration graph
[legend]

Classes

struct  Vertex
 Holds specific vertex data for an Overlay. More...
 

Public Member Functions

 CU_DeclareVector (Vertex, Vertex)
 
C3D_API OverlayCategory (OverlayType type)
 Constructor. More...
 
virtual C3D_API ~OverlayCategory ()
 Destructor. More...
 
C3D_API void update (OverlayRenderer const &renderer)
 Updates the overlay position, size... More...
 
virtual C3D_API void accept (OverlayVisitor &renderer) const =0
 Draws the overlay. More...
 
virtual C3D_API void setMaterial (MaterialRPtr material)
 Sets the material. More...
 
C3D_API castor::String const & getOverlayName () const
 Retrieves the overlay name. More...
 
C3D_API castor::Position getAbsolutePosition (castor::Size const &size) const
 Retrieves the absolute overlay position, in pixels. More...
 
C3D_API castor::Size getAbsoluteSize (castor::Size const &size) const
 Retrieves the absolute overlay size, in pixels. More...
 
C3D_API castor::Point2f getRenderRatio (castor::Size const &size) const
 
C3D_API castor::Point2d getAbsolutePosition () const
 Retrieves the absolute overlay position. More...
 
C3D_API castor::Point2d getAbsoluteSize () const
 Retrieves the absolute overlay size. More...
 
C3D_API bool isSizeChanged () const
 
C3D_API bool isPositionChanged () const
 
virtual C3D_API bool isChanged () const
 
void setPosition (castor::Point2d const &position)
 Sets the overlay position. More...
 
void setSize (castor::Point2d const &size)
 Sets the overlay size. More...
 
castor::Point2d const & getSize () const
 Retrieves the overlay size. More...
 
castor::Point2d const & getPosition () const
 Retrieves the overlay position. More...
 
castor::Size const & getPixelSize () const
 Retrieves the overlay size. More...
 
castor::Position const & getPixelPosition () const
 Retrieves the overlay position. More...
 
castor::Point2d & getSize ()
 Retrieves the overlay size. More...
 
castor::Point2d & getPosition ()
 Retrieves the overlay position. More...
 
castor::Size & getPixelSize ()
 Retrieves the overlay size. More...
 
castor::Position & getPixelPosition ()
 Retrieves the overlay position. More...
 
OverlayType getType () const
 Retrieves the overlay type. More...
 
bool isVisible () const
 Retrieves the visibility status. More...
 
MaterialRPtr getMaterial () const
 Retrieves the material. More...
 
int getIndex () const
 Retrieves the index. More...
 
int getLevel () const
 Retrieves the level. More...
 
Overlay const & getOverlay () const
 Retrieves the overlay. More...
 
OverlaygetOverlay ()
 Retrieves the overlay. More...
 
void setOverlay (Overlay *value)
 Sets the overlay. More...
 
void setVisible (bool value)
 Sets the visibility status. More...
 
void setPixelPosition (castor::Position const &value)
 Sets the overlay position. More...
 
void setPixelSize (castor::Size const &value)
 Sets the overlay size. More...
 
void setOrder (int index, int level)
 Sets the overlay order. More...
 
void setUV (castor::Point4d const &value)
 Sets the overlay UV. More...
 
castor::Point4d const & getUV () const
 Retrieves the overlay UV. More...
 

Protected Member Functions

castor::Point2d doGetTotalSize (OverlayRenderer const &renderer) const
 
virtual void doUpdatePosition (OverlayRenderer const &renderer)
 Updates the overlay position, taking care of wanted pixel position. More...
 
virtual void doUpdateSize (OverlayRenderer const &renderer)
 Updates the overlay size, taking care of wanted pixel size. More...
 
virtual void doUpdate (OverlayRenderer const &renderer)
 Updates the overlay position, size... More...
 
virtual void doUpdateBuffer (castor::Size const &size)=0
 Updates the vertex buffer. More...
 

Protected Attributes

Overlaym_pOverlay { nullptr }
 
castor::Point2d m_position
 
castor::Point2d m_ptSize
 
castor::Position m_pxPosition
 
castor::Size m_size
 
castor::Size m_computeSize
 
bool m_visible { true }
 
MaterialRPtr m_pMaterial
 
int m_index { 0 }
 
int m_level { 0 }
 
castor::String m_strMatName
 
OverlayType m_type
 
bool m_sizeChanged { true }
 
bool m_positionChanged { true }
 
castor::Point4d m_uv { 0.0, 0.0, 1.0, 1.0 }
 

Constructor & Destructor Documentation

◆ OverlayCategory()

C3D_API castor3d::OverlayCategory::OverlayCategory ( OverlayType  type)
explicit

Constructor.

Parameters
[in]typeThe overlay type

◆ ~OverlayCategory()

virtual C3D_API castor3d::OverlayCategory::~OverlayCategory ( )
virtual

Destructor.

Member Function Documentation

◆ accept()

virtual C3D_API void castor3d::OverlayCategory::accept ( OverlayVisitor renderer) const
pure virtual

◆ CU_DeclareVector()

castor3d::OverlayCategory::CU_DeclareVector ( Vertex  ,
Vertex   
)

◆ doGetTotalSize()

castor::Point2d castor3d::OverlayCategory::doGetTotalSize ( OverlayRenderer const &  renderer) const
protected
Returns
The screen or parent's size.

◆ doUpdate()

virtual void castor3d::OverlayCategory::doUpdate ( OverlayRenderer const &  renderer)
inlineprotectedvirtual

Updates the overlay position, size...

◆ doUpdateBuffer()

virtual void castor3d::OverlayCategory::doUpdateBuffer ( castor::Size const &  size)
protectedpure virtual

Updates the vertex buffer.

Parameters
[in]sizeThe render target size.

Implemented in castor3d::BorderPanelOverlay, and castor3d::PanelOverlay.

◆ doUpdatePosition()

virtual void castor3d::OverlayCategory::doUpdatePosition ( OverlayRenderer const &  renderer)
protectedvirtual

Updates the overlay position, taking care of wanted pixel position.

◆ doUpdateSize()

virtual void castor3d::OverlayCategory::doUpdateSize ( OverlayRenderer const &  renderer)
protectedvirtual

Updates the overlay size, taking care of wanted pixel size.

Reimplemented in castor3d::BorderPanelOverlay.

◆ getAbsolutePosition() [1/2]

C3D_API castor::Point2d castor3d::OverlayCategory::getAbsolutePosition ( ) const

Retrieves the absolute overlay position.

Returns
The position

◆ getAbsolutePosition() [2/2]

C3D_API castor::Position castor3d::OverlayCategory::getAbsolutePosition ( castor::Size const &  size) const

Retrieves the absolute overlay position, in pixels.

Parameters
[in]sizeThe screen size
Returns
The position

◆ getAbsoluteSize() [1/2]

C3D_API castor::Point2d castor3d::OverlayCategory::getAbsoluteSize ( ) const

Retrieves the absolute overlay size.

Returns
The size

◆ getAbsoluteSize() [2/2]

C3D_API castor::Size castor3d::OverlayCategory::getAbsoluteSize ( castor::Size const &  size) const

Retrieves the absolute overlay size, in pixels.

Parameters
[in]sizeThe screen size
Returns
The size

◆ getIndex()

int castor3d::OverlayCategory::getIndex ( ) const
inline

Retrieves the index.

Returns
The value

References m_index.

◆ getLevel()

int castor3d::OverlayCategory::getLevel ( ) const
inline

Retrieves the level.

Returns
The value

References m_level.

◆ getMaterial()

MaterialRPtr castor3d::OverlayCategory::getMaterial ( ) const
inline

Retrieves the material.

Returns
The value

References m_pMaterial.

◆ getOverlay() [1/2]

Overlay & castor3d::OverlayCategory::getOverlay ( )
inline

Retrieves the overlay.

Returns
The value

References m_pOverlay.

◆ getOverlay() [2/2]

Overlay const & castor3d::OverlayCategory::getOverlay ( ) const
inline

Retrieves the overlay.

Returns
The value

References m_pOverlay.

◆ getOverlayName()

C3D_API castor::String const & castor3d::OverlayCategory::getOverlayName ( ) const

Retrieves the overlay name.

Returns
The value

◆ getPixelPosition() [1/2]

castor::Position & castor3d::OverlayCategory::getPixelPosition ( )
inline

Retrieves the overlay position.

Returns
The value

References m_pxPosition.

◆ getPixelPosition() [2/2]

castor::Position const & castor3d::OverlayCategory::getPixelPosition ( ) const
inline

Retrieves the overlay position.

Returns
The value

References m_pxPosition.

◆ getPixelSize() [1/2]

castor::Size & castor3d::OverlayCategory::getPixelSize ( )
inline

Retrieves the overlay size.

Returns
The value

References m_size.

◆ getPixelSize() [2/2]

castor::Size const & castor3d::OverlayCategory::getPixelSize ( ) const
inline

Retrieves the overlay size.

Returns
The value

References m_size.

◆ getPosition() [1/2]

castor::Point2d & castor3d::OverlayCategory::getPosition ( )
inline

Retrieves the overlay position.

Returns
The value

References m_position.

◆ getPosition() [2/2]

castor::Point2d const & castor3d::OverlayCategory::getPosition ( ) const
inline

Retrieves the overlay position.

Returns
The value

References m_position.

◆ getRenderRatio()

C3D_API castor::Point2f castor3d::OverlayCategory::getRenderRatio ( castor::Size const &  size) const
Parameters
[in]sizeThe render size
Returns
The ratio between given dimensions and the dimensions used when computing relative position from pixel position.

◆ getSize() [1/2]

castor::Point2d & castor3d::OverlayCategory::getSize ( )
inline

Retrieves the overlay size.

Returns
The value

References m_ptSize.

◆ getSize() [2/2]

castor::Point2d const & castor3d::OverlayCategory::getSize ( ) const
inline

Retrieves the overlay size.

Returns
The value

References m_ptSize.

◆ getType()

OverlayType castor3d::OverlayCategory::getType ( ) const
inline

Retrieves the overlay type.

Returns
The value

References m_type.

◆ getUV()

castor::Point4d const & castor3d::OverlayCategory::getUV ( ) const
inline

Retrieves the overlay UV.

Returns
The value (left, top, right and bottom)

References m_uv.

◆ isChanged()

virtual C3D_API bool castor3d::OverlayCategory::isChanged ( ) const
inlinevirtual
Returns
true if this overlay's has changed.

Reimplemented in castor3d::BorderPanelOverlay, and castor3d::TextOverlay.

◆ isPositionChanged()

C3D_API bool castor3d::OverlayCategory::isPositionChanged ( ) const
Returns
true if this overlay's or one of its parents' position has changed.

◆ isSizeChanged()

C3D_API bool castor3d::OverlayCategory::isSizeChanged ( ) const
Returns
true if this overlay's or one of its parents' size has changed.

◆ isVisible()

bool castor3d::OverlayCategory::isVisible ( ) const
inline

Retrieves the visibility status.

Returns
The value

References m_visible.

◆ setMaterial()

virtual C3D_API void castor3d::OverlayCategory::setMaterial ( MaterialRPtr  material)
virtual

Sets the material.

Parameters
[in]materialThe new value

◆ setOrder()

void castor3d::OverlayCategory::setOrder ( int  index,
int  level 
)
inline

Sets the overlay order.

Parameters
[in]indexThe new index
[in]levelThe new level

References m_index, and m_level.

◆ setOverlay()

void castor3d::OverlayCategory::setOverlay ( Overlay value)
inline

Sets the overlay.

Parameters
[in]valueThe new value

References m_pOverlay.

◆ setPixelPosition()

void castor3d::OverlayCategory::setPixelPosition ( castor::Position const &  value)
inline

Sets the overlay position.

Parameters
[in]valueThe new value

References m_positionChanged, and m_pxPosition.

◆ setPixelSize()

void castor3d::OverlayCategory::setPixelSize ( castor::Size const &  value)
inline

Sets the overlay size.

Parameters
[in]valueThe new value

References m_size, and m_sizeChanged.

◆ setPosition()

void castor3d::OverlayCategory::setPosition ( castor::Point2d const &  position)
inline

Sets the overlay position.

Parameters
[in]positionThe new value

References m_position, and m_positionChanged.

◆ setSize()

void castor3d::OverlayCategory::setSize ( castor::Point2d const &  size)
inline

Sets the overlay size.

Parameters
[in]sizeThe new value

References m_ptSize, and m_sizeChanged.

◆ setUV()

void castor3d::OverlayCategory::setUV ( castor::Point4d const &  value)
inline

Sets the overlay UV.

Parameters
[in]valueThe new value (left, top, right and bottom)

References m_uv.

◆ setVisible()

void castor3d::OverlayCategory::setVisible ( bool  value)
inline

Sets the visibility status.

Parameters
[in]valueThe new value

References m_visible.

◆ update()

C3D_API void castor3d::OverlayCategory::update ( OverlayRenderer const &  renderer)

Updates the overlay position, size...

Member Data Documentation

◆ m_computeSize

castor::Size castor3d::OverlayCategory::m_computeSize
protected

The size used to compute relative position from pixel position.

◆ m_index

int castor3d::OverlayCategory::m_index { 0 }
protected

The overlay index.

Referenced by getIndex(), and setOrder().

◆ m_level

int castor3d::OverlayCategory::m_level { 0 }
protected

The overlay level.

Referenced by getLevel(), and setOrder().

◆ m_pMaterial

MaterialRPtr castor3d::OverlayCategory::m_pMaterial
protected

The material used by the overlay.

Referenced by getMaterial().

◆ m_position

castor::Point2d castor3d::OverlayCategory::m_position
protected

The relative position (to parent or screen).

Referenced by getPosition(), and setPosition().

◆ m_positionChanged

bool castor3d::OverlayCategory::m_positionChanged { true }
protected

Tells if this overlay's position has changed.

Referenced by setPixelPosition(), and setPosition().

◆ m_pOverlay

Overlay* castor3d::OverlayCategory::m_pOverlay { nullptr }
protected

The overlay.

Referenced by getOverlay(), and setOverlay().

◆ m_ptSize

castor::Point2d castor3d::OverlayCategory::m_ptSize
protected

The relative size (to parent or screen).

Referenced by getSize(), and setSize().

◆ m_pxPosition

castor::Position castor3d::OverlayCategory::m_pxPosition
protected

The relative position (to parent or screen), in pixels.

Referenced by getPixelPosition(), and setPixelPosition().

◆ m_size

castor::Size castor3d::OverlayCategory::m_size
protected

The absolute size in pixels.

Referenced by getPixelSize(), and setPixelSize().

◆ m_sizeChanged

bool castor3d::OverlayCategory::m_sizeChanged { true }
protected

Tells if this overlay's size has changed..

Referenced by setPixelSize(), and setSize().

◆ m_strMatName

castor::String castor3d::OverlayCategory::m_strMatName
protected

The material name.

◆ m_type

OverlayType castor3d::OverlayCategory::m_type
protected

The overlay type.

Referenced by getType().

◆ m_uv

castor::Point4d castor3d::OverlayCategory::m_uv { 0.0, 0.0, 1.0, 1.0 }
protected

The UV for the panel.

Referenced by getUV(), and setUV().

◆ m_visible

bool castor3d::OverlayCategory::m_visible { true }
protected

The visibility.

Referenced by isVisible(), and setVisible().


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