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

Marks an entity as a filled ellipse: a dot, a switch thumb, a disc. More...

#include <headers/guillaume/components/ellipse.hpp>

Inheritance diagram for guillaume::components::Ellipse:
Collaboration diagram for guillaume::components::Ellipse:

Public Types

using SegmentCount = int
 A number of straight segments.

Public Member Functions

 Ellipse (void)
 Construct an ellipse drawn with 48 segments.
 ~Ellipse (void)=default
 Default destructor for the Ellipse component.
SegmentCount getSegments (void) const
 Get how many straight segments approximate the outline.
Ellipse & setSegments (SegmentCount segments)
 Set how many straight segments approximate the outline.
Public Member Functions inherited from guillaume::ecs::Component
bool hasChanged (void) const
 Tell whether a value of the component changed since the flags were last reset (the end of the previous frame).
void setHasChanged (bool hasChanged)
 Raise or lower the changed flag.
 Component (void)=default
 Create a component that is not marked as changed.
virtual ~Component (void)=default
 Virtual destructor, so components can be destroyed through the base class.

Detailed Description

Marks an entity as a filled ellipse: a dot, a switch thumb, a disc.

The ellipse is the one inscribed in the entity's components::Bound (a square bound gives a circle) and is filled with the entity's components::Color. The only value held here is how many segments approximate the outline.

Added by the widget classes that need a round shape, or by the application. Read by systems::EllipseRender in the Render phase, with the entity's Transform, Bound and Color.

registry.addComponent<components::Ellipse>(id);
registry.getComponent<components::Bound>(id)
.setWidth(16.0f)
.setHeight(16.0f);
Size of an entity: the width and height, in dp, of the rectangle that starts at the position of its c...
Definition bound.hpp:62
Bound & setHeight(float height) noexcept
Set the height.
Definition bound.cpp:42
Marks an entity as a filled ellipse: a dot, a switch thumb, a disc.
Definition ellipse.hpp:53
See also
systems::EllipseRender, components::Ring for an outline only

Definition at line 52 of file ellipse.hpp.

Member Typedef Documentation

◆ SegmentCount

A number of straight segments.

Definition at line 55 of file ellipse.hpp.

Constructor & Destructor Documentation

◆ Ellipse()

guillaume::components::Ellipse::Ellipse ( void )
explicit

Construct an ellipse drawn with 48 segments.

Definition at line 27 of file ellipse.cpp.

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

Member Function Documentation

◆ getSegments()

Ellipse::SegmentCount guillaume::components::Ellipse::getSegments ( void ) const

Get how many straight segments approximate the outline.

Returns
The segment count (48 by default, never below 1).

Definition at line 32 of file ellipse.cpp.

◆ setSegments()

Ellipse & guillaume::components::Ellipse::setSegments ( SegmentCount segments)

Set how many straight segments approximate the outline.

More segments give a smoother curve for more triangles. Always marks the component changed, even when the count is the same.

Parameters
segmentsThe segment count; a value below 1 is stored as 1.
Returns
This component, for chaining.

Definition at line 37 of file ellipse.cpp.

Here is the call graph for this function:

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