#include <GLViewer_Drawer.h>
Public Member Functions | |
| GLViewer_TexFont () | |
| A default constructor. | |
| GLViewer_TexFont (QFont *theFont, int theSeparator=2, bool theIsResizeable=false, GLuint theMinMagFilter=GL_LINEAR) | |
| A constructor. | |
| ~GLViewer_TexFont () | |
| A destructor. | |
| bool | generateTexture () |
| Generating font texture. | |
| 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. | |
| int | getSeparator () |
| Returns separator between letters. | |
| void | setSeparator (int theSeparator) |
| Installing separator between letters. | |
| int | getStringWidth (QString theString) |
| Returns width of string in pixels. | |
| int | getStringHeight () |
| Returns height of string in pixels. | |
Static Public Member Functions | |
| static void | clearTextBases () |
| Clears all generated fonts. | |
Static Public Attributes | |
| static QMap < GLViewer_TexFindId, GLViewer_TexIdStored > | TexFontBase |
| Map for strorage generated texture fonts. | |
| static QMap < GLViewer_TexFindId, GLuint > | BitmapFontCache |
| Map for strorage generated bitmaps fonts. | |
Private Member Functions | |
| void | init () |
| Initializes font parameters. | |
Private Attributes | |
| int | myNbSymbols |
| Number of characters in the font texture. | |
| int * | myWidths |
| Array of letter width. | |
| int * | myPositions |
| Array of letter positions in texture. | |
| QFont | myQFont |
| Pointer to base font. | |
| GLuint | myTexFont |
| Font texture ID. | |
| int | myTexFontWidth |
| Font texture width. | |
| int | myTexFontHeight |
| Font texture height. | |
| int | mySeparator |
| Separator between letters. | |
| bool | myIsResizeable |
| Flag controlling scalability of this texmapped font. | |
| GLuint | myMinMagFilter |
| Min/mag filter. | |
| int | myFontHeight |
| Font height. | |
| int | myMaxRowWidth |
| Diagnostic information. | |
Font for GLViewer_Drawer, Drawing bitmap and texture fonts in GLViewer
| 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
| 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.
| bool GLViewer_TexFont::generateTexture | ( | ) |
Generating font texture
References FirstSymbolNumber, test_table.l, GLViewer_TexFindId.myFontFamily, myFontHeight, GLViewer_TexFindId.myIsBold, GLViewer_TexFindId.myIsItal, GLViewer_TexFindId.myIsUndl, myMaxRowWidth, myMinMagFilter, myNbSymbols, GLViewer_TexFindId.myPointSize, myPositions, myQFont, myTexFont, GLViewer_TexIdStored.myTexFontHeight, myTexFontHeight, GLViewer_TexIdStored.myTexFontId, GLViewer_TexIdStored.myTexFontWidth, myTexFontWidth, GLViewer_TexFindId.myViewPortId, NB_TEX_COMP, TEX_ROW_GAP, TEX_ROW_LEN, and TexFontBase.
| void GLViewer_TexFont::drawString | ( | QString | theStr, |
| GLdouble | theX = 0.0, |
||
| GLdouble | theY = 0.0, |
||
| GLfloat | theScale = 1.0 |
||
| ) |
Drawing string in viewer
| 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 | ( | ) |
| void GLViewer_TexFont.setSeparator | ( | int | theSeparator | ) |
| int GLViewer_TexFont::getStringWidth | ( | QString | theStr | ) |
References FirstSymbolNumber, mySeparator, and myWidths.
| int GLViewer_TexFont::getStringHeight | ( | ) |
References myQFont.
| void GLViewer_TexFont::clearTextBases | ( | ) | [static] |
Clears all generated fonts
References BitmapFontCache, and TexFontBase.
| void GLViewer_TexFont::init | ( | ) | [private] |
Initializes font parameters
References FirstSymbolNumber, test_big_table.k, LastSymbolNumber, myFontHeight, myMaxRowWidth, myNbSymbols, myPositions, myQFont, myTexFontHeight, myTexFontWidth, myWidths, and TEX_ROW_LEN.
QMap< GLViewer_TexFindId, GLViewer_TexIdStored > GLViewer_TexFont::TexFontBase [static] |
QMap< GLViewer_TexFindId, GLuint > GLViewer_TexFont::BitmapFontCache [static] |
int GLViewer_TexFont.myNbSymbols [private] |
int* GLViewer_TexFont.myWidths [private] |
int* GLViewer_TexFont.myPositions [private] |
QFont GLViewer_TexFont.myQFont [private] |
GLuint GLViewer_TexFont.myTexFont [private] |
int GLViewer_TexFont.myTexFontWidth [private] |
int GLViewer_TexFont.myTexFontHeight [private] |
int GLViewer_TexFont.mySeparator [private] |
bool GLViewer_TexFont.myIsResizeable [private] |
GLuint GLViewer_TexFont.myMinMagFilter [private] |
int GLViewer_TexFont.myFontHeight [private] |
int GLViewer_TexFont.myMaxRowWidth [private] |