#include <GLViewer_Drawer.h>
Font for GLViewer_Drawer, Drawing bitmap and texture fonts in GLViewer
◆ GLViewer_TexFont() [1/2]
GLViewer_TexFont::GLViewer_TexFont |
( |
| ) |
|
◆ GLViewer_TexFont() [2/2]
GLViewer_TexFont::GLViewer_TexFont |
( |
QFont * |
theFont, |
|
|
int |
theSeparator = 2 , |
|
|
bool |
theIsResizeable = false , |
|
|
GLuint |
theMinMagFilter = GL_LINEAR |
|
) |
| |
A constructor.
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::~GLViewer_TexFont |
( |
| ) |
|
◆ clearTextBases()
void GLViewer_TexFont::clearTextBases |
( |
| ) |
|
|
static |
◆ drawString()
void GLViewer_TexFont::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.
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, TEX_ROW_LEN, and theScale.
◆ generateTexture()
bool GLViewer_TexFont::generateTexture |
( |
| ) |
|
Generating font texture.
Generating font texture
<TODO: conversion from "size_t" to "long"
References aTexture, FirstSymbolNumber, GLViewer_TexFindId::myFontFamily, myFontHeight, GLViewer_TexFindId::myIsBold, GLViewer_TexFindId::myIsItal, GLViewer_TexFindId::myIsUndl, myMaxRowWidth, myMinMagFilter, myNbSymbols, GLViewer_TexFindId::myPointSize, myPositions, myQFont, myTexFont, myTexFontHeight, myTexFontWidth, GLViewer_TexFindId::myViewPortId, NB_TEX_COMP, TEX_ROW_GAP, TEX_ROW_LEN, and TexFontBase.
◆ getSeparator()
int GLViewer_TexFont::getSeparator |
( |
| ) |
|
|
inline |
Returns separator between letters.
◆ getStringHeight()
int GLViewer_TexFont::getStringHeight |
( |
| ) |
|
Returns height of string in pixels.
- Returns
- height of string in pixels
References myQFont.
◆ getStringWidth()
int GLViewer_TexFont::getStringWidth |
( |
QString |
theStr | ) |
|
◆ init()
void GLViewer_TexFont::init |
( |
| ) |
|
|
private |
Initializes font parameters.
Initializes font parameters
References FirstSymbolNumber, LastSymbolNumber, myFontHeight, myMaxRowWidth, myNbSymbols, myPositions, myQFont, myTexFontHeight, myTexFontWidth, myWidths, and TEX_ROW_LEN.
◆ setSeparator()
void GLViewer_TexFont::setSeparator |
( |
int |
theSeparator | ) |
|
|
inline |
Installing separator between letters.
◆ BitmapFontCache
Map for strorage generated bitmaps fonts.
◆ myFontHeight
int GLViewer_TexFont::myFontHeight |
|
private |
◆ myIsResizeable
bool GLViewer_TexFont::myIsResizeable |
|
private |
Flag controlling scalability of this texmapped font.
◆ myMaxRowWidth
int GLViewer_TexFont::myMaxRowWidth |
|
private |
◆ myMinMagFilter
GLuint GLViewer_TexFont::myMinMagFilter |
|
private |
◆ myNbSymbols
int GLViewer_TexFont::myNbSymbols |
|
private |
Number of characters in the font texture.
◆ myPositions
int* GLViewer_TexFont::myPositions |
|
private |
Array of letter positions in texture.
◆ myQFont
QFont GLViewer_TexFont::myQFont |
|
private |
◆ mySeparator
int GLViewer_TexFont::mySeparator |
|
private |
Separator between letters.
◆ myTexFont
GLuint GLViewer_TexFont::myTexFont |
|
private |
◆ myTexFontHeight
int GLViewer_TexFont::myTexFontHeight |
|
private |
◆ myTexFontWidth
int GLViewer_TexFont::myTexFontWidth |
|
private |
◆ myWidths
int* GLViewer_TexFont::myWidths |
|
private |
◆ TexFontBase
Map for strorage generated texture fonts.
The documentation for this class was generated from the following files: