Open CASCADE Technology: OpenGl_Text Class Reference

Open CASCADE Technology 6.8.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions
OpenGl_Text Class Reference

Text rendering. More...

`#include <OpenGl_Text.hxx>`

Inheritance diagram for OpenGl_Text:
[legend]

## Public Member Functions
| OpenGl_Text (const Standard_Utf8Char *theText, const OpenGl_Vec3 &thePoint, const OpenGl_TextParam &theParams)
| Main constructor. More...
void | Init (const Handle< OpenGl_Context > &theCtx, const Standard_Utf8Char *theText, const OpenGl_Vec3 &thePoint)
| Setup new string and position. More...
void | Init (const Handle< OpenGl_Context > &theCtx, const Standard_Utf8Char *theText, const OpenGl_Vec3 &thePoint, const OpenGl_TextParam &theParams)
| Setup new string and parameters. More...
void | SetPosition (const OpenGl_Vec3 &thePoint)
| Setup new position. More...
void | SetFontSize (const Handle< OpenGl_Context > &theContext, const Standard_Integer theFontSize)
| Setup new font size. More...
virtual void | Render (const Handle< OpenGl_Workspace > &theWorkspace) const
virtual void | Release (OpenGl_Context *theContext)
| Release GPU resources. Pointer to the context is used because this method might be called when the context is already being destroyed and usage of a handle would be unsafe. More...
Public Member Functions inherited from OpenGl_Element
| OpenGl_Element ()
Standard_Boolean | RenderFiltered (const Handle< OpenGl_Workspace > &theWorkspace, const Handle< OpenGl_RenderFilter > &theFilter) const
| Render element if it passes the filtering procedure. This method should be used for elements which can be used in scope of rendering algorithms. E.g. elements of groups during recursive rendering. If render filter is null, pure rendering is performed. More...

## methods for compatibility with layers
Handle< OpenGl_Font > | myFont
| textures' IDs More...
NCollection_Vector< GLuint > | myTextures
| textures' IDs More...
NCollection_Vector< Handle < OpenGl_VertexBuffer > > | myVertsVbo
| VBOs of vertices. More...
NCollection_Vector< Handle < OpenGl_VertexBuffer > > | myTCrdsVbo
| VBOs of texture coordinates. More...
Font_FTFont::Rect | myBndBox
| textures' IDs More...
OpenGl_Mat4d | myProjMatrix
| textures' IDs More...
OpenGl_Mat4d | myModelMatrix
| textures' IDs More...
GLint | myViewport [4]
| textures' IDs More...
GLdouble | myWinX
| textures' IDs More...
GLdouble | myWinY
| textures' IDs More...
GLdouble | myWinZ
| textures' IDs More...
GLdouble | myScaleHeight
| textures' IDs More...
GLdouble | myExportHeight
| textures' IDs More...
OpenGl_TextParam | myParams
| textures' IDs More...
NCollection_String | myString
| textures' IDs More...
OpenGl_Vec3 | myPoint
| textures' IDs More...
bool | myIs2d
| textures' IDs More...
| OpenGl_Text ()
| Empty constructor. More...
void | Init (const Handle< OpenGl_Context > &theCtx, const TCollection_ExtendedString &theText, const OpenGl_Vec2 &thePoint, const OpenGl_TextParam &theParams)
| Setup new string and parameters. More...
void | Render (const Handle< OpenGl_PrinterContext > &thePrintCtx, const Handle< OpenGl_Context > &theCtx, const OpenGl_AspectText &theTextAspect) const
| Perform rendering. More...
static TCollection_AsciiString | FontKey (const OpenGl_AspectText &theAspect, const Standard_Integer theHeight)
| Create key for shared resource. More...
static Handle< OpenGl_Font > | FindFont (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. More...
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. More...
virtual | ~OpenGl_Text ()
| Destructor. More...

## Additional Inherited Members
Static Public Member Functions inherited from OpenGl_Element
template<typename theResource_t >
static void | Destroy (OpenGl_Context *theContext, theResource_t *&theElement)
| Pointer to the context is used because this method might be called when the context is already being destroyed and usage of a handle would be unsafe. More...
Protected Member Functions inherited from OpenGl_Element
virtual | ~OpenGl_Element ()

## Detailed Description

Text rendering.

## Constructor & Destructor Documentation

OpenGl_Text::OpenGl_Text | ( | const Standard_Utf8Char * | theText,
|  | const OpenGl_Vec3 & | thePoint,
|  | const OpenGl_TextParam & | theParams
| ) |  |

Main constructor.

OpenGl_Text::OpenGl_Text | ( |  | ) |

Empty constructor.

virtual OpenGl_Text::~OpenGl_Text | ( |  | ) |
| protectedvirtual

Destructor.

## 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

Find shared resource for specified font or initialize new one.

static TCollection_AsciiString OpenGl_Text::FontKey | ( | const OpenGl_AspectText & | theAspect,
|  | const Standard_Integer | theHeight
| ) |  |
| static

Create key for shared resource.

void OpenGl_Text::Init | ( | const Handle< OpenGl_Context > & | theCtx,
|  | const Standard_Utf8Char * | theText,
|  | const OpenGl_Vec3 & | thePoint
| ) |  |

Setup new string and position.

void OpenGl_Text::Init | ( | const Handle< OpenGl_Context > & | theCtx,
|  | const Standard_Utf8Char * | theText,
|  | const OpenGl_Vec3 & | thePoint,
|  | const OpenGl_TextParam & | theParams
| ) |  |

Setup new string and parameters.

void OpenGl_Text::Init | ( | const Handle< OpenGl_Context > & | theCtx,
|  | const TCollection_ExtendedString & | theText,
|  | const OpenGl_Vec2 & | thePoint,
|  | const OpenGl_TextParam & | theParams
| ) |  |

Setup new string and parameters.

virtual void OpenGl_Text::Release | ( | OpenGl_Context * | theContext | ) |
| virtual

Release GPU resources. Pointer to the context is used because this method might be called when the context is already being destroyed and usage of a handle would be unsafe.

Implements OpenGl_Element.

virtual void OpenGl_Text::Render | ( | const Handle< OpenGl_Workspace > & | theWorkspace | ) | const
| virtual

Implements OpenGl_Element.

void OpenGl_Text::Render | ( | const Handle< OpenGl_PrinterContext > & | thePrintCtx,
|  | const Handle< OpenGl_Context > & | theCtx,
|  | const OpenGl_AspectText & | theTextAspect
| ) |  | const

Perform rendering.

void OpenGl_Text::SetFontSize | ( | const Handle< OpenGl_Context > & | theContext,
|  | const Standard_Integer | theFontSize
| ) |  |

Setup new font size.

void OpenGl_Text::SetPosition | ( | const OpenGl_Vec3 & | thePoint | ) |

Setup new position.

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

Compute text width.

## Field Documentation

Font_FTFont::Rect OpenGl_Text::myBndBox
| mutableprotected

textures' IDs

GLdouble OpenGl_Text::myExportHeight
| mutableprotected

textures' IDs

Handle< OpenGl_Font > OpenGl_Text::myFont
| mutableprotected

textures' IDs

bool OpenGl_Text::myIs2d
| protected

textures' IDs

OpenGl_Mat4d OpenGl_Text::myModelMatrix
| mutableprotected

textures' IDs

OpenGl_TextParam OpenGl_Text::myParams
| protected

textures' IDs

OpenGl_Vec3 OpenGl_Text::myPoint
| protected

textures' IDs

OpenGl_Mat4d OpenGl_Text::myProjMatrix
| mutableprotected

textures' IDs

GLdouble OpenGl_Text::myScaleHeight
| mutableprotected

textures' IDs

NCollection_String OpenGl_Text::myString
| protected

textures' IDs

NCollection_Vector<Handle< OpenGl_VertexBuffer > > OpenGl_Text::myTCrdsVbo
| mutableprotected

VBOs of texture coordinates.

NCollection_Vector<GLuint> OpenGl_Text::myTextures
| mutableprotected

textures' IDs

NCollection_Vector<Handle< OpenGl_VertexBuffer > > OpenGl_Text::myVertsVbo
| mutableprotected

VBOs of vertices.

GLint OpenGl_Text::myViewport[4]
| mutableprotected

textures' IDs

GLdouble OpenGl_Text::myWinX
| mutableprotected

textures' IDs

GLdouble OpenGl_Text::myWinY
| mutableprotected

textures' IDs

GLdouble OpenGl_Text::myWinZ
| mutableprotected

textures' IDs

The documentation for this class was generated from the following file:

- OpenGl_Text.hxx