SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::helper::gl::GlText Class Reference

#include <glText.h>

Detailed Description

This class, called GlText, allows to render text in OpenGL, always facing the camera in 2D (screen) or in 3D (world coordinates)

Public Member Functions

 GlText ()
 Constructor. More...
 
 GlText (const std::string &text)
 Constructor with specified text. More...
 
 GlText (const std::string &text, const defaulttype::Vector3 &position)
 Constructor with specified text and position. More...
 
 GlText (const std::string &text, const defaulttype::Vector3 &position, const double &scale)
 Constructor with specified text, position and scale. More...
 
 ~GlText ()
 Destructor. More...
 
void setText (const std::string &text)
 Update the text to render. More...
 
template<typename T >
void setText (const T &text)
 Update the text to render. More...
 
void update (const defaulttype::Vector3 &position)
 Update the position used to render the text. More...
 
void update (const double &scale)
 Update the scale used to render the text. More...
 
void draw ()
 Render the text at the defined position and scale. More...
 

Static Public Member Functions

template<typename T >
static void draw (const T &text, const defaulttype::Vector3 &position=defaulttype::Vector3(0.0, 0.0, 0.0), const double &scale=1.0)
 Render the text at the defined position and scale. More...
 
static void textureDraw_Overlay (const char *text, const double scale=1.0)
 
static void textureDraw_Indices (const helper::vector< defaulttype::Vector3 > &positions, const float &scale)
 

Constructor details

sofa::helper::gl::GlText::GlText ( )

Constructor.

sofa::helper::gl::GlText::GlText ( const std::string &  text)

Constructor with specified text.

sofa::helper::gl::GlText::GlText ( const std::string &  text,
const defaulttype::Vector3 &  position 
)

Constructor with specified text and position.

sofa::helper::gl::GlText::GlText ( const std::string &  text,
const defaulttype::Vector3 &  position,
const double scale 
)

Constructor with specified text, position and scale.

sofa::helper::gl::GlText::~GlText ( )

Destructor.

Function details

void sofa::helper::gl::GlText::draw ( )

Render the text at the defined position and scale.

template<typename T >
void sofa::helper::gl::GlText::draw ( const T &  text,
const defaulttype::Vector3 &  position = defaulttype::Vector3(0.0,0.0,0.0),
const double scale = 1.0 
)
static

Render the text at the defined position and scale.

void sofa::helper::gl::GlText::setText ( const std::string &  text)

Update the text to render.

template<typename T >
void sofa::helper::gl::GlText::setText ( const T &  text)

Update the text to render.

void sofa::helper::gl::GlText::textureDraw_Indices ( const helper::vector< defaulttype::Vector3 > &  positions,
const float scale 
)
static
void sofa::helper::gl::GlText::textureDraw_Overlay ( const char *  text,
const double  scale = 1.0 
)
static
void sofa::helper::gl::GlText::update ( const defaulttype::Vector3 &  position)

Update the position used to render the text.

void sofa::helper::gl::GlText::update ( const double scale)

Update the scale used to render the text.