OSG::RenderTraversalAction Class Reference

RenderTraversalAction class.

#include <OSGRenderTraversalAction.h>

Inheritance diagram for OSG::RenderTraversalAction:

OSG::RenderTraversalActionBase OSG::DataSlotMixin< MixinHead< RenderTravDataSlotDesc > > OSG::MixinHead< RenderTravDataSlotDesc > OSG::Action OSG::ActionBase List of all members.

Public Types

typedef std::vector< RenderPartition * > RenderPartitionStore
typedef std::stack< RenderPartition * > RenderPartitionStack
typedef std::stack< Int32 > RenderPartitionIdxStack
typedef std::stack< bool > RenderPartitionGrpStack
typedef boost::function< ResultE(NodeCorePtrConstArg, Action *)> Functor
typedef ActionBase::ResultE(NodeCore::*) Callback (Action *)
enum  ResultE { Continue, Skip, Quit }

Public Member Functions

virtual ~RenderTraversalAction (void)
ResultE recurceNoNodeCallbacks (NodePtrConstArg node)
virtual Action::ResultE start (void)
virtual Action::ResultE stop (ResultE res)
void dropFunctor (Material::DrawFunctor &func, State *pState, UInt32 uiSortKey)
void pushState (void)
void popState (void)
void addOverride (UInt32 uiSlot, StateChunk *pChunk)
Int32 allocateLightIndex (void)
void releaseLightIndex (void)
void pushMatrix (const Matrix &matrix)
void popMatrix (void)
const MatrixtopMatrix (void)
virtual bool isVisible (Node *node)
bool pushVisibility (void)
void popVisibility (void)
virtual bool getFrustumCulling (void) const
virtual void setFrustumCulling (bool val=true)
virtual const FrustumVolumegetFrustum (void) const
virtual void setFrustum (FrustumVolume &frust)
void overrideMaterial (Material *pMaterial, NodePtrConstArg pNode)
MaterialgetMaterial (void)
void setKeyGen (UInt32 uiKeyGen)
void pushPartition (UInt32 uiCopyOnPush=0x0000, RenderPartition::Mode eMode=RenderPartition::StateSorting)
void popPartition (void)
void beginPartitionGroup (void)
void endPartitionGroup (void)
Int32 getActivePartitionIdx (void)
Int32 getLastPartitionIdx (void)
void readdPartitionByIndex (UInt32 uiPartIdx)
void dumpPartitionList (void)
void disableDefaultPartition (void)
RenderPartitiongetActivePartition (void)
void addPassMask (BitVector bvMask)
void subPassMask (BitVector bvMask)
BitVector getPassMask (void)
void setDoCullOnly (bool val)
bool getDoCullOnly (void)
void setNumBuffers (UInt32 n)
UInt32 getNumBuffers (void)
void setCurrentBuffer (UInt32 b)
UInt32 getCurrentBuffer (void)
void drawBuffer (UInt32 buf)
void setUseGLFinish (bool bVal)
bool getUseGLFinish (void)
void setOcclusionCulling (const bool bVal)
bool getOcclusionCulling (void)
void setOcclusionCullingDebug (const bool bVal)
bool getOcclusionCullingDebug (void)
void setOcclusionDebugMasks (const UInt32 tested, const UInt32 culled, const UInt32 visible)
UInt32 getOcclusionTestedDebugMask (void)
UInt32 getOcclusionCulledDebugMask (void)
UInt32 getOcclusionVisibleDebugMask (void)
void setOcclusionCullingMinimumFeatureSize (const UInt32 pixels)
UInt32 getOcclusionCullingMinimumFeatureSize (void)
void setOcclusionCullingVisibilityThreshold (const UInt32 pixels)
UInt32 getOcclusionCullingVisibilityThreshold (void)
void setOcclusionCullingCoveredThreshold (const Real32 percent)
Real32 getOcclusionCullingCoveredThreshold (void)
void setOcclusionCullingQueryBufferSize (const UInt32 size)
UInt32 getOcclusionCullingQueryBufferSize (void)
void setOcclusionCullingMinimumTriangleCount (const UInt32 count)
UInt32 getOcclusionCullingMinimumTriangleCount (void)
void setScreenLODCoverageThreshold (const Real32 percent)
Real32 getScreenLODCoverageThreshold (void)
void setScreenLODNumLevels (const UInt32 levels)
UInt32 getScreenLODNumLevels (void)
void setScreenLODDegradationFactor (const Real32 percent)
Real32 getScreenLODDegradationFactor (void)
ValuePtr getData (Int32 iSlotId)
void setDataX (FieldBundleP pBundle, Int32 iSlotId)
void registerEnterFunction (const FieldContainerType &type, const Functor &func)
void registerLeaveFunction (const FieldContainerType &type, const Functor &func)
virtual ResultE apply (std::vector< NodePtr >::iterator begin, std::vector< NodePtr >::iterator end)
virtual ResultE apply (NodePtrConstArg node)
NodePtr getActNode (void)
void setActNode (NodePtrConstArg node)
UInt32 getNNodes (void) const
NodePtr getNode (int index)
void addNode (NodePtrConstArg node)
void useNodeList (void)
UInt32 getTravMask (void) const
void setTravMask (UInt32 val)
bool operator< (const Action &other)
 assignment
bool operator== (const Action &other)
bool operator!= (const Action &other)
 unequal
Rendering Environment


ViewportgetViewport (void) const
void setViewport (Viewport *pViewport)
CameragetCamera (void) const
void setCamera (Camera *pCamera)
BackgroundgetBackground (void) const
void setBackground (Background *pBackground)
WindowgetWindow (void) const
void setWindow (Window *pWindow)
StatCollectorgetStatCollector (void) const
void setStatCollector (StatCollector *pStat)
Culling


virtual bool getVolumeDrawing (void) const
virtual void setVolumeDrawing (bool val=false)
bool getAutoFrustum (void) const
void setAutoFrustum (bool val=true)
Lights


StageValidatorgetStageValidator (void)

Static Public Member Functions

static RenderTraversalActioncreate (void)
 create a new action
static void setPrototype (RenderTraversalAction *pPrototype)
static RenderTraversalActiongetPrototype (void)
static void registerEnterDefault (const FieldContainerType &type, const Action::Functor &func)
static void registerLeaveDefault (const FieldContainerType &type, const Action::Functor &func)
static void setPrototype (Action *proto)

Static Public Attributes

static StatElemDesc< StatTimeElemstatDrawTime
static StatElemDesc< StatIntElemstatNStates
static StatElemDesc< StatIntElemstatNMatrices
static StatElemDesc< StatIntElemstatNGeometries
static StatElemDesc< StatIntElemstatNTriangles
static StatElemDesc< StatIntElemstatNShaders
static StatElemDesc< StatIntElemstatNShaderParams
static StatElemDesc< StatTimeElemstatTravTime

Protected Types

typedef RenderTraversalActionBase Inherited
typedef Inherited::Desc Desc
typedef Desc::DataStore DataStore

Protected Member Functions

 RenderTraversalAction (void)
 RenderTraversalAction (const RenderTraversalAction &source)
virtual std::vector< Functor > * getDefaultEnterFunctors (void)
virtual std::vector< Functor > * getDefaultLeaveFunctors (void)
ResultE callEnter (NodeCorePtrConstArg core)
ResultE callLeave (NodeCorePtrConstArg core)
ResultE recurse (NodePtrConstArg node)
ResultE callNewList (void)

Static Protected Member Functions

static bool terminateEnter (void)
static bool terminateLeave (void)
static ResultE _defaultEnterFunction (NodeCorePtrConstArg node, Action *action)
static ResultE _defaultLeaveFunction (NodeCorePtrConstArg node, Action *action)

Protected Attributes

bool _doCullOnly
UInt32 _numBuffers
UInt32 _currentBuffer
UInt32 _uiKeyGen
std::vector< RenderPartitionPool * > _pPartitionPools
std::vector< RenderTreeNodePool * > _pNodePools
std::vector< StateOverridePool * > _pStatePools
std::vector< TreeBuilderPool * > _pTreeBuilderPools
std::vector< RenderPartitionStore_vRenderPartitions
Int32 _iActivePartitionIdx
bool _bInPartitionGroup
RenderPartition_pActivePartition
RenderPartitionStack _sRenderPartitionStack
RenderPartitionIdxStack _sRenderPartitionIdxStack
RenderPartitionGrpStack _sRenderPartitionGrpStack
BitVector _bvPassMask
bool _bUseGLFinish
bool _occlusionCulling
bool _occlusionCullingDebug
UInt32 _occDMTested
UInt32 _occDMCulled
UInt32 _occDMVisible
UInt32 _occMinFeatureSize
UInt32 _occVisibilityThreshold
Real32 _occCoveredThreshold
UInt32 _occQueryBufferSize
UInt32 _occMinimumTriangleCount
Real32 _scrlodCoverageThreshold
UInt32 _scrlodNumLODsToUse
Real32 _scrlodDegradationFactor
Camera_pCamera
Background_pBackground
Window_pWindow
Viewport_pViewport
StatCollector_pStatistics
StageValidator_pStageValidator
bool _bFrustumCulling
bool _bVolumeDrawing
bool _bAutoFrustum
FrustumVolume _oFrustum
DataStore _mfData
std::vector< Functor_enterFunctors
std::vector< Functor_leaveFunctors
NodePtr _actNode
std::vector< NodePtr > * _actList
bool _useNewList
std::vector< NodePtr > _newList
UInt32 _travMask

Static Protected Attributes

static RenderTraversalAction_pPrototype
static std::vector< Functor > * _vDefaultEnterFunctors
static std::vector< Functor > * _vDefaultLeaveFunctors

Private Member Functions

void operator= (const RenderTraversalAction &source)
 prohibit default function (move to 'public' if needed)

Detailed Description

Definition at line 76 of file OSGRenderTraversalAction.h.


Member Typedef Documentation

Definition at line 102 of file OSGRenderTraversalAction.h.

Definition at line 103 of file OSGRenderTraversalAction.h.

Definition at line 104 of file OSGRenderTraversalAction.h.

Definition at line 105 of file OSGRenderTraversalAction.h.

Reimplemented from OSG::RenderTraversalActionBase.

Definition at line 304 of file OSGRenderTraversalAction.h.

Reimplemented from OSG::MixinHead< RenderTravDataSlotDesc >.

Definition at line 139 of file OSGDataSlotMixin.h.

Definition at line 141 of file OSGDataSlotMixin.h.

typedef boost::function<ResultE (NodeCorePtrConstArg, Action *)> OSG::Action::Functor [inherited]

Definition at line 101 of file OSGAction.h.

typedef ActionBase::ResultE(NodeCore::*) OSG::Action::Callback(Action *) [inherited]

Definition at line 103 of file OSGAction.h.


Member Enumeration Documentation

enum OSG::ActionBase::ResultE [inherited]

Enumerator:
Continue 
Skip 
Quit 

Definition at line 71 of file OSGActionBase.h.

00072     {
00073         Continue,   // continue with my children
00074         Skip,       // skip my children
00075                     // really needed? Cancel, 
00076                     // skip my brothers, go one step up
00077         Quit        // forget it, you're done
00078     };


Constructor & Destructor Documentation

virtual OSG::RenderTraversalAction::~RenderTraversalAction ( void   )  [virtual]

OSG::RenderTraversalAction::RenderTraversalAction ( void   )  [protected]

OSG::RenderTraversalAction::RenderTraversalAction ( const RenderTraversalAction source  )  [protected]


Member Function Documentation

static RenderTraversalAction* OSG::RenderTraversalAction::create ( void   )  [static]

Reimplemented from OSG::Action.

Referenced by OSG::SimpleSceneManager::initialize().

static void OSG::RenderTraversalAction::setPrototype ( RenderTraversalAction pPrototype  )  [static]

static RenderTraversalAction* OSG::RenderTraversalAction::getPrototype ( void   )  [static]

Reimplemented from OSG::Action.

static void OSG::RenderTraversalAction::registerEnterDefault ( const FieldContainerType type,
const Action::Functor func 
) [static]

Reimplemented from OSG::Action.

Referenced by OSG::ScreenLOD::initMethod().

static void OSG::RenderTraversalAction::registerLeaveDefault ( const FieldContainerType type,
const Action::Functor func 
) [static]

Reimplemented from OSG::Action.

ResultE OSG::RenderTraversalAction::recurceNoNodeCallbacks ( NodePtrConstArg  node  ) 

virtual Action::ResultE OSG::RenderTraversalAction::start ( void   )  [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

virtual Action::ResultE OSG::RenderTraversalAction::stop ( ResultE  res  )  [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

void OSG::RenderTraversalAction::dropFunctor ( Material::DrawFunctor func,
State pState,
UInt32  uiSortKey 
)

void OSG::RenderTraversalAction::pushState ( void   ) 

void OSG::RenderTraversalAction::popState ( void   ) 

void OSG::RenderTraversalAction::addOverride ( UInt32  uiSlot,
StateChunk pChunk 
)

Int32 OSG::RenderTraversalAction::allocateLightIndex ( void   ) 

void OSG::RenderTraversalAction::releaseLightIndex ( void   ) 

void OSG::RenderTraversalAction::pushMatrix ( const Matrix matrix  ) 

void OSG::RenderTraversalAction::popMatrix ( void   ) 

const Matrix& OSG::RenderTraversalAction::topMatrix ( void   ) 

virtual bool OSG::RenderTraversalAction::isVisible ( Node node  )  [virtual]

bool OSG::RenderTraversalAction::pushVisibility ( void   ) 

void OSG::RenderTraversalAction::popVisibility ( void   ) 

virtual bool OSG::RenderTraversalAction::getFrustumCulling ( void   )  const [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

virtual void OSG::RenderTraversalAction::setFrustumCulling ( bool  val = true  )  [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

virtual const FrustumVolume& OSG::RenderTraversalAction::getFrustum ( void   )  const [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

virtual void OSG::RenderTraversalAction::setFrustum ( FrustumVolume frust  )  [virtual]

Reimplemented from OSG::RenderTraversalActionBase.

void OSG::RenderTraversalAction::overrideMaterial ( Material pMaterial,
NodePtrConstArg  pNode 
)

Material* OSG::RenderTraversalAction::getMaterial ( void   ) 

void OSG::RenderTraversalAction::setKeyGen ( UInt32  uiKeyGen  )  [inline]

Definition at line 89 of file OSGRenderTraversalAction.inl.

References _uiKeyGen.

00090 {
00091     _uiKeyGen = uiKeyGen;
00092 }

void OSG::RenderTraversalAction::pushPartition ( UInt32  uiCopyOnPush = 0x0000,
RenderPartition::Mode  eMode = RenderPartition::StateSorting 
) [virtual]

void OSG::RenderTraversalAction::popPartition ( void   )  [virtual]

void OSG::RenderTraversalAction::beginPartitionGroup ( void   )  [inline, virtual]

void OSG::RenderTraversalAction::endPartitionGroup ( void   )  [inline, virtual]

Int32 OSG::RenderTraversalAction::getActivePartitionIdx ( void   )  [inline, virtual]

Implements OSG::RenderTraversalActionBase.

Definition at line 147 of file OSGRenderTraversalAction.inl.

References _iActivePartitionIdx.

00148 {
00149     return _iActivePartitionIdx;
00150 }

Int32 OSG::RenderTraversalAction::getLastPartitionIdx ( void   )  [inline, virtual]

Implements OSG::RenderTraversalActionBase.

Definition at line 154 of file OSGRenderTraversalAction.inl.

References _currentBuffer, and _vRenderPartitions.

00155 {
00156     return _vRenderPartitions[_currentBuffer].size() - 1;
00157 }

void OSG::RenderTraversalAction::readdPartitionByIndex ( UInt32  uiPartIdx  )  [virtual]

void OSG::RenderTraversalAction::dumpPartitionList ( void   ) 

void OSG::RenderTraversalAction::disableDefaultPartition ( void   )  [inline]

Definition at line 160 of file OSGRenderTraversalAction.inl.

References _currentBuffer, and _vRenderPartitions.

00161 {
00162     _vRenderPartitions[_currentBuffer][0]->disable();
00163 }

RenderPartition* OSG::RenderTraversalAction::getActivePartition ( void   ) 

void OSG::RenderTraversalAction::addPassMask ( BitVector  bvMask  )  [inline]

Definition at line 95 of file OSGRenderTraversalAction.inl.

References _bvPassMask.

Referenced by OSG::SimpleShadowMapEngine::runOnEnter().

00096 {
00097     _bvPassMask |= bvMask;
00098 }

void OSG::RenderTraversalAction::subPassMask ( BitVector  bvMask  )  [inline]

Definition at line 101 of file OSGRenderTraversalAction.inl.

References _bvPassMask.

Referenced by OSG::SimpleShadowMapEngine::runOnEnter().

00102 {
00103     _bvPassMask &= ~bvMask;
00104 }

BitVector OSG::RenderTraversalAction::getPassMask ( void   )  [inline]

Definition at line 107 of file OSGRenderTraversalAction.inl.

References _bvPassMask.

Referenced by OSG::SimpleShadowMapEngine::runOnEnter().

00108 {
00109     return _bvPassMask;
00110 }

void OSG::RenderTraversalAction::setDoCullOnly ( bool  val  ) 

bool OSG::RenderTraversalAction::getDoCullOnly ( void   ) 

void OSG::RenderTraversalAction::setNumBuffers ( UInt32  n  ) 

UInt32 OSG::RenderTraversalAction::getNumBuffers ( void   ) 

void OSG::RenderTraversalAction::setCurrentBuffer ( UInt32  b  ) 

UInt32 OSG::RenderTraversalAction::getCurrentBuffer ( void   ) 

void OSG::RenderTraversalAction::drawBuffer ( UInt32  buf  ) 

void OSG::RenderTraversalAction::setUseGLFinish ( bool  bVal  )  [inline]

Definition at line 113 of file OSGRenderTraversalAction.inl.

References _bUseGLFinish.

00114 {
00115     _bUseGLFinish = bVal;
00116 }

bool OSG::RenderTraversalAction::getUseGLFinish ( void   )  [inline]

Definition at line 119 of file OSGRenderTraversalAction.inl.

References _bUseGLFinish.