OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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:

    Public Member Functions

     OpenGl_Workspace (OpenGl_View *theView, const occ::handle< OpenGl_Window > &theWindow)
     Constructor of rendering workspace.
     ~OpenGl_Workspace () override=default
     Destructor.
    bool Activate ()
     Activate rendering context.
    OpenGl_ViewView () const
    const occ::handle< OpenGl_Context > & GetGlContext ()
    occ::handle< OpenGl_FrameBufferFBOCreate (const int theWidth, const int theHeight)
    void FBORelease (occ::handle< OpenGl_FrameBuffer > &theFbo)
    bool BufferDump (const occ::handle< OpenGl_FrameBuffer > &theFbo, Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType)
    int Width () const
    int Height () const
    bool SetUseZBuffer (const bool theToUse)
     Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag.
    bool & UseZBuffer ()
    bool & UseDepthWrite ()
    Graphic3d_PolygonOffset SetDefaultPolygonOffset (const Graphic3d_PolygonOffset &theOffset)
     Configure default polygon offset parameters. Return previous settings.
    bool ToAllowFaceCulling () const
     Return true if active group might activate face culling (e.g. primitives are closed).
    bool 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.
    bool ToHighlight () const
     Return true if following structures should apply highlight color.
    const occ::handle< Graphic3d_PresentationAttributes > & HighlightStyle () const
     Return highlight style.
    void SetHighlightStyle (const occ::handle< Graphic3d_PresentationAttributes > &theStyle)
     Set highlight style.
    const NCollection_Vec4< float > & EdgeColor () const
     Return edge color taking into account highlight flag.
    const NCollection_Vec4< float > & InteriorColor () const
     Return Interior color taking into account highlight flag.
    const NCollection_Vec4< float > & BackInteriorColor () const
     Return back interior color taking into account highlight and distinguish flags.
    const NCollection_Vec4< float > & TextColor () const
     Return text color taking into account highlight flag.
    const NCollection_Vec4< float > & TextSubtitleColor () const
     Return text Subtitle color taking into account highlight flag.
    const OpenGl_AspectsAspects () const
     Currently set aspects (can differ from applied).
    const OpenGl_AspectsSetAspects (const OpenGl_Aspects *theAspect)
     Assign new aspects (will be applied within ApplyAspects()).
    const occ::handle< OpenGl_TextureSet > & TextureSet () const
     Return TextureSet from set Aspects or Environment texture.
    const OpenGl_AspectsApplyAspects (bool theToBindTextures=true)
     Apply aspects.
    void ResetAppliedAspect ()
     Clear the applied aspect state to default values.
    int RenderFilter () const
     Get rendering filter.
    void SetRenderFilter (int theFilter)
     Set filter for restricting rendering of particular elements.
    bool ShouldRender (const OpenGl_Element *theElement, const OpenGl_Group *theGroup)
     Checks whether the element can be rendered or not.
    int NbSkippedTransparentElements ()
     Return the number of skipped transparent elements within active OpenGl_RenderFilter_OpaqueOnly filter.
    void ResetSkippedCounter ()
     Reset skipped transparent elements counter.
    const OpenGl_AspectsNoneCulling () const
     Returns face aspect for none culling mode.
    const OpenGl_AspectsFrontCulling () const
     Returns face aspect for front face culling mode.
    void SetEnvironmentTexture (const occ::handle< OpenGl_TextureSet > &theTexture)
     Sets a new environment texture.
    const occ::handle< OpenGl_TextureSet > & EnvironmentTexture () const
     Returns environment texture.
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transientoperator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool 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.
    bool IsKind (const char *const 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.
    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.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Protected Attributes

    protected fields
    OpenGl_ViewmyView
    occ::handle< OpenGl_WindowmyWindow
    occ::handle< OpenGl_ContextmyGlContext
    bool myUseZBuffer
    bool myUseDepthWrite
    OpenGl_Aspects myNoneCulling
    OpenGl_Aspects myFrontCulling
    fields related to status
    int myNbSkippedTranspElems
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
    int myRenderFilter
     active filter for skipping rendering of elements by some criteria (multiple render passes)
    OpenGl_Aspects myDefaultAspects
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
    const OpenGl_AspectsmyAspectsSet
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
    occ::handle< Graphic3d_AspectsmyAspectsApplied
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
    occ::handle< Graphic3d_PresentationAttributesmyAspectFaceAppliedWithHL
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
    bool myToAllowFaceCulling
     allow back face culling
    occ::handle< Graphic3d_PresentationAttributesmyHighlightStyle
     active highlight style
    OpenGl_Aspects myAspectFaceHl
     Hiddenline aspect.
    occ::handle< OpenGl_TextureSetmyEnvironmentTexture
     counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.
    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    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 occ::handle< OpenGl_Window > & theWindow )

    Constructor of rendering workspace.

    ◆ ~OpenGl_Workspace()

    OpenGl_Workspace::~OpenGl_Workspace ( )
    overridedefault

    Destructor.

    Member Function Documentation

    ◆ Activate()

    bool OpenGl_Workspace::Activate ( )

    Activate rendering context.

    ◆ ApplyAspects()

    const OpenGl_Aspects * OpenGl_Workspace::ApplyAspects ( bool theToBindTextures = true)

    Apply aspects.

    Parameters
    theToBindTexturesflag to bind texture set defined by applied aspect
    Returns
    aspect set by SetAspects()

    ◆ Aspects()

    const OpenGl_Aspects * OpenGl_Workspace::Aspects ( ) const
    inline

    Currently set aspects (can differ from applied).

    ◆ BackInteriorColor()

    const NCollection_Vec4< float > & OpenGl_Workspace::BackInteriorColor ( ) const
    inline

    Return back interior color taking into account highlight and distinguish flags.

    ◆ BufferDump()

    bool OpenGl_Workspace::BufferDump ( const occ::handle< OpenGl_FrameBuffer > & theFbo,
    Image_PixMap & theImage,
    const Graphic3d_BufferType & theBufferType )

    ◆ DumpJson()

    void OpenGl_Workspace::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const

    Dumps the content of me into the stream.

    ◆ EdgeColor()

    const NCollection_Vec4< float > & OpenGl_Workspace::EdgeColor ( ) const
    inline

    Return edge color taking into account highlight flag.

    ◆ EnvironmentTexture()

    const occ::handle< OpenGl_TextureSet > & OpenGl_Workspace::EnvironmentTexture ( ) const
    inline

    Returns environment texture.

    ◆ FBOCreate()

    occ::handle< OpenGl_FrameBuffer > OpenGl_Workspace::FBOCreate ( const int theWidth,
    const int theHeight )

    ◆ FBORelease()

    void OpenGl_Workspace::FBORelease ( occ::handle< OpenGl_FrameBuffer > & theFbo)

    ◆ FrontCulling()

    const OpenGl_Aspects & OpenGl_Workspace::FrontCulling ( ) const
    inline

    Returns face aspect for front face culling mode.

    ◆ GetGlContext()

    const occ::handle< OpenGl_Context > & OpenGl_Workspace::GetGlContext ( )
    inline

    ◆ Height()

    int OpenGl_Workspace::Height ( ) const

    ◆ HighlightStyle()

    const occ::handle< Graphic3d_PresentationAttributes > & OpenGl_Workspace::HighlightStyle ( ) const
    inline

    Return highlight style.

    ◆ InteriorColor()

    const NCollection_Vec4< float > & OpenGl_Workspace::InteriorColor ( ) const
    inline

    Return Interior color taking into account highlight flag.

    ◆ NbSkippedTransparentElements()

    int OpenGl_Workspace::NbSkippedTransparentElements ( )
    inline

    Return the number of skipped transparent elements within active OpenGl_RenderFilter_OpaqueOnly filter.

    See also
    OpenGl_LayerList::Render()

    ◆ NoneCulling()

    const OpenGl_Aspects & OpenGl_Workspace::NoneCulling ( ) const
    inline

    Returns face aspect for none culling mode.

    ◆ RenderFilter()

    int OpenGl_Workspace::RenderFilter ( ) const
    inline

    Get rendering filter.

    See also
    ShouldRender()

    ◆ ResetAppliedAspect()

    void OpenGl_Workspace::ResetAppliedAspect ( )

    Clear the applied aspect state to default values.

    ◆ ResetSkippedCounter()

    void OpenGl_Workspace::ResetSkippedCounter ( )
    inline

    Reset skipped transparent elements counter.

    See also
    OpenGl_LayerList::Render()

    ◆ SetAllowFaceCulling()

    bool 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.

    ◆ SetAspects()

    const OpenGl_Aspects * OpenGl_Workspace::SetAspects ( const OpenGl_Aspects * theAspect)

    Assign new aspects (will be applied within ApplyAspects()).

    ◆ SetDefaultPolygonOffset()

    Graphic3d_PolygonOffset OpenGl_Workspace::SetDefaultPolygonOffset ( const Graphic3d_PolygonOffset & theOffset)

    Configure default polygon offset parameters. Return previous settings.

    ◆ SetEnvironmentTexture()

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

    Sets a new environment texture.

    ◆ SetHighlightStyle()

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

    Set highlight style.

    ◆ SetRenderFilter()

    void OpenGl_Workspace::SetRenderFilter ( int theFilter)
    inline

    Set filter for restricting rendering of particular elements.

    See also
    ShouldRender()

    ◆ SetUseZBuffer()

    bool OpenGl_Workspace::SetUseZBuffer ( const bool theToUse)
    inline

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

    ◆ ShouldRender()

    bool OpenGl_Workspace::ShouldRender ( const OpenGl_Element * theElement,
    const OpenGl_Group * theGroup )

    Checks whether the element can be rendered or not.

    Parameters
    [in]theElementthe element to check
    [in]theGroupthe group containing the element
    Returns
    True if element can be rendered

    ◆ TextColor()

    const NCollection_Vec4< float > & OpenGl_Workspace::TextColor ( ) const
    inline

    Return text color taking into account highlight flag.

    ◆ TextSubtitleColor()

    const NCollection_Vec4< float > & OpenGl_Workspace::TextSubtitleColor ( ) const
    inline

    Return text Subtitle color taking into account highlight flag.

    ◆ TextureSet()

    const occ::handle< OpenGl_TextureSet > & OpenGl_Workspace::TextureSet ( ) const
    inline

    Return TextureSet from set Aspects or Environment texture.

    ◆ 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()

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

    ◆ UseZBuffer()

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

    ◆ View()

    OpenGl_View * OpenGl_Workspace::View ( ) const
    inline

    ◆ Width()

    int OpenGl_Workspace::Width ( ) const

    Field Documentation

    ◆ myAspectFaceAppliedWithHL

    occ::handle<Graphic3d_PresentationAttributes> OpenGl_Workspace::myAspectFaceAppliedWithHL
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myAspectFaceHl

    OpenGl_Aspects OpenGl_Workspace::myAspectFaceHl
    protected

    Hiddenline aspect.

    ◆ myAspectsApplied

    occ::handle<Graphic3d_Aspects> OpenGl_Workspace::myAspectsApplied
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myAspectsSet

    const OpenGl_Aspects* OpenGl_Workspace::myAspectsSet
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myDefaultAspects

    OpenGl_Aspects OpenGl_Workspace::myDefaultAspects
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myEnvironmentTexture

    occ::handle<OpenGl_TextureSet> OpenGl_Workspace::myEnvironmentTexture
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myFrontCulling

    OpenGl_Aspects OpenGl_Workspace::myFrontCulling
    protected

    ◆ myGlContext

    occ::handle<OpenGl_Context> OpenGl_Workspace::myGlContext
    protected

    ◆ myHighlightStyle

    occ::handle<Graphic3d_PresentationAttributes> OpenGl_Workspace::myHighlightStyle
    protected

    active highlight style

    ◆ myNbSkippedTranspElems

    int OpenGl_Workspace::myNbSkippedTranspElems
    protected

    counter of skipped transparent elements for OpenGl_LayerList two rendering passes method

    ◆ myNoneCulling

    OpenGl_Aspects OpenGl_Workspace::myNoneCulling
    protected

    ◆ myRenderFilter

    int OpenGl_Workspace::myRenderFilter
    protected

    active filter for skipping rendering of elements by some criteria (multiple render passes)

    ◆ myToAllowFaceCulling

    bool OpenGl_Workspace::myToAllowFaceCulling
    protected

    allow back face culling

    ◆ myUseDepthWrite

    bool OpenGl_Workspace::myUseDepthWrite
    protected

    ◆ myUseZBuffer

    bool OpenGl_Workspace::myUseZBuffer
    protected

    ◆ myView

    OpenGl_View* OpenGl_Workspace::myView
    protected

    ◆ myWindow

    occ::handle<OpenGl_Window> OpenGl_Workspace::myWindow
    protected

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