\( \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 4.12.2 - Three
TextRenderer Class Reference

#include <CGAL/Three/TextRenderer.h>

Inherits from

QObject.

Definition

The TextRender projects each TextItem from the world coordinates to the Screen coordinates and draws it.

Signals

void sendMessage (QString message, int ms_delay=2000)
 Emit this to print message on the viewer for ms_delay ms.
 

Public Member Functions

void draw (CGAL::Three::Viewer_interface *viewer)
 Draws all the TextItems.
 
void addText (TextItem *)
 Adds a single TextItem to TextRenderer::local_textItems. More...
 
void addText (float p_x, float p_y, float p_z, QString p_text, bool p_3D=true, QFont font=QFont(), QColor p_color=Qt::black)
 Creates a new TextItem in TextRenderer::local_textItems. More...
 
void addTextList (TextListItem *)
 Adds a TextListItem to TextRenderer::textItems.
 
void removeText (TextItem *textItem)
 Removes a textItem from TextRenderer::local_textItems. More...
 
void removeTextList (TextListItem *)
 Removes a TextItemList from TextRenderer::textItems //! More...
 
QList< TextItem * > getLocalTextItems ()
 The local TextListItem.
 
QList< TextListItem * > items () const
 The global list of TextListItems.
 
void setScene (CGAL::Three::Scene_interface *p_scene)
 Gives the renderer a Scene.
 
int getMax_textItems () const
 The maximum TextItems that can be displayed at once. More...
 
void setMax (int max)
 Sets the maximum TextItems that can be displayed at once. More...
 

Protected Attributes

QList< TextListItem * > textItems
 list of TextListItems More...
 
QList< TextItem * > local_textItems
 List of TextItems. More...
 

Member Function Documentation

◆ addText() [1/2]

void TextRenderer::addText ( TextItem )

Adds a single TextItem to TextRenderer::local_textItems.

See also
addText(float p_x, float p_y, float p_z, QString p_text, bool p_3D = true, QFont font = QFont(), QColor p_color = Qt::black)

◆ addText() [2/2]

void TextRenderer::addText ( float  p_x,
float  p_y,
float  p_z,
QString  p_text,
bool  p_3D = true,
QFont  font = QFont(),
QColor  p_color = Qt::black 
)

Creates a new TextItem in TextRenderer::local_textItems.

This is a version of addText(TextItem*) that creates the TextItem on the fly.

See also
addText(TextItem*)

◆ getMax_textItems()

int TextRenderer::getMax_textItems ( ) const

The maximum TextItems that can be displayed at once.

See also
setMax()

◆ removeText()

void TextRenderer::removeText ( TextItem textItem)

Removes a textItem from TextRenderer::local_textItems.

Attention
the memory of the TextItem is not de-allocated.
See also
addText(TextItem*)

◆ removeTextList()

void TextRenderer::removeTextList ( TextListItem )

Removes a TextItemList from TextRenderer::textItems //!

Attention
the memory of the TextItems is not de-allocated.

◆ setMax()

void TextRenderer::setMax ( int  max)

Sets the maximum TextItems that can be displayed at once.

See also
getMax_textItems()

Member Data Documentation

◆ local_textItems

QList<TextItem*> TextRenderer::local_textItems
protected

List of TextItems.

Usually fed by the viewer, it holds the text informations from the viewer that are displayed directly on the screen, like the fps, the distances, etc.

◆ textItems

QList<TextListItem*> TextRenderer::textItems
protected

list of TextListItems

It holds lists of correlated TextItems that are associated to a CGAL::Three::Scene_item, like primitiveIds.