BMPosition Class Reference

#include <bmposition.h>

Inheritance diagram for BMPosition:

Inheritance graph
[legend]
Collaboration diagram for BMPosition:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BMPosition ()
virtual ~BMPosition ()
virtual double getX ()
virtual double getY ()
virtual int command (int argc, const char *const *argv)

Private Member Functions

void update (double now)

Private Attributes

double trgTime_
double lastUpdateTime_
 time in which the TCL command setdest is invoked
double Xdest_
 time last updated of the coordinates was computed
double Ydest_
 position on the x-axis of the destination point
double Xsorg_
 position on the y-axis of the destination point
double Ysorg_
 position on the x-axis of the starting point (when the TCL command setdest is invoked)
double speed_
 position on the y-axis of the starting point (when the TCL command setdest is invoked)
int debug_
 speed of the node

Detailed Description

This class implements the a basic movement behaviour: it is possible to define the direction and the speed of the linear movement thanks to a TCL command in which the user has to define the destination point an the speed of the movement required. NOTE: the destination point is used to define the direction od the node and when it is reached the node will proceed for the same direction

See also:
NodeCore, Position

Definition at line 50 of file bmposition.h.


Constructor & Destructor Documentation

BMPosition::BMPosition (  ) 

Constructor

Definition at line 46 of file bmposition.cc.

References debug_.

BMPosition::~BMPosition (  )  [virtual]

Destructor

Definition at line 51 of file bmposition.cc.


Member Function Documentation

double BMPosition::getX (  )  [virtual]

Method that return the current projection of the node on the x-axis. If it's necessary (updating time ia expired), update the position values before returns it.

Reimplemented from Position.

Definition at line 103 of file bmposition.cc.

References lastUpdateTime_, trgTime_, update(), and Position::x_.

Here is the call graph for this function:

double BMPosition::getY (  )  [virtual]

Method that return the current projection of the node on the y-axis. If it's necessary (updating time ia expired), update the position values before returns it.

Reimplemented from Position.

Definition at line 111 of file bmposition.cc.

References lastUpdateTime_, trgTime_, update(), and Position::y_.

Here is the call graph for this function:

int BMPosition::command ( int  argc,
const char *const *  argv 
) [virtual]

TCL command interpreter setdest <integer value>integer value>integer value>: set the movement pattern: the firts two values define the point to be reached (i.e., the direction of the movement) and the third value defines the speed to be used

Moreover it inherits all the OTcl method of Position

Parameters:
argc number of arguments in argv
argv array of strings which are the comand parameters (Note that argv[0] is the name of the object)
Returns:
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no

Reimplemented from Position.

Definition at line 55 of file bmposition.cc.

References Position::command(), debug_, speed_, trgTime_, Position::x_, Xdest_, Xsorg_, Position::y_, Ydest_, and Ysorg_.

Here is the call graph for this function:

void BMPosition::update ( double  now  )  [private]

Method that updates both the position coordinates

Definition at line 84 of file bmposition.cc.

References debug_, lastUpdateTime_, speed_, trgTime_, Position::x_, Xdest_, Xsorg_, Position::y_, Ydest_, and Ysorg_.

Referenced by getX(), and getY().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:48:26 2008 for NS-MIRACLE library by  doxygen 1.5.2