Castor3D 0.16.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.
 
virtual C3D_API ~OverlayCategory () noexcept=default
 Destructor.
 
C3D_API void update (OverlayRenderer const &renderer)
 Updates the overlay position, size...
 
C3D_API void reset ()
 Marks this cetegory as clean.
 
virtual C3D_API void accept (OverlayVisitor &renderer) const =0
 Draws the overlay.
 
virtual C3D_API void setMaterial (MaterialObs material)
 Sets the material.
 
C3D_API castor::String const & getOverlayName () const
 Retrieves the overlay name.
 
C3D_API castor::Position getAbsolutePosition (castor::Size const &size) const
 Retrieves the absolute overlay position, in pixels.
 
C3D_API castor::Size getAbsoluteSize (castor::Size const &size) const
 Retrieves the absolute overlay size, in pixels.
 
C3D_API castor::Point2d getRenderRatio (castor::Size const &size) const
 
C3D_API castor::Point2d getAbsolutePosition () const
 Retrieves the absolute overlay position.
 
C3D_API castor::Point2d getAbsoluteSize () const
 Retrieves the absolute overlay size.
 
C3D_API bool isSizeChanged () const
 
C3D_API bool isPositionChanged () const
 
C3D_API castor::Size computePixelSize () const
 Retrieves the overlay size.
 
C3D_API castor::Position computePixelPosition () const
 Retrieves the overlay position.
 
C3D_API castor::Point4d computeScissorRect () const
 Updates the scissor for this overlay.
 

Getters.

virtual C3D_API bool isChanged () const noexcept
 
bool hasAnyChange () const noexcept
 
castor::Point4d const & getDisplayRect () const noexcept
 
castor::Point2d const & getRelativeSize () const noexcept
 
castor::Point2d const & getRelativePosition () const noexcept
 
OverlayType getType () const noexcept
 
bool isVisible () const noexcept
 
bool isDisplayable () const noexcept
 
MaterialObs getMaterial () const noexcept
 
uint32_t getIndex () const noexcept
 
uint32_t getLevel () const noexcept
 
Overlay const & getOverlay () const noexcept
 
OverlaygetOverlay () noexcept
 
castor::Point4d const & getUV () const noexcept
 
bool hasPixelPosition () const noexcept
 
bool hasPixelSize () const noexcept
 
castor::Position const & getPixelPosition () const noexcept
 
castor::Size const & getPixelSize () const noexcept
 

Mutators.

void setRelativePosition (castor::Point2d const &value) noexcept
 
void setRelativeSize (castor::Point2d const &value) noexcept
 
void setPixelPosition (castor::Position const &value) noexcept
 
void setPixelSize (castor::Size const &value) noexcept
 
void setOverlay (Overlay *value) noexcept
 
void setVisible (bool value) noexcept
 
void setOrder (uint32_t level, uint32_t index) noexcept
 
void setUV (castor::Point4d const &value) noexcept
 

Protected Member Functions

C3D_API void updatePosition (OverlayRenderer const &renderer)
 Updates the overlay position, taking care of wanted pixel position.
 
C3D_API void updateSize (OverlayRenderer const &renderer)
 Updates the overlay size, taking care of wanted pixel size.
 
C3D_API void updateClientArea ()
 Updates the overlay size, taking care of wanted pixel size.
 
C3D_API castor::Point2d getParentSize () const
 
C3D_API bool isFullyCropped () const
 

Protected Attributes

Overlaym_overlay { nullptr }
 
castor::Point2d m_relPosition
 
castor::Point2d m_relSize
 
std::optional< castor::Positionm_pxPosition
 
std::optional< castor::Sizem_pxSize
 
castor::Size m_computeSize
 
bool m_visible { true }
 
bool m_displayable { false }
 
MaterialObs m_material {}
 
uint32_t m_index { 0 }
 
uint32_t m_level { 0 }
 
OverlayType m_type
 
bool m_sizeChanged { true }
 
bool m_positionChanged { true }
 
castor::Point4d m_uv { 0.0, 0.0, 1.0, 1.0 }
 
castor::Point4d m_displayRect {}
 

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 ( )
virtualdefaultnoexcept

Destructor.

Member Function Documentation

◆ accept()

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

◆ computePixelPosition()

C3D_API castor::Position castor3d::OverlayCategory::computePixelPosition ( ) const

Retrieves the overlay position.

Returns
The value

◆ computePixelSize()

C3D_API castor::Size castor3d::OverlayCategory::computePixelSize ( ) const

Retrieves the overlay size.

Returns
The value

◆ computeScissorRect()

C3D_API castor::Point4d castor3d::OverlayCategory::computeScissorRect ( ) const

Updates the scissor for this overlay.

◆ CU_DeclareVector()

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

◆ 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

◆ getDisplayRect()

castor::Point4d const & castor3d::OverlayCategory::getDisplayRect ( ) const
inlinenoexcept

References m_displayRect.

◆ getIndex()

uint32_t castor3d::OverlayCategory::getIndex ( ) const
inlinenoexcept

References m_index.

◆ getLevel()

uint32_t castor3d::OverlayCategory::getLevel ( ) const
inlinenoexcept

References m_level.

◆ getMaterial()

MaterialObs castor3d::OverlayCategory::getMaterial ( ) const
inlinenoexcept

References m_material.

◆ getOverlay() [1/2]

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

References m_overlay.

◆ getOverlay() [2/2]

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

References m_overlay.

◆ getOverlayName()

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

Retrieves the overlay name.

Returns
The value

◆ getParentSize()

C3D_API castor::Point2d castor3d::OverlayCategory::getParentSize ( ) const
protected
Returns
The screen or parent's size.

◆ getPixelPosition()

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

References CU_Require, hasPixelPosition(), and m_pxPosition.

Here is the call graph for this function:

◆ getPixelSize()

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

References CU_Require, hasPixelSize(), and m_pxSize.

Here is the call graph for this function:

◆ getRelativePosition()

castor::Point2d const & castor3d::OverlayCategory::getRelativePosition ( ) const
inlinenoexcept

References m_relPosition.

◆ getRelativeSize()

castor::Point2d const & castor3d::OverlayCategory::getRelativeSize ( ) const
inlinenoexcept

References m_relSize.

◆ getRenderRatio()

C3D_API castor::Point2d 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.

◆ getType()

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

References m_type.

◆ getUV()

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

References m_uv.

◆ hasAnyChange()

bool castor3d::OverlayCategory::hasAnyChange ( ) const
inlinenoexcept

References isChanged(), isPositionChanged(), and isSizeChanged().

Here is the call graph for this function:

◆ hasPixelPosition()

bool castor3d::OverlayCategory::hasPixelPosition ( ) const
inlinenoexcept

References m_pxPosition.

Referenced by getPixelPosition().

Here is the caller graph for this function:

◆ hasPixelSize()

bool castor3d::OverlayCategory::hasPixelSize ( ) const
inlinenoexcept

References m_pxSize.

Referenced by getPixelSize().

Here is the caller graph for this function:

◆ isChanged()

virtual C3D_API bool castor3d::OverlayCategory::isChanged ( ) const
inlinevirtualnoexcept

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

Referenced by hasAnyChange().

Here is the caller graph for this function:

◆ isDisplayable()

bool castor3d::OverlayCategory::isDisplayable ( ) const
inlinenoexcept

References isFullyCropped(), and m_displayable.

Here is the call graph for this function:

◆ isFullyCropped()

C3D_API bool castor3d::OverlayCategory::isFullyCropped ( ) const
protected
Returns
true if the overlay is fully cropped out.

Referenced by isDisplayable().

Here is the caller graph for this function:

◆ isPositionChanged()

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

Referenced by hasAnyChange().

Here is the caller graph for this function:

◆ isSizeChanged()

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

Referenced by hasAnyChange().

Here is the caller graph for this function:

◆ isVisible()

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

References m_visible.

◆ reset()

C3D_API void castor3d::OverlayCategory::reset ( )

Marks this cetegory as clean.

◆ setMaterial()

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

Sets the material.

Parameters
[in]materialThe new value

◆ setOrder()

void castor3d::OverlayCategory::setOrder ( uint32_t level,
uint32_t index )
inlinenoexcept

References m_index, and m_level.

◆ setOverlay()

void castor3d::OverlayCategory::setOverlay ( Overlay * value)
inlinenoexcept

References m_overlay.

◆ setPixelPosition()

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

References m_positionChanged, and m_pxPosition.

◆ setPixelSize()

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

References m_pxSize, and m_sizeChanged.

◆ setRelativePosition()

void castor3d::OverlayCategory::setRelativePosition ( castor::Point2d const & value)
inlinenoexcept

References m_positionChanged, and m_relPosition.

◆ setRelativeSize()

void castor3d::OverlayCategory::setRelativeSize ( castor::Point2d const & value)
inlinenoexcept

References m_relSize, and m_sizeChanged.

◆ setUV()

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

References m_uv.

◆ setVisible()

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

References m_visible.

◆ update()

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

Updates the overlay position, size...

◆ updateClientArea()

C3D_API void castor3d::OverlayCategory::updateClientArea ( )
protected

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

◆ updatePosition()

C3D_API void castor3d::OverlayCategory::updatePosition ( OverlayRenderer const & renderer)
protected

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

◆ updateSize()

C3D_API void castor3d::OverlayCategory::updateSize ( OverlayRenderer const & renderer)
protected

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

Member Data Documentation

◆ m_computeSize

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

The size used to compute relative position from pixel position.

◆ m_displayable

bool castor3d::OverlayCategory::m_displayable { false }
protected

Tells if the overlay can be displayed (valid size, non empty test, ...).

Referenced by isDisplayable().

◆ m_displayRect

castor::Point4d castor3d::OverlayCategory::m_displayRect {}
protected

The area where children can be drawn.

Referenced by getDisplayRect().

◆ m_index

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

The overlay index.

Referenced by getIndex(), and setOrder().

◆ m_level

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

The overlay level.

Referenced by getLevel(), and setOrder().

◆ m_material

MaterialObs castor3d::OverlayCategory::m_material {}
protected

The material used by the overlay.

Referenced by getMaterial().

◆ m_overlay

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

The overlay.

Referenced by getOverlay(), getOverlay(), and setOverlay().

◆ m_positionChanged

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

Tells if this overlay's position has changed.

Referenced by setPixelPosition(), and setRelativePosition().

◆ m_pxPosition

std::optional< castor::Position > castor3d::OverlayCategory::m_pxPosition
protected

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

Referenced by getPixelPosition(), hasPixelPosition(), and setPixelPosition().

◆ m_pxSize

std::optional< castor::Size > castor3d::OverlayCategory::m_pxSize
protected

The absolute size in pixels.

Referenced by getPixelSize(), hasPixelSize(), and setPixelSize().

◆ m_relPosition

castor::Point2d castor3d::OverlayCategory::m_relPosition
protected

The relative position (to parent or screen).

Referenced by getRelativePosition(), and setRelativePosition().

◆ m_relSize

castor::Point2d castor3d::OverlayCategory::m_relSize
protected

The relative size (to parent or screen).

Referenced by getRelativeSize(), and setRelativeSize().

◆ m_sizeChanged

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

◆ 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: