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

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

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder holding the defaults of reset().
std::shared_ptr< Divider > buildEntity (void) override
 Build a divider from the current configuration, without registering it or giving it a parent.
void reset (void) override
 Restore the defaults: default pose, the OutlineVariant color of the active theme, length 100 dp, hairline thickness (HairlineThickness), inset 16 dp, and the FullWidth variant.
Builder & withPose (const utility::graphic::PoseF &pose)
 Set where the line starts.
Builder & withColor (const utility::graphic::Color32Bit &color)
 Set the stroke color.
Builder & withLength (float length)
 Set the total length.
Builder & withThickness (float thickness)
 Set the stroke thickness.
Builder & withInset (float inset)
 Set how much an inset end is shortened.
Builder & withVariant (Variant variant)
 Choose which ends of the line are inset.
std::shared_ptr< Divider > makeDivider (std::shared_ptr< Entity > parent, float length, Variant variant)
 Build a divider, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Divider >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< Divider > 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 Divider widgets and registers them in the scene's entity registry.

Definition at line 113 of file divider.hpp.

Constructor & Destructor Documentation

◆ Builder()

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

Construct a builder holding the defaults of reset().

Parameters
componentRegistryThe registry the components of the built dividers are stored in.
entityRegistryThe registry that owns the dividers built by makeDivider.

Definition at line 33 of file divider.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

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

Build a divider from the current configuration, without registering it or giving it a parent.

Returns
The new divider.

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

Definition at line 40 of file divider.cpp.

Here is the call graph for this function:

◆ makeDivider()

std::shared_ptr< Divider > guillaume::entities::Divider::Builder::makeDivider ( std::shared_ptr< Entity > parent,
float length,
Variant variant )

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

The pose, color, thickness and inset set with the with... methods apply to the built divider.

Parameters
parentThe entity the divider is attached to, or nullptr for a root entity.
lengthThe total length, insets included, in dp.
variantWhich ends of the line are inset.
Returns
The registered divider.

Definition at line 97 of file divider.cpp.

Here is the call graph for this function:

◆ reset()

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

Restore the defaults: default pose, the OutlineVariant color of the active theme, length 100 dp, hairline thickness (HairlineThickness), inset 16 dp, and the FullWidth variant.

Implements guillaume::ecs::EntityBuilder.

Definition at line 48 of file divider.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withColor()

Divider::Builder & guillaume::entities::Divider::Builder::withColor ( const utility::graphic::Color32Bit & color)

Set the stroke color.

Parameters
colorThe color (RGBA). By default the OutlineVariant color the active theme had when the builder was last reset.
Returns
Reference to this builder for chaining.

Definition at line 66 of file divider.cpp.

◆ withInset()

Divider::Builder & guillaume::entities::Divider::Builder::withInset ( float inset)

Set how much an inset end is shortened.

Parameters
insetThe inset, in dp, applied to the ends the variant insets. 16 by default.
Returns
Reference to this builder for chaining.

Definition at line 84 of file divider.cpp.

◆ withLength()

Divider::Builder & guillaume::entities::Divider::Builder::withLength ( float length)

Set the total length.

Parameters
lengthThe length, insets included, in dp. 100 by default.
Returns
Reference to this builder for chaining.

Definition at line 72 of file divider.cpp.

Here is the caller graph for this function:

◆ withPose()

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

Set where the line starts.

Parameters
poseThe pose of the line before the leading inset is applied. A default-constructed pose by default.
Returns
Reference to this builder for chaining.

Definition at line 59 of file divider.cpp.

◆ withThickness()

Divider::Builder & guillaume::entities::Divider::Builder::withThickness ( float thickness)

Set the stroke thickness.

Parameters
thicknessThe thickness, in dp. HairlineThickness by default.
Returns
Reference to this builder for chaining.

Definition at line 78 of file divider.cpp.

◆ withVariant()

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

Choose which ends of the line are inset.

Parameters
variantThe variant. FullWidth by default.
Returns
Reference to this builder for chaining.

Definition at line 90 of file divider.cpp.


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