shawn::NoMovement Class Reference

NodeMovement for completely immobile nodes. More...

#include <no_movement.h>

Inheritance diagram for shawn::NoMovement:

Inheritance graph
[legend]
Collaboration diagram for shawn::NoMovement:

Collaboration graph
[legend]

List of all members.

Public Member Functions

construction / destruction
 NoMovement ()
virtual ~NoMovement ()
virtual void init (Node &) throw ()
virtual void init_from (Node &, NodeMovement &) throw ()
NodeMovement interface
only accepted *BEFORE* initialized...

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 ()


Detailed Description

NodeMovement for completely immobile nodes.

The NodeMovement does not allow a node to move. Calls to set_position() are rejected once the position is initialized (via set_initial_zone()).


Constructor & Destructor Documentation

shawn::NoMovement::NoMovement (  ) 

virtual shawn::NoMovement::~NoMovement (  )  [virtual]


Member Function Documentation

virtual void shawn::NoMovement::init ( Node  )  throw () [virtual]

Called from Node when added there!

Should call set_node() and obtain_initial_boxes()

Implements shawn::NodeMovement.

virtual void shawn::NoMovement::init_from ( Node ,
NodeMovement  
) throw () [virtual]

Implements shawn::NodeMovement.

virtual bool shawn::NoMovement::set_position ( const Vec  )  throw () [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.

Returns:
whether the NodeMovement accepted the call, ie, a subsequent call to position() will return the set position.

Implements shawn::NodeMovement.

virtual Vec shawn::NoMovement::position ( void   )  const throw () [virtual]

returns the current position of the node.

Implements shawn::NodeMovement.

virtual Vec shawn::NoMovement::velocity ( void   )  const throw () [virtual]

returns the current velocity vector of the node, ie, the derivate of the position function.

Therefore,

  velocity().euclidean_norm()
gives the current speed, and
  velocity() / velocity().euclidean_norm()
gives the direction, if velocity() is not (0,0,0).

Implements shawn::NodeMovement.

virtual std::string shawn::NoMovement::name ( void   )  const throw () [virtual]

Returns:
an identifying string

Implements shawn::NodeMovement.

virtual void shawn::NoMovement::boxes_changed (  )  throw () [protected, virtual]

Implements shawn::NodeMovement.


The documentation for this class was generated from the following file:

Generated on Thu Sep 9 00:01:10 2010 for Shawn by  doxygen 1.5.6