![]() |
Open CASCADE Technology Reference Manual 8.0.1
|
Text rendering. More...
#include <OpenGl_Text.hxx>

Public Member Functions | |
| OpenGl_Text (const occ::handle< Graphic3d_Text > &theTextParams) | |
| Creates new text in 3D space. | |
| ~OpenGl_Text () override | |
| Destructor. | |
| void | Reset (const occ::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. | |
| const occ::handle< Graphic3d_Text > & | Text () const |
| Returns text parameters. | |
| void | SetText (const occ::handle< Graphic3d_Text > &theText) |
| Sets text parameters. | |
| bool | Is2D () const |
| Return true if text is 2D. | |
| void | Set2D (const bool theEnable) |
| Set true if text is 2D. | |
| void | SetFontSize (const occ::handle< OpenGl_Context > &theContext, const int theFontSize) |
| Setup new font size. | |
| void | Render (const occ::handle< OpenGl_Workspace > &theWorkspace) const override |
| 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. | |
| size_t | EstimatedDataSize () const override |
| Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules. | |
| void | UpdateDrawStats (Graphic3d_FrameStatsDataTmp &theStats, bool theIsDetailed) const override |
| Increment draw calls statistics. | |
| Public Member Functions inherited from OpenGl_Element | |
| OpenGl_Element () | |
| virtual bool | IsFillDrawMode () const |
| Return TRUE if primitive type generates shaded triangulation (to be used in filters). | |
| virtual void | UpdateMemStats (Graphic3d_FrameStatsDataTmp &theStats) const |
| Increment memory usage statistics. Default implementation puts EstimatedDataSize() into Graphic3d_FrameStatsCounter_EstimatedBytesGeom. | |
| virtual void | SynchronizeAspects () |
| Update parameters of the drawable elements. | |
obsolete methods | |
| occ::handle< Graphic3d_Text > | myText |
| text parameters | |
| occ::handle< OpenGl_Font > | myFont |
| text parameters | |
| NCollection_DynamicArray< GLuint > | myTextures |
| textures' IDs | |
| NCollection_DynamicArray< occ::handle< OpenGl_VertexBuffer > > | myVertsVbo |
| VBOs of vertices. | |
| NCollection_DynamicArray< occ::handle< OpenGl_VertexBuffer > > | myTCrdsVbo |
| VBOs of texture coordinates. | |
| occ::handle< OpenGl_VertexBuffer > | myBndVertsVbo |
| VBOs of vertices for bounding box. | |
| Font_Rect | myBndBox |
| text parameters | |
| NCollection_Mat4< double > | myProjMatrix |
| text parameters | |
| NCollection_Mat4< double > | myModelMatrix |
| text parameters | |
| NCollection_Mat4< double > | myOrientationMatrix |
| text parameters | |
| NCollection_Vec3< double > | myWinXYZ |
| text parameters | |
| GLdouble | myScaleHeight |
| text parameters | |
| bool | myIs2d |
| text parameters | |
| Deprecated method | Init () with obsolete arguments |
| Setup new string and position. | |
| Deprecated method use Init() and Text() instead of it") 1 void Init( const occ void | SetPosition (const NCollection_Vec3< float > &thePoint) |
| Setup new position. | |
| void | releaseVbos (OpenGl_Context *theCtx) |
| Release cached VBO resources. | |
methods for compatibility with layers | |
Empty constructor | |
| OpenGl_Text () | |
| Perform rendering. | |
| void | Render (const occ::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 | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override |
| Dumps the content of me into the stream. | |
| static TCollection_AsciiString | FontKey (const OpenGl_Aspects &theAspect, int theHeight, unsigned int theResolution, Font_Hinting theFontHinting) |
| Create key for shared resource. | |
| static occ::handle< OpenGl_Font > | FindFont (const occ::handle< OpenGl_Context > &theCtx, const OpenGl_Aspects &theAspect, int theHeight, unsigned int theResolution, Font_Hinting theFontHinting, const TCollection_AsciiString &theKey) |
| Find shared resource for specified font or initialize new one. | |
| static void | StringSize (const occ::handle< OpenGl_Context > &theCtx, const NCollection_String &theText, const OpenGl_Aspects &theTextAspect, const float theHeight, const unsigned int theResolution, const Font_Hinting theFontHinting, float &theWidth, float &theAscent, float &theDescent) |
| Compute text width. | |
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. | |
| Protected Member Functions inherited from OpenGl_Element | |
| virtual | ~OpenGl_Element () |
Text rendering.
| OpenGl_Text::OpenGl_Text | ( | const occ::handle< Graphic3d_Text > & | theTextParams | ) |
Creates new text in 3D space.
|
override |
Destructor.
| OpenGl_Text::OpenGl_Text | ( | ) |
Perform rendering.
|
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.
| Deprecated method OpenGl_Text::Init | ( | ) |
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.
| void OpenGl_Text::Render | ( | const occ::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.
|
overridevirtual |
Implements OpenGl_Element.
| void OpenGl_Text::Reset | ( | const occ::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 occ::handle< OpenGl_Context > & | theContext, |
| const int | theFontSize ) |
Setup new font size.
| Deprecated method use Init() and Text() instead of it") 1 void Init( const occ void OpenGl_Text::SetPosition | ( | const NCollection_Vec3< float > & | 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