Guillaume 1.0.0
Guillaume.
Loading...
Searching...
No Matches
Text Class Reference

Represents a text primitive for rendering in 3D space. More...

#include <text.hpp>

Inheritance diagram for Text:
Collaboration diagram for Text:

Public Member Functions

 Text (void)
 Default constructor - initializes empty text at origin with no rotation and unit scale.
 
 Text (const std::string &content)
 Constructor with text content.
 
 Text (const std::string &content, const Point &position)
 Constructor with text content and 3D position.
 
 Text (const std::string &content, const Point &position, const Point &rotation, float scale)
 Constructor with text content, position, rotation, and scale for full 3D control.
 
 ~Text (void) override=default
 Destroy the Text object.
 
const std::string & getContent (void) const
 Gets the text content.
 
void setContent (const std::string &content)
 Sets the text content.
 
const PointgetPosition (void) const
 Gets the text position.
 
void setPosition (const Point &position)
 Sets the text position.
 
const PointgetRotation (void) const
 Gets the text rotation.
 
void setRotation (const Point &rotation)
 Sets the text rotation.
 
float getScale (void) const
 Gets the text scale.
 
void setScale (float scale)
 Sets the text scale.
 
- Public Member Functions inherited from Primitive
 Primitive (void)
 Constructs a Primitive object.
 
virtual ~Primitive (void)=default
 Destroy the Primitive object.
 

Detailed Description

Represents a text primitive for rendering in 3D space.

The Text class is a derived class of Primitive that represents text content at a specific 3D position with optional rotation and scaling. This allows components like Labels and Buttons to generate text primitives for 3D rendering.

Constructor & Destructor Documentation

◆ Text() [1/3]

Text::Text ( const std::string &  content)
inline

Constructor with text content.

Parameters
contentThe text content to display

◆ Text() [2/3]

Text::Text ( const std::string &  content,
const Point position 
)
inline

Constructor with text content and 3D position.

Parameters
contentThe text content to display
positionThe 3D position where the text should be rendered

◆ Text() [3/3]

Text::Text ( const std::string &  content,
const Point position,
const Point rotation,
float  scale 
)
inline

Constructor with text content, position, rotation, and scale for full 3D control.

Parameters
contentThe text content to display
positionThe 3D position where the text should be rendered
rotationThe rotation angles (x, y, z) in radians
scaleThe scale factor for text size

Member Function Documentation

◆ getContent()

const std::string & Text::getContent ( void  ) const
inline

Gets the text content.

Returns
const std::string& Reference to the text content

◆ getPosition()

const Point & Text::getPosition ( void  ) const
inline

Gets the text position.

Returns
const Point& Reference to the text position

◆ getRotation()

const Point & Text::getRotation ( void  ) const
inline

Gets the text rotation.

Returns
const Point& Reference to the rotation angles (x, y, z) in radians

◆ getScale()

float Text::getScale ( void  ) const
inline

Gets the text scale.

Returns
float The scale factor

◆ setContent()

void Text::setContent ( const std::string &  content)
inline

Sets the text content.

Parameters
contentThe new text content

◆ setPosition()

void Text::setPosition ( const Point position)
inline

Sets the text position.

Parameters
positionThe new 3D position for the text

◆ setRotation()

void Text::setRotation ( const Point rotation)
inline

Sets the text rotation.

Parameters
rotationThe new rotation angles (x, y, z) in radians

◆ setScale()

void Text::setScale ( float  scale)
inline

Sets the text scale.

Parameters
scaleThe new scale factor

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