Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_TexFont Class Reference

#include <GLViewer_Drawer.h>

Public Member Functions

 GLViewer_TexFont ()
 A default constructor. More...
 
 GLViewer_TexFont (QFont *theFont, int theSeparator=2, bool theIsResizeable=false, GLuint theMinMagFilter=GL_LINEAR)
 A constructor. More...
 
 ~GLViewer_TexFont ()
 A destructor. More...
 
bool generateTexture ()
 Generating font texture. More...
 
void drawString (QString theStr, GLdouble theX=0.0, GLdouble theY=0.0, GLfloat theScale=1.0)
 Drawing string theStr in point with coords theX and theY. More...
 
int getSeparator ()
 Returns separator between letters. More...
 
void setSeparator (int theSeparator)
 Installing separator between letters. More...
 
int getStringWidth (QString theString)
 Returns width of string in pixels. More...
 
int getStringHeight ()
 Returns height of string in pixels. More...
 

Static Public Member Functions

static void clearTextBases ()
 Clears all generated fonts. More...
 

Static Public Attributes

static QMap
< GLViewer_TexFindId,
GLViewer_TexIdStored
TexFontBase
 Map for strorage generated texture fonts. More...
 
static QMap
< GLViewer_TexFindId, GLuint > 
BitmapFontCache
 Map for strorage generated bitmaps fonts. More...
 

Private Member Functions

void init ()
 Initializes font parameters. More...
 

Private Attributes

int myNbSymbols
 Number of characters in the font texture. More...
 
int * myWidths
 Array of letter width. More...
 
int * myPositions
 Array of letter positions in texture. More...
 
QFont myQFont
 Pointer to base font. More...
 
GLuint myTexFont
 Font texture ID. More...
 
int myTexFontWidth
 Font texture width. More...
 
int myTexFontHeight
 Font texture height. More...
 
int mySeparator
 Separator between letters. More...
 
bool myIsResizeable
 Flag controlling scalability of this texmapped font. More...
 
GLuint myMinMagFilter
 Min/mag filter. More...
 
int myFontHeight
 Font height. More...
 
int myMaxRowWidth
 Diagnostic information. More...
 

Detailed Description

Font for GLViewer_Drawer, Drawing bitmap and texture fonts in GLViewer

Constructor & Destructor Documentation

GLViewer_TexFont::GLViewer_TexFont ( )

Default constructor

References init(), myIsResizeable, myMinMagFilter, myQFont, and mySeparator.

GLViewer_TexFont::GLViewer_TexFont ( QFont *  theFont,
int  theSeparator = 2,
bool  theIsResizeable = false,
GLuint  theMinMagFilter = GL_LINEAR 
)

Constructor

Parameters
theFont- a base font
theSeparator- separator between letters
theIsResizeable- specifies whether text drawn by this object can be scaled along with the scene
theMinMagFilter- min/mag filter, affects text sharpness

References init(), myIsResizeable, myMinMagFilter, myQFont, and mySeparator.

GLViewer_TexFont::~GLViewer_TexFont ( )

Destructor

References myPositions, and myWidths.

Member Function Documentation

void GLViewer_TexFont::clearTextBases ( )
static

Clears all generated fonts

References BitmapFontCache, and TexFontBase.

void GLViewer_TexFont::drawString ( QString  theStr,
GLdouble  theX = 0.0,
GLdouble  theY = 0.0,
GLfloat  theScale = 1.0 
)

Drawing string in viewer

Parameters
theStr- string to be drawn
theX- X position
theY- Y position
theScale- scale coefficient

References FirstSymbolNumber, modelMatrix, myFontHeight, myIsResizeable, myPositions, mySeparator, myTexFont, myTexFontHeight, myTexFontWidth, myWidths, TEX_ROW_GAP, and TEX_ROW_LEN.

int GLViewer_TexFont::getSeparator ( )
inline
int GLViewer_TexFont::getStringHeight ( )
Returns
height of string in pixels

References myQFont.

int GLViewer_TexFont::getStringWidth ( QString  theStr)
Returns
width of string in pixels

References FirstSymbolNumber, mySeparator, and myWidths.

void GLViewer_TexFont::init ( )
private
void GLViewer_TexFont::setSeparator ( int  theSeparator)
inline

Member Data Documentation

QMap< GLViewer_TexFindId, GLuint > GLViewer_TexFont::BitmapFontCache
static
int GLViewer_TexFont::myFontHeight
private
bool GLViewer_TexFont::myIsResizeable
private
int GLViewer_TexFont::myMaxRowWidth
private
GLuint GLViewer_TexFont::myMinMagFilter
private
int GLViewer_TexFont::myNbSymbols
private
int* GLViewer_TexFont::myPositions
private
QFont GLViewer_TexFont::myQFont
private
int GLViewer_TexFont::mySeparator
private
GLuint GLViewer_TexFont::myTexFont
private
int GLViewer_TexFont::myTexFontHeight
private
int GLViewer_TexFont::myTexFontWidth
private
int* GLViewer_TexFont::myWidths
private
QMap< GLViewer_TexFindId, GLViewer_TexIdStored > GLViewer_TexFont::TexFontBase
static

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