Avogadro  1.1.0
Public Member Functions
Avogadro::TextRenderer Class Reference

List of all members.

Public Member Functions

void begin (GLWidget *widget)
void end ()
int draw (const Eigen::Vector3d &pos, const QString &string)
int draw (int x, int y, const QString &string)
bool isActive ()

Member Function Documentation

Call this before drawing any text. This method saves the GL state and changes it to prepare for text rendering.

Parameters:
widgetThe widget to use for rendering
int Avogadro::TextRenderer::draw ( const Eigen::Vector3d &  pos,
const QString string 
)

Draw text inside the 3D scene. Must be called between begin() and end(). The text is centered (both horizontally and vertically) around the specified position.

Parameters:
posthe position of the text in the scene's coordinate system
stringthe QString to render
Returns:
the height in pixels of the text just rendered (0 for an empty string).

References QFontMetrics::height(), and QFontMetrics::width().

int Avogadro::TextRenderer::draw ( int  x,
int  y,
const QString string 
)

Draw 2D text at the position (x,y) in window coordinates. Must be called between begin() and end(). (0,0) is the top-left corner.

Parameters:
xthe x-coordinate
ythe y-coordinate
stringthe QString to render
Returns:
the height in pixels of the text just rendered (0 for an empty string).

References QFontMetrics::height().

Call this after drawing text. This method restores the GL state to what it was when begin() was called.


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