Open CASCADE Technology  6.9.0
Data Structures | Public Member Functions

OpenGl_BackgroundArray Class Reference

Tool class for generating reusable data for gradient or texture background rendering. More...

#include <OpenGl_BackgroundArray.hxx>

Inheritance diagram for OpenGl_BackgroundArray:
Inheritance graph
[legend]

Data Structures

struct  OpenGl_GradientParameters
 

Public Member Functions

 OpenGl_BackgroundArray (const Graphic3d_TypeOfBackground theType)
 Main constructor. More...
 
bool IsDefined () const
 Check if background parameters are set properly. More...
 
Standard_Boolean Init (const Handle< OpenGl_Workspace > &theWorkspace)
 Fill attributes arrays for background array according to its type: More...
 
void SetTextureParameters (const Aspect_FillMethod theFillMethod)
 Sets background texture parameters. More...
 
void SetTextureFillMethod (const Aspect_FillMethod theFillMethod)
 Sets texture fill method. More...
 
Aspect_FillMethod TextureFillMethod () const
 Gets background texture fill method. More...
 
Aspect_GradientFillMethod GradientFillMethod () const
 Gets background gradient fill method. More...
 
void SetGradientFillMethod (const Aspect_GradientFillMethod theType)
 Sets type of gradient fill method. More...
 
void SetGradientParameters (const Quantity_Color &theColor1, const Quantity_Color &theColor2, const Aspect_GradientFillMethod theType)
 Sets background gradient parameters. More...
 
Standard_Boolean IsDataChanged () const
 Shows if array parameters were changed. More...
 
Standard_Boolean IsViewSizeChanged (const Handle< OpenGl_Workspace > &theWorkspace) const
 Shows if view sizes were changed (texture coordinates is no be changed) More...
 
- Public Member Functions inherited from OpenGl_PrimitiveArray
 OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver)
 Empty constructor. More...
 
 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. More...
 
virtual ~OpenGl_PrimitiveArray ()
 Destructor. More...
 
virtual void Render (const Handle< OpenGl_Workspace > &theWorkspace) const
 Render primitives to the window. More...
 
virtual void Release (OpenGl_Context *theContext)
 Release OpenGL resources (VBOs) More...
 
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. More...
 
void Invalidate () const
 Invalidate VBO content without destruction. More...
 
GLint DrawMode () const
 
const Handle
< Graphic3d_IndexBuffer > & 
Indices () const
 
const Handle< Graphic3d_Buffer > & Attributes () const
 
const Handle
< Graphic3d_BoundBuffer > & 
Bounds () const
 
const Standard_Size GetUID () const
 Returns unique ID of primitive array. More...
 
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. More...
 
- Public Member Functions inherited from OpenGl_Element
 OpenGl_Element ()
 
Standard_Boolean RenderFiltered (const Handle< OpenGl_Workspace > &theWorkspace, const Handle< OpenGl_RenderFilter > &theFilter) const
 Render element if it passes the filtering procedure. This method should be used for elements which can be used in scope of rendering algorithms. E.g. elements of groups during recursive rendering. If render filter is null, pure rendering is performed. More...
 

Internal structure for storing gradient parameters

Standard_Boolean myToUpdate
 Shows if array parameters were changed and data (myAttribs storage) is to be updated. More...
 
Graphic3d_TypeOfBackground myType
 Type of background: texture or gradient. More...
 
Standard_Integer myViewWidth
 view width used for array initialization More...
 
Standard_Integer myViewHeight
 view height used for array initialization More...
 
Aspect_FillMethod myFillMethod
 Texture parameters. More...
 
OpenGl_GradientParameters myGradientParams
 Gradient parameters. More...
 
Standard_Boolean createGradientArray ()
 Initializes gradient arrays. More...
 
Standard_Boolean createTextureArray (const Handle< OpenGl_Workspace > &theWorkspace)
 Initializes texture arrays. More...
 
void invalidateData ()
 Marks array parameters as changed, on next rendering stage array data is to be updated. More...
 

Additional Inherited Members

- Public Types inherited from OpenGl_PrimitiveArray
enum  { DRAW_MODE_NONE = -1 }
 
- 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_PrimitiveArray
Standard_Boolean buildVBO (const Handle< OpenGl_Context > &theCtx, const Standard_Boolean theToKeepData) const
 VBO initialization procedures. More...
 
void clearMemoryGL (const Handle< OpenGl_Context > &theGlCtx) const
 
- Protected Member Functions inherited from OpenGl_Element
virtual ~OpenGl_Element ()
 
- Protected Attributes inherited from OpenGl_PrimitiveArray
Handle< OpenGl_VertexBuffermyVboIndices
 
Handle< OpenGl_VertexBuffermyVboAttribs
 
Handle< Graphic3d_IndexBuffermyIndices
 
Handle< Graphic3d_BuffermyAttribs
 
Handle< Graphic3d_BoundBuffermyBounds
 
GLint myDrawMode
 
Standard_Boolean myIsVboInit
 
Standard_Size myUID
 Unique ID of primitive array. More...
 

Detailed Description

Tool class for generating reusable data for gradient or texture background rendering.

Constructor & Destructor Documentation

OpenGl_BackgroundArray::OpenGl_BackgroundArray ( const Graphic3d_TypeOfBackground  theType)

Main constructor.

Member Function Documentation

Standard_Boolean OpenGl_BackgroundArray::createGradientArray ( )
protected

Initializes gradient arrays.

Standard_Boolean OpenGl_BackgroundArray::createTextureArray ( const Handle< OpenGl_Workspace > &  theWorkspace)
protected

Initializes texture arrays.

Parameters
theWorkspaceOpenGl workspace that stores texture in the current enabled face aspect.
Aspect_GradientFillMethod OpenGl_BackgroundArray::GradientFillMethod ( ) const
inline

Gets background gradient fill method.

Standard_Boolean OpenGl_BackgroundArray::Init ( const Handle< OpenGl_Workspace > &  theWorkspace)

Fill attributes arrays for background array according to its type:

  • for gradient background its attributes consist of colors and gradient coordinates
  • for texture one its attributes consist of position and texure coordinates.
void OpenGl_BackgroundArray::invalidateData ( )
protected

Marks array parameters as changed, on next rendering stage array data is to be updated.

Standard_Boolean OpenGl_BackgroundArray::IsDataChanged ( ) const
inline

Shows if array parameters were changed.

bool OpenGl_BackgroundArray::IsDefined ( ) const

Check if background parameters are set properly.

Standard_Boolean OpenGl_BackgroundArray::IsViewSizeChanged ( const Handle< OpenGl_Workspace > &  theWorkspace) const
inline

Shows if view sizes were changed (texture coordinates is no be changed)

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.

Aspect_FillMethod OpenGl_BackgroundArray::TextureFillMethod ( ) const
inline

Gets background texture fill method.

Field Documentation

Aspect_FillMethod OpenGl_BackgroundArray::myFillMethod
protected

Texture parameters.

OpenGl_GradientParameters OpenGl_BackgroundArray::myGradientParams
protected

Gradient parameters.

Standard_Boolean OpenGl_BackgroundArray::myToUpdate
protected

Shows if array parameters were changed and data (myAttribs storage) is to be updated.

Graphic3d_TypeOfBackground OpenGl_BackgroundArray::myType
protected

Type of background: texture or gradient.

Standard_Integer OpenGl_BackgroundArray::myViewHeight
protected

view height used for array initialization

Standard_Integer OpenGl_BackgroundArray::myViewWidth
protected

view width used for array initialization


The documentation for this class was generated from the following file: