osg::DrawTreeNode Class Reference
[Rendering Backend]

#include <OSGDrawTreeNode.h>

Inheritance diagram for osg::DrawTreeNode:

osg::MemoryObject

List of all members.

Public Member Functions

Access


DrawTreeNodegetFirstChild (void)
DrawTreeNodegetLastChild (void)
void addChild (DrawTreeNode *pChild)
void insertFirstChild (DrawTreeNode *pChild)
void insertChildAfter (DrawTreeNode *pCurrent, DrawTreeNode *pChild)
DrawTreeNodegetBrother (void)
void setBrother (DrawTreeNode *pBrother)
void setGeometry (Geometry *pGeo)
GeometrygetGeometry (void)
void setFunctor (Material::DrawFunctor &func)
Material::DrawFunctorgetFunctor (void)
bool hasFunctor (void)
void setState (State *pState)
StategetState (void)
void setNode (NodePtr pNode)
NodePtr getNode (void)
void setMatrixStore (const RenderAction::MatrixStore &oMatrixStore)
RenderAction::MatrixStoregetMatrixStore (void)
void setScalar (Real32 rScalar)
Real32 getScalar (void)
void setLightsState (UInt32 state)
UInt32 getLightsState (void)
void setClipPlanesState (UInt32 state)
UInt32 getClipPlanesState (void)
void setMultiPass (void)
void setLastMultiPass (void)
bool isMultiPass (void)
bool isLastMultiPass (void)
void setNoStateSorting (void)
bool isNoStateSorting (void)
void reset (void)
Reference Counting


void addRef (void)
void subRef (void)
Int32 getRefCount (void)

Static Public Attributes

Statistic


static Int32 _iCreateCount = 0
static Int32 _iDeleteCount = 0
Flags


static const UInt8 MultiPass = 1
static const UInt8 LastMultiPass = 2
static const UInt8 NoStateSorting = 4

Protected Types

typedef MemoryObject Inherited

Protected Member Functions

Constructors


 DrawTreeNode (void)
Destructor


virtual ~DrawTreeNode (void)

Protected Attributes

Member


DrawTreeNode_pFirstChild
DrawTreeNode_pLastChild
DrawTreeNode_pBrother
NodePtr _pNode
State_pState
Geometry_pGeo
Material::DrawFunctor _functor
bool _hasFunctor
RenderAction::MatrixStore _oMatrixStore
Real32 _rScalarVal
UInt32 _lightsState
UInt32 _clipPlanesState
Int8 _flags

Private Member Functions

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

Friends

class DrawTreeNodeFactory


Detailed Description

Definition at line 61 of file OSGDrawTreeNode.h.


Member Typedef Documentation

Definition at line 137 of file OSGDrawTreeNode.h.


Constructor & Destructor Documentation

DrawTreeNode::DrawTreeNode ( void   )  [protected]

Definition at line 73 of file OSGDrawTreeNode.cpp.

References _oMatrixStore, and osg::RenderAction::MatrixStore::first.

00073                                :
00074      Inherited       (),
00075     _pFirstChild     (NULL),
00076     _pLastChild      (NULL),
00077     _pBrother        (NULL),
00078     _pState          (NULL),
00079     _pGeo            (NULL),
00080     _functor         (),
00081     _hasFunctor      (false),
00082     _oMatrixStore    (),
00083     _rScalarVal      (0.f),
00084     _lightsState     (0),
00085     _clipPlanesState (0),
00086     _flags           (0)
00087 {
00088     _oMatrixStore.first = 0;
00089 }

DrawTreeNode::~DrawTreeNode ( void   )  [protected, virtual]

Definition at line 94 of file OSGDrawTreeNode.cpp.

00095 {
00096 }

osg::DrawTreeNode::DrawTreeNode ( const DrawTreeNode source  )  [private]


Member Function Documentation

DrawTreeNode * osg::DrawTreeNode::getFirstChild ( void   )  [inline]

Definition at line 46 of file OSGDrawTreeNode.inl.

References _pFirstChild.

Referenced by osg::RenderAction::draw(), osg::RenderAction::drawMultiFrameOcclusionBB(), and osg::RenderAction::dump().

00047 {
00048     return _pFirstChild;
00049 }

DrawTreeNode * osg::DrawTreeNode::getLastChild ( void   )  [inline]

Definition at line 52 of file OSGDrawTreeNode.inl.

References _pLastChild.

00053 {
00054     return _pLastChild;
00055 }

void osg::DrawTreeNode::addChild ( DrawTreeNode pChild  )  [inline]

Definition at line 58 of file OSGDrawTreeNode.inl.

References _pFirstChild, _pLastChild, and setBrother().

Referenced by osg::RenderAction::dropFunctor(), osg::RenderAction::dropGeometry(), and insertFirstChild().

00059 {
00060     if(_pLastChild == NULL)
00061     {
00062         _pFirstChild = pChild;
00063         _pLastChild  = pChild;
00064     }
00065     else
00066     {
00067         _pLastChild->setBrother(pChild);
00068         _pLastChild = pChild;
00069     }
00070 }

void osg::DrawTreeNode::insertFirstChild ( DrawTreeNode pChild  )  [inline]

Definition at line 73 of file OSGDrawTreeNode.inl.

References _pFirstChild, addChild(), and setBrother().

00074 {
00075     if(pChild == NULL)
00076         return;
00077 
00078     if(_pFirstChild == NULL)
00079     {
00080         addChild(pChild);
00081     }
00082     else
00083     {
00084         pChild->setBrother(_pFirstChild);
00085         _pFirstChild = pChild;
00086     }
00087     
00088 }

void osg::DrawTreeNode::insertChildAfter ( DrawTreeNode pCurrent,
DrawTreeNode pChild 
) [inline]

Definition at line 91 of file OSGDrawTreeNode.inl.

References _pLastChild, getBrother(), and setBrother().

00093 {
00094     if(pCurrent == NULL || pChild == NULL)
00095         return;
00096 
00097     pChild  ->setBrother(pCurrent->getBrother());
00098     pCurrent->setBrother(pChild  );
00099 
00100     if(pCurrent == _pLastChild)
00101     {
00102         _pLastChild = pChild;
00103     }    
00104 }

DrawTreeNode * osg::DrawTreeNode::getBrother ( void   )  [inline]

void osg::DrawTreeNode::setBrother ( DrawTreeNode pBrother  )  [inline]

Definition at line 113 of file OSGDrawTreeNode.inl.

References _pBrother.

Referenced by addChild(), insertChildAfter(), and insertFirstChild().

00114 {
00115     _pBrother = pBrother;
00116 }

void osg::DrawTreeNode::setGeometry ( Geometry pGeo  )  [inline]

Definition at line 119 of file OSGDrawTreeNode.inl.

References _pGeo.

Referenced by osg::RenderAction::dropGeometry().

00120 {
00121     _pGeo = pGeo;
00122 }

Geometry * osg::DrawTreeNode::getGeometry ( void   )  [inline]

Definition at line 125 of file OSGDrawTreeNode.inl.

References _pGeo.

Referenced by osg::RenderAction::draw(), and osg::RenderAction::dump().

00126 {
00127     return _pGeo;
00128 }

void osg::DrawTreeNode::setFunctor ( Material::DrawFunctor func  )  [inline]

Definition at line 131 of file OSGDrawTreeNode.inl.

References _functor, and _hasFunctor.

Referenced by osg::RenderAction::dropFunctor().

00132 {
00133     _functor=func;
00134     _hasFunctor=true;
00135 }

Material::DrawFunctor & osg::DrawTreeNode::getFunctor ( void   )  [inline]

Definition at line 138 of file OSGDrawTreeNode.inl.

References _functor.

Referenced by osg::RenderAction::draw().

00139 {
00140     return _functor;
00141 }

bool osg::DrawTreeNode::hasFunctor ( void   )  [inline]

Definition at line 144 of file OSGDrawTreeNode.inl.

References _hasFunctor.

Referenced by osg::RenderAction::draw(), osg::RenderAction::drawMultiFrameOcclusionBB(), and osg::RenderAction::isOccluded().

00145 {
00146     return _hasFunctor;
00147 }

void osg::DrawTreeNode::setState ( State pState  )  [inline]

Definition at line 150 of file OSGDrawTreeNode.inl.

References _pState.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00151 {
00152     _pState = pState;
00153 }

State * osg::DrawTreeNode::getState ( void   )  [inline]

Definition at line 156 of file OSGDrawTreeNode.inl.

References _pState.

Referenced by osg::RenderAction::draw(), and osg::RenderAction::dump().

00157 {
00158     return _pState;
00159 }

void osg::DrawTreeNode::setNode ( NodePtr  pNode  )  [inline]

Definition at line 162 of file OSGDrawTreeNode.inl.

References _pNode.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00163 {
00164     _pNode = pNode;
00165 }

NodePtr osg::DrawTreeNode::getNode ( void   )  [inline]

void osg::DrawTreeNode::setMatrixStore ( const RenderAction::MatrixStore oMatrixStore  )  [inline]

Definition at line 174 of file OSGDrawTreeNode.inl.

References _oMatrixStore.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00175 {
00176     _oMatrixStore = oMatrixStore;
00177 }

RenderAction::MatrixStore & osg::DrawTreeNode::getMatrixStore ( void   )  [inline]

Definition at line 180 of file OSGDrawTreeNode.inl.

References _oMatrixStore.

Referenced by osg::RenderAction::draw(), osg::RenderAction::drawMultiFrameOcclusionBB(), and osg::RenderAction::dump().

00181 {
00182     return _oMatrixStore;
00183 }

void osg::DrawTreeNode::setScalar ( Real32  rScalar  )  [inline]

Definition at line 186 of file OSGDrawTreeNode.inl.

References _rScalarVal.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00187 {
00188     _rScalarVal = rScalar;
00189 }

Real32 osg::DrawTreeNode::getScalar ( void   )  [inline]

Definition at line 192 of file OSGDrawTreeNode.inl.

References _rScalarVal.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00193 {
00194     return _rScalarVal;
00195 }

void osg::DrawTreeNode::setLightsState ( UInt32  state  )  [inline]

Definition at line 198 of file OSGDrawTreeNode.inl.

References _lightsState.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00199 {
00200     _lightsState = state;
00201 }

UInt32 osg::DrawTreeNode::getLightsState ( void   )  [inline]

Definition at line 204 of file OSGDrawTreeNode.inl.

References _lightsState.

Referenced by osg::RenderAction::activateLocalLights(), and osg::RenderAction::draw().

00205 {
00206     return _lightsState;
00207 }

void osg::DrawTreeNode::setClipPlanesState ( UInt32  state  )  [inline]

Definition at line 210 of file OSGDrawTreeNode.inl.

References _clipPlanesState.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00211 {
00212     _clipPlanesState = state;
00213 }

UInt32 osg::DrawTreeNode::getClipPlanesState ( void   )  [inline]

Definition at line 216 of file OSGDrawTreeNode.inl.

References _clipPlanesState.

Referenced by osg::RenderAction::activateLocalClipPlanes().

00217 {
00218     return _clipPlanesState;
00219 }

void osg::DrawTreeNode::setMultiPass ( void   )  [inline]

Definition at line 222 of file OSGDrawTreeNode.inl.

References _flags, and MultiPass.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00223 {
00224     _flags |= DrawTreeNode::MultiPass;
00225 }

void osg::DrawTreeNode::setLastMultiPass ( void   )  [inline]

Definition at line 228 of file OSGDrawTreeNode.inl.

References _flags, and LastMultiPass.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00229 {
00230     _flags |= DrawTreeNode::LastMultiPass;
00231 }

bool osg::DrawTreeNode::isMultiPass ( void   )  [inline]

Definition at line 234 of file OSGDrawTreeNode.inl.

References _flags, LastMultiPass, and MultiPass.

00235 {
00236     return (_flags & DrawTreeNode::MultiPass) ||
00237            (_flags & DrawTreeNode::LastMultiPass);
00238 }

bool osg::DrawTreeNode::isLastMultiPass ( void   )  [inline]

Definition at line 241 of file OSGDrawTreeNode.inl.

References _flags, and LastMultiPass.

Referenced by osg::RenderAction::draw().

00242 {
00243     return (_flags & DrawTreeNode::LastMultiPass);
00244 }

void osg::DrawTreeNode::setNoStateSorting ( void   )  [inline]

Definition at line 247 of file OSGDrawTreeNode.inl.

References _flags, and NoStateSorting.

Referenced by osg::RenderAction::dropFunctor(), and osg::RenderAction::dropGeometry().

00248 {
00249     _flags |= DrawTreeNode::NoStateSorting;
00250 }

bool osg::DrawTreeNode::isNoStateSorting ( void   )  [inline]

Definition at line 253 of file OSGDrawTreeNode.inl.

References _flags, and NoStateSorting.

Referenced by osg::RenderAction::draw().

00254 {
00255     return (_flags & DrawTreeNode::NoStateSorting);
00256 }

void osg::DrawTreeNode::reset ( void   )  [inline]

Definition at line 259 of file OSGDrawTreeNode.inl.

References _flags, _hasFunctor, _lightsState, _oMatrixStore, _pBrother, _pFirstChild, _pGeo, _pLastChild, _pState, _rScalarVal, osg::RenderAction::MatrixStore::first, osg::RenderAction::MatrixStore::second, and osg::TransformationMatrix< ValueTypeT >::setIdentity().

Referenced by osg::DrawTreeNodeFactory::create().

00260 {
00261     _pFirstChild = NULL;
00262     _pLastChild  = NULL;
00263     _pBrother    = NULL;
00264     _pState      = NULL;
00265     _pGeo        = NULL;
00266     _hasFunctor  = false;
00267 
00268     _oMatrixStore.first = 0;
00269     _oMatrixStore.second.setIdentity();
00270 
00271     _rScalarVal = 0.f;
00272 
00273     _lightsState = 0;
00274     _flags = 0;
00275 }

void osg::DrawTreeNode::operator= ( const DrawTreeNode source  )  [private]

void MemoryObject::addRef ( void   )  [inherited]

void MemoryObject::subRef ( void   )  [inherited]

Definition at line 69 of file OSGMemoryObject.cpp.

References osg::MemoryObject::_refCount.

00070 {
00071     _refCount--;
00072 
00073     if(_refCount <= 0)
00074         delete this;
00075 }

Int32 MemoryObject::getRefCount ( void   )  [inherited]

Definition at line 77 of file OSGMemoryObject.cpp.

References osg::MemoryObject::_refCount.

00078 {
00079     return _refCount;
00080 }


Friends And Related Function Documentation

friend class DrawTreeNodeFactory [friend]

Definition at line 182 of file OSGDrawTreeNode.h.


Member Data Documentation

Definition at line 70 of file OSGDrawTreeNode.h.

Referenced by osg::RenderAction::start().

Definition at line 71 of file OSGDrawTreeNode.h.

Referenced by osg::RenderAction::start().

const UInt8 DrawTreeNode::MultiPass = 1 [static]

Definition at line 78 of file OSGDrawTreeNode.h.

Referenced by isMultiPass(), and setMultiPass().

const UInt8 DrawTreeNode::LastMultiPass = 2 [static]

Definition at line 79 of file OSGDrawTreeNode.h.

Referenced by isLastMultiPass(), isMultiPass(), and setLastMultiPass().

const UInt8 DrawTreeNode::NoStateSorting = 4 [static]

Definition at line 80 of file OSGDrawTreeNode.h.

Referenced by isNoStateSorting(), and setNoStateSorting().

Definition at line 143 of file OSGDrawTreeNode.h.

Referenced by addChild(), getFirstChild(), insertFirstChild(), and reset().

Definition at line 144 of file OSGDrawTreeNode.h.

Referenced by addChild(), getLastChild(), insertChildAfter(), and reset().

Definition at line 146 of file OSGDrawTreeNode.h.

Referenced by getBrother(), reset(), and setBrother().

Definition at line 148 of file OSGDrawTreeNode.h.

Referenced by getNode(), and setNode().

Definition at line 150 of file OSGDrawTreeNode.h.

Referenced by getState(), reset(), and setState().

Definition at line 151 of file OSGDrawTreeNode.h.

Referenced by getGeometry(), reset(), and setGeometry().

Definition at line 152 of file OSGDrawTreeNode.h.

Referenced by getFunctor(), and setFunctor().

Definition at line 153 of file OSGDrawTreeNode.h.

Referenced by hasFunctor(), reset(), and setFunctor().

Definition at line 155 of file OSGDrawTreeNode.h.

Referenced by DrawTreeNode(), getMatrixStore(), reset(), and setMatrixStore().

Definition at line 157 of file OSGDrawTreeNode.h.

Referenced by getScalar(), reset(), and setScalar().

Definition at line 159 of file OSGDrawTreeNode.h.

Referenced by getLightsState(), reset(), and setLightsState().

Definition at line 160 of file OSGDrawTreeNode.h.

Referenced by getClipPlanesState(), and setClipPlanesState().


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

Generated on Mon Mar 17 11:16:39 2008 for OpenSG by  doxygen 1.5.5