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

Configures a ProgressIndicator, then builds it and registers it in the entity registry given at construction. More...

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Create a builder set to the defaults of reset().
std::shared_ptr< ProgressIndicator > buildEntity (void) override
 Build a progress indicator and its track and fill children from the current configuration, without registering it or setting its parent.
void reset (void) override
 Restore the defaults: LinearDeterminate variant, value 0, a 200 dp long bar, a 48 dp wide ring and a default pose.
Builder & withPose (const utility::graphic::PoseF &pose)
 Set the pose the indicator is created with.
Builder & withVariant (Variant variant)
 Set the indicator variant.
Builder & withValue (float value)
 Set the progress the indicator starts with.
Builder & withWidth (float width)
 Set the length of the bar of the linear variants.
Builder & withSize (float size)
 Set the diameter of the ring of the circular variants.
std::shared_ptr< ProgressIndicator > makeProgressIndicator (std::shared_ptr< ecs::Entity > parent, Variant variant, float value)
 Build a progress indicator, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< ProgressIndicator >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< ProgressIndicator > 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 a ProgressIndicator, then builds it and registers it in the entity registry given at construction.

Definition at line 118 of file progress_indicator.hpp.

Constructor & Destructor Documentation

◆ Builder()

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

Create a builder set to the defaults of reset().

Parameters
componentRegistryThe registry the indicator's components are created in.
entityRegistryThe registry the built indicators are added to.

Definition at line 161 of file progress_indicator.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

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

Build a progress indicator and its track and fill children from the current configuration, without registering it or setting its parent.

Returns
The new indicator, visible.

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

Definition at line 171 of file progress_indicator.cpp.

Here is the call graph for this function:

◆ makeProgressIndicator()

std::shared_ptr< ProgressIndicator > guillaume::entities::ProgressIndicator::Builder::makeProgressIndicator ( std::shared_ptr< ecs::Entity > parent,
Variant variant,
float value )

Build a progress indicator, register it under parent and reset the builder.

The arguments replace the variant and value set before; the pose, length and diameter are kept.

Parameters
parentThe entity the indicator is attached to.
variantThe indicator variant.
valueThe progress it starts with, 0 to 1; a value outside is clamped. Not drawn by the indeterminate variants.
Returns
The registered indicator, visible.

Definition at line 242 of file progress_indicator.cpp.

Here is the call graph for this function:

◆ reset()

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

Restore the defaults: LinearDeterminate variant, value 0, a 200 dp long bar, a 48 dp wide ring and a default pose.

Implements guillaume::ecs::EntityBuilder.

Definition at line 187 of file progress_indicator.cpp.

Here is the caller graph for this function:

◆ withPose()

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

Set the pose the indicator is created with.

Parameters
poseThe position and orientation of the widget. Default: a default-constructed pose.
Returns
This builder, for chaining.

Definition at line 207 of file progress_indicator.cpp.

◆ withSize()

ProgressIndicator::Builder & guillaume::entities::ProgressIndicator::Builder::withSize ( float size)

Set the diameter of the ring of the circular variants.

Parameters
sizeThe diameter, in dp. Default: 48. The linear variants ignore it.
Returns
This builder, for chaining.

Definition at line 235 of file progress_indicator.cpp.

◆ withValue()

ProgressIndicator::Builder & guillaume::entities::ProgressIndicator::Builder::withValue ( float value)

Set the progress the indicator starts with.

Parameters
valueThe progress, 0 to 1; a value outside is clamped. Default: 0.
Returns
This builder, for chaining.

Definition at line 222 of file progress_indicator.cpp.

◆ withVariant()

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

Set the indicator variant.

Parameters
variantThe variant. Default: Variant::LinearDeterminate.
Returns
This builder, for chaining.

Definition at line 215 of file progress_indicator.cpp.

Here is the caller graph for this function:

◆ withWidth()

ProgressIndicator::Builder & guillaume::entities::ProgressIndicator::Builder::withWidth ( float width)

Set the length of the bar of the linear variants.

Parameters
widthThe length, in dp. Default: 200. The circular variants ignore it.
Returns
This builder, for chaining.

Definition at line 229 of file progress_indicator.cpp.


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