![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Tool class for generating reusable data for gradient or texture background rendering. More...
#include <OpenGl_BackgroundArray.hxx>

Data Structures | |
| struct | OpenGl_GradientParameters |
Public Member Functions | |
| OpenGl_BackgroundArray (const Graphic3d_TypeOfBackground theType) | |
| Main constructor. | |
| void | Render (const occ::handle< OpenGl_Workspace > &theWorkspace, Graphic3d_Camera::Projection theProjection) const |
| Render primitives to the window. | |
| bool | IsDefined () const |
| Check if background parameters are set properly. | |
| void | SetTextureParameters (const Aspect_FillMethod theFillMethod) |
| Sets background texture parameters. | |
| void | SetTextureFillMethod (const Aspect_FillMethod theFillMethod) |
| Sets texture fill method. | |
| Aspect_FillMethod | TextureFillMethod () const |
| Gets background texture fill method. | |
| Aspect_GradientFillMethod | GradientFillMethod () const |
| Gets background gradient fill method. | |
| const NCollection_Vec4< float > & | GradientColor (const int theIndex) const |
| Returns color of gradient background for the given index. | |
| void | SetGradientFillMethod (const Aspect_GradientFillMethod theType) |
| Sets type of gradient fill method. | |
| void | SetGradientParameters (const Quantity_Color &theColor1, const Quantity_Color &theColor2, const Aspect_GradientFillMethod theType) |
| Sets background gradient parameters. | |
Public Member Functions inherited from OpenGl_PrimitiveArray | |
| OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver) | |
| Empty constructor. | |
| OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver, const Graphic3d_TypeOfPrimitiveArray theType, const occ::handle< Graphic3d_IndexBuffer > &theIndices, const occ::handle< Graphic3d_Buffer > &theAttribs, const occ::handle< Graphic3d_BoundBuffer > &theBounds) | |
| Default constructor. | |
| ~OpenGl_PrimitiveArray () override | |
| Destructor. | |
| void | Render (const occ::handle< OpenGl_Workspace > &theWorkspace) const override |
| Render primitives to the window. | |
| void | Release (OpenGl_Context *theContext) override |
| Release OpenGL resources (VBOs) | |
| 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. | |
| bool | 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. | |
| int | DrawMode () const |
| bool | IsFillDrawMode () const override |
| Return TRUE if primitive type generates shaded triangulation. | |
| const occ::handle< Graphic3d_IndexBuffer > & | Indices () const |
| const occ::handle< Graphic3d_Buffer > & | Attributes () const |
| const occ::handle< Graphic3d_BoundBuffer > & | Bounds () const |
| size_t | GetUID () const |
| Returns unique ID of primitive array. | |
| void | InitBuffers (const occ::handle< OpenGl_Context > &theContext, const Graphic3d_TypeOfPrimitiveArray theType, const occ::handle< Graphic3d_IndexBuffer > &theIndices, const occ::handle< Graphic3d_Buffer > &theAttribs, const occ::handle< Graphic3d_BoundBuffer > &theBounds) |
| Initialize indices, attributes and bounds with new data. | |
| const occ::handle< OpenGl_IndexBuffer > & | IndexVbo () const |
| Returns index VBO. | |
| const occ::handle< OpenGl_VertexBuffer > & | AttributesVbo () const |
| Returns attributes VBO. | |
| void | DumpJson (Standard_OStream &theOStream, int 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. | |
Internal structure for storing gradient parameters | |
| Graphic3d_TypeOfBackground | myType |
| Type of background: texture or gradient. | |
| Aspect_FillMethod | myFillMethod |
| Texture parameters. | |
| OpenGl_GradientParameters | myGradientParams |
| Gradient parameters. | |
| int | myViewWidth |
| view width used for array initialization | |
| int | myViewHeight |
| view height used for array initialization | |
| bool | myToUpdate |
| Shows if array parameters were changed and data (myAttribs storage) is to be updated. | |
| bool | init (const occ::handle< OpenGl_Workspace > &theWorkspace) const |
| Fill attributes arrays for background array according to its type: | |
| bool | createGradientArray (const occ::handle< OpenGl_Context > &theCtx) const |
| Initializes gradient arrays. | |
| bool | createTextureArray (const occ::handle< OpenGl_Workspace > &theWorkspace) const |
| Initializes texture arrays. | |
| bool | createCubeMapArray () const |
| Initializes cubemap arrays. | |
| void | invalidateData () |
| Marks array parameters as changed, on next rendering stage array data is to be updated. | |
| void | Render (const occ::handle< OpenGl_Workspace > &theWorkspace) const override |
| Render primitives to the window. | |
Additional Inherited Members | |
Public Types inherited from OpenGl_PrimitiveArray | |
| 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... | |
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_PrimitiveArray | |
| bool | buildVBO (const occ::handle< OpenGl_Context > &theCtx, const bool theToKeepData) const |
| VBO initialization procedures. | |
| void | updateVBO (const occ::handle< OpenGl_Context > &theCtx) const |
| Patch VBO sub-date within invalidated range. | |
| void | clearMemoryGL (const occ::handle< OpenGl_Context > &theGlCtx) const |
| Release GL memory. | |
Protected Member Functions inherited from OpenGl_Element | |
| virtual | ~OpenGl_Element () |
Protected Attributes inherited from OpenGl_PrimitiveArray | |
| occ::handle< OpenGl_IndexBuffer > | myVboIndices |
| occ::handle< OpenGl_VertexBuffer > | myVboAttribs |
| occ::handle< Graphic3d_IndexBuffer > | myIndices |
| occ::handle< Graphic3d_Buffer > | myAttribs |
| occ::handle< Graphic3d_BoundBuffer > | myBounds |
| short | myDrawMode |
| bool | myIsFillType |
| bool | myIsVboInit |
| size_t | myUID |
| Unique ID of primitive array. | |
Tool class for generating reusable data for gradient or texture background rendering.
| OpenGl_BackgroundArray::OpenGl_BackgroundArray | ( | const Graphic3d_TypeOfBackground | theType | ) |
Main constructor.
|
protected |
Initializes cubemap arrays.
|
protected |
Initializes gradient arrays.
|
protected |
Initializes texture arrays.
| theWorkspace | OpenGl workspace that stores texture in the current enabled face aspect. |
|
inline |
Returns color of gradient background for the given index.
|
inline |
Gets background gradient fill method.
|
protected |
Fill attributes arrays for background array according to its type:
|
protected |
Marks array parameters as changed, on next rendering stage array data is to be updated.
| bool OpenGl_BackgroundArray::IsDefined | ( | ) | const |
Check if background parameters are set properly.
|
overrideprotectedvirtual |
Render primitives to the window.
Implements OpenGl_Element.
| void OpenGl_BackgroundArray::Render | ( | const occ::handle< OpenGl_Workspace > & | theWorkspace, |
| Graphic3d_Camera::Projection | theProjection ) const |
Render primitives to the window.
| void OpenGl_BackgroundArray::SetGradientFillMethod | ( | const Aspect_GradientFillMethod | theType | ) |
Sets type of gradient fill method.
| void OpenGl_BackgroundArray::SetGradientParameters | ( | const Quantity_Color & | theColor1, |
| const Quantity_Color & | theColor2, | ||
| const Aspect_GradientFillMethod | theType ) |
Sets background gradient parameters.
| void OpenGl_BackgroundArray::SetTextureFillMethod | ( | const Aspect_FillMethod | theFillMethod | ) |
Sets texture fill method.
| void OpenGl_BackgroundArray::SetTextureParameters | ( | const Aspect_FillMethod | theFillMethod | ) |
Sets background texture parameters.
|
inline |
Gets background texture fill method.
|
protected |
Texture parameters.
|
mutableprotected |
Gradient parameters.
|
mutableprotected |
Shows if array parameters were changed and data (myAttribs storage) is to be updated.
|
protected |
Type of background: texture or gradient.
|
mutableprotected |
view height used for array initialization
|
mutableprotected |
view width used for array initialization