![]() |
wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
|
Represents a single tick mark ("notch") on a 2D axis. More...
#include <wNotchEntity.hpp>
Public Member Functions | |
NotchEntity (AxisType type) | |
Constructs a NotchEntity aligned to a given axis. | |
virtual | ~NotchEntity ()=default |
Virtual destructor. | |
void | render (sf::RenderWindow &window) |
Renders the notch using SFML. | |
Public Member Functions inherited from wEngine::Entity | |
Entity () | |
virtual | ~Entity () |
unsigned int | getEntityID () const |
Returns the unique ID associated with this entity. | |
void | clearComponents () |
Removes all components currently attached to the entity. | |
template<typename T, typename... Args> | |
std::shared_ptr< T > | addComponent (Args &&... args) |
Adds a new component of type T to the entity. | |
template<typename T> | |
void | removeComponent () |
Removes the component of type T from the entity. | |
template<typename T> | |
bool | hasComponent () const noexcept |
Checks whether the entity has a component of type T. | |
template<typename T> | |
std::shared_ptr< T > | getComponent () const |
Retrieves the component of type T attached to the entity. | |
template<typename T> | |
std::shared_ptr< T > | requireComponent (const std::string &context="") const |
Retrieves the component of type T and throws if it's missing. | |
template<typename Interface> | |
std::shared_ptr< Interface > | getInterfaceComponent () const |
Returns the first component that implements the specified interface. |
Additional Inherited Members | |
Static Public Member Functions inherited from wEngine::Entity | |
static void | resetEntityIDCounter () |
Resets the global entity ID counter to zero. |
Represents a single tick mark ("notch") on a 2D axis.
A NotchEntity is a visual element used to mark intervals along a coordinate axis, helping users interpret scale in a plot. It is rendered as a small filled rectangle, oriented perpendicularly to its associated axis (X_AXIS or Y_AXIS).
The actual rendering logic is handled internally using sf::RectangleShape.
wPlot2D::NotchEntity::NotchEntity | ( | AxisType | type | ) |
Constructs a NotchEntity aligned to a given axis.
type | The axis type (X or Y) which determines notch orientation. |
|
virtualdefault |
Virtual destructor.
void wPlot2D::NotchEntity::render | ( | sf::RenderWindow & | window | ) |
Renders the notch using SFML.
Builds a rectangle from ECS components (position, thickness, length, color) and draws it in the render window.
std::runtime_error | if any required component is missing. |
window | The render window to draw onto. |