Open CASCADE Technology  7.3.0
Public Member Functions

OpenGl_Workspace Class Reference

Rendering workspace. Provides methods to render primitives and maintain GL state. More...

#include <OpenGl_Workspace.hxx>

Inheritance diagram for OpenGl_Workspace:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Workspace (OpenGl_View *theView, const Handle< OpenGl_Window > &theWindow)
 Constructor of rendering workspace. More...
 
virtual ~OpenGl_Workspace ()
 Destructor. More...
 
Standard_Boolean Activate ()
 Activate rendering context. More...
 
OpenGl_ViewView () const
 
const Handle< OpenGl_Context > & GetGlContext ()
 
Handle< OpenGl_FrameBufferFBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight)
 
void FBORelease (Handle< OpenGl_FrameBuffer > &theFbo)
 
Standard_Boolean BufferDump (const Handle< OpenGl_FrameBuffer > &theFbo, Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType)
 
Standard_Integer Width () const
 
Standard_Integer Height () const
 
Standard_Boolean SetUseZBuffer (const Standard_Boolean theToUse)
 Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag. More...
 
Standard_BooleanUseZBuffer ()
 
Standard_BooleanUseDepthWrite ()
 
Standard_Boolean IsCullingEnabled () const
 
bool ToAllowFaceCulling () const
 Return true if active group might activate face culling (e.g. primitives are closed). More...
 
void SetAllowFaceCulling (bool theToAllow)
 Allow or disallow face culling. This call does NOT affect current state of back face culling; ApplyAspectFace() should be called to update state. More...
 
bool ToHighlight () const
 Return true if following structures should apply highlight color. More...
 
const Handle< Graphic3d_PresentationAttributes > & HighlightStyle () const
 Return highlight style. More...
 
void SetHighlightStyle (const Handle< Graphic3d_PresentationAttributes > &theStyle)
 Set highlight style. More...
 
const OpenGl_Vec4LineColor () const
 Return line color taking into account highlight flag. More...
 
const OpenGl_Vec4EdgeColor () const
 Return edge color taking into account highlight flag. More...
 
const OpenGl_Vec4MarkerColor () const
 Return marker color taking into account highlight flag. More...
 
const OpenGl_Vec4InteriorColor () const
 Return Interior color taking into account highlight flag. More...
 
const OpenGl_Vec4TextColor () const
 Return text color taking into account highlight flag. More...
 
const OpenGl_Vec4TextSubtitleColor () const
 Return text Subtitle color taking into account highlight flag. More...
 
const OpenGl_AspectLineAspectLine () const
 Currently set line aspect (can differ from applied). More...
 
const OpenGl_AspectFaceAspectFace () const
 Currently set face aspect (can differ from applied). More...
 
const OpenGl_AspectMarkerAspectMarker () const
 Currently set marker aspect (can differ from applied). More...
 
const OpenGl_AspectTextAspectText () const
 Currently set text aspect (can differ from applied). More...
 
const OpenGl_AspectLineSetAspectLine (const OpenGl_AspectLine *theAspect)
 Assign new line aspect (will be applied within ApplyAspectLine()). More...
 
const OpenGl_AspectFaceSetAspectFace (const OpenGl_AspectFace *theAspect)
 Assign new face aspect (will be applied within ApplyAspectFace()). More...
 
const OpenGl_AspectMarkerSetAspectMarker (const OpenGl_AspectMarker *theAspect)
 Assign new marker aspect (will be applied within ApplyAspectMarker()). More...
 
const OpenGl_AspectTextSetAspectText (const OpenGl_AspectText *theAspect)
 Assign new text aspect (will be applied within ApplyAspectText()). More...
 
const OpenGl_AspectLineApplyAspectLine ()
 Apply line aspect. More...
 
const OpenGl_AspectFaceApplyAspectFace ()
 Apply face aspect. More...
 
const OpenGl_AspectMarkerApplyAspectMarker ()
 Apply marker aspect. More...
 
const OpenGl_AspectTextApplyAspectText ()
 Apply text aspect. More...
 
void ResetAppliedAspect ()
 Clear the applied aspect state to default values. More...
 
void SetRenderFilter (const Handle< OpenGl_RenderFilter > &theFilter)
 Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups. More...
 
const Handle< OpenGl_RenderFilter > & GetRenderFilter () const
 Get rendering filter. More...
 
const OpenGl_MatrixViewMatrix () const
 
const OpenGl_MatrixModelMatrix () const
 
const OpenGl_AspectFaceFontFaceAspect () const
 Returns face aspect for textured font rendering. More...
 
const Handle< OpenGl_CappingAlgoFilter > & DefaultCappingAlgoFilter () const
 Returns capping algorithm rendering filter. More...
 
const OpenGl_AspectFaceNoneCulling () const
 Returns face aspect for none culling mode. More...
 
const OpenGl_AspectFaceFrontCulling () const
 Returns face aspect for front face culling mode. More...
 
void SetEnvironmentTexture (const Handle< OpenGl_TextureSet > &theTexture)
 Sets a new environment texture. More...
 
const Handle< OpenGl_TextureSet > & EnvironmentTexture () const
 Returns environment texture. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Attributes

protected fields
OpenGl_ViewmyView
 
Handle< OpenGl_WindowmyWindow
 
Handle< OpenGl_ContextmyGlContext
 
Standard_Boolean myUseZBuffer
 
Standard_Boolean myUseDepthWrite
 
Handle< OpenGl_CappingAlgoFiltermyDefaultCappingAlgoFilter
 
OpenGl_AspectFace myNoneCulling
 
OpenGl_AspectFace myFrontCulling
 
OpenGl_AspectFace myFontFaceAspect
 
fields related to status
Handle< OpenGl_RenderFiltermyRenderFilter
 allow back face culling More...
 
const OpenGl_AspectLinemyAspectLineSet
 allow back face culling More...
 
const OpenGl_AspectFacemyAspectFaceSet
 allow back face culling More...
 
Handle< Graphic3d_AspectFillArea3dmyAspectFaceApplied
 allow back face culling More...
 
const OpenGl_AspectMarkermyAspectMarkerSet
 allow back face culling More...
 
Handle< Graphic3d_AspectMarker3dmyAspectMarkerApplied
 allow back face culling More...
 
const OpenGl_AspectTextmyAspectTextSet
 allow back face culling More...
 
Handle< Graphic3d_PresentationAttributesmyAspectFaceAppliedWithHL
 allow back face culling More...
 
const OpenGl_MatrixViewMatrix_applied
 allow back face culling More...
 
const OpenGl_MatrixStructureMatrix_applied
 allow back face culling More...
 
bool myToAllowFaceCulling
 allow back face culling More...
 
Handle< Graphic3d_PresentationAttributesmyHighlightStyle
 active highlight style More...
 
OpenGl_Matrix myModelViewMatrix
 Model matrix with applied structure transformations. More...
 
OpenGl_AspectFace myAspectFaceHl
 Hiddenline aspect. More...
 
Handle< OpenGl_TextureSetmyEnvironmentTexture
 allow back face culling More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Rendering workspace. Provides methods to render primitives and maintain GL state.

Constructor & Destructor Documentation

◆ OpenGl_Workspace()

OpenGl_Workspace::OpenGl_Workspace ( OpenGl_View theView,
const Handle< OpenGl_Window > &  theWindow 
)

Constructor of rendering workspace.

◆ ~OpenGl_Workspace()

virtual OpenGl_Workspace::~OpenGl_Workspace ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ Activate()

Standard_Boolean OpenGl_Workspace::Activate ( )

Activate rendering context.

◆ ApplyAspectFace()

const OpenGl_AspectFace* OpenGl_Workspace::ApplyAspectFace ( )

Apply face aspect.

Returns
aspect set by SetAspectFace()

◆ ApplyAspectLine()

const OpenGl_AspectLine* OpenGl_Workspace::ApplyAspectLine ( )
inline

Apply line aspect.

Returns
aspect set by SetAspectLine()

◆ ApplyAspectMarker()

const OpenGl_AspectMarker* OpenGl_Workspace::ApplyAspectMarker ( )

Apply marker aspect.

Returns
aspect set by SetAspectMarker()

◆ ApplyAspectText()

const OpenGl_AspectText* OpenGl_Workspace::ApplyAspectText ( )
inline

Apply text aspect.

Returns
aspect set by SetAspectText()

◆ AspectFace()

const OpenGl_AspectFace* OpenGl_Workspace::AspectFace ( ) const
inline

Currently set face aspect (can differ from applied).

◆ AspectLine()

const OpenGl_AspectLine* OpenGl_Workspace::AspectLine ( ) const
inline

Currently set line aspect (can differ from applied).

◆ AspectMarker()

const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker ( ) const
inline

Currently set marker aspect (can differ from applied).

◆ AspectText()

const OpenGl_AspectText* OpenGl_Workspace::AspectText ( ) const
inline

Currently set text aspect (can differ from applied).

◆ BufferDump()

Standard_Boolean OpenGl_Workspace::BufferDump ( const Handle< OpenGl_FrameBuffer > &  theFbo,
Image_PixMap theImage,
const Graphic3d_BufferType theBufferType 
)

◆ DefaultCappingAlgoFilter()

const Handle< OpenGl_CappingAlgoFilter >& OpenGl_Workspace::DefaultCappingAlgoFilter ( ) const
inline

Returns capping algorithm rendering filter.

◆ EdgeColor()

const OpenGl_Vec4& OpenGl_Workspace::EdgeColor ( ) const
inline

Return edge color taking into account highlight flag.

◆ EnvironmentTexture()

const Handle< OpenGl_TextureSet >& OpenGl_Workspace::EnvironmentTexture ( ) const
inline

Returns environment texture.

◆ FBOCreate()

Handle< OpenGl_FrameBuffer > OpenGl_Workspace::FBOCreate ( const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)

◆ FBORelease()

void OpenGl_Workspace::FBORelease ( Handle< OpenGl_FrameBuffer > &  theFbo)

◆ FontFaceAspect()

const OpenGl_AspectFace& OpenGl_Workspace::FontFaceAspect ( ) const
inline

Returns face aspect for textured font rendering.

◆ FrontCulling()

const OpenGl_AspectFace& OpenGl_Workspace::FrontCulling ( ) const
inline

Returns face aspect for front face culling mode.

◆ GetGlContext()

const Handle< OpenGl_Context >& OpenGl_Workspace::GetGlContext ( )
inline

◆ GetRenderFilter()

const Handle< OpenGl_RenderFilter >& OpenGl_Workspace::GetRenderFilter ( ) const
inline

Get rendering filter.

Returns
filter instance.

◆ Height()

Standard_Integer OpenGl_Workspace::Height ( ) const

◆ HighlightStyle()

const Handle< Graphic3d_PresentationAttributes >& OpenGl_Workspace::HighlightStyle ( ) const
inline

Return highlight style.

◆ InteriorColor()

const OpenGl_Vec4& OpenGl_Workspace::InteriorColor ( ) const
inline

Return Interior color taking into account highlight flag.

◆ IsCullingEnabled()

Standard_Boolean OpenGl_Workspace::IsCullingEnabled ( ) const
Returns
true if clipping algorithm enabled

◆ LineColor()

const OpenGl_Vec4& OpenGl_Workspace::LineColor ( ) const
inline

Return line color taking into account highlight flag.

◆ MarkerColor()

const OpenGl_Vec4& OpenGl_Workspace::MarkerColor ( ) const
inline

Return marker color taking into account highlight flag.

◆ ModelMatrix()

const OpenGl_Matrix* OpenGl_Workspace::ModelMatrix ( ) const
inline
Returns
applied model structure matrix.

◆ NoneCulling()

const OpenGl_AspectFace& OpenGl_Workspace::NoneCulling ( ) const
inline

Returns face aspect for none culling mode.

◆ ResetAppliedAspect()

void OpenGl_Workspace::ResetAppliedAspect ( )

Clear the applied aspect state to default values.

◆ SetAllowFaceCulling()

void OpenGl_Workspace::SetAllowFaceCulling ( bool  theToAllow)
inline

Allow or disallow face culling. This call does NOT affect current state of back face culling; ApplyAspectFace() should be called to update state.

◆ SetAspectFace()

const OpenGl_AspectFace* OpenGl_Workspace::SetAspectFace ( const OpenGl_AspectFace theAspect)

Assign new face aspect (will be applied within ApplyAspectFace()).

◆ SetAspectLine()

const OpenGl_AspectLine* OpenGl_Workspace::SetAspectLine ( const OpenGl_AspectLine theAspect)

Assign new line aspect (will be applied within ApplyAspectLine()).

◆ SetAspectMarker()

const OpenGl_AspectMarker* OpenGl_Workspace::SetAspectMarker ( const OpenGl_AspectMarker theAspect)

Assign new marker aspect (will be applied within ApplyAspectMarker()).

◆ SetAspectText()

const OpenGl_AspectText* OpenGl_Workspace::SetAspectText ( const OpenGl_AspectText theAspect)

Assign new text aspect (will be applied within ApplyAspectText()).

◆ SetEnvironmentTexture()

void OpenGl_Workspace::SetEnvironmentTexture ( const Handle< OpenGl_TextureSet > &  theTexture)
inline

Sets a new environment texture.

◆ SetHighlightStyle()

void OpenGl_Workspace::SetHighlightStyle ( const Handle< Graphic3d_PresentationAttributes > &  theStyle)
inline

Set highlight style.

◆ SetRenderFilter()

void OpenGl_Workspace::SetRenderFilter ( const Handle< OpenGl_RenderFilter > &  theFilter)
inline

Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups.

Parameters
theFilter[in] the filter instance.

◆ SetUseZBuffer()

Standard_Boolean OpenGl_Workspace::SetUseZBuffer ( const Standard_Boolean  theToUse)
inline

Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag.

◆ TextColor()

const OpenGl_Vec4& OpenGl_Workspace::TextColor ( ) const
inline

Return text color taking into account highlight flag.

◆ TextSubtitleColor()

const OpenGl_Vec4& OpenGl_Workspace::TextSubtitleColor ( ) const
inline

Return text Subtitle color taking into account highlight flag.

◆ ToAllowFaceCulling()

bool OpenGl_Workspace::ToAllowFaceCulling ( ) const
inline

Return true if active group might activate face culling (e.g. primitives are closed).

◆ ToHighlight()

bool OpenGl_Workspace::ToHighlight ( ) const
inline

Return true if following structures should apply highlight color.

◆ UseDepthWrite()

Standard_Boolean& OpenGl_Workspace::UseDepthWrite ( )
inline
Returns
true if depth writing is enabled.

◆ UseZBuffer()

Standard_Boolean& OpenGl_Workspace::UseZBuffer ( )
inline
Returns
true if usage of Z buffer is enabled.

◆ View()

OpenGl_View* OpenGl_Workspace::View ( ) const
inline

◆ ViewMatrix()

const OpenGl_Matrix* OpenGl_Workspace::ViewMatrix ( ) const
inline
Returns
applied view matrix.

◆ Width()

Standard_Integer OpenGl_Workspace::Width ( ) const

Field Documentation

◆ myAspectFaceApplied

Handle< Graphic3d_AspectFillArea3d > OpenGl_Workspace::myAspectFaceApplied
protected

allow back face culling

◆ myAspectFaceAppliedWithHL

Handle< Graphic3d_PresentationAttributes > OpenGl_Workspace::myAspectFaceAppliedWithHL
protected

allow back face culling

◆ myAspectFaceHl

OpenGl_AspectFace OpenGl_Workspace::myAspectFaceHl
protected

Hiddenline aspect.

◆ myAspectFaceSet

const OpenGl_AspectFace* OpenGl_Workspace::myAspectFaceSet
protected

allow back face culling

◆ myAspectLineSet

const OpenGl_AspectLine* OpenGl_Workspace::myAspectLineSet
protected

allow back face culling

◆ myAspectMarkerApplied

Handle< Graphic3d_AspectMarker3d > OpenGl_Workspace::myAspectMarkerApplied
protected

allow back face culling

◆ myAspectMarkerSet

const OpenGl_AspectMarker* OpenGl_Workspace::myAspectMarkerSet
protected

allow back face culling

◆ myAspectTextSet

const OpenGl_AspectText* OpenGl_Workspace::myAspectTextSet
protected

allow back face culling

◆ myDefaultCappingAlgoFilter

Handle< OpenGl_CappingAlgoFilter > OpenGl_Workspace::myDefaultCappingAlgoFilter
protected

◆ myEnvironmentTexture

Handle< OpenGl_TextureSet > OpenGl_Workspace::myEnvironmentTexture
protected

allow back face culling

◆ myFontFaceAspect

OpenGl_AspectFace OpenGl_Workspace::myFontFaceAspect
protected

◆ myFrontCulling

OpenGl_AspectFace OpenGl_Workspace::myFrontCulling
protected

◆ myGlContext

Handle< OpenGl_Context > OpenGl_Workspace::myGlContext
protected

◆ myHighlightStyle

Handle< Graphic3d_PresentationAttributes > OpenGl_Workspace::myHighlightStyle
protected

active highlight style

◆ myModelViewMatrix

OpenGl_Matrix OpenGl_Workspace::myModelViewMatrix
protected

Model matrix with applied structure transformations.

◆ myNoneCulling

OpenGl_AspectFace OpenGl_Workspace::myNoneCulling
protected

◆ myRenderFilter

Handle< OpenGl_RenderFilter > OpenGl_Workspace::myRenderFilter
protected

allow back face culling

◆ myToAllowFaceCulling

bool OpenGl_Workspace::myToAllowFaceCulling
protected

allow back face culling

◆ myUseDepthWrite

Standard_Boolean OpenGl_Workspace::myUseDepthWrite
protected

◆ myUseZBuffer

Standard_Boolean OpenGl_Workspace::myUseZBuffer
protected

◆ myView

OpenGl_View* OpenGl_Workspace::myView
protected

◆ myWindow

Handle< OpenGl_Window > OpenGl_Workspace::myWindow
protected

◆ StructureMatrix_applied

const OpenGl_Matrix* OpenGl_Workspace::StructureMatrix_applied
protected

allow back face culling

◆ ViewMatrix_applied

const OpenGl_Matrix* OpenGl_Workspace::ViewMatrix_applied
protected

allow back face culling


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