\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.2 - Three
TextItem Class Reference

#include <CGAL/Three/TextRenderer.h>

Definition

A TextItem is a string with properties, like coordinates, font and color, that is to be rendered in the viewer.

Public Member Functions

 TextItem ()
 The default constructor.
 
 TextItem (float p_x, float p_y, float p_z, QString p_text, bool p_3D=true, QFont font=QFont(), QColor p_color=Qt::black, bool always_visible=false)
 The construtor for the TextItem. More...
 
QString text () const
 Accessor for the string. More...
 
QVector3D position ()
 The center of the item. More...
 
float width ()
 The text's width in pixels.
 
float height ()
 The text's height in pixels.
 
QFont font ()
 Accessor for the text's font.
 
QColor color ()
 Accessor for the text's color.
 
bool is_3D () const
 Specifies if the item's coordinates are World or Screen coordinates. More...
 
bool is_always_visible ()
 Specifies if the item may be hidden. More...
 

Constructor & Destructor Documentation

◆ TextItem()

TextItem::TextItem ( float  p_x,
float  p_y,
float  p_z,
QString  p_text,
bool  p_3D = true,
QFont  font = QFont(),
QColor  p_color = Qt::black,
bool  always_visible = false 
)

The construtor for the TextItem.

Parameters
p_x,p_y,p_zthe coordinates of the TextItem.
p_textthe text to render.
p_3DIf true : the TextRenderer will convert the coordinates into world coordinates. If false : the TextRenderer will display the text in screen coordinates, and ignore p_z
fontthe font used for the rendering.
p_colorthe color of the text.
always_visibleoverrides Viewer_interface::testDisplayId() if true;

Member Function Documentation

◆ is_3D()

bool TextItem::is_3D ( ) const

Specifies if the item's coordinates are World or Screen coordinates.

Returns
true if they are World coordinates
false if they are Screen coordinates

◆ is_always_visible()

bool TextItem::is_always_visible ( )

Specifies if the item may be hidden.

Returns
true if it may not
false if it may

◆ position()

QVector3D TextItem::position ( )

The center of the item.

Returns
the position of the center of the text, in world coordinates.

◆ text()

QString TextItem::text ( ) const

Accessor for the string.

Returns
the item's string