Open CASCADE Technology 6.6.0
Public Member Functions
OpenGl_TextFormatter Class Reference

This class intended to prepare formatted text.

#include <OpenGl_TextFormatter.hxx>

Inheritance diagram for OpenGl_TextFormatter:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_TextFormatter ()
 Default constructor.
void SetupAlignment (const Graphic3d_HorizontalTextAlignment theAlignX, const Graphic3d_VerticalTextAlignment theAlignY)
 Setup alignment style.
void Reset ()
 Reset current progress.
void Append (const Handle< OpenGl_Context > &theCtx, const NCollection_String &theString, OpenGl_Font &theFont)
 Render specified text to inner buffer.
void Format ()
 Perform formatting on the buffered text. Should not be called more than once after initialization!
void Result (NCollection_Vector< GLuint > &theTextures, NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &theVertsPerTexture, NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &theTCrdsPerTexture) const
 Retrieve formatting results.
void Result (const Handle< OpenGl_Context > &theCtx, NCollection_Vector< GLuint > &theTextures, NCollection_Vector< Handle< OpenGl_VertexBuffer >> &theVertsPerTexture, NCollection_Vector< Handle< OpenGl_VertexBuffer >> &theTCrdsPerTexture) const
 Retrieve formatting results.
void Result (const Handle< OpenGl_Context > &theCtx, NCollection_Vector< GLuint > &theTextures, NCollection_Vector< Handle< OpenGl_Vec2Array >> &theVertsPerTexture, NCollection_Vector< Handle< OpenGl_Vec2Array >> &theTCrdsPerTexture) const
 Retrieve formatting results.
Standard_ShortReal ResultWidth () const
Standard_ShortReal ResultHeight () const
void BndBox (Font_FTFont::Rect &theBndBox) const

Protected Member Functions

class auxiliary methods
void newLine (const Standard_Integer theLastRect)
 Move glyphs on the current line to correct position.

Protected Attributes

configuration
Graphic3d_HorizontalTextAlignment myAlignX
 horizontal alignment style
Graphic3d_VerticalTextAlignment myAlignY
 vertical alignment style
Standard_Integer myTabSize
 horizontal tabulation width (number of space symbols)
input data
NCollection_String myString
 currently rendered text
OpenGl_Vec2 myPen
 current pen position
NCollection_Vector
< OpenGl_Font::Tile
myRects
 glyphs rectangles
Standard_Integer myRectsNb
 rectangles number
NCollection_Vector
< Standard_ShortReal
myNewLines
 position at LF
Standard_ShortReal myLineSpacing
 line spacing (computed as maximum of all fonts involved in text formatting)
Standard_ShortReal myAscender
 currently rendered text
bool myIsFormatted
 formatting state
OpenGl_VertexBufferEditor
< OpenGl_Vec2
myVboEditor
 currently rendered text
temporary variables for formatting routines
Standard_Integer myLinesNb
 overall (new)lines number (including splitting by width limit)
Standard_Integer myRectLineStart
 id of first rectangle on the current line
Standard_Integer myRectWordStart
 id of first rectangle in the current word
Standard_Integer myNewLineNb
 overall (new)lines number (including splitting by width limit)
Standard_ShortReal myPenCurrLine
 current baseline position
Standard_ShortReal myLineLeft
 left x position of first glyph on line before formatting applied
Standard_ShortReal myLineTail
 overall (new)lines number (including splitting by width limit)
Standard_ShortReal myBndTop
 overall (new)lines number (including splitting by width limit)
Standard_ShortReal myBndWidth
 overall (new)lines number (including splitting by width limit)
OpenGl_Vec2 myMoveVec
 local variable

Constructor & Destructor Documentation

OpenGl_TextFormatter::OpenGl_TextFormatter ( )

Member Function Documentation

void OpenGl_TextFormatter::Append ( const Handle< OpenGl_Context > &  theCtx,
const NCollection_String theString,
OpenGl_Font theFont 
)
void OpenGl_TextFormatter::BndBox ( Font_FTFont::Rect theBndBox) const [inline]
Parameters:
boundingbox.
void OpenGl_TextFormatter::Format ( )
void OpenGl_TextFormatter::newLine ( const Standard_Integer  theLastRect) [protected]
void OpenGl_TextFormatter::Reset ( )
void OpenGl_TextFormatter::Result ( const Handle< OpenGl_Context > &  theCtx,
NCollection_Vector< GLuint > &  theTextures,
NCollection_Vector< Handle< OpenGl_Vec2Array >> &  theVertsPerTexture,
NCollection_Vector< Handle< OpenGl_Vec2Array >> &  theTCrdsPerTexture 
) const
void OpenGl_TextFormatter::Result ( NCollection_Vector< GLuint > &  theTextures,
NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &  theVertsPerTexture,
NCollection_Vector< NCollection_Handle< NCollection_Vector< OpenGl_Vec2 > > > &  theTCrdsPerTexture 
) const
void OpenGl_TextFormatter::Result ( const Handle< OpenGl_Context > &  theCtx,
NCollection_Vector< GLuint > &  theTextures,
NCollection_Vector< Handle< OpenGl_VertexBuffer >> &  theVertsPerTexture,
NCollection_Vector< Handle< OpenGl_VertexBuffer >> &  theTCrdsPerTexture 
) const
Standard_ShortReal OpenGl_TextFormatter::ResultHeight ( ) const [inline]
Returns:
height of formatted text.
Standard_ShortReal OpenGl_TextFormatter::ResultWidth ( ) const [inline]
Returns:
width of formatted text.
void OpenGl_TextFormatter::SetupAlignment ( const Graphic3d_HorizontalTextAlignment  theAlignX,
const Graphic3d_VerticalTextAlignment  theAlignY 
)

Field Documentation


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines