Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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 ()
 Constructor.
 
virtual ~OpenGl_LayerList ()
 Destructor.
 
int NbPriorities () const
 Method returns the number of available priorities.
 
int NbStructures () const
 Number of displayed structures.
 
int NbImmediateStructures () const
 Return number of structures within immediate layers.
 
void InsertLayerBefore (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerAfter)
 Insert a new layer with id.
 
void InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerBefore)
 Insert a new layer with id.
 
void RemoveLayer (const Graphic3d_ZLayerId theLayerId)
 Remove layer by its id.
 
void AddStructure (const OpenGl_Structure *theStruct, const Graphic3d_ZLayerId theLayerId, const Graphic3d_DisplayPriority thePriority, bool isForChangePriority=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.
 
void RemoveStructure (const OpenGl_Structure *theStructure)
 Remove structure from structure list and return its previous priority.
 
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.
 
void ChangePriority (const OpenGl_Structure *theStructure, const Graphic3d_ZLayerId theLayerId, const Graphic3d_DisplayPriority theNewPriority)
 Changes structure priority within its ZLayer.
 
OpenGl_LayerLayer (const Graphic3d_ZLayerId theLayerId)
 Returns reference to the layer with given ID.
 
const OpenGl_LayerLayer (const Graphic3d_ZLayerId theLayerId) const
 Returns reference to the layer with given ID.
 
void SetLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings)
 Assign new settings to the layer.
 
void UpdateCulling (const occ::handle< OpenGl_Workspace > &theWorkspace, const bool theToDrawImmediate)
 Update culling state - should be called before rendering.
 
void Render (const occ::handle< OpenGl_Workspace > &theWorkspace, const bool theToDrawImmediate, const OpenGl_LayerFilter theFilterMode, const Graphic3d_ZLayerId theLayersToProcess, OpenGl_FrameBuffer *theReadDrawFbo, OpenGl_FrameBuffer *theOitAccumFbo) const
 Render this element.
 
const NCollection_List< occ::handle< Graphic3d_Layer > > & Layers () const
 Returns the set of OpenGL Z-layers.
 
const NCollection_DataMap< Graphic3d_ZLayerId, occ::handle< Graphic3d_Layer > > & LayerIDs () const
 Returns the map of Z-layer IDs to indexes.
 
void InvalidateBVHData (const Graphic3d_ZLayerId theLayerId)
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild.
 
size_t ModificationStateOfRaytracable () const
 Returns structure modification state (for ray-tracing).
 
const occ::handle< BVH_Builder3d > & FrustumCullingBVHBuilder () const
 Returns BVH tree builder for frustum culling.
 
void SetFrustumCullingBVHBuilder (const occ::handle< BVH_Builder3d > &theBuilder)
 Assigns BVH tree builder for frustum culling.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 

Protected Member Functions

void renderTransparent (const occ::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.
 
void renderLayer (const occ::handle< OpenGl_Workspace > &theWorkspace, const OpenGl_GlobalLayerSettings &theDefaultSettings, const Graphic3d_Layer &theLayer) const
 

Protected Attributes

NCollection_List< occ::handle< Graphic3d_Layer > > myLayers
 
NCollection_DataMap< Graphic3d_ZLayerId, occ::handle< Graphic3d_Layer > > myLayerIds
 
occ::handle< BVH_Builder3dmyBVHBuilder
 BVH tree builder for frustum culling.
 
int myNbStructures
 
int myImmediateNbStructures
 number of structures within immediate layers
 
size_t myModifStateOfRaytraceable
 
OpenGl_LayerStack myTransparentToProcess
 Collection of references to layers with transparency gathered during rendering pass.
 

Detailed Description

Class defining the list of layers.

Constructor & Destructor Documentation

◆ OpenGl_LayerList()

OpenGl_LayerList::OpenGl_LayerList ( )

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 Graphic3d_DisplayPriority thePriority,
bool isForChangePriority = 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 Graphic3d_DisplayPriority theNewPriority )

Changes structure priority within its ZLayer.

◆ DumpJson()

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

Dumps the content of me into the stream.

◆ FrustumCullingBVHBuilder()

const occ::handle< BVH_Builder3d > & OpenGl_LayerList::FrustumCullingBVHBuilder ( ) const
inline

Returns BVH tree builder for frustum 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, occ::handle< Graphic3d_Layer > > & OpenGl_LayerList::LayerIDs ( ) const
inline

Returns the map of Z-layer IDs to indexes.

◆ Layers()

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

Returns the set of OpenGL Z-layers.

◆ ModificationStateOfRaytracable()

size_t OpenGl_LayerList::ModificationStateOfRaytracable ( ) const
inline

Returns structure modification state (for ray-tracing).

◆ NbImmediateStructures()

int OpenGl_LayerList::NbImmediateStructures ( ) const
inline

Return number of structures within immediate layers.

◆ NbPriorities()

int OpenGl_LayerList::NbPriorities ( ) const
inline

Method returns the number of available priorities.

◆ NbStructures()

int 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 occ::handle< OpenGl_Workspace > & theWorkspace,
const bool theToDrawImmediate,
const OpenGl_LayerFilter theFilterMode,
const Graphic3d_ZLayerId theLayersToProcess,
OpenGl_FrameBuffer * theReadDrawFbo,
OpenGl_FrameBuffer * theOitAccumFbo ) const

Render this element.

◆ renderLayer()

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

◆ renderTransparent()

void OpenGl_LayerList::renderTransparent ( const occ::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
[in]theWorkspacethe currently used workspace for rendering.
theLayerIter[in/out] the current iterator of transparent layers to process.
[in]theGlobalSettingsthe set of global settings used for rendering.
[in]theReadDrawFbothe framebuffer for reading depth and writing final color.
[in]theOitAccumFbothe framebuffer for accumulating color and coverage for OIT process.

◆ SetFrustumCullingBVHBuilder()

void OpenGl_LayerList::SetFrustumCullingBVHBuilder ( const occ::handle< BVH_Builder3d > & theBuilder)

Assigns BVH tree builder for frustum 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 occ::handle< OpenGl_Workspace > & theWorkspace,
const bool theToDrawImmediate )

Update culling state - should be called before rendering.

Field Documentation

◆ myBVHBuilder

occ::handle<BVH_Builder3d> OpenGl_LayerList::myBVHBuilder
protected

BVH tree builder for frustum culling.

◆ myImmediateNbStructures

int OpenGl_LayerList::myImmediateNbStructures
protected

number of structures within immediate layers

◆ myLayerIds

NCollection_DataMap<Graphic3d_ZLayerId, occ::handle<Graphic3d_Layer> > OpenGl_LayerList::myLayerIds
protected

◆ myLayers

NCollection_List<occ::handle<Graphic3d_Layer> > OpenGl_LayerList::myLayers
protected

◆ myModifStateOfRaytraceable

size_t OpenGl_LayerList::myModifStateOfRaytraceable
mutableprotected

◆ myNbStructures

int 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: