Open CASCADE Technology  7.3.0
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes

OpenGl_Structure Class Reference

Implementation of low-level graphic structure. More...

#include <OpenGl_Structure.hxx>

Inheritance diagram for OpenGl_Structure:
Inheritance graph
[legend]

Data Structures

class  GroupIterator
 Auxiliary wrapper to iterate OpenGl_Group sequence. More...
 

Public Member Functions

 OpenGl_Structure (const Handle< Graphic3d_StructureManager > &theManager)
 Create empty structure. More...
 
virtual void OnVisibilityChanged () override
 Setup structure graphic state. More...
 
virtual void Clear () override
 Clear graphic data. More...
 
virtual void Connect (Graphic3d_CStructure &theStructure) override
 Connect other structure to this one. More...
 
virtual void Disconnect (Graphic3d_CStructure &theStructure) override
 Disconnect other structure to this one. More...
 
virtual void SetTransformation (const Handle< Geom_Transformation > &theTrsf) override
 Synchronize structure transformation. More...
 
virtual void SetTransformPersistence (const Handle< Graphic3d_TransformPers > &theTrsfPers) override
 Set transformation persistence. More...
 
virtual void SetZLayer (const Graphic3d_ZLayerId theLayerIndex) override
 Set z layer ID to display the structure in specified layer. More...
 
virtual void GraphicHighlight (const Handle< Graphic3d_PresentationAttributes > &theStyle, const Handle< Graphic3d_Structure > &theStruct) override
 Highlights structure according to the given style and updates corresponding class fields (highlight status and style) More...
 
virtual void GraphicUnhighlight () override
 Unighlights structure and updates corresponding class fields (highlight status and style) More...
 
virtual Handle< Graphic3d_CStructureShadowLink (const Handle< Graphic3d_StructureManager > &theManager) const override
 Create shadow link to this structure. More...
 
virtual Handle< Graphic3d_GroupNewGroup (const Handle< Graphic3d_Structure > &theStruct) override
 Create new group within this structure. More...
 
virtual void RemoveGroup (const Handle< Graphic3d_Group > &theGroup) override
 Remove group from this structure. More...
 
OpenGl_GraphicDriverGlDriver () const
 Access graphic driver. More...
 
void Clear (const Handle< OpenGl_Context > &theGlCtx)
 
virtual void Render (const Handle< OpenGl_Workspace > &theWorkspace) const
 Renders the structure. More...
 
virtual void Release (const Handle< OpenGl_Context > &theGlCtx)
 Releases structure resources. More...
 
void SetCulled (Standard_Boolean theIsCulled) const
 Marks structure as culled/not culled - note that IsAlwaysRendered() is ignored here! More...
 
void MarkAsNotCulled () const
 Marks structure as overlapping the current view volume one. The method is called during traverse of BVH tree. More...
 
Standard_Boolean IsCulled () const
 Returns Standard_False if the structure hits the current view volume, otherwise returns Standard_True. The default value for all structures before each traverse of BVH tree is Standard_True. More...
 
Standard_Boolean IsAlwaysRendered () const
 Checks if the structure should be included into BVH tree or not. More...
 
void ReleaseGlResources (const Handle< OpenGl_Context > &theGlCtx)
 This method releases GL resources without actual elements destruction. As result structure could be correctly destroyed layer without GL context (after last window was closed for example). More...
 
const OpenGl_StructureInstancedStructure () const
 Returns instanced OpenGL structure. More...
 
Standard_Size ModificationState () const
 Returns structure modification state (for ray-tracing). More...
 
void ResetModificationState () const
 Resets structure modification state (for ray-tracing). More...
 
Standard_Boolean IsRaytracable () const
 Is the structure ray-tracable (contains ray-tracable elements)? More...
 
void updateLayerTransformation ()
 Update render transformation matrix. More...
 
- Public Member Functions inherited from Graphic3d_CStructure
const Handle< Graphic3d_GraphicDriver > & GraphicDriver () const
 
const Graphic3d_SequenceOfGroupGroups () const
 
const Handle< Geom_Transformation > & Transformation () const
 Return transformation. More...
 
const Handle< Graphic3d_TransformPers > & TransformPersistence () const
 Return transformation persistence. More...
 
const Handle< Graphic3d_SequenceOfHClipPlane > & ClipPlanes () const
 
void SetClipPlanes (const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes)
 Pass clip planes to the associated graphic driver structure. More...
 
const Graphic3d_BndBox3dBoundingBox () const
 
Graphic3d_BndBox3dChangeBoundingBox ()
 
bool IsVisible () const
 Return structure visibility flag. More...
 
bool IsVisible (const Standard_Integer theViewId) const
 Return structure visibility considering both View Affinity and global visibility state. More...
 
Graphic3d_ZLayerId ZLayer () const
 Get z layer ID. More...
 
const Handle< Graphic3d_PresentationAttributes > & HighlightStyle () const
 Returns valid handle to highlight style of the structure in case if highlight flag is set to true. 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 Member Functions

virtual ~OpenGl_Structure ()
 
void UpdateStateIfRaytracable (const Standard_Boolean toCheck=Standard_True) const
 Updates ray-tracable status for structure and its parents. More...
 
void renderGeometry (const Handle< OpenGl_Workspace > &theWorkspace, bool &theHasClosed) const
 Renders groups of structure without applying any attributes (i.e. transform, material etc). More...
 
void highlightWithBndBox (const Handle< Graphic3d_Structure > &theStruct)
 Highlight structure using boundary box. More...
 
void clearHighlightBox (const Handle< OpenGl_Context > &theGlCtx)
 Invalidates highlight box and releases graphic resources it uses. More...
 
- Protected Member Functions inherited from Graphic3d_CStructure
 Graphic3d_CStructure (const Handle< Graphic3d_StructureManager > &theManager)
 Create empty structure. More...
 

Protected Attributes

Handle< OpenGl_GroupmyHighlightBox
 
OpenGl_StructuremyInstancedStructure
 
Graphic3d_Mat4 myRenderTrsf
 transformation, actually used for rendering (includes Local Origin shift) More...
 
Standard_Boolean myIsRaytracable
 
Standard_Size myModificationState
 
Standard_Boolean myIsCulled
 A status specifying is structure needs to be rendered after BVH tree traverse. More...
 
Standard_Boolean myIsMirrored
 Used to tell OpenGl to interpret polygons in clockwise order. More...
 
- Protected Attributes inherited from Graphic3d_CStructure
Handle< Graphic3d_GraphicDrivermyGraphicDriver
 
Graphic3d_SequenceOfGroup myGroups
 
Graphic3d_BndBox3d myBndBox
 
Handle< Geom_TransformationmyTrsf
 
Handle< Graphic3d_TransformPersmyTrsfPers
 
Handle< Graphic3d_SequenceOfHClipPlanemyClipPlanes
 
Handle< Graphic3d_PresentationAttributesmyHighlightStyle
 

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...
 
- Data Fields inherited from Graphic3d_CStructure
int Id
 
Graphic3d_ZLayerId myZLayer
 
int Priority
 
int PreviousPriority
 
int ContainsFacet
 
Handle< Graphic3d_ViewAffinityViewAffinity
 view affinity mask More...
 
unsigned IsInfinite: 1
 
unsigned stick: 1
 displaying state - should be set when structure has been added to scene graph (but can be in hidden state) More...
 
unsigned highlight: 1
 
unsigned visible: 1
 visibility flag - can be used to suppress structure while leaving it in the scene graph More...
 
unsigned HLRValidation: 1
 
unsigned IsForHighlight: 1
 
unsigned IsMutable: 1
 
unsigned Is2dText: 1
 

Detailed Description

Implementation of low-level graphic structure.

Constructor & Destructor Documentation

◆ OpenGl_Structure()

OpenGl_Structure::OpenGl_Structure ( const Handle< Graphic3d_StructureManager > &  theManager)

Create empty structure.

◆ ~OpenGl_Structure()

virtual OpenGl_Structure::~OpenGl_Structure ( )
protectedvirtual

Member Function Documentation

◆ Clear() [1/2]

virtual void OpenGl_Structure::Clear ( )
overridevirtual

Clear graphic data.

Implements Graphic3d_CStructure.

◆ Clear() [2/2]

void OpenGl_Structure::Clear ( const Handle< OpenGl_Context > &  theGlCtx)

◆ clearHighlightBox()

void OpenGl_Structure::clearHighlightBox ( const Handle< OpenGl_Context > &  theGlCtx)
protected

Invalidates highlight box and releases graphic resources it uses.

◆ Connect()

virtual void OpenGl_Structure::Connect ( Graphic3d_CStructure theStructure)
overridevirtual

Connect other structure to this one.

Implements Graphic3d_CStructure.

Reimplemented in OpenGl_StructureShadow.

◆ Disconnect()

virtual void OpenGl_Structure::Disconnect ( Graphic3d_CStructure theStructure)
overridevirtual

Disconnect other structure to this one.

Implements Graphic3d_CStructure.

Reimplemented in OpenGl_StructureShadow.

◆ GlDriver()

OpenGl_GraphicDriver* OpenGl_Structure::GlDriver ( ) const
inline

Access graphic driver.

◆ GraphicHighlight()

virtual void OpenGl_Structure::GraphicHighlight ( const Handle< Graphic3d_PresentationAttributes > &  theStyle,
const Handle< Graphic3d_Structure > &  theStruct 
)
overridevirtual

Highlights structure according to the given style and updates corresponding class fields (highlight status and style)

Implements Graphic3d_CStructure.

◆ GraphicUnhighlight()

virtual void OpenGl_Structure::GraphicUnhighlight ( )
overridevirtual

Unighlights structure and updates corresponding class fields (highlight status and style)

Implements Graphic3d_CStructure.

◆ highlightWithBndBox()

void OpenGl_Structure::highlightWithBndBox ( const Handle< Graphic3d_Structure > &  theStruct)
protected

Highlight structure using boundary box.

◆ InstancedStructure()

const OpenGl_Structure* OpenGl_Structure::InstancedStructure ( ) const
inline

Returns instanced OpenGL structure.

◆ IsAlwaysRendered()

Standard_Boolean OpenGl_Structure::IsAlwaysRendered ( ) const
inline

Checks if the structure should be included into BVH tree or not.

◆ IsCulled()

Standard_Boolean OpenGl_Structure::IsCulled ( ) const
inline

Returns Standard_False if the structure hits the current view volume, otherwise returns Standard_True. The default value for all structures before each traverse of BVH tree is Standard_True.

◆ IsRaytracable()

Standard_Boolean OpenGl_Structure::IsRaytracable ( ) const

Is the structure ray-tracable (contains ray-tracable elements)?

◆ MarkAsNotCulled()

void OpenGl_Structure::MarkAsNotCulled ( ) const
inline

Marks structure as overlapping the current view volume one. The method is called during traverse of BVH tree.

◆ ModificationState()

Standard_Size OpenGl_Structure::ModificationState ( ) const
inline

Returns structure modification state (for ray-tracing).

◆ NewGroup()

virtual Handle< Graphic3d_Group > OpenGl_Structure::NewGroup ( const Handle< Graphic3d_Structure > &  theStruct)
overridevirtual

Create new group within this structure.

Implements Graphic3d_CStructure.

◆ OnVisibilityChanged()

virtual void OpenGl_Structure::OnVisibilityChanged ( )
overridevirtual

Setup structure graphic state.

Implements Graphic3d_CStructure.

◆ Release()

virtual void OpenGl_Structure::Release ( const Handle< OpenGl_Context > &  theGlCtx)
virtual

Releases structure resources.

◆ ReleaseGlResources()

void OpenGl_Structure::ReleaseGlResources ( const Handle< OpenGl_Context > &  theGlCtx)

This method releases GL resources without actual elements destruction. As result structure could be correctly destroyed layer without GL context (after last window was closed for example).

Notice however that reusage of this structure after calling this method is incorrect and will lead to broken visualization due to loosed data.

◆ RemoveGroup()

virtual void OpenGl_Structure::RemoveGroup ( const Handle< Graphic3d_Group > &  theGroup)
overridevirtual

Remove group from this structure.

Implements Graphic3d_CStructure.

◆ Render()

virtual void OpenGl_Structure::Render ( const Handle< OpenGl_Workspace > &  theWorkspace) const
virtual

Renders the structure.

◆ renderGeometry()

void OpenGl_Structure::renderGeometry ( const Handle< OpenGl_Workspace > &  theWorkspace,
bool &  theHasClosed 
) const
protected

Renders groups of structure without applying any attributes (i.e. transform, material etc).

Parameters
theWorkspacecurrent workspace
theHasClosedflag will be set to TRUE if structure contains at least one group of closed primitives

◆ ResetModificationState()

void OpenGl_Structure::ResetModificationState ( ) const
inline

Resets structure modification state (for ray-tracing).

◆ SetCulled()

void OpenGl_Structure::SetCulled ( Standard_Boolean  theIsCulled) const
inline

Marks structure as culled/not culled - note that IsAlwaysRendered() is ignored here!

◆ SetTransformation()

virtual void OpenGl_Structure::SetTransformation ( const Handle< Geom_Transformation > &  theTrsf)
overridevirtual

Synchronize structure transformation.

Reimplemented from Graphic3d_CStructure.

◆ SetTransformPersistence()

virtual void OpenGl_Structure::SetTransformPersistence ( const Handle< Graphic3d_TransformPers > &  theTrsfPers)
overridevirtual

Set transformation persistence.

Reimplemented from Graphic3d_CStructure.

◆ SetZLayer()

virtual void OpenGl_Structure::SetZLayer ( const Graphic3d_ZLayerId  theLayerIndex)
overridevirtual

Set z layer ID to display the structure in specified layer.

Reimplemented from Graphic3d_CStructure.

◆ ShadowLink()

virtual Handle< Graphic3d_CStructure > OpenGl_Structure::ShadowLink ( const Handle< Graphic3d_StructureManager > &  theManager) const
overridevirtual

Create shadow link to this structure.

Implements Graphic3d_CStructure.

◆ updateLayerTransformation()

void OpenGl_Structure::updateLayerTransformation ( )

Update render transformation matrix.

◆ UpdateStateIfRaytracable()

void OpenGl_Structure::UpdateStateIfRaytracable ( const Standard_Boolean  toCheck = Standard_True) const
protected

Updates ray-tracable status for structure and its parents.

Field Documentation

◆ myHighlightBox

Handle< OpenGl_Group > OpenGl_Structure::myHighlightBox
protected

◆ myInstancedStructure

OpenGl_Structure* OpenGl_Structure::myInstancedStructure
protected

◆ myIsCulled

Standard_Boolean OpenGl_Structure::myIsCulled
mutableprotected

A status specifying is structure needs to be rendered after BVH tree traverse.

◆ myIsMirrored

Standard_Boolean OpenGl_Structure::myIsMirrored
protected

Used to tell OpenGl to interpret polygons in clockwise order.

◆ myIsRaytracable

Standard_Boolean OpenGl_Structure::myIsRaytracable
mutableprotected

◆ myModificationState

Standard_Size OpenGl_Structure::myModificationState
mutableprotected

◆ myRenderTrsf

Graphic3d_Mat4 OpenGl_Structure::myRenderTrsf
protected

transformation, actually used for rendering (includes Local Origin shift)


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