Open CASCADE Technology  7.3.0
Public Member Functions | Protected Member Functions

OpenGl_Layer Class Reference

Presentations list sorted within priorities. More...

#include <OpenGl_Layer.hxx>

Inheritance diagram for OpenGl_Layer:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Layer (const Standard_Integer theNbPriorities, const Handle< Select3D_BVHBuilder3d > &theBuilder)
 Initializes associated priority list and layer properties. More...
 
virtual ~OpenGl_Layer ()
 Destructor. More...
 
const Handle< Select3D_BVHBuilder3d > & FrustumCullingBVHBuilder () const
 Returns BVH tree builder for frustom culling. More...
 
void SetFrustumCullingBVHBuilder (const Handle< Select3D_BVHBuilder3d > &theBuilder)
 Assigns BVH tree builder for frustom culling. More...
 
Standard_Boolean IsImmediate () const
 Return true if layer was marked with immediate flag. More...
 
const Graphic3d_ZLayerSettingsLayerSettings () const
 Returns settings of the layer object. More...
 
void SetLayerSettings (const Graphic3d_ZLayerSettings &theSettings)
 Sets settings of the layer object. More...
 
void Add (const OpenGl_Structure *theStruct, const Standard_Integer thePriority, Standard_Boolean isForChangePriority=Standard_False)
 
bool Remove (const OpenGl_Structure *theStruct, Standard_Integer &thePriority, Standard_Boolean isForChangePriority=Standard_False)
 Remove structure and returns its priority, if the structure is not found, method returns negative value. More...
 
Standard_Integer NbStructures () const
 
Standard_Integer NbStructuresNotCulled () const
 Number of NOT culled structures in the layer. More...
 
Standard_Integer NbPriorities () const
 Returns the number of available priority levels. More...
 
Standard_Boolean Append (const OpenGl_Layer &theOther)
 Append layer of acceptable type (with similar number of priorities or less). Returns Standard_False if the list can not be accepted. More...
 
const OpenGl_ArrayOfIndexedMapOfStructureArrayOfStructures () const
 Returns array of OpenGL structures. More...
 
void InvalidateBVHData ()
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. More...
 
void InvalidateBoundingBox () const
 Marks cached bounding box as obsolete. More...
 
Bnd_Box BoundingBox (const Standard_Integer theViewId, const Handle< Graphic3d_Camera > &theCamera, const Standard_Integer theWindowWidth, const Standard_Integer theWindowHeight, const Standard_Boolean theToIncludeAuxiliary) const
 Returns layer bounding box. More...
 
Standard_Real considerZoomPersistenceObjects (const Standard_Integer theViewId, const Handle< Graphic3d_Camera > &theCamera, const Standard_Integer theWindowWidth, const Standard_Integer theWindowHeight) const
 Returns zoom-scale factor. More...
 
void UpdateCulling (const Standard_Integer theViewId, const OpenGl_BVHTreeSelector &theSelector, const Standard_Boolean theToTraverse)
 Update culling state - should be called before rendering. Traverses through BVH tree to determine which structures are in view volume. More...
 
bool IsCulled () const
 Returns TRUE if layer is empty or has been discarded entirely by culling test. More...
 
void Render (const Handle< OpenGl_Workspace > &theWorkspace, const OpenGl_GlobalLayerSettings &theDefaultSettings) const
 
Standard_Integer NbOfTransformPersistenceObjects () const
 Returns number of transform persistence objects. More...
 
const OpenGl_BVHClipPrimitiveSetCullableStructuresBVH () const
 Returns set of OpenGl_Structures structures for building BVH tree. More...
 
const OpenGl_BVHClipPrimitiveTrsfPersSetCullableTrsfPersStructuresBVH () const
 Returns set of transform persistent OpenGl_Structures for building BVH tree. More...
 
const NCollection_IndexedMap< const OpenGl_Structure * > & NonCullableStructures () const
 Returns indexed map of always rendered structures. 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

void updateBVH () const
 Updates BVH trees if their state has been invalidated. More...
 
void renderAll (const Handle< OpenGl_Workspace > &theWorkspace) const
 Iterates through the hierarchical list of existing structures and renders them all. 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

Presentations list sorted within priorities.

Constructor & Destructor Documentation

◆ OpenGl_Layer()

OpenGl_Layer::OpenGl_Layer ( const Standard_Integer  theNbPriorities,
const Handle< Select3D_BVHBuilder3d > &  theBuilder 
)

Initializes associated priority list and layer properties.

◆ ~OpenGl_Layer()

virtual OpenGl_Layer::~OpenGl_Layer ( )
virtual

Destructor.

Member Function Documentation

◆ Add()

void OpenGl_Layer::Add ( const OpenGl_Structure theStruct,
const Standard_Integer  thePriority,
Standard_Boolean  isForChangePriority = Standard_False 
)

◆ Append()

Standard_Boolean OpenGl_Layer::Append ( const OpenGl_Layer theOther)

Append layer of acceptable type (with similar number of priorities or less). Returns Standard_False if the list can not be accepted.

◆ ArrayOfStructures()

const OpenGl_ArrayOfIndexedMapOfStructure& OpenGl_Layer::ArrayOfStructures ( ) const
inline

Returns array of OpenGL structures.

◆ BoundingBox()

Bnd_Box OpenGl_Layer::BoundingBox ( const Standard_Integer  theViewId,
const Handle< Graphic3d_Camera > &  theCamera,
const Standard_Integer  theWindowWidth,
const Standard_Integer  theWindowHeight,
const Standard_Boolean  theToIncludeAuxiliary 
) const

Returns layer bounding box.

Parameters
theViewIdview index to consider View Affinity in structure
theCameracamera definition
theWindowWidthviewport width (for applying transformation-persistence)
theWindowHeightviewport height (for applying transformation-persistence)
theToIncludeAuxiliaryconsider also auxiliary presentations (with infinite flag or with trihedron transformation persistence)
Returns
computed bounding box

◆ considerZoomPersistenceObjects()

Standard_Real OpenGl_Layer::considerZoomPersistenceObjects ( const Standard_Integer  theViewId,
const Handle< Graphic3d_Camera > &  theCamera,
const Standard_Integer  theWindowWidth,
const Standard_Integer  theWindowHeight 
) const

Returns zoom-scale factor.

◆ CullableStructuresBVH()

const OpenGl_BVHClipPrimitiveSet& OpenGl_Layer::CullableStructuresBVH ( ) const
inline

Returns set of OpenGl_Structures structures for building BVH tree.

◆ CullableTrsfPersStructuresBVH()

const OpenGl_BVHClipPrimitiveTrsfPersSet& OpenGl_Layer::CullableTrsfPersStructuresBVH ( ) const
inline

Returns set of transform persistent OpenGl_Structures for building BVH tree.

◆ FrustumCullingBVHBuilder()

const Handle< Select3D_BVHBuilder3d >& OpenGl_Layer::FrustumCullingBVHBuilder ( ) const
inline

Returns BVH tree builder for frustom culling.

◆ InvalidateBoundingBox()

void OpenGl_Layer::InvalidateBoundingBox ( ) const
inline

Marks cached bounding box as obsolete.

◆ InvalidateBVHData()

void OpenGl_Layer::InvalidateBVHData ( )

Marks BVH tree for given priority list as dirty and marks primitive set for rebuild.

◆ IsCulled()

bool OpenGl_Layer::IsCulled ( ) const
inline

Returns TRUE if layer is empty or has been discarded entirely by culling test.

◆ IsImmediate()

Standard_Boolean OpenGl_Layer::IsImmediate ( ) const
inline

Return true if layer was marked with immediate flag.

◆ LayerSettings()

const Graphic3d_ZLayerSettings& OpenGl_Layer::LayerSettings ( ) const
inline

Returns settings of the layer object.

◆ NbOfTransformPersistenceObjects()

Standard_Integer OpenGl_Layer::NbOfTransformPersistenceObjects ( ) const
inline

Returns number of transform persistence objects.

◆ NbPriorities()

Standard_Integer OpenGl_Layer::NbPriorities ( ) const
inline

Returns the number of available priority levels.

◆ NbStructures()

Standard_Integer OpenGl_Layer::NbStructures ( ) const
inline
Returns
the number of structures

◆ NbStructuresNotCulled()

Standard_Integer OpenGl_Layer::NbStructuresNotCulled ( ) const
inline

Number of NOT culled structures in the layer.

◆ NonCullableStructures()

const NCollection_IndexedMap<const OpenGl_Structure*>& OpenGl_Layer::NonCullableStructures ( ) const
inline

Returns indexed map of always rendered structures.

◆ Remove()

bool OpenGl_Layer::Remove ( const OpenGl_Structure theStruct,
Standard_Integer thePriority,
Standard_Boolean  isForChangePriority = Standard_False 
)

Remove structure and returns its priority, if the structure is not found, method returns negative value.

◆ Render()

void OpenGl_Layer::Render ( const Handle< OpenGl_Workspace > &  theWorkspace,
const OpenGl_GlobalLayerSettings theDefaultSettings 
) const

◆ renderAll()

void OpenGl_Layer::renderAll ( const Handle< OpenGl_Workspace > &  theWorkspace) const
protected

Iterates through the hierarchical list of existing structures and renders them all.

◆ SetFrustumCullingBVHBuilder()

void OpenGl_Layer::SetFrustumCullingBVHBuilder ( const Handle< Select3D_BVHBuilder3d > &  theBuilder)
inline

Assigns BVH tree builder for frustom culling.

◆ SetLayerSettings()

void OpenGl_Layer::SetLayerSettings ( const Graphic3d_ZLayerSettings theSettings)

Sets settings of the layer object.

◆ updateBVH()

void OpenGl_Layer::updateBVH ( ) const
protected

Updates BVH trees if their state has been invalidated.

◆ UpdateCulling()

void OpenGl_Layer::UpdateCulling ( const Standard_Integer  theViewId,
const OpenGl_BVHTreeSelector theSelector,
const Standard_Boolean  theToTraverse 
)

Update culling state - should be called before rendering. Traverses through BVH tree to determine which structures are in view volume.


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