![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Rendering workspace. Provides methods to render primitives and maintain GL state. More...
#include <OpenGl_Workspace.hxx>

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_View * | View () const |
| const occ::handle< OpenGl_Context > & | GetGlContext () |
| occ::handle< OpenGl_FrameBuffer > | FBOCreate (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 > & | 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_Aspects * | Aspects () const |
| Currently set aspects (can differ from applied). | |
| const OpenGl_Aspects * | SetAspects (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_Aspects * | ApplyAspects (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_Aspects & | NoneCulling () const |
| Returns face aspect for none culling mode. | |
| const OpenGl_Aspects & | FrontCulling () 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_Transient & | operator= (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_Transient * | This () 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_View * | myView |
| occ::handle< OpenGl_Window > | myWindow |
| occ::handle< OpenGl_Context > | myGlContext |
| 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_Aspects * | myAspectsSet |
| counter of skipped transparent elements for OpenGl_LayerList two rendering passes method | |
| occ::handle< Graphic3d_Aspects > | myAspectsApplied |
| counter of skipped transparent elements for OpenGl_LayerList two rendering passes method | |
| occ::handle< Graphic3d_PresentationAttributes > | myAspectFaceAppliedWithHL |
| counter of skipped transparent elements for OpenGl_LayerList two rendering passes method | |
| bool | myToAllowFaceCulling |
| allow back face culling | |
| occ::handle< Graphic3d_PresentationAttributes > | myHighlightStyle |
| active highlight style | |
| OpenGl_Aspects | myAspectFaceHl |
| Hiddenline aspect. | |
| occ::handle< OpenGl_TextureSet > | myEnvironmentTexture |
| counter of skipped transparent elements for OpenGl_LayerList two rendering passes method | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
| 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. | |
Rendering workspace. Provides methods to render primitives and maintain GL state.
| OpenGl_Workspace::OpenGl_Workspace | ( | OpenGl_View * | theView, |
| const occ::handle< OpenGl_Window > & | theWindow ) |
Constructor of rendering workspace.
|
overridedefault |
Destructor.
| bool OpenGl_Workspace::Activate | ( | ) |
Activate rendering context.
| const OpenGl_Aspects * OpenGl_Workspace::ApplyAspects | ( | bool | theToBindTextures = true | ) |
Apply aspects.
| theToBindTextures | flag to bind texture set defined by applied aspect |
|
inline |
Currently set aspects (can differ from applied).
| bool OpenGl_Workspace::BufferDump | ( | const occ::handle< OpenGl_FrameBuffer > & | theFbo, |
| Image_PixMap & | theImage, | ||
| const Graphic3d_BufferType & | theBufferType ) |
| void OpenGl_Workspace::DumpJson | ( | Standard_OStream & | theOStream, |
| int | theDepth = -1 ) const |
Dumps the content of me into the stream.
|
inline |
Return edge color taking into account highlight flag.
|
inline |
Returns environment texture.
| occ::handle< OpenGl_FrameBuffer > OpenGl_Workspace::FBOCreate | ( | const int | theWidth, |
| const int | theHeight ) |
| void OpenGl_Workspace::FBORelease | ( | occ::handle< OpenGl_FrameBuffer > & | theFbo | ) |
|
inline |
Returns face aspect for front face culling mode.
|
inline |
| int OpenGl_Workspace::Height | ( | ) | const |
|
inline |
Return highlight style.
|
inline |
Return Interior color taking into account highlight flag.
|
inline |
Return the number of skipped transparent elements within active OpenGl_RenderFilter_OpaqueOnly filter.
|
inline |
Returns face aspect for none culling mode.
|
inline |
Get rendering filter.
| void OpenGl_Workspace::ResetAppliedAspect | ( | ) |
Clear the applied aspect state to default values.
|
inline |
Reset skipped transparent elements counter.
Allow or disallow face culling. This call does NOT affect current state of back face culling; ApplyAspectFace() should be called to update state.
| const OpenGl_Aspects * OpenGl_Workspace::SetAspects | ( | const OpenGl_Aspects * | theAspect | ) |
Assign new aspects (will be applied within ApplyAspects()).
| Graphic3d_PolygonOffset OpenGl_Workspace::SetDefaultPolygonOffset | ( | const Graphic3d_PolygonOffset & | theOffset | ) |
Configure default polygon offset parameters. Return previous settings.
|
inline |
Sets a new environment texture.
|
inline |
Set highlight style.
Set filter for restricting rendering of particular elements.
Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag.
| bool OpenGl_Workspace::ShouldRender | ( | const OpenGl_Element * | theElement, |
| const OpenGl_Group * | theGroup ) |
Checks whether the element can be rendered or not.
| [in] | theElement | the element to check |
| [in] | theGroup | the group containing the element |
|
inline |
Return text color taking into account highlight flag.
|
inline |
Return text Subtitle color taking into account highlight flag.
|
inline |
Return TextureSet from set Aspects or Environment texture.
|
inline |
Return true if active group might activate face culling (e.g. primitives are closed).
|
inline |
Return true if following structures should apply highlight color.
|
inline |
|
inline |
|
inline |
| int OpenGl_Workspace::Width | ( | ) | const |
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
Hiddenline aspect.
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
|
protected |
|
protected |
active highlight style
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
|
protected |
active filter for skipping rendering of elements by some criteria (multiple render passes)
|
protected |
allow back face culling
|
protected |
|
protected |
|
protected |
|
protected |