Open CASCADE Technology  7.5.0
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes
OpenGl_LayerList Class Reference

Class defining the list of layers. More...

#include <OpenGl_LayerList.hxx>

Data Structures

class  OpenGl_LayerStack
 Stack of references to existing layers of predefined maximum size. More...
 

Public Member Functions

 OpenGl_LayerList (const Standard_Integer theNbPriorities)
 Constructor. More...
 
virtual ~OpenGl_LayerList ()
 Destructor. More...
 
Standard_Integer NbPriorities () const
 Method returns the number of available priorities. More...
 
Standard_Integer NbStructures () const
 Number of displayed structures. More...
 
Standard_Integer NbImmediateStructures () const
 Return number of structures within immediate layers. More...
 
void InsertLayerBefore (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerAfter)
 Insert a new layer with id. More...
 
void InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerBefore)
 Insert a new layer with id. More...
 
void RemoveLayer (const Graphic3d_ZLayerId theLayerId)
 Remove layer by its id. More...
 
void AddStructure (const OpenGl_Structure *theStruct, const Graphic3d_ZLayerId theLayerId, const Standard_Integer thePriority, Standard_Boolean isForChangePriority=Standard_False)
 Add structure to list with given priority. The structure will be inserted to specified layer. If the layer isn't found, the structure will be put to default bottom-level layer. More...
 
void RemoveStructure (const OpenGl_Structure *theStructure)
 Remove structure from structure list and return its previous priority. More...
 
void ChangeLayer (const OpenGl_Structure *theStructure, const Graphic3d_ZLayerId theOldLayerId, const Graphic3d_ZLayerId theNewLayerId)
 Change structure z layer If the new layer is not presented, the structure will be displayed in default z layer. More...
 
void ChangePriority (const OpenGl_Structure *theStructure, const Graphic3d_ZLayerId theLayerId, const Standard_Integer theNewPriority)
 Changes structure priority within its ZLayer. More...
 
OpenGl_LayerLayer (const Graphic3d_ZLayerId theLayerId)
 Returns reference to the layer with given ID. More...
 
const OpenGl_LayerLayer (const Graphic3d_ZLayerId theLayerId) const
 Returns reference to the layer with given ID. More...
 
void SetLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings)
 Assign new settings to the layer. More...
 
void UpdateCulling (const Handle< OpenGl_Workspace > &theWorkspace, const Standard_Boolean theToDrawImmediate)
 Update culling state - should be called before rendering. More...
 
void Render (const Handle< OpenGl_Workspace > &theWorkspace, const Standard_Boolean theToDrawImmediate, const OpenGl_LayerFilter theLayersToProcess, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo) const
 Render this element. More...
 
const NCollection_List< Handle< Graphic3d_Layer > > & Layers () const
 Returns the set of OpenGL Z-layers. More...
 
const NCollection_DataMap< Graphic3d_ZLayerId, Handle< Graphic3d_Layer > > & LayerIDs () const
 Returns the map of Z-layer IDs to indexes. More...
 
void InvalidateBVHData (const Graphic3d_ZLayerId theLayerId)
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. More...
 
Standard_Size ModificationStateOfRaytracable () const
 Returns structure modification state (for ray-tracing). 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...
 
void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream. More...
 

Protected Member Functions

void renderTransparent (const Handle< OpenGl_Workspace > &theWorkspace, OpenGl_LayerStack::iterator &theLayerIter, const OpenGl_GlobalLayerSettings &theGlobalSettings, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo) const
 Render transparent objects using blending operator. Additional accumulation framebuffer is used for blended order-independent transparency algorithm. It should support floating-point color components and share depth with main reading/drawing framebuffer. More...
 
void renderLayer (const Handle< OpenGl_Workspace > &theWorkspace, const OpenGl_GlobalLayerSettings &theDefaultSettings, const Graphic3d_Layer &theLayer) const
 

Protected Attributes

NCollection_List< Handle< Graphic3d_Layer > > myLayers
 
NCollection_DataMap< Graphic3d_ZLayerId, Handle< Graphic3d_Layer > > myLayerIds
 
Handle< Select3D_BVHBuilder3dmyBVHBuilder
 BVH tree builder for frustom culling. More...
 
Standard_Integer myNbPriorities
 
Standard_Integer myNbStructures
 
Standard_Integer myImmediateNbStructures
 number of structures within immediate layers More...
 
Standard_Size myModifStateOfRaytraceable
 
OpenGl_LayerStack myTransparentToProcess
 Collection of references to layers with transparency gathered during rendering pass. More...
 

Detailed Description

Class defining the list of layers.

Constructor & Destructor Documentation

◆ OpenGl_LayerList()

OpenGl_LayerList::OpenGl_LayerList ( const Standard_Integer  theNbPriorities)

Constructor.

◆ ~OpenGl_LayerList()

virtual OpenGl_LayerList::~OpenGl_LayerList ( )
virtual

Destructor.

Member Function Documentation

◆ AddStructure()

void OpenGl_LayerList::AddStructure ( const OpenGl_Structure theStruct,
const Graphic3d_ZLayerId  theLayerId,
const Standard_Integer  thePriority,
Standard_Boolean  isForChangePriority = Standard_False 
)

Add structure to list with given priority. The structure will be inserted to specified layer. If the layer isn't found, the structure will be put to default bottom-level layer.

◆ ChangeLayer()

void OpenGl_LayerList::ChangeLayer ( const OpenGl_Structure theStructure,
const Graphic3d_ZLayerId  theOldLayerId,
const Graphic3d_ZLayerId  theNewLayerId 
)

Change structure z layer If the new layer is not presented, the structure will be displayed in default z layer.

◆ ChangePriority()

void OpenGl_LayerList::ChangePriority ( const OpenGl_Structure theStructure,
const Graphic3d_ZLayerId  theLayerId,
const Standard_Integer  theNewPriority 
)

Changes structure priority within its ZLayer.

◆ DumpJson()

void OpenGl_LayerList::DumpJson ( Standard_OStream theOStream,
Standard_Integer  theDepth = -1 
) const

Dumps the content of me into the stream.

◆ FrustumCullingBVHBuilder()

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

Returns BVH tree builder for frustom culling.

◆ InsertLayerAfter()

void OpenGl_LayerList::InsertLayerAfter ( const Graphic3d_ZLayerId  theNewLayerId,
const Graphic3d_ZLayerSettings theSettings,
const Graphic3d_ZLayerId  theLayerBefore 
)

Insert a new layer with id.

◆ InsertLayerBefore()

void OpenGl_LayerList::InsertLayerBefore ( const Graphic3d_ZLayerId  theNewLayerId,
const Graphic3d_ZLayerSettings theSettings,
const Graphic3d_ZLayerId  theLayerAfter 
)

Insert a new layer with id.

◆ InvalidateBVHData()

void OpenGl_LayerList::InvalidateBVHData ( const Graphic3d_ZLayerId  theLayerId)

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

◆ Layer() [1/2]

OpenGl_Layer& OpenGl_LayerList::Layer ( const Graphic3d_ZLayerId  theLayerId)
inline

Returns reference to the layer with given ID.

◆ Layer() [2/2]

const OpenGl_Layer& OpenGl_LayerList::Layer ( const Graphic3d_ZLayerId  theLayerId) const
inline

Returns reference to the layer with given ID.

◆ LayerIDs()

const NCollection_DataMap<Graphic3d_ZLayerId, Handle< Graphic3d_Layer > >& OpenGl_LayerList::LayerIDs ( ) const
inline

Returns the map of Z-layer IDs to indexes.

◆ Layers()

const NCollection_List<Handle< Graphic3d_Layer > >& OpenGl_LayerList::Layers ( ) const
inline

Returns the set of OpenGL Z-layers.

◆ ModificationStateOfRaytracable()

Standard_Size OpenGl_LayerList::ModificationStateOfRaytracable ( ) const
inline

Returns structure modification state (for ray-tracing).

◆ NbImmediateStructures()

Standard_Integer OpenGl_LayerList::NbImmediateStructures ( ) const
inline

Return number of structures within immediate layers.

◆ NbPriorities()

Standard_Integer OpenGl_LayerList::NbPriorities ( ) const
inline

Method returns the number of available priorities.

◆ NbStructures()

Standard_Integer OpenGl_LayerList::NbStructures ( ) const
inline

Number of displayed structures.

◆ RemoveLayer()

void OpenGl_LayerList::RemoveLayer ( const Graphic3d_ZLayerId  theLayerId)

Remove layer by its id.

◆ RemoveStructure()

void OpenGl_LayerList::RemoveStructure ( const OpenGl_Structure theStructure)

Remove structure from structure list and return its previous priority.

◆ Render()

void OpenGl_LayerList::Render ( const Handle< OpenGl_Workspace > &  theWorkspace,
const Standard_Boolean  theToDrawImmediate,
const OpenGl_LayerFilter  theLayersToProcess,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo 
) const

Render this element.

◆ renderLayer()

void OpenGl_LayerList::renderLayer ( const Handle< OpenGl_Workspace > &  theWorkspace,
const OpenGl_GlobalLayerSettings &  theDefaultSettings,
const Graphic3d_Layer theLayer 
) const
protected

◆ renderTransparent()

void OpenGl_LayerList::renderTransparent ( const Handle< OpenGl_Workspace > &  theWorkspace,
OpenGl_LayerStack::iterator theLayerIter,
const OpenGl_GlobalLayerSettings &  theGlobalSettings,
OpenGl_FrameBuffer theReadDrawFbo,
OpenGl_FrameBuffer theOitAccumFbo 
) const
protected

Render transparent objects using blending operator. Additional accumulation framebuffer is used for blended order-independent transparency algorithm. It should support floating-point color components and share depth with main reading/drawing framebuffer.

Parameters
theWorkspace[in] the currently used workspace for rendering.
theLayerIter[in/out] the current iterator of transparent layers to process.
theGlobalSettings[in] the set of global settings used for rendering.
theReadDrawFbo[in] the framebuffer for reading depth and writing final color.
theOitAccumFbo[in] the framebuffer for accumulating color and coverage for OIT process.

◆ SetFrustumCullingBVHBuilder()

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

Assigns BVH tree builder for frustom culling.

◆ SetLayerSettings()

void OpenGl_LayerList::SetLayerSettings ( const Graphic3d_ZLayerId  theLayerId,
const Graphic3d_ZLayerSettings theSettings 
)

Assign new settings to the layer.

◆ UpdateCulling()

void OpenGl_LayerList::UpdateCulling ( const Handle< OpenGl_Workspace > &  theWorkspace,
const Standard_Boolean  theToDrawImmediate 
)

Update culling state - should be called before rendering.

Field Documentation

◆ myBVHBuilder

Handle< Select3D_BVHBuilder3d > OpenGl_LayerList::myBVHBuilder
protected

BVH tree builder for frustom culling.

◆ myImmediateNbStructures

Standard_Integer OpenGl_LayerList::myImmediateNbStructures
protected

number of structures within immediate layers

◆ myLayerIds

NCollection_DataMap<Graphic3d_ZLayerId, Handle< Graphic3d_Layer > > OpenGl_LayerList::myLayerIds
protected

◆ myLayers

NCollection_List<Handle< Graphic3d_Layer > > OpenGl_LayerList::myLayers
protected

◆ myModifStateOfRaytraceable

Standard_Size OpenGl_LayerList::myModifStateOfRaytraceable
mutableprotected

◆ myNbPriorities

Standard_Integer OpenGl_LayerList::myNbPriorities
protected

◆ myNbStructures

Standard_Integer OpenGl_LayerList::myNbStructures
protected

◆ myTransparentToProcess

OpenGl_LayerStack OpenGl_LayerList::myTransparentToProcess
mutableprotected

Collection of references to layers with transparency gathered during rendering pass.


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