Guillaume 1.0.0
Guillaume.
|
Specialized component to group other components. More...
#include <container.hpp>
Public Member Functions | |
Container (void) | |
Constructs a Container object. | |
Container (const Properties &properties) | |
Constructs a Container object with properties. | |
~Container (void) override=default | |
Destroys the Container object. | |
std::shared_ptr< Component > | render (void) override |
Renders the container and its children recursively. | |
void | onEvent (const Event &event) override |
Handles events for the container. | |
![]() | |
Component (void) | |
Constructs a Component object. | |
Component (const Properties &properties) | |
Constructs a Component object with properties. | |
virtual | ~Component (void)=default |
Destroy the Component object. | |
ComponentID | getID (void) const |
Get the ID object. | |
virtual void | addChild (const std::shared_ptr< Component > &child) |
Add a child component. | |
virtual void | addPrimitive (const std::shared_ptr< Primitive > &primitive) |
Add a primitive for rendering. | |
State & | getState (void) |
Gets the component's state. | |
const Properties & | getProperties (void) const |
Gets the component's properties. | |
const std::vector< std::shared_ptr< Component > > & | getChildren (void) const |
Gets the component's children. | |
std::shared_ptr< Component > | getParent (void) const |
Gets the component's parent. | |
const std::vector< std::shared_ptr< Primitive > > & | getPrimitives (void) const |
Gets the component's primitives. | |
Additional Inherited Members | |
![]() | |
void | setParent (const std::shared_ptr< Component > &parent) |
Set the Parent object. | |
![]() | |
State | _state |
The component's state. | |
Properties | _properties |
The component's properties. | |
std::shared_ptr< Component > | _parent |
Pointer to the parent component. | |
std::vector< std::shared_ptr< Component > > | _children |
Vector of child components. | |
std::vector< std::shared_ptr< Primitive > > | _primitives |
Vector of primitives for rendering. | |
Specialized component to group other components.
The Container class manages the hierarchy and recursive rendering of children.
|
inline |
Constructs a Container object with properties.
properties | The properties for the container |
|
inlineoverridevirtual |
Handles events for the container.
Events are propagated to children if needed.
event | The event to handle |
Reimplemented from Component.
|
inlineoverridevirtual |
Renders the container and its children recursively.
Reimplemented from Component.