Open CASCADE Technology
6.9.0
|
This class intended to prepare formatted text. More...
#include <OpenGl_TextFormatter.hxx>
Public Member Functions | |
OpenGl_TextFormatter () | |
Default constructor. More... | |
void | SetupAlignment (const Graphic3d_HorizontalTextAlignment theAlignX, const Graphic3d_VerticalTextAlignment theAlignY) |
Setup alignment style. More... | |
void | Reset () |
Reset current progress. More... | |
void | Append (const Handle< OpenGl_Context > &theCtx, const NCollection_String &theString, OpenGl_Font &theFont) |
Render specified text to inner buffer. More... | |
void | Format () |
Perform formatting on the buffered text. Should not be called more than once after initialization! More... | |
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. More... | |
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. More... | |
Standard_ShortReal | ResultWidth () const |
Standard_ShortReal | ResultHeight () const |
void | BndBox (Font_FTFont::Rect &theBndBox) const |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const Handle_Standard_Type & | DynamicType () const |
Returns a type information object about this object. More... | |
Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
virtual Handle_Standard_Transient | This () const |
Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
Protected Member Functions | |
class auxiliary methods | |
void | newLine (const Standard_Integer theLastRect) |
Move glyphs on the current line to correct position. More... | |
Protected Attributes | |
configuration | |
Graphic3d_HorizontalTextAlignment | myAlignX |
horizontal alignment style More... | |
Graphic3d_VerticalTextAlignment | myAlignY |
vertical alignment style More... | |
Standard_Integer | myTabSize |
horizontal tabulation width (number of space symbols) More... | |
input data | |
NCollection_String | myString |
currently rendered text More... | |
OpenGl_Vec2 | myPen |
current pen position More... | |
NCollection_Vector < OpenGl_Font::Tile > | myRects |
glyphs rectangles More... | |
Standard_Integer | myRectsNb |
rectangles number More... | |
NCollection_Vector < Standard_ShortReal > | myNewLines |
position at LF More... | |
Standard_ShortReal | myLineSpacing |
line spacing (computed as maximum of all fonts involved in text formatting) More... | |
Standard_ShortReal | myAscender |
currently rendered text More... | |
bool | myIsFormatted |
formatting state More... | |
OpenGl_VertexBufferEditor < OpenGl_Vec2 > | myVboEditor |
currently rendered text More... | |
temporary variables for formatting routines | |
Standard_Integer | myLinesNb |
overall (new)lines number (including splitting by width limit) More... | |
Standard_Integer | myRectLineStart |
id of first rectangle on the current line More... | |
Standard_Integer | myRectWordStart |
id of first rectangle in the current word More... | |
Standard_Integer | myNewLineNb |
overall (new)lines number (including splitting by width limit) More... | |
Standard_ShortReal | myPenCurrLine |
current baseline position More... | |
Standard_ShortReal | myLineLeft |
left x position of first glyph on line before formatting applied More... | |
Standard_ShortReal | myLineTail |
overall (new)lines number (including splitting by width limit) More... | |
Standard_ShortReal | myBndTop |
overall (new)lines number (including splitting by width limit) More... | |
Standard_ShortReal | myBndWidth |
overall (new)lines number (including splitting by width limit) More... | |
OpenGl_Vec2 | myMoveVec |
local variable More... | |
This class intended to prepare formatted text.
OpenGl_TextFormatter::OpenGl_TextFormatter | ( | ) |
Default constructor.
void OpenGl_TextFormatter::Append | ( | const Handle< OpenGl_Context > & | theCtx, |
const NCollection_String & | theString, | ||
OpenGl_Font & | theFont | ||
) |
Render specified text to inner buffer.
|
inline |
bounding | box. |
void OpenGl_TextFormatter::Format | ( | ) |
Perform formatting on the buffered text. Should not be called more than once after initialization!
|
protected |
Move glyphs on the current line to correct position.
void OpenGl_TextFormatter::Reset | ( | ) |
Reset current progress.
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 |
Retrieve formatting results.
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 |
Retrieve formatting results.
|
inline |
|
inline |
void OpenGl_TextFormatter::SetupAlignment | ( | const Graphic3d_HorizontalTextAlignment | theAlignX, |
const Graphic3d_VerticalTextAlignment | theAlignY | ||
) |
Setup alignment style.
|
protected |
horizontal alignment style
|
protected |
vertical alignment style
|
protected |
currently rendered text
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
formatting state
|
protected |
left x position of first glyph on line before formatting applied
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
line spacing (computed as maximum of all fonts involved in text formatting)
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
local variable
|
protected |
overall (new)lines number (including splitting by width limit)
|
protected |
position at LF
|
protected |
current pen position
|
protected |
current baseline position
|
protected |
id of first rectangle on the current line
|
protected |
glyphs rectangles
|
protected |
rectangles number
|
protected |
id of first rectangle in the current word
|
protected |
currently rendered text
|
protected |
horizontal tabulation width (number of space symbols)
|
mutableprotected |
currently rendered text