#include <OSGActorBase.h>
Inheritance diagram for osg::ActorBase:

Types | |
| typedef NewActionTypes::PriorityType | PriorityType |
| typedef NewActionTypes::PriorityTypeTraits | PriorityTypeTraits |
| typedef NewActionTypes::Functor | Functor |
| typedef NewActionTypes::FunctorArgumentType | FunctorArgumentType |
| *typedef NewActionTypes::ResultE | ResultE |
Public Member Functions | |
Destructor | |
| *virtual | ~ActorBase (void)=0 |
Start/Stop | |
| *virtual ResultE | start (void)=0 |
| virtual ResultE | stop (void)=0 |
Enter/Leave Callback | |
| *virtual ResultE | enterNode (FunctorArgumentType &funcArg)=0 |
| virtual ResultE | leaveNode (FunctorArgumentType &funcArg)=0 |
Config | |
| *bool | getEnterNodeFlag (void) const |
| bool | getLeaveNodeFlag (void) const |
| void | setEnterNodeFlag (bool enter) |
| void | setLeaveNodeFlag (bool leave) |
Action Access | |
| *const NewActionBase * | getAction (void) const |
| NewActionBase * | getAction (void) |
| UInt32 | getActorId (void) const |
Children Management | |
| *bool | getChildrenListEnabled (void) const |
| void | setChildrenListEnabled (bool enabled) |
| NodePtr | getNode (void) const |
| UInt32 | getNumChildren (void) const |
| NodePtr | getChild (UInt32 childIndex) const |
| bool | getChildActive (UInt32 childIndex) const |
| void | setChildActive (UInt32 childIndex, bool active) |
| PriorityType | getChildPriority (UInt32 childIndex) const |
| void | setChildPriority (UInt32 childIndex, PriorityType prio) |
Extra Children Management | |
| *UInt32 | getNumExtraChildren (void) const |
| NodePtr | getExtraChild (UInt32 childIndex) const |
| bool | getExtraChildActive (UInt32 childIndex) const |
| void | setExtraChildActive (UInt32 childIndex, bool active) |
| PriorityType | getExtraChildPriority (UInt32 childIndex) const |
| void | setExtraChildPriority (UInt32 childIndex, PriorityType prio) |
Multi Pass Management | |
| *UInt32 | getNumPasses (void) const |
State Management | |
| *virtual ActorBaseState * | createStateClone (void)=0 |
| virtual void | destroyStateClone (ActorBaseState *pStateClone)=0 |
| virtual void | createInitialState (void)=0 |
| virtual void | deleteInitialState (void)=0 |
| void | beginEditState (void) |
| void | endEditState (void) |
| const ActorBaseState * | getState (void) const |
| ActorBaseState * | getState (void) |
| void | setState (ActorBaseState *pState) |
Protected Member Functions | |
Constructor | |
| * | ActorBase (void) |
Add, Sub and Find Helper | |
| *virtual UInt32 | addHelper (NewActionBase *pAction)=0 |
| virtual void | subHelper (NewActionBase *pAction)=0 |
| virtual UInt32 | findHelper (const NewActionBase *pAction)=0 |
Event Notification | |
| *virtual void | addEvent (NewActionBase *pAction, UInt32 actorId) |
| virtual void | subEvent (NewActionBase *pAction, UInt32 actorId) |
Protected Attributes | |
Types | |
| *typedef ActorBaseState | StateType |
Private Attributes | |
| NewActionBase * | _pAction |
| UInt32 | _actorId |
| bool | _enterNodeFlag |
| bool | _leaveNodeFlag |
| ActorBaseState * | _pState |
Classes | |
| class | ActorBaseState |
Ext:
To create a new actor you should use the actorEdit utility that can be found in /OpenSG/Tools/actorEdit. It will generate a base class for your own actor that takes care of the management of functors and state.
Definition at line 58 of file OSGActorBase.h.
|
|
Definition at line 67 of file OSGActorBase.h. |
|
|
Definition at line 68 of file OSGActorBase.h. |
|
|
Definition at line 69 of file OSGActorBase.h. |
|
|
Definition at line 70 of file OSGActorBase.h. |
|
|
Destructor Definition at line 95 of file OSGActorBase.cpp.
|
|
|
Constructor Definition at line 139 of file OSGActorBase.cpp. 00140 : _pAction (NULL ), 00141 _actorId (TypeTraits<UInt32>::getMax()), 00142 _enterNodeFlag(false ), 00143 _leaveNodeFlag(false ), 00144 #ifdef OSG_NEWACTION_STATESLOTINTERFACE 00145 _stateSlotMap ( ), 00146 #endif 00147 _pState (NULL ) 00148 { 00149 }
|
|
|
Called by an action before a traversal.
Implemented in osg::BasicActorBase, and osg::ExtendActorBase. Definition at line 109 of file OSGActorBase.cpp. References osg::NewActionTypes::Continue. 00110 { 00111 #ifdef OSG_NEWACTION_STATESLOTINTERFACE 00112 _stateSlotMap.clear(); 00113 #endif 00114 00115 return NewActionTypes::Continue; 00116 }
|
|
|
Called by an action after a traversal.
Implemented in osg::BasicActorBase, and osg::ExtendActorBase. Definition at line 123 of file OSGActorBase.cpp. References osg::NewActionTypes::Continue. 00124 { 00125 #ifdef OSG_NEWACTION_STATESLOTINTERFACE 00126 _stateSlotMap.clear(); 00127 #endif 00128 00129 return NewActionTypes::Continue; 00130 }
|
|
|
|
|
|
|
|
|
Return if operations upon "entering" a node are enabled. Definition at line 75 of file OSGActorBase.inl. References _enterNodeFlag. Referenced by osg::PriorityAction::addBasicEvent(), osg::DepthFirstStateAction::addBasicEvent(), osg::DepthFirstAction::addBasicEvent(), osg::PriorityAction::addExtendEvent(), osg::DepthFirstStateAction::addExtendEvent(), and osg::DepthFirstAction::addExtendEvent(). 00076 { 00077 return _enterNodeFlag; 00078 }
|
|
|
Return if operations upon "leaving" a node are enabled. Definition at line 84 of file OSGActorBase.inl. References _leaveNodeFlag. Referenced by osg::DepthFirstStateAction::addBasicEvent(), osg::DepthFirstAction::addBasicEvent(), osg::DepthFirstStateAction::addExtendEvent(), and osg::DepthFirstAction::addExtendEvent(). 00085 { 00086 return _leaveNodeFlag; 00087 }
|
|
|
Set if operations upon "entering a node are desired.
Definition at line 95 of file OSGActorBase.inl. References _enterNodeFlag. 00096 { 00097 _enterNodeFlag = enter; 00098 }
|
|
|
Set if operations upon "leaving a node are desired.
Definition at line 106 of file OSGActorBase.inl. References _leaveNodeFlag. 00107 { 00108 _leaveNodeFlag = leave; 00109 }
|
|
|
Definition at line 116 of file OSGActorBase.inl. References _pAction. Referenced by osg::ExtendActorBase::addExtraChild(), and osg::ExtendActorBase::setNumPasses(). 00117 { 00118 return _pAction; 00119 }
|
|
|
Definition at line 122 of file OSGActorBase.inl. References _pAction. 00123 { 00124 return _pAction; 00125 }
|
|
|
Definition at line 128 of file OSGActorBase.inl. References _actorId. Referenced by osg::NewActionBase::subBasicActor(), and osg::NewActionBase::subExtendActor(). 00129 { 00130 return _actorId; 00131 }
|
|
|
Return if the children list is enabled. Definition at line 141 of file OSGActorBase.inl. References _pAction, and osg::NewActionBase::getChildrenListEnabled(). 00142 { 00143 return _pAction->getChildrenListEnabled(); 00144 }
|
|
|
Enable or disable the children list. Definition at line 150 of file OSGActorBase.inl. References _pAction, and osg::NewActionBase::setChildrenListEnabled(). 00151 { 00152 _pAction->setChildrenListEnabled(enabled); 00153 }
|
|
|
Return the traversed node. Definition at line 159 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getChildrenList(), and osg::ChildrenList::getParentNode(). 00160 { 00161 return _pAction->getChildrenList().getParentNode(); 00162 }
|
|
|
Return the number of children of the traversed node. Definition at line 168 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getChildrenList(), and osg::ChildrenList::getSize(). 00169 { 00170 return _pAction->getChildrenList().getSize(); 00171 }
|
|
|
Return the childIndex'th child of the traversed node.
Definition at line 178 of file OSGActorBase.inl. References _pAction, osg::ChildrenList::getChild(), and osg::NewActionBase::getChildrenList(). 00179 { 00180 return _pAction->getChildrenList().getChild(childIndex); 00181 }
|
|
|
Return if the childIndex'th child is active, i.e. whether it will be traversed.
Definition at line 191 of file OSGActorBase.inl. References _pAction, osg::ChildrenList::getActive(), and osg::NewActionBase::getChildrenList(). 00192 { 00193 return _pAction->getChildrenList().getActive(childIndex); 00194 }
|
|
||||||||||||
|
Set if the childIndex'th child will be included in the traversal.
Definition at line 203 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getChildrenList(), and osg::ChildrenList::setActive(). 00204 { 00205 _pAction->getChildrenList().setActive(childIndex, active); 00206 }
|
|
|
Return the priority assigned to the childIndex'th child.
Definition at line 215 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getChildrenList(), and osg::ChildrenList::getPriority(). 00216 { 00217 return _pAction->getChildrenList().getPriority(childIndex); 00218 }
|
|
||||||||||||
|
Set the priority of the childIndex'th child.
Definition at line 227 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getChildrenList(), and osg::ChildrenList::setPriority(). 00228 { 00229 _pAction->getChildrenList().setPriority(childIndex, prio); 00230 }
|
|
|
Return the number of extra children already added. Definition at line 240 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getExtraChildrenList(), and osg::ExtraChildrenList::getSize(). 00241 { 00242 return _pAction->getExtraChildrenList().getSize(); 00243 }
|
|
|
Return the childIndex'th extra child.
Definition at line 250 of file OSGActorBase.inl. References _pAction, osg::ExtraChildrenList::getChild(), and osg::NewActionBase::getExtraChildrenList(). 00251 { 00252 return _pAction->getExtraChildrenList().getChild(childIndex); 00253 }
|
|
|
Return if the childIndex'th extra child is active, i.e. whether it will be traversed.
Definition at line 261 of file OSGActorBase.inl. References _pAction, osg::ExtraChildrenList::getActive(), and osg::NewActionBase::getExtraChildrenList(). 00262 { 00263 return _pAction->getExtraChildrenList().getActive(childIndex); 00264 }
|
|
||||||||||||
|
Set if the childIndex'th extra child will be included in the traversal.
Definition at line 271 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getExtraChildrenList(), and osg::ExtraChildrenList::setActive(). 00272 { 00273 _pAction->getExtraChildrenList().setActive(childIndex, active); 00274 }
|
|
|
Return the priority assigned to the childIndex'th extra child.
Definition at line 281 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getExtraChildrenList(), and osg::ExtraChildrenList::getPriority(). 00282 { 00283 return _pAction->getExtraChildrenList().getPriority(childIndex); 00284 }
|
|
||||||||||||
|
Set the priority of the childIndex'th extra child.
Definition at line 291 of file OSGActorBase.inl. References _pAction, osg::NewActionBase::getExtraChildrenList(), and osg::ExtraChildrenList::setPriority(). 00292 { 00293 _pAction->getExtraChildrenList().setPriority(childIndex, prio); 00294 }
|
|
|
Return the number of passes requested for the current node. The default number of passes is 1. Definition at line 305 of file OSGActorBase.inl. References _pAction, and osg::NewActionBase::getNumPasses(). 00306 { 00307 return _pAction->getNumPasses(); 00308 }
|
|
|
|
|
|
|
|
|
Referenced by addEvent(). |
|
|
Referenced by subEvent(). |
|
|
Notify the action, that state is about to be edited. Ext: Call this method inside a functor or the enterNode method of an actor before accessing any state variables. If you are worried about top performance you may omit the call as long as you only read state values, but as this is error prone it is not recommended. Definition at line 326 of file OSGActorBase.inl. References _actorId, _pAction, and osg::NewActionBase::beginEditStateEvent().
|
|
|
Notify the action, that state access is complete. Ext: Call this method after you are done with modifying state. None of the implemented actions perform anything upon this call, hence it is not as critical as the beginEditState call. Definition at line 341 of file OSGActorBase.inl. References _actorId, _pAction, and osg::NewActionBase::endEditStateEvent().
|
|
|
Get a const pointer to the currently used state. Definition at line 350 of file OSGActorBase.inl. References _pState. 00351 { 00352 return _pState; 00353 }
|
|
|
Get a pointer to the currently used state. Definition at line 359 of file OSGActorBase.inl. References _pState. 00360 { 00361 return _pState; 00362 }
|
|
|
Set the currently used state. Definition at line 368 of file OSGActorBase.inl. References _pState. 00369 { 00370 _pState = pState; 00371 }
|
|
|
Implemented in osg::BasicActorBase, and osg::ExtendActorBase. Referenced by osg::NewActionBase::addActor(). |
|
|
Implemented in osg::BasicActorBase, and osg::ExtendActorBase. Referenced by osg::NewActionBase::subActor(). |
|
|
Implemented in osg::BasicActorBase, and osg::ExtendActorBase. Referenced by osg::NewActionBase::findActor(). |
|
||||||||||||
|
Notifies the actor, that it was added to an action.
Definition at line 160 of file OSGActorBase.cpp. References _actorId, _pAction, createInitialState(), osg::endLog(), and SWARNING. Referenced by osg::NewActionBase::addBasicActor(), and osg::NewActionBase::addExtendActor(). 00161 { 00162 if((_pAction != NULL) || (_actorId != TypeTraits<UInt32>::getMax())) 00163 { 00164 SWARNING << "ActorBase::attachEvent: Actor already attached." 00165 << endLog; 00166 } 00167 00168 createInitialState(); 00169 00170 _pAction = pAction; 00171 _actorId = actorId; 00172 }
|
|
||||||||||||
|
Notifies the actor, that it was removed from an action.
Definition at line 179 of file OSGActorBase.cpp. References _actorId, _pAction, deleteInitialState(), osg::endLog(), and SWARNING. Referenced by osg::NewActionBase::subBasicActor(), and osg::NewActionBase::subExtendActor(). 00180 { 00181 if((_pAction != pAction) || (_actorId != actorId)) 00182 { 00183 SWARNING << "ActorBase::detachEvent: Inconsistency detected." 00184 << endLog; 00185 } 00186 00187 deleteInitialState(); 00188 00189 _pAction = NULL; 00190 _actorId = TypeTraits<UInt32>::getMax(); 00191 }
|
|
|
Definition at line 66 of file OSGActorBase.h. |
|
|
Reimplemented in osg::BasicActorBase, and osg::ExtendActorBase. Definition at line 200 of file OSGActorBase.h. |
|
|
|
Definition at line 244 of file OSGActorBase.h. Referenced by addEvent(), beginEditState(), endEditState(), getActorId(), and subEvent(). |
|
|
Definition at line 246 of file OSGActorBase.h. Referenced by getEnterNodeFlag(), and setEnterNodeFlag(). |
|
|
Definition at line 247 of file OSGActorBase.h. Referenced by getLeaveNodeFlag(), and setLeaveNodeFlag(). |
|
|
Definition at line 253 of file OSGActorBase.h. Referenced by getState(), and setState(). |
1.4.3