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

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

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder holding the defaults of reset().
std::shared_ptr< Mesh > buildEntity (void) override
 Build a mesh from the current configuration, without registering it or giving it a parent.
void reset (void) override
 Restore the defaults: empty model path and empty texture path.
Builder & withMeshPath (const std::string &meshPath)
 Choose the model to draw.
Builder & withTexturePath (const std::string &texturePath)
 Choose the texture applied to the model.
std::shared_ptr< Mesh > makeMesh (std::shared_ptr< Entity > parent, const std::string &meshPath, const std::string &texturePath="")
 Build a mesh, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Mesh >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< Mesh > 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 Mesh widgets and registers them in the scene's entity registry.

Definition at line 74 of file mesh.hpp.

Constructor & Destructor Documentation

◆ Builder()

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

Construct a builder holding the defaults of reset().

Parameters
componentRegistryThe registry the components of the built meshes are stored in.
entityRegistryThe registry that owns the meshes built by makeMesh.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ buildEntity()

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

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

Returns
The new mesh.

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

Definition at line 38 of file mesh.cpp.

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

◆ makeMesh()

std::shared_ptr< Mesh > guillaume::entities::Mesh::Builder::makeMesh ( std::shared_ptr< Entity > parent,
const std::string & meshPath,
const std::string & texturePath = "" )

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

Parameters
parentThe entity the mesh is attached to, or nullptr for a root entity.
meshPathThe path of the model file to draw.
texturePathThe path of the texture file applied to the model, or an empty string for the default material.
Returns
The registered mesh.

Definition at line 66 of file mesh.cpp.

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

◆ reset()

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

Restore the defaults: empty model path and empty texture path.

Implements guillaume::ecs::EntityBuilder.

Definition at line 46 of file mesh.cpp.

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

◆ withMeshPath()

Mesh::Builder & guillaume::entities::Mesh::Builder::withMeshPath ( const std::string & meshPath)

Choose the model to draw.

Parameters
meshPathThe path of the model file, as the resource provider of the application resolves it. Empty by default.
Returns
Reference to this builder for chaining.
See also
components::Mesh::getMeshPath

Definition at line 52 of file mesh.cpp.

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

◆ withTexturePath()

Mesh::Builder & guillaume::entities::Mesh::Builder::withTexturePath ( const std::string & texturePath)

Choose the texture applied to the model.

Parameters
texturePathThe path of the texture file. Empty by default: the model is then drawn with the default material.
Returns
Reference to this builder for chaining.

Definition at line 59 of file mesh.cpp.

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

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