#include <node_movement.h>


Public Member Functions | |
construction / destruction | |
| NodeMovement () | |
| virtual | ~NodeMovement () |
| virtual void | init (Node &)=0 throw () |
| virtual void | init_from (Node &, NodeMovement &)=0 throw () |
node positioning | |
| virtual bool | set_position (const Vec &)=0 throw () |
| virtual Vec | position (void) const =0 throw () |
| virtual Vec | velocity (void) const =0 throw () |
misc access | |
| virtual std::string | name (void) const =0 throw () |
| virtual int | simulation_round (void) const throw () |
| virtual double | current_time (void) const throw () |
| virtual const World & | world (void) const throw () |
| virtual World & | world_w (void) throw () |
| virtual Node & | node_w (void) throw () |
| virtual const Node & | node (void) throw () |
Protected Member Functions | |
| virtual void | set_node (Node &) throw () |
| virtual void | movement_initial_boxes () throw () |
| virtual void | movement_update_boxes () throw () |
| virtual void | observers_added (MovementObserver &obs) throw () |
| virtual void | boxes_changed ()=0 throw () |
A NodeMovement that supports only a single Node at once should probably derive from SingleNodeMovement , which provides a few utility methods for easier implementation.
| shawn::NodeMovement::NodeMovement | ( | ) |
| virtual shawn::NodeMovement::~NodeMovement | ( | ) | [virtual] |
| virtual void shawn::NodeMovement::init | ( | Node & | ) | throw () [pure virtual] |
Called from Node when added there!
Should call set_node() and obtain_initial_boxes()
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual void shawn::NodeMovement::init_from | ( | Node & | , | |
| NodeMovement & | ||||
| ) | throw () [pure virtual] |
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual bool shawn::NodeMovement::set_position | ( | const Vec & | ) | throw () [pure virtual] |
sets the current position of the given node. There is no need for a NodeMovement to actually place the Node there, as it may be the single authority about node positions.
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual Vec shawn::NodeMovement::position | ( | void | ) | const throw () [pure virtual] |
returns the current position of the node.
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual Vec shawn::NodeMovement::velocity | ( | void | ) | const throw () [pure virtual] |
returns the current velocity vector of the node, ie, the derivate of the position function.
Therefore,
velocity().euclidean_norm()
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual std::string shawn::NodeMovement::name | ( | void | ) | const throw () [pure virtual] |
Implemented in shawn::JumpMovement, shawn::LinearMovement, shawn::NoMovement, and shawn::SimpleMovement.
| virtual int shawn::NodeMovement::simulation_round | ( | void | ) | const throw () [virtual] |
| virtual double shawn::NodeMovement::current_time | ( | void | ) | const throw () [virtual] |
| virtual Node& shawn::NodeMovement::node_w | ( | void | ) | throw () [virtual] |
| virtual const Node& shawn::NodeMovement::node | ( | void | ) | throw () [virtual] |
| virtual void shawn::NodeMovement::set_node | ( | Node & | ) | throw () [protected, virtual] |
| virtual void shawn::NodeMovement::movement_initial_boxes | ( | ) | throw () [protected, virtual] |
| virtual void shawn::NodeMovement::movement_update_boxes | ( | ) | throw () [protected, virtual] |
| virtual void shawn::NodeMovement::observers_added | ( | MovementObserver & | obs | ) | throw () [protected, virtual] |
| virtual void shawn::NodeMovement::boxes_changed | ( | ) | throw () [protected, pure virtual] |
Implemented in shawn::JumpMovement, shawn::LinearMovement, and shawn::NoMovement.
1.5.6