guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::entities::Badge::Builder Class Reference

Configures Badge widgets and registers them in the scene's entity registry. More...

#include <headers/guillaume/entities/badge.hpp>

Inheritance diagram for guillaume::entities::Badge::Builder:
Collaboration diagram for guillaume::entities::Badge::Builder:

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder holding the defaults of reset().
std::shared_ptr< Badge > buildEntity (void) override
 Build a badge and its label from the current configuration, without registering it or giving it a parent.
void reset (void) override
 Restore the defaults: default pose, the Large variant, an empty label, and a horizontal layout centered on both axes.
Builder & withPose (const utility::graphic::PoseF &pose)
 Set where the badge is.
Builder & withVariant (Variant variant)
 Choose the size class of the badge.
Builder & withLabel (const std::string &label)
 Set the text shown in the badge.
std::shared_ptr< Badge > makeBadge (std::shared_ptr< ecs::Entity > parent, const std::string &label, Variant variant)
 Build a badge and its label, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Badge >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< Badge > registerEntity (std::shared_ptr< ecs::Entity > parent)
 Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults.
Public Member Functions inherited from guillaume::ecs::EntityBuilder
 EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Create a builder working on a pair of registries, normally those of one scene.
virtual ~EntityBuilder (void)=default
 Virtual destructor.

Additional Inherited Members

Protected Member Functions inherited from guillaume::ecs::EntityBuilder
ComponentRegistry & getComponentRegistry (void)
 Get the registry in which the builder creates components.
EntityRegistry & getEntityRegistry (void)
 Get the registry in which the builder registers the entities it creates.

Detailed Description

Configures Badge widgets and registers them in the scene's entity registry.

Definition at line 95 of file badge.hpp.

Constructor & Destructor Documentation

◆ Builder()

guillaume::entities::Badge::Builder::Builder ( ecs::ComponentRegistry & componentRegistry,
ecs::EntityRegistry & entityRegistry )

Construct a builder holding the defaults of reset().

Parameters
componentRegistryThe registry the components of the built badges are stored in.
entityRegistryThe registry that owns the badges built by makeBadge.

Definition at line 36 of file badge.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

std::shared_ptr< Badge > guillaume::entities::Badge::Builder::buildEntity ( void )
overridevirtual

Build a badge and its label from the current configuration, without registering it or giving it a parent.

Returns
The new badge.

Implements guillaume::entities::EntityBuilderBase< Badge >.

Definition at line 43 of file badge.cpp.

Here is the call graph for this function:

◆ makeBadge()

std::shared_ptr< Badge > guillaume::entities::Badge::Builder::makeBadge ( std::shared_ptr< ecs::Entity > parent,
const std::string & label,
Variant variant )

Build a badge and its label, register it under parent and reset the builder.

Parameters
parentThe entity the badge is attached to, or nullptr for a root entity.
labelThe text shown in the badge. Ignored by the Dot variant.
variantThe size class: Dot, Small or Large.
Returns
The registered badge.

Definition at line 81 of file badge.cpp.

Here is the call graph for this function:

◆ reset()

void guillaume::entities::Badge::Builder::reset ( void )
overridevirtual

Restore the defaults: default pose, the Large variant, an empty label, and a horizontal layout centered on both axes.

Implements guillaume::ecs::EntityBuilder.

Definition at line 49 of file badge.cpp.

Here is the caller graph for this function:

◆ withLabel()

Badge::Builder & guillaume::entities::Badge::Builder::withLabel ( const std::string & label)

Set the text shown in the badge.

Parameters
labelThe label, such as a count. Empty by default, which builds a badge without a label child.
Returns
Reference to this builder for chaining.

Definition at line 74 of file badge.cpp.

Here is the caller graph for this function:

◆ withPose()

Badge::Builder & guillaume::entities::Badge::Builder::withPose ( const utility::graphic::PoseF & pose)

Set where the badge is.

Parameters
poseThe pose of the top-left corner of the badge. A default-constructed pose by default.
Returns
Reference to this builder for chaining.

Definition at line 62 of file badge.cpp.

◆ withVariant()

Badge::Builder & guillaume::entities::Badge::Builder::withVariant ( Variant variant)

Choose the size class of the badge.

Parameters
variantDot, Small or Large. Large by default.
Returns
Reference to this builder for chaining.

Definition at line 68 of file badge.cpp.


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