#include <OSGDepthFirstStateAction.h>
Inheritance diagram for osg::DepthFirstStateAction:

Definition at line 63 of file OSGDepthFirstStateAction.h.
|
|
Definition at line 137 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 164 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 165 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 166 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 191 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 192 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 193 of file OSGDepthFirstStateAction.h. |
|
|
Definition at line 218 of file OSGDepthFirstStateAction.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. |
|
|
Definition at line 156 of file OSGNewActionBase.h. |
|
|
Definition at line 157 of file OSGNewActionBase.h. |
|
|
Definition at line 159 of file OSGNewActionBase.h. |
|
|
Definition at line 160 of file OSGNewActionBase.h. |
|
|
Definition at line 161 of file OSGNewActionBase.h. |
|
|
Destructor. Definition at line 71 of file OSGDepthFirstStateAction.cpp.
|
|
|
Default constructor. Definition at line 154 of file OSGDepthFirstStateAction.cpp. Referenced by create(). 00155 : Inherited ( ), 00156 _nodeStack ( ), 00157 _stateRefCountStore( ), 00158 #ifndef OSG_NEWACTION_STATESLOTINTERFACE 00159 _stateStore ( ), 00160 #endif 00161 _itInitialState ( ), 00162 _itActiveState ( ), 00163 _stateClonedFlag (false), 00164 _extendEnterActors ( ), 00165 _extendLeaveActors ( ), 00166 _basicEnterActors ( ), 00167 _basicLeaveActors ( ) 00168 { 00169 }
|
|
|
Create new instance. Definition at line 83 of file OSGDepthFirstStateAction.cpp. References DepthFirstStateAction(). 00084 { 00085 return new DepthFirstStateAction(); 00086 }
|
|
|
Implements osg::NewActionBase. Definition at line 93 of file OSGDepthFirstStateAction.cpp. References _basicLeaveActors, _extendLeaveActors, _itActiveState, _itInitialState, _nodeStack, _stateClonedFlag, _stateRefCountStore, _stateStore, cloneState(), osg::NewActionTypes::Continue, decRefCount(), getState(), incRefCount(), osg::NewActionTypes::Quit, osg::NewActionBase::ResultE, setState(), osg::NewActionBase::startActors(), startEvent(), osg::NewActionBase::stopActors(), stopEvent(), traverseEnter(), and traverseEnterLeave(). 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 _nodeStack.push_back(NodeStackEntry(pRoot, _itActiveState, 1)); 00111 00112 if((_extendLeaveActors.empty() == true) && 00113 (_basicLeaveActors .empty() == true) ) 00114 { 00115 result = traverseEnter(); 00116 } 00117 else 00118 { 00119 result = traverseEnterLeave(); 00120 } 00121 00122 setState(_itInitialState); 00123 00124 // lost refs: active, current node 00125 decRefCount(_itActiveState, 2); 00126 00127 _itActiveState = _itInitialState; 00128 _stateClonedFlag = true; 00129 00130 _nodeStack .clear(); 00131 #ifndef OSG_NEWACTION_STATESLOTINTERFACE 00132 _stateStore .clear(); 00133 #endif 00134 _stateRefCountStore.clear(); 00135 00136 if(result & NewActionTypes::Quit) 00137 return result; 00138 00139 result = stopActors(); 00140 00141 stopEvent(); 00142 00143 return result; 00144 }
|
|
||||||||||||
|
Inserts the extend actor into an internal data structure, depending on whether the enter node flag and leave node flag are set. This avoids making the destinction everytime the actors are called. Implements osg::NewActionBase. Definition at line 181 of file OSGDepthFirstStateAction.cpp. References _extendEnterActors, _extendLeaveActors, osg::NewActionBase::beginExtend(), osg::ActorBase::getEnterNodeFlag(), and osg::ActorBase::getLeaveNodeFlag(). 00182 { 00183 ExtendActorStoreIt itActors = beginExtend(); 00184 ExtendActorStoreIt endActors = beginExtend() + actorIndex; 00185 00186 ExtendActorStoreIt itEnter = _extendEnterActors.begin(); 00187 ExtendActorStoreIt itLeave = _extendLeaveActors.begin(); 00188 00189 for(; itActors != endActors; ++itActors) 00190 { 00191 if((*itActors)->getEnterNodeFlag() == true) 00192 ++itEnter; 00193 00194 if((*itActors)->getLeaveNodeFlag() == true) 00195 ++itLeave; 00196 } 00197 00198 if(pActor->getEnterNodeFlag() == true) 00199 _extendEnterActors.insert(itEnter, pActor); 00200 00201 if(pActor->getLeaveNodeFlag() == true) 00202 _extendLeaveActors.insert(itLeave, pActor); 00203 }
|
|
||||||||||||
|
Removes the extend actor from the internal data structures. Implements osg::NewActionBase. Definition at line 209 of file OSGDepthFirstStateAction.cpp. References _extendEnterActors, and _extendLeaveActors. 00210 { 00211 ExtendActorStoreIt itEnter = _extendEnterActors.begin(); 00212 ExtendActorStoreIt endEnter = _extendEnterActors.end (); 00213 00214 ExtendActorStoreIt itLeave = _extendLeaveActors.begin(); 00215 ExtendActorStoreIt endLeave = _extendLeaveActors.end (); 00216 00217 for(; itEnter != endEnter; ++itEnter) 00218 { 00219 if(*itEnter == pActor) 00220 { 00221 _extendEnterActors.erase(itEnter); 00222 00223 break; 00224 } 00225 } 00226 00227 for(; itLeave != endLeave; ++itLeave) 00228 { 00229 if(*itLeave == pActor) 00230 { 00231 _extendLeaveActors.erase(itLeave); 00232 00233 break; 00234 } 00235 } 00236 }
|
|
||||||||||||
|
Inserts the basic actor into an internal data structure, depending on whether the enter node flag and leave node flag are set. This avoids making the destinction everytime the actors are called. Implements osg::NewActionBase. Definition at line 244 of file OSGDepthFirstStateAction.cpp. References _basicEnterActors, _basicLeaveActors, osg::NewActionBase::beginBasic(), osg::ActorBase::getEnterNodeFlag(), and osg::ActorBase::getLeaveNodeFlag(). 00245 { 00246 BasicActorStoreIt itActors = beginBasic(); 00247 BasicActorStoreIt endActors = beginBasic() + actorIndex; 00248 00249 BasicActorStoreIt itEnter = _basicEnterActors.begin(); 00250 BasicActorStoreIt itLeave = _basicLeaveActors.begin(); 00251 00252 for(; itActors != endActors; ++itActors) 00253 { 00254 if((*itActors)->getEnterNodeFlag() == true) 00255 ++itEnter; 00256 00257 if((*itActors)->getLeaveNodeFlag() == true) 00258 ++itLeave; 00259 } 00260 00261 if(pActor->getEnterNodeFlag() == true) 00262 _basicEnterActors.insert(itEnter, pActor); 00263 00264 if(pActor->getLeaveNodeFlag() == true) 00265 _basicLeaveActors.insert(itLeave, pActor); 00266 }
|
|
||||||||||||
|
Removes the extend actor from the internal data structures. Implements osg::NewActionBase. Definition at line 272 of file OSGDepthFirstStateAction.cpp. References _basicEnterActors, and _basicLeaveActors. 00273 { 00274 BasicActorStoreIt itEnter = _basicEnterActors.begin(); 00275 BasicActorStoreIt endEnter = _basicEnterActors.end (); 00276 00277 BasicActorStoreIt itLeave = _basicLeaveActors.begin(); 00278 BasicActorStoreIt endLeave = _basicLeaveActors.end (); 00279 00280 for(; itEnter != endEnter; ++itEnter) 00281 { 00282 if(*itEnter == pActor) 00283 { 00284 _basicEnterActors.erase(itEnter); 00285 00286 break; 00287 } 00288 } 00289 00290 for(; itLeave != endLeave; ++itLeave) 00291 { 00292 if(*itLeave == pActor) 00293 { 00294 _basicLeaveActors.erase(itLeave); 00295 00296 break; 00297 } 00298 } 00299 }
|
|
|
Inserts the extend actor into an internal data structure, depending on whether the enter node flag and leave node flag are set. This avoids making the destinction everytime the actors are called. Reimplemented from osg::NewActionBase. Definition at line 302 of file OSGDepthFirstStateAction.cpp. References osg::StatCollector::getElem(), osg::NewActionBase::getStatistics(), osg::StatElem::reset(), statStateClones, and statStateRestores. Referenced by apply(). 00303 { 00304 Inherited::startEvent(); 00305 00306 #ifdef OSG_NEWACTION_STATISTICS 00307 getStatistics()->getElem(statStateClones )->reset(); 00308 getStatistics()->getElem(statStateRestores)->reset(); 00309 #endif /* OSG_NEWACTION_STATISTICS */ 00310 }
|
|
|
Inserts the extend actor into an internal data structure, depending on whether the enter node flag and leave node flag are set. This avoids making the destinction everytime the actors are called. Reimplemented from osg::NewActionBase. Definition at line 313 of file OSGDepthFirstStateAction.cpp. Referenced by apply().
|
|
||||||||||||
|
Creates a copy of the state of the attached actors and activates the copy. Implements osg::NewActionBase. Definition at line 323 of file OSGDepthFirstStateAction.cpp. References _itActiveState, _nodeStack, _stateClonedFlag, cloneState(), decRefCount(), osg::StatCollector::getElem(), osg::NewActionBase::getStatistics(), incRefCount(), and statStateClones. 00324 { 00325 if(_stateClonedFlag == false) 00326 { 00327 #ifdef OSG_NEWACTION_STATISTICS 00328 getStatistics()->getElem(statStateClones)->inc(); 00329 #endif /* OSG_NEWACTION_STATISTICS */ 00330 00331 _stateClonedFlag = true; 00332 00333 StateRefCountStoreIt itClonedState = cloneState(); 00334 00335 // gained refs: active and current node 00336 incRefCount(itClonedState, 2); 00337 00338 // lost refs: active and current node 00339 decRefCount(_itActiveState, 2); 00340 00341 _nodeStack.back().setStateRefCount(itClonedState); 00342 00343 _itActiveState = itClonedState; 00344 } 00345 }
|
|
||||||||||||
|
Does nothing. Implements osg::NewActionBase. Definition at line 351 of file OSGDepthFirstStateAction.cpp.
|
|
|
Definition at line 361 of file OSGDepthFirstStateAction.cpp. References _itActiveState, _nodeStack, _stateClonedFlag, osg::NewActionTypes::Continue, decRefCount(), enterNode(), osg::NewActionBase::getChildrenList(), osg::StatCollector::getElem(), osg::NewActionBase::getNumPasses(), osg::NewActionBase::getStatistics(), incRefCount(), pushChildren(), osg::NewActionTypes::Quit, osg::NewActionBase::ResultE, osg::ChildrenList::setParentNode(), setState(), osg::NewActionBase::statNodesEnter, and statStateRestores. Referenced by apply(). 00362 { 00363 ResultE result = NewActionTypes::Continue; 00364 NodePtr pNode; 00365 Int32 nodePass; // pass over current node 00366 UInt32 multiPasses; // requested passes over current node 00367 StateRefCountStoreIt itStateRefCount; // state for current node 00368 00369 while((_nodeStack.empty() == false) && !(result & NewActionTypes::Quit)) 00370 { 00371 pNode = _nodeStack.back().getNode (); 00372 nodePass = _nodeStack.back().getPassCount (); 00373 itStateRefCount = _nodeStack.back().getStateRefCount(); 00374 00375 #ifdef OSG_NEWACTION_STATISTICS 00376 getStatistics()->getElem(statNodesEnter)->inc(); 00377 #endif /* OSG_NEWACTION_STATISTICS */ 00378 00379 if(itStateRefCount != _itActiveState) 00380 { 00381 #ifdef OSG_NEWACTION_STATISTICS 00382 getStatistics()->getElem(statStateRestores)->inc(); 00383 #endif /* OSG_NEWACTION_STATISTICS */ 00384 00385 setState(itStateRefCount); 00386 00387 // gained refs: active 00388 incRefCount(itStateRefCount); 00389 00390 // lost refs: active 00391 decRefCount(_itActiveState); 00392 00393 _itActiveState = itStateRefCount; 00394 } 00395 00396 _stateClonedFlag = false; 00397 00398 getChildrenList().setParentNode(pNode); 00399 00400 result = enterNode (pNode, static_cast<UInt32>(nodePass - 1)); 00401 multiPasses = getNumPasses( ); 00402 00403 _nodeStack.pop_back(); 00404 00405 // only initial pass (nodePass == 1) can request multiPasses 00406 if((nodePass == 1) && (multiPasses > 1)) 00407 { 00408 for(; multiPasses > 1; --multiPasses) 00409 { 00410 // gained refs: additional pass 00411 incRefCount(_itActiveState); 00412 00413 _nodeStack.push_back( 00414 NodeStackEntry(pNode, _itActiveState, multiPasses)); 00415 } 00416 } 00417 00418 pushChildren(pNode, result); 00419 00420 // lost refs: current node 00421 decRefCount(_itActiveState); 00422 } 00423 00424 return result; 00425 }
|
|