#include <jump_movement.h>


Public Types | |
| enum | Dimension { X, Y, Z } |
Public Member Functions | |
| virtual void | set_dimension (Dimension, double) |
| virtual void | set_dimensions (Vec *newpos) |
construction / destruction | |
| JumpMovement () | |
| virtual | ~JumpMovement () |
| virtual void | init (Node &) throw () |
| virtual void | init_from (Node &, NodeMovement &) throw () |
inherited from NodeMovement | |
| virtual bool | set_position (const Vec &) throw () |
| virtual Vec | position (void) const throw () |
| virtual Vec | velocity (void) const throw () |
| virtual std::string | name (void) const throw () |
Protected Member Functions | |
| virtual void | boxes_changed () throw () |
In short, the JumpMovement changes a single Node Coordinate, i.e. x,y or z. If the Node was moving before, it stops. The velocity of a JumpMovement is always zero.
To ensure compatibility with ns-2 movement files a method set_dimension() is provided, allowing the setting of only a single dimension. The remaining dimensions are taking from the previous Node position.
set_position will always use all dimensions of the provided Vec
| shawn::JumpMovement::JumpMovement | ( | ) |
| virtual shawn::JumpMovement::~JumpMovement | ( | ) | [virtual] |
| virtual void shawn::JumpMovement::init | ( | Node & | ) | throw () [virtual] |
Called from Node when added there!
Should call set_node() and obtain_initial_boxes()
Implements shawn::NodeMovement.
| virtual void shawn::JumpMovement::init_from | ( | Node & | , | |
| NodeMovement & | ||||
| ) | throw () [virtual] |
Implements shawn::NodeMovement.
| virtual bool shawn::JumpMovement::set_position | ( | const Vec & | ) | throw () [virtual] |
Sets the new position to be identical to the given position Vector.
Implements shawn::NodeMovement.
| virtual Vec shawn::JumpMovement::position | ( | void | ) | const throw () [virtual] |
Returns the current position of the corresponding Node
Implements shawn::NodeMovement.
| virtual Vec shawn::JumpMovement::velocity | ( | void | ) | const throw () [virtual] |
Always returns a zero velocity (0,0,0).
Implements shawn::NodeMovement.
| virtual std::string shawn::JumpMovement::name | ( | void | ) | const throw () [virtual] |
Returns the type of Movement, in this case JumpMovement.
Implements shawn::NodeMovement.
| virtual void shawn::JumpMovement::set_dimension | ( | Dimension | , | |
| double | ||||
| ) | [virtual] |
This method sets one Dimension (X,Y or Z) that is to be replaced
| virtual void shawn::JumpMovement::set_dimensions | ( | Vec * | newpos | ) | [virtual] |
This method alters whole position vector (X,Y or Z)
| virtual void shawn::JumpMovement::boxes_changed | ( | ) | throw () [protected, virtual] |
Implements shawn::NodeMovement.
1.5.6