#include <ArActionGroup.h>
Inheritance diagram for ArActionGroup::
Public Methods | |
ArActionGroup (ArRobot *robot) | |
Constructor. More... | |
virtual | ~ArActionGroup (void) |
Destructor, it also deletes the actions in its group. | |
virtual void | addAction (ArAction *action, int priority) |
Adds the action to the robot this group uses with the given priority. More... | |
virtual void | remAction (ArAction *action) |
Removes the action from the robot this group uses. More... | |
virtual void | activate (void) |
Activates all the actions in this group. | |
virtual void | activateExclusive (void) |
Activates all the actions in this group and deactivates all others. | |
virtual void | deactivate (void) |
Deactivates all the actions in this group. | |
virtual void | removeActions (void) |
Removes all the actions in this group from the robot. | |
virtual std::list< ArAction *> * | getActionList (void) |
Gets the action list (use this to delete actions after doing removeActions). |
This class is used to have a group of ArActions and turn them on and off in aggregate... this is so that you can say have a group of like 5 behaviors for teleop or wander, and just turn 'em all on and off at once. Note that the destructor by default will delete the actions added to the group, this is controlled with a flag to the constructor though, so you can have it how you want.... this is nice though so you can just do addAction(new ArActionWhatever(blah, blah, blah), 90); and not worry about the deletion (since the destructor will do it), just delete the group... if for some reason (I'd advise against it) you are using one action in multiple groups, don't use this feature, ie pass in false to the constructor for it or you'll wind up with a crash when the action is deleted by both groups (again, you should probably only have an action in one group).
|
Constructor. @param robot The robot that this action group is attached to @param deleteActionsOnDestruction if this is true then when the destructor is called the actions that this group has will be deleted |
|
Adds the action to the robot this group uses with the given priority. @param action the action to add to the robot @param priority the priority to give the action @see ArRobot::addAction |
|
Removes the action from the robot this group uses. @param action the action to remove from the robot @see ArRobot::remAction |