Castor3D 0.16.0
Multiplatform 3D engine
|
#include <OverlayCategory.hpp>
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 |
Overlay & | getOverlay () 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 | |
Overlay * | m_overlay { nullptr } |
castor::Point2d | m_relPosition |
castor::Point2d | m_relSize |
std::optional< castor::Position > | m_pxPosition |
std::optional< castor::Size > | m_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 {} |
|
explicit |
Constructor.
[in] | type | The overlay type |
|
virtualdefaultnoexcept |
Destructor.
|
pure virtual |
Draws the overlay.
Implemented in castor3d::BorderPanelOverlay, castor3d::PanelOverlay, and castor3d::TextOverlay.
C3D_API castor::Position castor3d::OverlayCategory::computePixelPosition | ( | ) | const |
Retrieves the overlay position.
C3D_API castor::Size castor3d::OverlayCategory::computePixelSize | ( | ) | const |
Retrieves the overlay size.
C3D_API castor::Point4d castor3d::OverlayCategory::computeScissorRect | ( | ) | const |
Updates the scissor for this overlay.
C3D_API castor::Point2d castor3d::OverlayCategory::getAbsolutePosition | ( | ) | const |
Retrieves the absolute overlay position.
C3D_API castor::Position castor3d::OverlayCategory::getAbsolutePosition | ( | castor::Size const & | size | ) | const |
Retrieves the absolute overlay position, in pixels.
[in] | size | The screen size |
C3D_API castor::Point2d castor3d::OverlayCategory::getAbsoluteSize | ( | ) | const |
Retrieves the absolute overlay size.
C3D_API castor::Size castor3d::OverlayCategory::getAbsoluteSize | ( | castor::Size const & | size | ) | const |
Retrieves the absolute overlay size, in pixels.
[in] | size | The screen size |
|
inlinenoexcept |
References m_displayRect.
|
inlinenoexcept |
References m_index.
|
inlinenoexcept |
References m_level.
|
inlinenoexcept |
References m_material.
|
inlinenoexcept |
References m_overlay.
C3D_API castor::String const & castor3d::OverlayCategory::getOverlayName | ( | ) | const |
Retrieves the overlay name.
|
protected |
|
inlinenoexcept |
References CU_Require, hasPixelPosition(), and m_pxPosition.
|
inlinenoexcept |
|
inlinenoexcept |
References m_relPosition.
|
inlinenoexcept |
References m_relSize.
C3D_API castor::Point2d castor3d::OverlayCategory::getRenderRatio | ( | castor::Size const & | size | ) | const |
[in] | size | The render size |
|
inlinenoexcept |
References m_type.
|
inlinenoexcept |
References m_uv.
|
inlinenoexcept |
References isChanged(), isPositionChanged(), and isSizeChanged().
|
inlinenoexcept |
References m_pxPosition.
Referenced by getPixelPosition().
|
inlinenoexcept |
|
inlinevirtualnoexcept |
Reimplemented in castor3d::BorderPanelOverlay, and castor3d::TextOverlay.
Referenced by hasAnyChange().
|
inlinenoexcept |
|
protected |
true
if the overlay is fully cropped out. Referenced by isDisplayable().
C3D_API bool castor3d::OverlayCategory::isPositionChanged | ( | ) | const |
true
if this overlay's or one of its parents' position has changed. Referenced by hasAnyChange().
C3D_API bool castor3d::OverlayCategory::isSizeChanged | ( | ) | const |
true
if this overlay's or one of its parents' size has changed. Referenced by hasAnyChange().
|
inlinenoexcept |
References m_visible.
C3D_API void castor3d::OverlayCategory::reset | ( | ) |
Marks this cetegory as clean.
|
virtual |
Sets the material.
[in] | material | The new value |
|
inlinenoexcept |
|
inlinenoexcept |
References m_positionChanged, and m_pxPosition.
|
inlinenoexcept |
References m_pxSize, and m_sizeChanged.
|
inlinenoexcept |
References m_positionChanged, and m_relPosition.
|
inlinenoexcept |
References m_relSize, and m_sizeChanged.
|
inlinenoexcept |
References m_uv.
|
inlinenoexcept |
References m_visible.
C3D_API void castor3d::OverlayCategory::update | ( | OverlayRenderer const & | renderer | ) |
Updates the overlay position, size...
|
protected |
Updates the overlay size, taking care of wanted pixel size.
|
protected |
Updates the overlay position, taking care of wanted pixel position.
|
protected |
Updates the overlay size, taking care of wanted pixel size.
|
protected |
The size used to compute relative position from pixel position.
|
protected |
Tells if the overlay can be displayed (valid size, non empty test, ...).
Referenced by isDisplayable().
|
protected |
The area where children can be drawn.
Referenced by getDisplayRect().
|
protected |
The overlay index.
Referenced by getIndex(), and setOrder().
|
protected |
The overlay level.
Referenced by getLevel(), and setOrder().
|
protected |
The material used by the overlay.
Referenced by getMaterial().
|
protected |
The overlay.
Referenced by getOverlay(), getOverlay(), and setOverlay().
|
protected |
Tells if this overlay's position has changed.
Referenced by setPixelPosition(), and setRelativePosition().
|
protected |
The relative position (to parent or screen), in pixels.
Referenced by getPixelPosition(), hasPixelPosition(), and setPixelPosition().
|
protected |
The absolute size in pixels.
Referenced by getPixelSize(), hasPixelSize(), and setPixelSize().
|
protected |
The relative position (to parent or screen).
Referenced by getRelativePosition(), and setRelativePosition().
|
protected |
The relative size (to parent or screen).
Referenced by getRelativeSize(), and setRelativeSize().
|
protected |
Tells if this overlay's size has changed..
Referenced by castor3d::BorderPanelOverlay::setBorderPosition(), castor3d::BorderPanelOverlay::setPixelBorderSize(), castor3d::BorderPanelOverlay::setPixelBottomBorderSize(), castor3d::BorderPanelOverlay::setPixelLeftBorderSize(), castor3d::BorderPanelOverlay::setPixelRightBorderSize(), setPixelSize(), castor3d::BorderPanelOverlay::setPixelTopBorderSize(), castor3d::BorderPanelOverlay::setRelativeBorderSize(), castor3d::BorderPanelOverlay::setRelativeBottomBorderSize(), castor3d::BorderPanelOverlay::setRelativeLeftBorderSize(), castor3d::BorderPanelOverlay::setRelativeRightBorderSize(), setRelativeSize(), and castor3d::BorderPanelOverlay::setRelativeTopBorderSize().
|
protected |
The overlay type.
Referenced by getType().
|
protected |
|
protected |
The visibility.
Referenced by isVisible(), and setVisible().