Open CASCADE Technology  7.0.0
Public Member Functions | Data Fields | Protected 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...
 
Handle< OpenGl_PrinterContext > & PrinterContext ()
 
Standard_BooleanUseZBuffer ()
 
Standard_BooleanUseDepthWrite ()
 
Standard_Boolean UseGLLight () const
 
Standard_Integer AntiAliasingMode () const
 
Standard_Boolean IsCullingEnabled () const
 
const OpenGl_AspectLineSetAspectLine (const OpenGl_AspectLine *theAspect)
 
const OpenGl_AspectFaceSetAspectFace (const OpenGl_AspectFace *theAspect)
 
const OpenGl_AspectMarkerSetAspectMarker (const OpenGl_AspectMarker *theAspect)
 
const OpenGl_AspectTextSetAspectText (const OpenGl_AspectText *theAspect)
 
const OpenGl_AspectLineAspectLine (const Standard_Boolean theWithApply)
 
const OpenGl_AspectFaceAspectFace (const Standard_Boolean theWithApply)
 
const OpenGl_AspectMarkerAspectMarker (const Standard_Boolean theWithApply)
 
const OpenGl_AspectTextAspectText (const Standard_Boolean theWithApply)
 
void ResetAppliedAspect ()
 Clear the applied aspect state. More...
 
Handle< OpenGl_TextureDisableTexture ()
 
Handle< OpenGl_TextureEnableTexture (const Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams=NULL)
 
const Handle< OpenGl_Texture > & ActiveTexture () const
 
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
 
void SetPolygonOffset (int theMode, Standard_ShortReal theFactor, Standard_ShortReal theUnits)
 Sets and applies current polygon offset. More...
 
const TEL_POFFSET_PARAMAppliedPolygonOffset ()
 Returns currently applied polygon offset params. 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...
 
- 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...
 

Data Fields

Standard_Integer NamedStatus
 
const TEL_COLOURHighlightColor
 

Protected Member Functions

void updateMaterial (const int theFlag)
 
void setTextureParams (Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams)
 

Protected Attributes

protected fields
OpenGl_ViewmyView
 
Handle< OpenGl_WindowmyWindow
 
Handle< OpenGl_ContextmyGlContext
 
Handle< OpenGl_PrinterContextmyPrintContext
 
Handle< OpenGl_LineAttributesmyLineAttribs
 
Standard_Integer myAntiAliasingMode
 
Standard_Boolean myUseZBuffer
 
Standard_Boolean myUseDepthWrite
 
Standard_Boolean myUseGLLight
 
Handle< OpenGl_CappingAlgoFiltermyDefaultCappingAlgoFilter
 
OpenGl_AspectFace myNoneCulling
 
OpenGl_AspectFace myFrontCulling
 
fields related to status
Handle< OpenGl_RenderFiltermyRenderFilter
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
Handle< OpenGl_TexturemyTextureBound
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectLineAspectLine_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectLineAspectLine_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectFaceAspectFace_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectFaceAspectFace_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectMarkerAspectMarker_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectMarkerAspectMarker_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectTextAspectText_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_AspectTextAspectText_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_MatrixViewMatrix_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
const OpenGl_MatrixStructureMatrix_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More...
 
OpenGl_Material myMatFront
 current front material state (cached to reduce GL context updates) More...
 
OpenGl_Material myMatBack
 current back material state More...
 
OpenGl_Material myMatTmp
 temporary variable More...
 
TelCullMode myCullingMode
 back face culling mode, applied from face aspect More...
 
OpenGl_Matrix myModelViewMatrix
 Model matrix with applied structure transformations. More...
 
TEL_POFFSET_PARAM PolygonOffset_applied
 Currently applied polygon offset. More...
 
OpenGl_AspectFace myAspectFaceHl
 Hiddenline aspect. 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_View theView,
const Handle< OpenGl_Window > &  theWindow 
)

Constructor of rendering workspace.

virtual OpenGl_Workspace::~OpenGl_Workspace ( )
virtual

Destructor.

Member Function Documentation

Standard_Boolean OpenGl_Workspace::Activate ( )

Activate rendering context.

const Handle< OpenGl_Texture >& OpenGl_Workspace::ActiveTexture ( ) const
inline
Standard_Integer OpenGl_Workspace::AntiAliasingMode ( ) const
Returns
true if antialiasing is enabled.
const TEL_POFFSET_PARAM& OpenGl_Workspace::AppliedPolygonOffset ( )
inline

Returns currently applied polygon offset params.

const OpenGl_AspectFace* OpenGl_Workspace::AspectFace ( const Standard_Boolean  theWithApply)
const OpenGl_AspectLine* OpenGl_Workspace::AspectLine ( const Standard_Boolean  theWithApply)
const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker ( const Standard_Boolean  theWithApply)
const OpenGl_AspectText* OpenGl_Workspace::AspectText ( const Standard_Boolean  theWithApply)
Standard_Boolean OpenGl_Workspace::BufferDump ( const Handle< OpenGl_FrameBuffer > &  theFbo,
Image_PixMap theImage,
const Graphic3d_BufferType theBufferType 
)
const Handle< OpenGl_CappingAlgoFilter >& OpenGl_Workspace::DefaultCappingAlgoFilter ( ) const
inline

Returns capping algorithm rendering filter.

Handle< OpenGl_Texture > OpenGl_Workspace::DisableTexture ( )
Handle< OpenGl_Texture > OpenGl_Workspace::EnableTexture ( const Handle< OpenGl_Texture > &  theTexture,
const Handle< Graphic3d_TextureParams > &  theParams = NULL 
)
Handle< OpenGl_FrameBuffer > OpenGl_Workspace::FBOCreate ( const Standard_Integer  theWidth,
const Standard_Integer  theHeight 
)
void OpenGl_Workspace::FBORelease ( Handle< OpenGl_FrameBuffer > &  theFbo)
const OpenGl_AspectFace& OpenGl_Workspace::FrontCulling ( ) const
inline

Returns face aspect for front face culling mode.

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

Get rendering filter.

Returns
filter instance.
Standard_Integer OpenGl_Workspace::Height ( ) const
Standard_Boolean OpenGl_Workspace::IsCullingEnabled ( ) const
Returns
true if clipping algorithm enabled
const OpenGl_Matrix* OpenGl_Workspace::ModelMatrix ( ) const
inline
Returns
applied model structure matrix.
const OpenGl_AspectFace& OpenGl_Workspace::NoneCulling ( ) const
inline

Returns face aspect for none culling mode.

Handle< OpenGl_PrinterContext >& OpenGl_Workspace::PrinterContext ( )
inline
void OpenGl_Workspace::ResetAppliedAspect ( )

Clear the applied aspect state.

const OpenGl_AspectFace* OpenGl_Workspace::SetAspectFace ( const OpenGl_AspectFace theAspect)
const OpenGl_AspectLine* OpenGl_Workspace::SetAspectLine ( const OpenGl_AspectLine theAspect)
const OpenGl_AspectMarker* OpenGl_Workspace::SetAspectMarker ( const OpenGl_AspectMarker theAspect)
const OpenGl_AspectText* OpenGl_Workspace::SetAspectText ( const OpenGl_AspectText theAspect)
void OpenGl_Workspace::SetPolygonOffset ( int  theMode,
Standard_ShortReal  theFactor,
Standard_ShortReal  theUnits 
)

Sets and applies current polygon offset.

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.
void OpenGl_Workspace::setTextureParams ( Handle< OpenGl_Texture > &  theTexture,
const Handle< Graphic3d_TextureParams > &  theParams 
)
protected
Standard_Boolean OpenGl_Workspace::SetUseZBuffer ( const Standard_Boolean  theToUse)
inline

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

void OpenGl_Workspace::updateMaterial ( const int  theFlag)
protected
Standard_Boolean& OpenGl_Workspace::UseDepthWrite ( )
inline
Returns
true if depth writing is enabled.
Standard_Boolean OpenGl_Workspace::UseGLLight ( ) const
Returns
true if usage of GL light is enabled.
Standard_Boolean& OpenGl_Workspace::UseZBuffer ( )
inline
Returns
true if usage of Z buffer is enabled.
OpenGl_View* OpenGl_Workspace::View ( ) const
inline
const OpenGl_Matrix* OpenGl_Workspace::ViewMatrix ( ) const
inline
Returns
applied view matrix.
Standard_Integer OpenGl_Workspace::Width ( ) const

Field Documentation

const OpenGl_AspectFace * OpenGl_Workspace::AspectFace_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectFace* OpenGl_Workspace::AspectFace_set
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectLine * OpenGl_Workspace::AspectLine_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectLine* OpenGl_Workspace::AspectLine_set
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectMarker * OpenGl_Workspace::AspectMarker_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker_set
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectText * OpenGl_Workspace::AspectText_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_AspectText* OpenGl_Workspace::AspectText_set
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const TEL_COLOUR* OpenGl_Workspace::HighlightColor
Standard_Integer OpenGl_Workspace::myAntiAliasingMode
protected
OpenGl_AspectFace OpenGl_Workspace::myAspectFaceHl
protected

Hiddenline aspect.

TelCullMode OpenGl_Workspace::myCullingMode
protected

back face culling mode, applied from face aspect

Handle< OpenGl_CappingAlgoFilter > OpenGl_Workspace::myDefaultCappingAlgoFilter
protected
OpenGl_AspectFace OpenGl_Workspace::myFrontCulling
protected
Handle< OpenGl_Context > OpenGl_Workspace::myGlContext
protected
Handle< OpenGl_LineAttributes > OpenGl_Workspace::myLineAttribs
protected
OpenGl_Material OpenGl_Workspace::myMatBack
protected

current back material state

OpenGl_Material OpenGl_Workspace::myMatFront
protected

current front material state (cached to reduce GL context updates)

OpenGl_Material OpenGl_Workspace::myMatTmp
protected

temporary variable

OpenGl_Matrix OpenGl_Workspace::myModelViewMatrix
protected

Model matrix with applied structure transformations.

OpenGl_AspectFace OpenGl_Workspace::myNoneCulling
protected
Handle< OpenGl_PrinterContext > OpenGl_Workspace::myPrintContext
protected
Handle< OpenGl_RenderFilter > OpenGl_Workspace::myRenderFilter
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

Handle< OpenGl_Texture > OpenGl_Workspace::myTextureBound
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

Standard_Boolean OpenGl_Workspace::myUseDepthWrite
protected
Standard_Boolean OpenGl_Workspace::myUseGLLight
protected
Standard_Boolean OpenGl_Workspace::myUseZBuffer
protected
OpenGl_View* OpenGl_Workspace::myView
protected
Handle< OpenGl_Window > OpenGl_Workspace::myWindow
protected
Standard_Integer OpenGl_Workspace::NamedStatus
TEL_POFFSET_PARAM OpenGl_Workspace::PolygonOffset_applied
protected

Currently applied polygon offset.

const OpenGl_Matrix* OpenGl_Workspace::StructureMatrix_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

const OpenGl_Matrix* OpenGl_Workspace::ViewMatrix_applied
protected

currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)


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