|
Open CASCADE Technology
7.7.2
|
Text rendering. More...
#include <OpenGl_Text.hxx>

Public Member Functions | |
| OpenGl_Text (const Handle< Graphic3d_Text > &theTextParams) | |
| Creates new text in 3D space. More... | |
| virtual | ~OpenGl_Text () |
| Destructor. More... | |
| void | Reset (const Handle< OpenGl_Context > &theCtx) |
| Release cached VBO resources and the previous font if height changed. Cached structures will be refilled by the next render. Call Reset after modifying text parameters. More... | |
| const Handle< Graphic3d_Text > & | Text () const |
| Returns text parameters. More... | |
| void | SetText (const Handle< Graphic3d_Text > &theText) |
| Sets text parameters. More... | |
| Standard_Boolean | Is2D () const |
| Return true if text is 2D. More... | |
| void | Set2D (const Standard_Boolean theEnable) |
| Set true if text is 2D. 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 override |
| virtual void | Release (OpenGl_Context *theContext) override |
| 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... | |
| virtual Standard_Size | EstimatedDataSize () const override |
| Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules. More... | |
| virtual void | UpdateDrawStats (Graphic3d_FrameStatsDataTmp &theStats, bool theIsDetailed) const override |
| Increment draw calls statistics. More... | |
Public Member Functions inherited from OpenGl_Element | |
| OpenGl_Element () | |
| virtual Standard_Boolean | IsFillDrawMode () const |
| Return TRUE if primitive type generates shaded triangulation (to be used in filters). More... | |
| virtual void | UpdateMemStats (Graphic3d_FrameStatsDataTmp &theStats) const |
| Increment memory usage statistics. Default implementation puts EstimatedDataSize() into Graphic3d_FrameStatsCounter_EstimatedBytesGeom. More... | |
| virtual void | SynchronizeAspects () |
| Update parameters of the drawable elements. More... | |
methods for compatibility with layers | |
| OpenGl_Text () | |
| Empty constructor. More... | |
| void | Render (const Handle< OpenGl_Context > &theCtx, const OpenGl_Aspects &theTextAspect, unsigned int theResolution=Graphic3d_RenderingParams::THE_DEFAULT_RESOLUTION, Font_Hinting theFontHinting=Font_Hinting_Off) const |
| Perform rendering. More... | |
| virtual void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override |
| Dumps the content of me into the stream. More... | |
| static TCollection_AsciiString | FontKey (const OpenGl_Aspects &theAspect, Standard_Integer theHeight, unsigned int theResolution, Font_Hinting theFontHinting) |
| Create key for shared resource. More... | |
| static Handle< OpenGl_Font > | FindFont (const Handle< OpenGl_Context > &theCtx, const OpenGl_Aspects &theAspect, Standard_Integer theHeight, unsigned int theResolution, Font_Hinting theFontHinting, 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_Aspects &theTextAspect, const Standard_ShortReal theHeight, const unsigned int theResolution, const Font_Hinting theFontHinting, Standard_ShortReal &theWidth, Standard_ShortReal &theAscent, Standard_ShortReal &theDescent) |
| Compute text width. 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 () |
Text rendering.
| OpenGl_Text::OpenGl_Text | ( | const Handle< Graphic3d_Text > & | theTextParams | ) |
Creates new text in 3D space.
|
virtual |
Destructor.
| OpenGl_Text::OpenGl_Text | ( | ) |
Empty constructor.
|
overridevirtual |
Dumps the content of me into the stream.
Reimplemented from OpenGl_Element.
|
overridevirtual |
Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules.
Reimplemented from OpenGl_Element.
|
static |
Find shared resource for specified font or initialize new one.
|
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.
|
inline |
Return true if text is 2D.
|
overridevirtual |
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.
|
protected |
Release cached VBO resources.
|
overridevirtual |
Implements OpenGl_Element.
| void OpenGl_Text::Render | ( | const Handle< OpenGl_Context > & | theCtx, |
| const OpenGl_Aspects & | theTextAspect, | ||
| unsigned int | theResolution = Graphic3d_RenderingParams::THE_DEFAULT_RESOLUTION, |
||
| Font_Hinting | theFontHinting = Font_Hinting_Off |
||
| ) | const |
Perform rendering.
| void OpenGl_Text::Reset | ( | const Handle< OpenGl_Context > & | theCtx | ) |
Release cached VBO resources and the previous font if height changed. Cached structures will be refilled by the next render. Call Reset after modifying text parameters.
|
inline |
Set true if text is 2D.
| 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.
|
inline |
Sets text parameters.
|
static |
Compute text width.
|
inline |
Returns text parameters.
|
overridevirtual |
Increment draw calls statistics.
Reimplemented from OpenGl_Element.
|
mutableprotected |
text parameters
|
mutableprotected |
VBOs of vertices for bounding box.
|
mutableprotected |
text parameters
|
protected |
text parameters
|
mutableprotected |
text parameters
|
mutableprotected |
text parameters
|
mutableprotected |
text parameters
|
mutableprotected |
text parameters
|
mutableprotected |
VBOs of texture coordinates.
|
protected |
text parameters
|
mutableprotected |
textures' IDs
|
mutableprotected |
VBOs of vertices.
|
mutableprotected |
text parameters
1.8.10