Open CASCADE Technology 6.6.0
Public Member Functions
OpenGl_Text Class Reference

Text rendering.

#include <OpenGl_Text.hxx>

Inheritance diagram for OpenGl_Text:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Text (const TCollection_ExtendedString &theText, const OpenGl_Vec3 &thePoint, const OpenGl_TextParam &theParams)
 Main constructor.
void Init (const Handle< OpenGl_Context > &theCtx, const Standard_Utf8Char *theText, const OpenGl_Vec3 &thePoint)
 Setup new string and position.
void Init (const Handle< OpenGl_Context > &theCtx, const Standard_Utf8Char *theText, const OpenGl_Vec3 &thePoint, const OpenGl_TextParam &theParams)
 Setup new string and parameters.
void SetPosition (const OpenGl_Vec3 &thePoint)
 Setup new position.
void SetFontSize (const Handle< OpenGl_Context > &theContext, const Standard_Integer theFontSize)
 Setup new font size.
virtual void Render (const Handle< OpenGl_Workspace > &theWorkspace) const
virtual void Release (const Handle< OpenGl_Context > &theContext)
 Release GPU resources.

methods for compatibility with layers

Handle< OpenGl_FontmyFont
 textures' IDs
NCollection_Vector< GLuint > myTextures
 textures' IDs
NCollection_Vector< Handle
< OpenGl_VertexBuffer > > 
myVertsVbo
 VBOs of vertices.
NCollection_Vector< Handle
< OpenGl_VertexBuffer > > 
myTCrdsVbo
 VBOs of texture coordinates.
NCollection_Vector< Handle
< OpenGl_Vec2Array > > 
myVertsArray
 arrays of vertices (for compatibility mode)
NCollection_Vector< Handle
< OpenGl_Vec2Array > > 
myTCrdsArray
 arrays of vertices (for compatibility mode)
Font_FTFont::Rect myBndBox
 textures' IDs
GLdouble myProjMatrix [16]
 textures' IDs
GLdouble myModelMatrix [16]
 textures' IDs
GLint myViewport [4]
 textures' IDs
GLdouble myWinX
 textures' IDs
GLdouble myWinY
 textures' IDs
GLdouble myWinZ
 textures' IDs
GLdouble myScaleHeight
 textures' IDs
GLdouble myExportHeight
 textures' IDs
OpenGl_TextParam myParams
 textures' IDs
NCollection_String myString
 textures' IDs
OpenGl_Vec3 myPoint
 textures' IDs
bool myIs2d
 textures' IDs
 OpenGl_Text ()
 Empty constructor.
void Init (const Handle< OpenGl_Context > &theCtx, const TCollection_ExtendedString &theText, const OpenGl_Vec2 &thePoint, const OpenGl_TextParam &theParams)
 Setup new string and parameters.
void Render (const Handle< OpenGl_PrinterContext > &thePrintCtx, const Handle< OpenGl_Context > &theCtx, const OpenGl_AspectText &theTextAspect) const
 Perform rendering.
static TCollection_AsciiString FontKey (const OpenGl_AspectText &theAspect, const Standard_Integer theHeight)
 Create key for shared resource.
static Handle< OpenGl_FontFindFont (const Handle< OpenGl_Context > &theCtx, const OpenGl_AspectText &theAspect, const Standard_Integer theHeight, const TCollection_AsciiString theKey)
 Find shared resource for specified font or initialize new one.
static void StringSize (const Handle< OpenGl_Context > &theCtx, const NCollection_String &theText, const OpenGl_AspectText &theTextAspect, const OpenGl_TextParam &theParams, Standard_ShortReal &theWidth, Standard_ShortReal &theAscent, Standard_ShortReal &theDescent)
 Compute text width.
virtual ~OpenGl_Text ()
 Destructor.

Constructor & Destructor Documentation

OpenGl_Text::OpenGl_Text ( const TCollection_ExtendedString theText,
const OpenGl_Vec3 thePoint,
const OpenGl_TextParam theParams 
)
OpenGl_Text::OpenGl_Text ( )
virtual OpenGl_Text::~OpenGl_Text ( ) [protected, virtual]

Member Function Documentation

static Handle< OpenGl_Font > OpenGl_Text::FindFont ( const Handle< OpenGl_Context > &  theCtx,
const OpenGl_AspectText theAspect,
const Standard_Integer  theHeight,
const TCollection_AsciiString  theKey 
) [static]
static TCollection_AsciiString OpenGl_Text::FontKey ( const OpenGl_AspectText theAspect,
const Standard_Integer  theHeight 
) [static]
void OpenGl_Text::Init ( const Handle< OpenGl_Context > &  theCtx,
const Standard_Utf8Char theText,
const OpenGl_Vec3 thePoint,
const OpenGl_TextParam theParams 
)
void OpenGl_Text::Init ( const Handle< OpenGl_Context > &  theCtx,
const TCollection_ExtendedString theText,
const OpenGl_Vec2 thePoint,
const OpenGl_TextParam theParams 
)
void OpenGl_Text::Init ( const Handle< OpenGl_Context > &  theCtx,
const Standard_Utf8Char theText,
const OpenGl_Vec3 thePoint 
)
virtual void OpenGl_Text::Release ( const Handle< OpenGl_Context > &  theContext) [virtual]

Implements OpenGl_Element.

void OpenGl_Text::Render ( const Handle< OpenGl_PrinterContext > &  thePrintCtx,
const Handle< OpenGl_Context > &  theCtx,
const OpenGl_AspectText theTextAspect 
) const
virtual void OpenGl_Text::Render ( const Handle< OpenGl_Workspace > &  theWorkspace) const [virtual]

Implements OpenGl_Element.

void OpenGl_Text::SetFontSize ( const Handle< OpenGl_Context > &  theContext,
const Standard_Integer  theFontSize 
)
void OpenGl_Text::SetPosition ( const OpenGl_Vec3 thePoint)
static void OpenGl_Text::StringSize ( const Handle< OpenGl_Context > &  theCtx,
const NCollection_String theText,
const OpenGl_AspectText theTextAspect,
const OpenGl_TextParam theParams,
Standard_ShortReal theWidth,
Standard_ShortReal theAscent,
Standard_ShortReal theDescent 
) [static]

Field Documentation

GLdouble OpenGl_Text::myExportHeight [mutable, protected]
Handle< OpenGl_Font > OpenGl_Text::myFont [mutable, protected]
bool OpenGl_Text::myIs2d [protected]
GLdouble OpenGl_Text::myModelMatrix[16] [mutable, protected]
GLdouble OpenGl_Text::myProjMatrix[16] [mutable, protected]
GLdouble OpenGl_Text::myScaleHeight [mutable, protected]
NCollection_Vector<GLuint> OpenGl_Text::myTextures [mutable, protected]
GLint OpenGl_Text::myViewport[4] [mutable, protected]
GLdouble OpenGl_Text::myWinX [mutable, protected]
GLdouble OpenGl_Text::myWinY [mutable, protected]
GLdouble OpenGl_Text::myWinZ [mutable, protected]

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