Open CASCADE Technology 7.8.2.dev
|
Class for rendering of arbitrary primitive array. More...
#include <OpenGl_PrimitiveArray.hxx>
Public Types | |
enum | { DRAW_MODE_NONE = -1 } |
OpenGL does not provide a constant for "none" draw mode. So we define our own one that does not conflict with GL constants and utilizes common GL invalid value. More... | |
Public Member Functions | |
OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver) | |
Empty constructor. | |
OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver, const Graphic3d_TypeOfPrimitiveArray theType, const Handle< Graphic3d_IndexBuffer > &theIndices, const Handle< Graphic3d_Buffer > &theAttribs, const Handle< Graphic3d_BoundBuffer > &theBounds) | |
Default constructor. | |
virtual | ~OpenGl_PrimitiveArray () |
Destructor. | |
virtual void | Render (const Handle< OpenGl_Workspace > &theWorkspace) const override |
Render primitives to the window. | |
virtual void | Release (OpenGl_Context *theContext) override |
Release OpenGL resources (VBOs) | |
virtual Standard_Size | EstimatedDataSize () const override |
Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules. | |
virtual void | UpdateDrawStats (Graphic3d_FrameStatsDataTmp &theStats, bool theIsDetailed) const override |
Increment draw calls statistics. | |
Standard_Boolean | IsInitialized () const |
Return true if VBOs initialization has been performed. VBO initialization is performed during first Render() call. Notice that this flag does not indicate VBOs validity. | |
void | Invalidate () const |
Invalidate VBO content without destruction. | |
Standard_Integer | DrawMode () const |
virtual Standard_Boolean | IsFillDrawMode () const override |
Return TRUE if primitive type generates shaded triangulation. | |
const Handle< Graphic3d_IndexBuffer > & | Indices () const |
const Handle< Graphic3d_Buffer > & | Attributes () const |
const Handle< Graphic3d_BoundBuffer > & | Bounds () const |
Standard_Size | GetUID () const |
Returns unique ID of primitive array. | |
void | InitBuffers (const Handle< OpenGl_Context > &theContext, const Graphic3d_TypeOfPrimitiveArray theType, const Handle< Graphic3d_IndexBuffer > &theIndices, const Handle< Graphic3d_Buffer > &theAttribs, const Handle< Graphic3d_BoundBuffer > &theBounds) |
Initialize indices, attributes and bounds with new data. | |
const Handle< OpenGl_IndexBuffer > & | IndexVbo () const |
Returns index VBO. | |
const Handle< OpenGl_VertexBuffer > & | AttributesVbo () const |
Returns attributes VBO. | |
virtual void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override |
Dumps the content of me into the stream. | |
Public Member Functions inherited from OpenGl_Element | |
OpenGl_Element () | |
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. | |
Protected Member Functions | |
Standard_Boolean | buildVBO (const Handle< OpenGl_Context > &theCtx, const Standard_Boolean theToKeepData) const |
VBO initialization procedures. | |
void | updateVBO (const Handle< OpenGl_Context > &theCtx) const |
Patch VBO sub-date within invalidated range. | |
void | clearMemoryGL (const Handle< OpenGl_Context > &theGlCtx) const |
Release GL memory. | |
Protected Member Functions inherited from OpenGl_Element | |
virtual | ~OpenGl_Element () |
Protected Attributes | |
Handle< OpenGl_IndexBuffer > | myVboIndices |
Handle< OpenGl_VertexBuffer > | myVboAttribs |
Handle< Graphic3d_IndexBuffer > | myIndices |
Handle< Graphic3d_Buffer > | myAttribs |
Handle< Graphic3d_BoundBuffer > | myBounds |
short | myDrawMode |
Standard_Boolean | myIsFillType |
Standard_Boolean | myIsVboInit |
Standard_Size | myUID |
Unique ID of primitive array. | |
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. | |
Class for rendering of arbitrary primitive array.
anonymous enum |
OpenGl_PrimitiveArray::OpenGl_PrimitiveArray | ( | const OpenGl_GraphicDriver * | theDriver | ) |
Empty constructor.
OpenGl_PrimitiveArray::OpenGl_PrimitiveArray | ( | const OpenGl_GraphicDriver * | theDriver, |
const Graphic3d_TypeOfPrimitiveArray | theType, | ||
const Handle< Graphic3d_IndexBuffer > & | theIndices, | ||
const Handle< Graphic3d_Buffer > & | theAttribs, | ||
const Handle< Graphic3d_BoundBuffer > & | theBounds ) |
Default constructor.
|
virtual |
Destructor.
|
inline |
|
inline |
Returns attributes VBO.
|
inline |
|
protected |
VBO initialization procedures.
theCtx | bound GL context |
theToKeepData | when true, myAttribs will not be nullified after VBO creation |
|
protected |
Release GL memory.
|
inline |
|
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.
|
inline |
Returns unique ID of primitive array.
|
inline |
Returns index VBO.
|
inline |
void OpenGl_PrimitiveArray::InitBuffers | ( | const Handle< OpenGl_Context > & | theContext, |
const Graphic3d_TypeOfPrimitiveArray | theType, | ||
const Handle< Graphic3d_IndexBuffer > & | theIndices, | ||
const Handle< Graphic3d_Buffer > & | theAttribs, | ||
const Handle< Graphic3d_BoundBuffer > & | theBounds ) |
Initialize indices, attributes and bounds with new data.
|
inline |
Invalidate VBO content without destruction.
|
inlineoverridevirtual |
Return TRUE if primitive type generates shaded triangulation.
Reimplemented from OpenGl_Element.
|
inline |
Return true if VBOs initialization has been performed. VBO initialization is performed during first Render() call. Notice that this flag does not indicate VBOs validity.
|
overridevirtual |
Release OpenGL resources (VBOs)
Implements OpenGl_Element.
|
overridevirtual |
Render primitives to the window.
Implements OpenGl_Element.
Reimplemented in OpenGl_BackgroundArray.
|
overridevirtual |
Increment draw calls statistics.
Reimplemented from OpenGl_Element.
|
protected |
Patch VBO sub-date within invalidated range.
|
mutableprotected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
protected |
Unique ID of primitive array.
|
mutableprotected |
|
mutableprotected |