osg::PriorityAction Class Reference

#include <OSGPriorityAction.h>

Inheritance diagram for osg::PriorityAction:
osg::NewActionBase

List of all members.

Classes

class  NodeQueueEntry
class  StateRefCount

Public Member Functions

Destructor



virtual ~PriorityAction (void)
Apply



virtual ResultE apply (NodePtr pRoot)
Generic Actor Management



UInt32 addActor (ActorBase *pActor)
void subActor (ActorBase *pActor)
UInt32 findActor (ActorBase *pActor) const
UInt32 getNumActors (void) const
Extend Actor Management



UInt32 addExtendActor (ExtendActorBase *pActor)
UInt32 addExtendActor (ExtendActorBase *pActor, UInt32 pos)
void subExtendActor (UInt32 pos)
UInt32 findExtendActor (ExtendActorBase *pActor) const
UInt32 getNumExtendActors (void) const
Basic Actor Management



UInt32 addBasicActor (BasicActorBase *pActor)
UInt32 addBasicActor (BasicActorBase *pActor, UInt32 pos)
void subBasicActor (UInt32 pos)
UInt32 findBasicActor (BasicActorBase *pActor) const
UInt32 getNumBasicActors (void) const
Traversal Mask



UInt32 getTravMask (void) const
void setTravMask (UInt32 travMask)

Static Public Member Functions

Create



static PriorityActioncreate (void)

Static Public Attributes

Statistics



static StatElemDesc< StatIntElemstatStateClones
static StatElemDesc< StatIntElemstatStateRestores

Protected Member Functions

Constructors



 PriorityAction (void)
Events



virtual void addExtendEvent (ExtendActorBase *pActor, UInt32 actorIndex)
virtual void subExtendEvent (ExtendActorBase *pActor, UInt32 actorIndex)
virtual void addBasicEvent (BasicActorBase *pActor, UInt32 actorIndex)
virtual void subBasicEvent (BasicActorBase *pActor, UInt32 actorIndex)
virtual void startEvent (void)
virtual void stopEvent (void)
virtual void beginEditStateEvent (ActorBase *pActor, UInt32 actorId)
virtual void endEditStateEvent (ActorBase *pActor, UInt32 actorId)
ChildrenList/ExtraChildrenList Access



bool getChildrenListEnabled (void) const
void setChildrenListEnabled (bool enabled)
const ChildrenListgetChildrenList (void) const
ChildrenListgetChildrenList (void)
const ExtraChildrenListgetExtraChildrenList (void) const
ExtraChildrenListgetExtraChildrenList (void)
MultiPass Setup



UInt32 getNumPasses (void) const
void setNumPasses (UInt32 numPasses)
Actor Access



ExtendActorStoreConstIt beginExtend (void) const
ExtendActorStoreIt beginExtend (void)
ExtendActorStoreConstIt endExtend (void) const
ExtendActorStoreIt endExtend (void)
BasicActorStoreConstIt beginBasic (void) const
BasicActorStoreIt beginBasic (void)
BasicActorStoreConstIt endBasic (void) const
BasicActorStoreIt endBasic (void)
ResultE startActors (void)
ResultE stopActors (void)

Private Member Functions

Helper Methods



ResultE enterNode (const NodePtr &pNode, UInt32 pass)
StateRefCountStoreIt cloneState (void)
StateRefCountStoreIt getState (void)
void setState (StateRefCountStoreIt itStateRefCount)
void incRefCount (StateRefCountStoreIt itStateRefCount, Int32 inc=1)
void decRefCount (StateRefCountStoreIt itStateRefCount, Int32 dec=1)
const NodeQueueEntrypqTop (void) const
void pqPush (const NodeQueueEntry &entry)
void pqPop (void)
bool pqEmpty (void) const
void pqClear (void)

Private Attributes

ExtendActorStore _extendEnterActors
BasicActorStore _basicEnterActors
NodePriorityQueue _nodePrioQueue
NodePriorityQueueComp _nodePrioQueueComp
bool _stateClonedFlag
StateStore _stateStore
StateRefCountStore _stateRefCountStore
StateRefCountStoreIt _itInitialState
StateRefCountStoreIt _itActiveState

Friends

Friends



class osg::ActorBase
class osg::ExtendActorBase
class osg::BasicActorBase

Types



typedef NewActionBase Inherited
typedef ActorBase::ActorBaseState ActorBaseState
typedef std::list
< ActorBaseState * > 
StateStore
typedef StateStore::iterator StateStoreIt
typedef StateStore::const_iterator StateStoreConstIt
typedef std::list< StateRefCountStateRefCountStore
typedef
StateRefCountStore::iterator 
StateRefCountStoreIt
typedef
StateRefCountStore::const_iterator 
StateRefCountStoreConstIt
typedef std::vector
< NodeQueueEntry
NodePriorityQueue
typedef NodeQueueEntry::LessCompare NodePriorityQueueComp
class StateRefCount
class NodeQueueEntry
ResultE traverseEnter (void)
void enqueueChildren (const NodePtr &pNode, ResultE result)

Types



typedef NewActionTypes::ResultE ResultE
typedef
NewActionTypes::PriorityType 
PriorityType
typedef
NewActionTypes::PriorityTypeTraits 
PriorityTypeTraits
typedef NewActionTypes::Functor Functor
typedef
NewActionTypes::FunctorArgumentType 
FunctorArgumentType
typedef std::vector
< ExtendActorBase * > 
ExtendActorStore
typedef ExtendActorStore::iterator ExtendActorStoreIt
typedef
ExtendActorStore::const_iterator 
ExtendActorStoreConstIt
typedef std::vector
< BasicActorBase * > 
BasicActorStore
typedef BasicActorStore::iterator BasicActorStoreIt
typedef
BasicActorStore::const_iterator 
BasicActorStoreConstIt

Detailed Description

Definition at line 64 of file OSGPriorityAction.h.


Member Typedef Documentation

Definition at line 131 of file OSGPriorityAction.h.

Definition at line 132 of file OSGPriorityAction.h.

typedef std::list<ActorBaseState *> osg::PriorityAction::StateStore [private]

Definition at line 159 of file OSGPriorityAction.h.

typedef StateStore::iterator osg::PriorityAction::StateStoreIt [private]

Definition at line 160 of file OSGPriorityAction.h.

typedef StateStore::const_iterator osg::PriorityAction::StateStoreConstIt [private]

Definition at line 161 of file OSGPriorityAction.h.

Definition at line 191 of file OSGPriorityAction.h.

typedef StateRefCountStore::iterator osg::PriorityAction::StateRefCountStoreIt [private]

Definition at line 192 of file OSGPriorityAction.h.

typedef StateRefCountStore::const_iterator osg::PriorityAction::StateRefCountStoreConstIt [private]

Definition at line 193 of file OSGPriorityAction.h.

Definition at line 225 of file OSGPriorityAction.h.

Definition at line 226 of file OSGPriorityAction.h.

Definition at line 71 of file OSGNewActionBase.h.

Definition at line 72 of file OSGNewActionBase.h.

Definition at line 73 of file OSGNewActionBase.h.

Definition at line 74 of file OSGNewActionBase.h.

Definition at line 75 of file OSGNewActionBase.h.

typedef std::vector<ExtendActorBase *> osg::NewActionBase::ExtendActorStore [protected, inherited]

Definition at line 155 of file OSGNewActionBase.h.

typedef ExtendActorStore::iterator osg::NewActionBase::ExtendActorStoreIt [protected, inherited]

Definition at line 156 of file OSGNewActionBase.h.

typedef ExtendActorStore::const_iterator osg::NewActionBase::ExtendActorStoreConstIt [protected, inherited]

Definition at line 157 of file OSGNewActionBase.h.

typedef std::vector<BasicActorBase *> osg::NewActionBase::BasicActorStore [protected, inherited]

Definition at line 159 of file OSGNewActionBase.h.

typedef BasicActorStore::iterator osg::NewActionBase::BasicActorStoreIt [protected, inherited]

Definition at line 160 of file OSGNewActionBase.h.

typedef BasicActorStore::const_iterator osg::NewActionBase::BasicActorStoreConstIt [protected, inherited]

Definition at line 161 of file OSGNewActionBase.h.


Constructor & Destructor Documentation

PriorityAction::~PriorityAction ( void   )  [virtual]

Definition at line 68 of file OSGPriorityAction.cpp.

00069 {
00070 }

PriorityAction::PriorityAction ( void   )  [protected]

Definition at line 148 of file OSGPriorityAction.cpp.

Referenced by create().

00149     : Inherited          (     ),
00150       _extendEnterActors (     ),
00151       _basicEnterActors  (     ),
00152       _nodePrioQueue     (     ),
00153       _nodePrioQueueComp (     ),
00154       _stateClonedFlag   (false),
00155 #ifndef OSG_NEWACTION_STATESLOTINTERFACE
00156       _stateStore        (     ),
00157 #endif
00158       _stateRefCountStore(     ),
00159       _itInitialState    (     ),
00160       _itActiveState     (     )
00161 {
00162 }


Member Function Documentation

PriorityAction * PriorityAction::create ( void   )  [static]

Create new instance.

Definition at line 80 of file OSGPriorityAction.cpp.

References PriorityAction().

00081 {
00082     return new PriorityAction();
00083 }

PriorityAction::ResultE PriorityAction::apply ( NodePtr  pRoot  )  [virtual]

Apply the action to the node pRoot, i.e. traverse the graph below it.

Implements osg::NewActionBase.

Definition at line 93 of file OSGPriorityAction.cpp.

References _itActiveState, _itInitialState, _stateClonedFlag, _stateRefCountStore, _stateStore, cloneState(), osg::NewActionTypes::Continue, decRefCount(), getState(), incRefCount(), NodeQueueEntry, pqClear(), pqPush(), osg::NewActionTypes::Quit, setState(), osg::NewActionBase::startActors(), startEvent(), osg::NewActionBase::stopActors(), stopEvent(), and traverseEnter().

00094 {
00095     ResultE result = NewActionTypes::Continue;
00096 
00097     startEvent();
00098 
00099     result = startActors();
00100 
00101     if(result & NewActionTypes::Quit)
00102         return result;
00103 
00104     _itInitialState = getState  ();
00105     _itActiveState  = cloneState();
00106 
00107     // gained refs: active, root
00108     incRefCount(_itActiveState, 2);
00109 
00110     pqPush(NodeQueueEntry(pRoot, PriorityTypeTraits::getZeroElement(),
00111                           1,     _itActiveState                       ));
00112 
00113     result = traverseEnter();
00114 
00115     setState(_itInitialState);
00116 
00117     // lost refs: active, current node
00118     decRefCount(_itActiveState, 2);
00119 
00120     _itActiveState   = _itInitialState;
00121     _stateClonedFlag = true;
00122 
00123     pqClear();
00124 #ifndef OSG_NEWACTION_STATESLOTINTERFACE
00125     _stateStore        .clear();
00126 #endif
00127     _stateRefCountStore.clear();
00128 
00129     if(result & NewActionTypes::Quit)
00130     {
00131         stopActors();
00132         stopEvent ();
00133     }
00134     else
00135     {
00136         result = stopActors();
00137         stopEvent();
00138     }
00139     
00140     return result;
00141 }

void PriorityAction::addExtendEvent ( ExtendActorBase pActor,
UInt32  actorIndex 
) [protected, virtual]

Inserts the extend actor into an internal data structure, depending on whether the enter node flag is set. This avoids making the destinction everytime the actors are called.

Implements osg::NewActionBase.

Definition at line 174 of file OSGPriorityAction.cpp.

References _extendEnterActors, osg::NewActionBase::beginExtend(), and osg::ActorBase::getEnterNodeFlag().

00175 {
00176     ExtendActorStoreIt itActors  = beginExtend();
00177     ExtendActorStoreIt endActors = beginExtend() + actorIndex;
00178 
00179     ExtendActorStoreIt itEnter   = _extendEnterActors.begin();
00180 
00181     if(pActor->getEnterNodeFlag() == true)
00182     {
00183         for(; itActors != endActors; ++itActors)
00184         {
00185             if((*itActors)->getEnterNodeFlag() == true)
00186                 ++itEnter;
00187         }
00188 
00189         _extendEnterActors.insert(itEnter, pActor);
00190     }
00191 }

void PriorityAction::subExtendEvent ( ExtendActorBase pActor,
UInt32  actorIndex 
) [protected, virtual]

Removes the extend actor from the internal data structures.

Implements osg::NewActionBase.

Definition at line 197 of file OSGPriorityAction.cpp.

References _extendEnterActors.

00198 {
00199     ExtendActorStoreIt itEnter  = _extendEnterActors.begin();
00200     ExtendActorStoreIt endEnter = _extendEnterActors.end  ();
00201 
00202     for(; itEnter != endEnter; ++itEnter)
00203     {
00204         if(*itEnter == pActor)
00205         {
00206             _extendEnterActors.erase(itEnter);
00207 
00208             break;
00209         }
00210     }
00211 }

void PriorityAction::addBasicEvent ( BasicActorBase pActor,
UInt32  actorIndex 
) [protected, virtual]

Inserts the basic actor into an internal data structure, depending on whether the enter node flag is set. This avoids making the destinction everytime the actors are called.

Implements osg::NewActionBase.

Definition at line 219 of file OSGPriorityAction.cpp.

References _basicEnterActors, osg::NewActionBase::beginBasic(), and osg::ActorBase::getEnterNodeFlag().

00220 {
00221     BasicActorStoreIt itActors  = beginBasic();
00222     BasicActorStoreIt endActors = beginBasic() + actorIndex;
00223 
00224     BasicActorStoreIt itEnter   = _basicEnterActors.begin();
00225 
00226     if(pActor->getEnterNodeFlag() == true)
00227     {
00228         for(; itActors != endActors; ++itActors)
00229         {
00230             if((*itActors)->getEnterNodeFlag() == true)
00231                 ++itEnter;
00232         }
00233 
00234         _basicEnterActors.insert(itEnter, pActor);
00235     }
00236 }

void PriorityAction::subBasicEvent ( BasicActorBase pActor,
UInt32  actorIndex 
) [protected, virtual]

Removes the extend actor from the internal data structures.

Implements osg::NewActionBase.

Definition at line 242 of file OSGPriorityAction.cpp.

References _basicEnterActors.

00243 {
00244     BasicActorStoreIt itEnter  = _basicEnterActors.begin();
00245     BasicActorStoreIt endEnter = _basicEnterActors.end  ();
00246 
00247     for(; itEnter != endEnter; ++itEnter)
00248     {
00249         if(*itEnter == pActor)
00250         {
00251             _basicEnterActors.erase(itEnter);
00252 
00253             break;
00254         }
00255     }
00256 }

void PriorityAction::startEvent ( void   )  [protected, virtual]

Inserts the extend actor into an internal data structure, depending on whether the enter node flag is set. This avoids making the destinction everytime the actors are called.

Reimplemented from osg::NewActionBase.

Definition at line 259 of file OSGPriorityAction.cpp.

References osg::NewActionBase::startEvent(), statStateClones, and statStateRestores.

Referenced by apply().

00260 {
00261     Inherited::startEvent();
00262 
00263 #ifdef OSG_NEWACTION_STATISTICS
00264     getStatistics()->getElem(statStateClones  )->reset();
00265     getStatistics()->getElem(statStateRestores)->reset();
00266 #endif /* OSG_NEWACTION_STATISTICS */
00267 }

void PriorityAction::stopEvent ( void   )  [protected, virtual]

Inserts the extend actor into an internal data structure, depending on whether the enter node flag is set. This avoids making the destinction everytime the actors are called.

Reimplemented from osg::NewActionBase.

Definition at line 270 of file OSGPriorityAction.cpp.

References osg::NewActionBase::stopEvent().

Referenced by apply().

00271 {
00272     Inherited::stopEvent();
00273 }

void PriorityAction::beginEditStateEvent ( ActorBase pActor,
UInt32  actorId 
) [protected, virtual]

Creates a copy of the state of the attached actors and activates the copy.

Implements osg::NewActionBase.

Definition at line 279 of file OSGPriorityAction.cpp.

References _itActiveState, _stateClonedFlag, cloneState(), decRefCount(), incRefCount(), and statStateClones.

00280 {
00281     if(_stateClonedFlag == false)
00282     {
00283 #ifdef OSG_NEWACTION_STATISTICS
00284         getStatistics()->getElem(statStateClones)->inc();
00285 #endif /* OSG_NEWACTION_STATISTICS */
00286 
00287         _stateClonedFlag = true;
00288 
00289         StateRefCountStoreIt itClonedState = cloneState();
00290 
00291         // gained refs: active and current node
00292         incRefCount(itClonedState, 2);
00293 
00294         // lost refs: active and current node
00295         decRefCount(_itActiveState, 2);
00296 
00297         _itActiveState = itClonedState;
00298     }
00299 }

void PriorityAction::endEditStateEvent ( ActorBase pActor,
UInt32  actorId 
) [protected, virtual]

Does nothing.

Implements osg::NewActionBase.

Definition at line 305 of file OSGPriorityAction.cpp.

00306 {
00307 }

PriorityAction::ResultE PriorityAction::traverseEnter ( void   )  [private]

Drives the traversal of the graph by activating the proper state for the nodes and calling the enterNode method of the actors.

Definition at line 319 of file OSGPriorityAction.cpp.

References _itActiveState, _stateClonedFlag, osg::NewActionTypes::Continue, decRefCount(), enqueueChildren(), enterNode(), osg::NewActionBase::getChildrenList(), osg::PriorityAction::NodeQueueEntry::getNode(), osg::NewActionBase::getNumPasses(), osg::PriorityAction::NodeQueueEntry::getPassCount(), osg::PriorityAction::NodeQueueEntry::getPriority(), osg::PriorityAction::NodeQueueEntry::getStateRefCount(), incRefCount(), NodeQueueEntry, pqEmpty(), pqPop(), pqPush(), pqTop(), osg::NewActionTypes::Quit, osg::ChildrenList::setParentNode(), setState(), and statStateRestores.

Referenced by apply().

00320 {
00321     ResultE              result          = NewActionTypes::Continue;
00322     NodePtr              pNode;
00323     PriorityType         nodePrio;
00324     UInt32               nodePass;
00325     UInt32               multiPasses;
00326     StateRefCountStoreIt itStateRefCount;
00327 
00328     while((pqEmpty() == false) && !(result & NewActionTypes::Quit))
00329     {
00330         pNode           = pqTop().getNode         ();
00331         nodePrio        = pqTop().getPriority     ();
00332         nodePass        = pqTop().getPassCount    ();
00333         itStateRefCount = pqTop().getStateRefCount();
00334 
00335         if(itStateRefCount != _itActiveState)
00336         {
00337 #ifdef OSG_NEWACTION_STATISTICS
00338             getStatistics()->getElem(statStateRestores)->inc();
00339 #endif /* OSG_NEWACTION_STATISTICS */
00340 
00341             setState(itStateRefCount);
00342 
00343             // gained refs: active
00344             incRefCount(itStateRefCount);
00345 
00346             // lost refs: active
00347             decRefCount(_itActiveState);
00348 
00349             _itActiveState = itStateRefCount;
00350         }
00351 
00352         _stateClonedFlag = false;
00353 
00354         getChildrenList().setParentNode(pNode);
00355 
00356 #ifdef OSG_NEWACTION_STATISTICS
00357         getStatistics()->getElem(statNodesEnter)->inc();
00358 #endif /* OSG_NEWACTION_STATISTICS */
00359 
00360         result      = enterNode   (pNode, nodePass - 1);
00361         multiPasses = getNumPasses(                   );
00362         
00363         pqPop();
00364         
00365         // only initial pass (nodePass == 1) can request multiPasses
00366         if((nodePass == 1) && (multiPasses > 1))
00367         {
00368             for(; multiPasses > 1; --multiPasses)
00369             {
00370                 // gained refs: additional pass
00371                 incRefCount(_itActiveState);
00372                 
00373                 pqPush(NodeQueueEntry(pNode,       nodePrio, 
00374                                       multiPasses, _itActiveState));
00375             }
00376         }
00377 
00378         enqueueChildren(pNode, result);
00379     }
00380 
00381     return result;
00382 }

void PriorityAction::enqueueChildren ( const NodePtr pNode,
ResultE  result 
) [private]

Inserts the active children and extra children into the internal priority queue.

Definition at line 389 of file OSGPriorityAction.cpp.

References _itActiveState, osg::NewActionTypes::Break, osg::ExtraChildrenList::clear(), decRefCount(), osg::ExtraChildrenList::getActive(), osg::ChildrenList::getActive(), osg::ExtraChildrenList::getChild(), osg::ChildrenList::getChild(), osg::NewActionBase::getChildrenList(), osg::NewActionBase::getChildrenListEnabled(), osg::NewActionBase::getExtraChildrenList(), osg::ExtraChildrenList::getPriority(), osg::ChildrenList::getPriority(), osg::ExtraChildrenList::getSize(), osg::ChildrenList::getSize(), osg::NewActionBase::getTravMask(), incRefCount(), NodeQueueEntry, osg::NullFC, pqPush(), osg::NewActionTypes::Quit, osg::NewActionBase::setChildrenListEnabled(), osg::NewActionBase::setNumPasses(), and osg::NewActionTypes::Skip.

Referenced by traverseEnter().

00390 {
00391     if(result & (NewActionTypes::Skip  |
00392                  NewActionTypes::Break |
00393                  NewActionTypes::Quit   ))
00394     {
00395         setChildrenListEnabled(false);
00396         setNumPasses          (1    );
00397         
00398         getExtraChildrenList().clear();
00399 
00400         // lost refs: current node
00401         decRefCount(_itActiveState);
00402 
00403         return;
00404     }
00405 
00406     ChildrenList      &cl  = getChildrenList     ();
00407     ExtraChildrenList &ecl = getExtraChildrenList();
00408 
00409     if(getChildrenListEnabled() == true)
00410     {
00411         for(UInt32 i = 0, size = cl.getSize(); i < size; ++i)
00412         {
00413             if(( cl.getActive(i)                                 == true  ) &&
00414                ( cl.getChild (i)                                 != NullFC) &&
00415                ((cl.getChild (i)->getTravMask() & getTravMask()) != 0     )   )
00416             {
00417                 // gained refs: child
00418                 incRefCount(_itActiveState);
00419 
00420                 pqPush(NodeQueueEntry(cl.getChild(i), cl.getPriority(i),
00421                                       1,              _itActiveState    ));
00422             }
00423         }
00424     }
00425     else
00426     {
00427         MFNodePtr::const_iterator itChildren  = pNode->getMFChildren()->begin();
00428         MFNodePtr::const_iterator endChildren = pNode->getMFChildren()->end  ();
00429 
00430         for(; itChildren != endChildren; ++itChildren)
00431         {
00432             if((  *itChildren                                  != NullFC) &&
00433                (((*itChildren)->getTravMask() & getTravMask()) != 0     )   )
00434             {
00435                 // gained refs: child
00436                 incRefCount(_itActiveState);
00437 
00438                 pqPush(
00439                     NodeQueueEntry(*itChildren,
00440                                    PriorityTypeTraits::getZeroElement(),
00441                                    1, _itActiveState                    ));
00442             }
00443         }
00444     }
00445 
00446     for(UInt32 i = 0, size = ecl.getSize(); i < size; ++i)
00447     {
00448         if(( ecl.getActive(i)                                 == true  ) &&
00449            ( ecl.getChild (i)                                 != NullFC) &&
00450            ((ecl.getChild (i)->getTravMask() & getTravMask()) != 0     )   )
00451         {
00452             // gained refs: extra child
00453             incRefCount(_itActiveState);
00454 
00455             pqPush(NodeQueueEntry(ecl.getChild(i), ecl.getPriority(i),
00456                                   1,               _itActiveState     ));
00457         }
00458     }
00459 
00460     setChildrenListEnabled(false);
00461     ecl.clear             (     );
00462     setNumPasses          (1    );
00463 
00464     // lost refs: current node
00465     decRefCount(_itActiveState);
00466 }

PriorityAction::ResultE osg::PriorityAction::enterNode ( const NodePtr pNode,
UInt32  pass 
) [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 315 of file OSGPriorityAction.inl.

References _extendEnterActors, osg::NewActionBase::beginBasic(), osg::NewActionTypes::Break, osg::NewActionTypes::Continue, osg::NewActionBase::endBasic(), osg::NewActionTypes::Quit, and osg::NewActionTypes::FunctorArgumentType::setActor().

Referenced by traverseEnter().

00316 {
00317     FunctorArgumentType funcArg(NULL, pNode, pass);
00318     ResultE             result     = NewActionTypes::Continue;
00319     
00320     ExtendActorStoreIt itExtend    = _extendEnterActors.begin();
00321     ExtendActorStoreIt endItExtend = _extendEnterActors.end  ();
00322 
00323     for(;  (itExtend != endItExtend                                 )  &&
00324           !(result   & (NewActionTypes::Break | NewActionTypes::Quit));
00325         ++itExtend                                                       )
00326     {
00327         funcArg.setActor(*itExtend);
00328         
00329         result = static_cast<ResultE>(result | (*itExtend)->enterNode(funcArg));
00330     }
00331 
00332     BasicActorStoreIt  itBasic     = beginBasic ();
00333     BasicActorStoreIt  endItBasic  = endBasic   ();
00334 
00335     for(;  (itBasic != endItBasic                                  )  &&
00336           !(result  & (NewActionTypes::Break | NewActionTypes::Quit));
00337         ++itBasic                                                        )
00338     {
00339         funcArg.setActor(*itBasic);
00340         
00341         result = static_cast<ResultE>(result | (*itBasic)->enterNode(funcArg));
00342     }
00343 
00344     return result;
00345 }

PriorityAction::StateRefCountStoreIt osg::PriorityAction::cloneState ( void   )  [inline, private]

Creates a copy of the state currently used by the attached actors.

Definition at line 351 of file OSGPriorityAction.inl.

References _basicEnterActors, _extendEnterActors, _stateRefCountStore, _stateStore, osg::NewActionBase::endBasic(), osg::NewActionBase::endExtend(), and StateRefCount.

Referenced by apply(), and beginEditStateEvent().

00352 {
00353 #ifdef OSG_NEWACTION_STATESLOTINTERFACE
00354 
00355     UInt32               stateSlot;
00356     StateRefCountStoreIt itStateRefCount = --(_stateRefCountStore.end());
00357 
00358     ExtendActorStoreIt   itExtend        =    _extendEnterActors.begin();
00359     ExtendActorStoreIt   endExtend       =    _extendEnterActors.end  ();
00360 
00361     for(; itExtend != endExtend; ++itExtend)
00362     {
00363         stateSlot = (*itExtend)->createStateClone();
00364     }
00365 
00366     BasicActorStoreIt itBasic  = _basicEnterActors.begin();
00367     BasicActorStoreIt endBasic = _basicEnterActors.end  ();
00368 
00369     for(; itBasic != endBasic; ++itBasic)
00370     {
00371         stateSlot = (*itBasic)->createStateClone();
00372     }
00373 
00374     _stateRefCountStore.push_back(StateRefCount(stateSlot));
00375 
00376     return ++itStateRefCount;
00377 
00378 #else  /* OSG_NEWACTION_STATESLOTINTERFACE */
00379 
00380     StateStoreIt         itState         = --(_stateStore        .end  ());
00381     StateRefCountStoreIt itStateRefCount = --(_stateRefCountStore.end  ());
00382 
00383     ExtendActorStoreIt   itExtend        =    _extendEnterActors .begin();
00384     ExtendActorStoreIt   endItExtend     =    _extendEnterActors .end  ();
00385 
00386     for(; itExtend != endItExtend; ++itExtend)
00387     {
00388         _stateStore.push_back((*itExtend)->createStateClone());
00389     }
00390 
00391     BasicActorStoreIt itBasic    = _basicEnterActors.begin();
00392     BasicActorStoreIt endItBasic = _basicEnterActors.end  ();
00393 
00394     for(; itBasic != endItBasic; ++itBasic)
00395     {
00396         _stateStore.push_back((*itBasic)->createStateClone());
00397     }
00398 
00399     _stateRefCountStore.push_back(StateRefCount(++itState));
00400 
00401     return ++itStateRefCount;
00402 
00403 #endif /* OSG_NEWACTION_STATESLOTINTERFACE */
00404 }

PriorityAction::StateRefCountStoreIt osg::PriorityAction::getState ( void   )  [inline, private]

Stores the state currently used by the attached actors.

Definition at line 410 of file OSGPriorityAction.inl.

References _basicEnterActors, _extendEnterActors, _stateRefCountStore, _stateStore, and StateRefCount.

Referenced by apply().

00411 {
00412 #ifdef OSG_NEWACTION_STATESLOTINTERFACE
00413 
00414     UInt32               stateSlot;
00415     StateRefCountStoreIt itStateRefCount = --(_stateRefCountStore.end  ());
00416 
00417     ExtendActorStoreIt   itExtend        =    _extendEnterActors .begin();
00418     ExtendActorStoreIt   endItExtend     =    _extendEnterActors .end  ();
00419 
00420     for(; itExtend != endItExtend; ++itExtend)
00421     {
00422         stateSlot = (*itExtend)->getSlotMap().size();
00423 
00424         (*itExtend)->getSlotMap().push_back((*itExtend)->getState());
00425     }
00426 
00427     BasicActorStoreIt itBasic    = _basicEnterActors.begin();
00428     BasicActorStoreIt endItBasic = _basicEnterActors.end  ();
00429 
00430     for(; itBasic != endItBasic; ++itBasic)
00431     {
00432         stateSlot = (*itExtend)->getSlotMap().size();
00433 
00434         (*itExtend)->getSlotMap().push_back((*itExtend)->getState());
00435     }
00436 
00437     _stateRefCountStore.push_back(StateRefCount(stateSlot));
00438 
00439     return ++itStateRefCount;
00440 
00441 #else  /* OSG_NEWACTION_STATESLOTINTERFACE */
00442 
00443     StateStoreIt         itState         = --(_stateStore        .end  ());
00444     StateRefCountStoreIt itStateRefCount = --(_stateRefCountStore.end  ());
00445 
00446     ExtendActorStoreIt   itExtend        =    _extendEnterActors .begin();
00447     ExtendActorStoreIt   endItExtend     =    _extendEnterActors .end  ();
00448 
00449     for(; itExtend != endItExtend; ++itExtend)
00450     {
00451         _stateStore.push_back((*itExtend)->getState());
00452     }
00453 
00454     BasicActorStoreIt itBasic    = _basicEnterActors.begin();
00455     BasicActorStoreIt endItBasic = _basicEnterActors.end  ();
00456 
00457     for(; itBasic != endItBasic; ++itBasic)
00458     {
00459         _stateStore.push_back((*itBasic)->getState());
00460     }
00461 
00462     _stateRefCountStore.push_back(StateRefCount(++itState));
00463 
00464     return ++itStateRefCount;
00465 
00466 #endif /* OSG_NEWACTION_STATESLOTINTERFACE */
00467 }

void osg::PriorityAction::setState ( StateRefCountStoreIt  itStateRefCount  )  [inline, private]

Sets the state to use for the attached actors.

Definition at line 473 of file OSGPriorityAction.inl.

References _basicEnterActors, _extendEnterActors, and osg::NewActionBase::endExtend().

Referenced by apply(), and traverseEnter().

00474 {
00475 #ifdef OSG_NEWACTION_STATESLOTINTERFACE
00476 
00477     UInt32             stateSlot   = itStateRefCount->getStateSlot();
00478 
00479     ExtendActorStoreIt itExtend    = _extendEnterActors.begin();
00480     ExtendActorStoreIt endItExtend = _extendEnterActors.end  ();
00481 
00482     for(; itExtend != endExtend; ++itExtend, ++itState)
00483     {
00484         (*itExtend)->setState((*itExtend)->getSlotMap()[stateSlot]);
00485     }
00486 
00487     BasicActorStoreIt itBasic    = _basicEnterActors.begin();
00488     BasicActorStoreIt endItBasic = _basicEnterActors.end  ();
00489 
00490     for(; itBasic != endItBasic; ++itBasic, ++itState)
00491     {
00492         (*itBasic)->setState((*itBasic)->getSlotMap()[stateSlot]);
00493     }
00494 
00495 #else  /* OSG_NEWACTION_STATESLOTINTERFACE */
00496 
00497     StateStoreIt       itState     = itStateRefCount->getState();
00498 
00499     ExtendActorStoreIt itExtend    = _extendEnterActors.begin();
00500     ExtendActorStoreIt endItExtend = _extendEnterActors.end  ();
00501 
00502     for(; itExtend != endItExtend; ++itExtend, ++itState)
00503     {
00504         (*itExtend)->setState(*itState);
00505     }
00506 
00507     BasicActorStoreIt itBasic    = _basicEnterActors.begin();
00508     BasicActorStoreIt endItBasic = _basicEnterActors.end  ();
00509 
00510     for(; itBasic != endItBasic; ++itBasic, ++itState)
00511     {
00512         (*itBasic)->setState(*itState);
00513     }
00514 
00515 #endif /* OSG_NEWACTION_STATESLOTINTERFACE */
00516 }

void osg::PriorityAction::incRefCount ( StateRefCountStoreIt  itStateRefCount,
Int32  inc = 1 
) [inline, private]

Increment the ref count by inc.

Definition at line 522 of file OSGPriorityAction.inl.

Referenced by apply(), beginEditStateEvent(), enqueueChildren(), and traverseEnter().

00523 {
00524     itStateRefCount->incRefCount(inc);
00525 }

void osg::PriorityAction::decRefCount ( StateRefCountStoreIt  itStateRefCount,
Int32  dec = 1 
) [inline, private]

Decrement the ref count by dec. If it reaches 0 the state is delete.

Definition at line 531 of file OSGPriorityAction.inl.

References _basicEnterActors, _extendEnterActors, _stateRefCountStore, _stateStore, osg::NewActionBase::endBasic(), and osg::NewActionBase::endExtend().

Referenced by apply(), beginEditStateEvent(), enqueueChildren(), and traverseEnter().

00532 {
00533 #ifdef OSG_NEWACTION_STATESLOTINTERFACE
00534 
00535     itStateRefCount->decRefCount(dec);
00536 
00537     if(itStateRefCount->getRefCount() <= 0)
00538     {
00539         UInt32             stateSlot = itStateRefCount->getStateSlot();
00540 
00541         ExtendActorStoreIt itExtend  = _extendEnterActors.begin();
00542         ExtendActorStoreIt endExtend = _extendEnterActors.end  ();
00543 
00544         for(; itExtend != endExtend; ++itExtend)
00545         {
00546             delete (*itExtend)->getSlotMap()[stateSlot];
00547 
00548             //(*itExtend)->destroyStateClone(stateSlot);
00549         }
00550 
00551         BasicActorStoreIt itBasic  = _basicEnterActors.begin();
00552         BasicActorStoreIt endBasic = _basicEnterActors.end  ();
00553 
00554         for(; itBasic != endBasic; ++itBasic)
00555         {
00556             delete (*itBasic)->getSlotMap()[stateSlot];
00557 
00558             //(*itBasic)->destroyStateClone(stateSlot);
00559         }
00560 
00561         _stateRefCountStore.erase(itStateRefCount);
00562     }
00563 
00564 #else /* OSG_NEWACTION_STATESLOTINTERFACE */
00565 
00566     itStateRefCount->decRefCount(dec);
00567 
00568     if(itStateRefCount->getRefCount() <= 0)
00569     {
00570         StateStoreIt       itState   = itStateRefCount->getState();
00571 
00572         ExtendActorStoreIt itExtend  = _extendEnterActors.begin();
00573         ExtendActorStoreIt endExtend = _extendEnterActors.end  ();
00574 
00575         for(; itExtend != endExtend; ++itExtend)
00576         {
00577             delete *itState;
00578 
00579             //(*itExtend)->destroyStateClone(*itState);
00580 
00581             itState = _stateStore.erase(itState);
00582         }
00583 
00584         BasicActorStoreIt itBasic  = _basicEnterActors.begin();
00585         BasicActorStoreIt endBasic = _basicEnterActors.end  ();
00586 
00587         for(; itBasic != endBasic; ++itBasic)
00588         {
00589             delete *itState;
00590 
00591             //(*itBasic)->destroyStateClone(*itState);
00592 
00593             itState = _stateStore.erase(itState);
00594         }
00595 
00596         _stateRefCountStore.erase(itStateRefCount);
00597     }
00598 
00599 #endif /* OSG_NEWACTION_STATESLOTINTERFACE */
00600 }

const PriorityAction::NodeQueueEntry & osg::PriorityAction::pqTop ( void   )  const [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 603 of file OSGPriorityAction.inl.

References _nodePrioQueue.

Referenced by traverseEnter().

00604 {
00605     return _nodePrioQueue.front();
00606 }

void osg::PriorityAction::pqPush ( const NodeQueueEntry entry  )  [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 609 of file OSGPriorityAction.inl.

References _nodePrioQueue, and _nodePrioQueueComp.

Referenced by apply(), enqueueChildren(), and traverseEnter().

00610 {
00611     _nodePrioQueue.push_back(entry);
00612 
00613     std::push_heap(_nodePrioQueue.begin(), _nodePrioQueue.end(),
00614                    _nodePrioQueueComp                           );
00615 }

void osg::PriorityAction::pqPop ( void   )  [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 618 of file OSGPriorityAction.inl.

References _nodePrioQueue, and _nodePrioQueueComp.

Referenced by traverseEnter().

00619 {
00620     std::pop_heap(_nodePrioQueue.begin(), _nodePrioQueue.end(),
00621                   _nodePrioQueueComp                           );
00622 
00623     _nodePrioQueue.pop_back();
00624 }

bool osg::PriorityAction::pqEmpty ( void   )  const [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 627 of file OSGPriorityAction.inl.

References _nodePrioQueue.

Referenced by traverseEnter().

00628 {
00629     return _nodePrioQueue.empty();
00630 }

void osg::PriorityAction::pqClear ( void   )  [inline, private]

Calls the enterNode method of the attached actors.

Definition at line 633 of file OSGPriorityAction.inl.

References _nodePrioQueue.

Referenced by apply().

00634 {
00635     _nodePrioQueue.clear();
00636 }

UInt32 NewActionBase::addActor ( ActorBase pActor  )  [inherited]

Add an actor to this action, it will be appended to the list of extend or basic actors. Returns the index at which the actor was added.

Warning:
Actions assume exclusive ownership of an actor, you can not add an actor to two actions at the same time.

Dev: The ActorBase class has three "visitor pattern" style methods, that will call the appropriate method of the action, e.g. assume pActor is actually derived from ExtendActorBase, then its addHelper method will call the addExtendActor method of the action passed as parameter.

Definition at line 144 of file OSGNewActionBase.cpp.

References osg::ActorBase::addHelper().

00145 {
00146     return pActor->addHelper(this);
00147 }

void NewActionBase::subActor ( ActorBase pActor  )  [inherited]

Remove an actor from this action. The actor may now be attached to another action.

Dev: See NewActionBase::addActor(ActorBase *pActor) for an explanation of the mechanism used to discover the type of pActor.

Definition at line 159 of file OSGNewActionBase.cpp.

References osg::ActorBase::subHelper().

00160 {
00161     pActor->subHelper(this);
00162 }

UInt32 NewActionBase::findActor ( ActorBase pActor  )  const [inherited]

Return the index of an actor or TypeTraits<UInt32>::getMax() if the actor can not be found. Note that two actors may have the same index, if one is derived from ExtendActorBase and the other from BasicActorBase.

Dev: See NewActionBase::addActor(ActorBase *pActor) for an explanation of the mechanism used to discover the type of pActor.

I'm not sure if this is a useful thing to have ?? -carsten

Definition at line 177 of file OSGNewActionBase.cpp.

References osg::ActorBase::findHelper().

00178 {
00179     return pActor->findHelper(this);
00180 }

UInt32 NewActionBase::getNumActors ( void   )  const [inherited]

Return the total number of actors attached to this action.

Definition at line 186 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors, and osg::NewActionBase::_extendActors.

Referenced by osg::NewActionBase::addBasicActor(), and osg::NewActionBase::addExtendActor().

00187 {
00188     return _extendActors.size() + _basicActors.size();
00189 }

UInt32 NewActionBase::addExtendActor ( ExtendActorBase pActor  )  [inherited]

Add an extend actor to this action. Returns the index at which the actor was added.

Warning:
Actions assume exclusive ownership of an actor, you can not add an actor to two actions at the same time.

Definition at line 202 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_extendActors.

Referenced by osg::ExtendActorBase::addHelper().

00203 {
00204     return addExtendActor(pActor, _extendActors.size());
00205 }

UInt32 NewActionBase::addExtendActor ( ExtendActorBase pActor,
UInt32  pos 
) [inherited]

Add an extend actor to this action before the index pos. Returns the index at which the actor was added, i.e. this should be pos.

Warning:
Actions assume exclusive ownership of an actor, you can not add an actor to two actions at the same time.

Definition at line 214 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_extendActors, osg::ActorBase::addEvent(), and osg::NewActionBase::getNumActors().

00215 {
00216     UInt32 actorId = getNumActors();
00217 
00218     pActor       ->addEvent      (this,                        actorId);
00219     _extendActors. insert        (_extendActors.begin() + pos, pActor );
00220     this         ->addExtendEvent(pActor,                      pos    );
00221 
00222     return pos;
00223 }

void NewActionBase::subExtendActor ( UInt32  pos  )  [inherited]

Remove the extend actor at index pos. The actor may now be attached to another action.

Definition at line 230 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_extendActors, osg::ActorBase::getActorId(), and osg::ActorBase::subEvent().

Referenced by osg::ExtendActorBase::subHelper().

00231 {
00232     ExtendActorStoreIt  itActor = _extendActors.begin() + pos;
00233     ExtendActorBase    *pActor  = *itActor;
00234 
00235     this  ->subExtendEvent(pActor, pos                 );
00236     pActor->subEvent      (this,   pActor->getActorId());
00237 
00238     _extendActors.erase(itActor);
00239 }

UInt32 NewActionBase::findExtendActor ( ExtendActorBase pActor  )  const [inherited]

Return the index of the extend actor or TypeTraits<UInt32>::getMax() if the actor is not found. The return value may be used as the pos argument to the addExtendActor and subExtendActor methods.

Definition at line 247 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_extendActors.

Referenced by osg::ExtendActorBase::findHelper(), and osg::ExtendActorBase::subHelper().

00248 {
00249     ExtendActorStoreConstIt itActors  = _extendActors.begin();
00250     ExtendActorStoreConstIt endActors = _extendActors.end  ();
00251 
00252     UInt32             pos       = 0;
00253     bool               found     = false;
00254 
00255     for(; (itActors != endActors) && !found; ++itActors, ++pos)
00256     {
00257         if(*itActors == pActor)
00258         {
00259             found = true;
00260             break;
00261         }
00262     }
00263 
00264     return (found ? pos : TypeTraits<UInt32>::getMax());
00265 }

UInt32 NewActionBase::getNumExtendActors ( void   )  const [inherited]

Return the number of extend actors attached to the action.

Definition at line 271 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_extendActors.

00272 {
00273     return _extendActors.size();
00274 }

UInt32 NewActionBase::addBasicActor ( BasicActorBase pActor  )  [inherited]

Add an basic actor to this action. Returns the index at which the actor was added.

Warning:
Actions assume exclusive ownership of an actor, you can not add an actor to two actions at the same time.

Definition at line 287 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors.

Referenced by osg::BasicActorBase::addHelper().

00288 {
00289     return addBasicActor(pActor, _basicActors.size());
00290 }

UInt32 NewActionBase::addBasicActor ( BasicActorBase pActor,
UInt32  pos 
) [inherited]

Add an basic actor to this action before the index pos. Returns the index at which the actor was added, i.e. this should be pos.

Warning:
Actions assume exclusive ownership of an actor, you can not add an actor to two actions at the same time.

Definition at line 299 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors, osg::ActorBase::addEvent(), and osg::NewActionBase::getNumActors().

00300 {
00301     UInt32 actorId = getNumActors();
00302 
00303     pActor      ->addEvent     (this,                       actorId);
00304     _basicActors. insert       (_basicActors.begin() + pos, pActor );
00305     this        ->addBasicEvent(pActor,                     pos    );
00306 
00307     return pos;
00308 }

void NewActionBase::subBasicActor ( UInt32  pos  )  [inherited]

Remove the basic actor at index pos. The actor may now be attached to another action.

Definition at line 315 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors, osg::ActorBase::getActorId(), and osg::ActorBase::subEvent().

Referenced by osg::BasicActorBase::subHelper().

00316 {
00317     BasicActorStoreIt  itActor = _basicActors.begin() + pos;
00318     BasicActorBase    *pActor  = *itActor;
00319 
00320     this  ->subBasicEvent(pActor, pos                 );
00321     pActor->subEvent     (this,   pActor->getActorId());
00322 
00323     _basicActors.erase(itActor);
00324 }

UInt32 NewActionBase::findBasicActor ( BasicActorBase pActor  )  const [inherited]

Return the index of the basic actor or TypeTraits<UInt32>::getMax() if the actor is not found. The return value may be used as the pos argument to the addBasicActor and subBasicActor methods.

Definition at line 332 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors.

Referenced by osg::BasicActorBase::findHelper(), and osg::BasicActorBase::subHelper().

00333 {
00334     BasicActorStoreConstIt itActors  = _basicActors.begin();
00335     BasicActorStoreConstIt endActors = _basicActors.end  ();
00336 
00337     UInt32            pos       = 0;
00338     bool              found     = false;
00339 
00340     for(; (itActors != endActors) && !found; ++itActors, ++pos)
00341     {
00342         if(*itActors == pActor)
00343         {
00344             found = true;
00345             break;
00346         }
00347     }
00348 
00349     return (found ? pos : TypeTraits<UInt32>::getMax());
00350 }

UInt32 NewActionBase::getNumBasicActors ( void   )  const [inherited]

Return the number of basic actors attached to the action.

Definition at line 356 of file OSGNewActionBase.cpp.

References osg::NewActionBase::_basicActors.

00357 {
00358     return _basicActors.size();
00359 }

UInt32 osg::NewActionBase::getTravMask ( void   )  const [inline, inherited]

Return the traversal mask of this action. The action will only traverse a node if the bitwise AND of its traversal mask with the actions is nonzero.

Definition at line 76 of file OSGNewActionBase.inl.

References osg::NewActionBase::_travMask.

Referenced by enqueueChildren(), osg::DepthFirstStateAction::pushChildren(), and osg::DepthFirstAction::pushChildren().

00077 {
00078     return _travMask;
00079 }

void osg::NewActionBase::setTravMask ( UInt32  travMask  )  [inline, inherited]

Set the actions traversal maks. The action will only traverse a node if the bitwise AND of its traversal mask with the actions is nonzero.

Definition at line 86 of file OSGNewActionBase.inl.

References osg::NewActionBase::_travMask.

00087 {
00088     _travMask = travMask;
00089 }

bool osg::NewActionBase::getChildrenListEnabled ( void   )  const [inline, protected, inherited]
void osg::NewActionBase::setChildrenListEnabled ( bool  enabled  )  [inline, protected, inherited]

Enable or disable the children list.

Ext: Actors should avoid enabling the children list without need as it has a negative impact on performance, e.g. if you do not want to traverse any children it is far more effective to return NewActionTypes::Skip instead of enabling the children list and setting all children inactive.

Definition at line 115 of file OSGNewActionBase.inl.

References osg::NewActionBase::_childrenList, osg::NewActionBase::_childrenListEnabled, and osg::ChildrenList::reset().

Referenced by enqueueChildren(), osg::DepthFirstStateAction::pushChildren(), osg::DepthFirstAction::pushChildren(), and osg::ActorBase::setChildrenListEnabled().

00116 {
00117     if((enabled == true) && (_childrenListEnabled == false))
00118     {
00119         _childrenList.reset();
00120     }
00121 
00122     _childrenListEnabled = enabled;
00123 }

const ChildrenList & osg::NewActionBase::getChildrenList ( void   )  const [inline, protected, inherited]
ChildrenList & osg::NewActionBase::getChildrenList ( void   )  [inline, protected, inherited]

Return a reference to the children list.

Ext: ExtendActorBase and BasicActorBase have convenience functions for children management, use them instead of manipulating the list directly.

Definition at line 148 of file OSGNewActionBase.inl.

References osg::NewActionBase::_childrenList.

00149 {
00150     return _childrenList;
00151 }

const ExtraChildrenList & osg::NewActionBase::getExtraChildrenList ( void   )  const [inline, protected, inherited]
ExtraChildrenList & osg::NewActionBase::getExtraChildrenList ( void   )  [inline, protected, inherited]

Return a reference to the children list.

Ext: ExtendActorBase and BasicActorBase have convenience functions for extra children management, use them instead of manipulating the list directly.

Definition at line 176 of file OSGNewActionBase.inl.

References osg::NewActionBase::_extraChildrenList.

00177 {
00178     return _extraChildrenList;
00179 }

UInt32 osg::NewActionBase::getNumPasses ( void   )  const [inline, protected, inherited]
void osg::NewActionBase::setNumPasses ( UInt32  numPasses  )  [inline, protected, inherited]
NewActionBase::ExtendActorStoreConstIt osg::NewActionBase::beginExtend ( void   )  const [inline, protected, inherited]
NewActionBase::ExtendActorStoreIt osg::NewActionBase::beginExtend ( void   )  [inline, protected, inherited]

Return an iterator to the beginning of the extend actors.

Definition at line 214 of file OSGNewActionBase.inl.

References osg::NewActionBase::_extendActors.

00215 {
00216     return _extendActors.begin();
00217 }

NewActionBase::ExtendActorStoreConstIt osg::NewActionBase::endExtend ( void   )  const [inline, protected, inherited]
NewActionBase::ExtendActorStoreIt osg::NewActionBase::endExtend ( void   )  [inline, protected, inherited]

Return an iterator to the end of the extend actors.

Definition at line 232 of file OSGNewActionBase.inl.

References osg::NewActionBase::_extendActors.

00233 {
00234     return _extendActors.end();
00235 }

NewActionBase::BasicActorStoreConstIt osg::NewActionBase::beginBasic ( void   )  const [inline, protected, inherited]
NewActionBase::BasicActorStoreIt osg::NewActionBase::beginBasic ( void   )  [inline, protected, inherited]

Return an iterator to the beginning of the basic actors.

Definition at line 250 of file OSGNewActionBase.inl.

References osg::NewActionBase::_basicActors.

00251 {
00252     return _basicActors.begin();
00253 }

NewActionBase::BasicActorStoreConstIt osg::NewActionBase::endBasic ( void   )  const [inline, protected, inherited]
NewActionBase::BasicActorStoreIt osg::NewActionBase::endBasic ( void   )  [inline, protected, inherited]

Return an iterator to the end of the basic actors.

Definition at line 268 of file OSGNewActionBase.inl.

References osg::NewActionBase::_basicActors.

00269 {
00270     return _basicActors.end();
00271 }

NewActionBase::ResultE NewActionBase::startActors ( void   )  [protected, inherited]

Return a const iterator to the beginning of the extend actors.

Definition at line 428 of file OSGNewActionBase.cpp.

References osg::NewActionBase::beginBasic(), osg::NewActionBase::beginExtend(), osg::NewActionTypes::Continue, osg::NewActionBase::endBasic(), osg::NewActionBase::endExtend(), and osg::NewActionTypes::Quit.

Referenced by apply(), osg::DepthFirstStateAction::apply(), and osg::DepthFirstAction::apply().

00429 {
00430     ResultE            result      = NewActionTypes::Continue;
00431 
00432     ExtendActorStoreIt itExtend    = beginExtend();
00433     ExtendActorStoreIt endItExtend = endExtend  ();
00434 
00435     for(; (itExtend != endItExtend         ) &&
00436          !(result   &  NewActionTypes::Quit);    ++itExtend)
00437     {
00438         result = (*itExtend)->start();
00439     }
00440 
00441     BasicActorStoreIt itBasic    = beginBasic();
00442     BasicActorStoreIt endItBasic = endBasic  ();
00443 
00444     for(;  (itBasic != endItBasic          ) &&
00445           !(result  &  NewActionTypes::Quit);    ++itBasic)
00446     {
00447         result = (*itBasic)->start();
00448     }
00449 
00450     return result;
00451 }

NewActionBase::ResultE NewActionBase::stopActors ( void   )  [protected, inherited]

Return a const iterator to the beginning of the extend actors.

Definition at line 454 of file OSGNewActionBase.cpp.

References osg::NewActionBase::beginBasic(), osg::NewActionBase::beginExtend(), osg::NewActionTypes::Continue, osg::NewActionBase::endBasic(), osg::NewActionBase::endExtend(), and osg::NewActionTypes::Quit.

Referenced by apply(), osg::DepthFirstStateAction::apply(), and osg::DepthFirstAction::apply().

00455 {
00456     ResultE            result      = NewActionTypes::Continue;
00457 
00458     ExtendActorStoreIt itExtend    = beginExtend();
00459     ExtendActorStoreIt endItExtend = endExtend  ();
00460 
00461     for(; (itExtend != endItExtend         ) &&
00462          !(result   &  NewActionTypes::Quit);    ++itExtend)
00463     {
00464         result = (*itExtend)->stop();
00465     }
00466 
00467     BasicActorStoreIt itBasic    = beginBasic();
00468     BasicActorStoreIt endItBasic = endBasic  ();
00469 
00470     for(;  (itBasic != endItBasic          ) &&
00471           !(result  &  NewActionTypes::Quit);    ++itBasic)
00472     {
00473         result = (*itBasic)->stop();
00474     }
00475 
00476     return result;
00477 }


Friends And Related Function Documentation

friend class StateRefCount [friend]

Definition at line 164 of file OSGPriorityAction.h.

Referenced by cloneState(), and getState().

friend class NodeQueueEntry [friend]

Definition at line 166 of file OSGPriorityAction.h.

Referenced by apply(), enqueueChildren(), and traverseEnter().

friend class osg::ActorBase [friend, inherited]

Definition at line 168 of file OSGNewActionBase.h.

friend class osg::ExtendActorBase [friend, inherited]

Definition at line 169 of file OSGNewActionBase.h.

friend class osg::BasicActorBase [friend, inherited]

Definition at line 170 of file OSGNewActionBase.h.


Member Data Documentation

Definition at line 73 of file OSGPriorityAction.h.

Referenced by beginEditStateEvent(), and startEvent().

Definition at line 74 of file OSGPriorityAction.h.

Referenced by startEvent(), and traverseEnter().

Definition at line 259 of file OSGPriorityAction.h.

Referenced by pqClear(), pqEmpty(), pqPop(), pqPush(), and pqTop().

Definition at line 260 of file OSGPriorityAction.h.

Referenced by pqPop(), and pqPush().

Definition at line 262 of file OSGPriorityAction.h.

Referenced by apply(), beginEditStateEvent(), and traverseEnter().

Definition at line 265 of file OSGPriorityAction.h.

Referenced by apply(), cloneState(), decRefCount(), and getState().

Definition at line 268 of file OSGPriorityAction.h.

Referenced by apply(), cloneState(), decRefCount(), and getState().

Definition at line 269 of file OSGPriorityAction.h.

Referenced by apply().

Definition at line 270 of file OSGPriorityAction.h.

Referenced by apply(), beginEditStateEvent(), enqueueChildren(), and traverseEnter().


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

Generated on 8 Feb 2010 for OpenSG by  doxygen 1.6.1