Open CASCADE Technology 7.8.0
|
Tool class for generating reusable data for gradient or texture background rendering. More...
#include <OpenGl_BackgroundArray.hxx>
Data Structures | |
struct | OpenGl_GradientParameters |
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. | |
Standard_Integer | myViewWidth |
view width used for array initialization | |
Standard_Integer | myViewHeight |
view height used for array initialization | |
Standard_Boolean | myToUpdate |
Shows if array parameters were changed and data (myAttribs storage) is to be updated. | |
Standard_Boolean | init (const Handle< OpenGl_Workspace > &theWorkspace) const |
Fill attributes arrays for background array according to its type: | |
Standard_Boolean | createGradientArray (const Handle< OpenGl_Context > &theCtx) const |
Initializes gradient arrays. | |
Standard_Boolean | createTextureArray (const Handle< OpenGl_Workspace > &theWorkspace) const |
Initializes texture arrays. | |
Standard_Boolean | createCubeMapArray () const |
Initializes cubemap arrays. | |
void | invalidateData () |
Marks array parameters as changed, on next rendering stage array data is to be updated. | |
virtual void | Render (const Handle< OpenGl_Workspace > &theWorkspace) const override |
Render primitives to the window. | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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. | |
![]() | |
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. | |
![]() | |
virtual | ~OpenGl_Element () |
![]() | |
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. | |
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.
Reimplemented from OpenGl_PrimitiveArray.
void OpenGl_BackgroundArray::Render | ( | const 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