#include <movement_observer.h>

Public Member Functions | |
| virtual | ~MovementObserver () |
| virtual Box | observer_initial_zone (Node &, const Vec &newpos, const Vec &velo)=0 throw () |
| virtual Box | observer_update_zone (Node &, const Vec &newpos, const Vec &velo)=0 throw () |
A class implementing this interface has to provide the methods below.
An initial box is the first box that a MovementObservable object must only leave if observer_update_zone() is called immediately after that. This will serve two purposes: Notification, that the box has been left and retrieval of a new box.
Currently, NodeMovement and Node inherit this interface. If you want to trace a nodes movement, simply add a MovementOverserver reference using the nodes' Node::observer_add method. You will then need to supply an initial box and later an updated box which a node must not leave whithout notification via a callback to your observer_update_zone() method.
| virtual shawn::MovementObserver::~MovementObserver | ( | ) | [virtual] |
destructor
| virtual Box shawn::MovementObserver::observer_initial_zone | ( | Node & | , | |
| const Vec & | newpos, | |||
| const Vec & | velo | |||
| ) | throw () [pure virtual] |
Returns an initial bounding box. If a node leaves this box, observer_update_zone() must be called - by convention - by the observed movement to retrieve a new box.
Implemented in shawn::GridEdgeModel, shawn::LazyEdgeModel, and shawn::ListEdgeModel.
| virtual Box shawn::MovementObserver::observer_update_zone | ( | Node & | , | |
| const Vec & | newpos, | |||
| const Vec & | velo | |||
| ) | throw () [pure virtual] |
Informs this Observer that the old box has been left by the NodeMovement / Node. A new box must be provided by this method.
Implemented in shawn::GridEdgeModel, shawn::LazyEdgeModel, and shawn::ListEdgeModel.
1.5.6