SGRoute Class Reference

A class to manage a list of waypoints (i.e. More...

#include <route.hxx>

List of all members.

Public Member Functions

 SGRoute ()
 Constructor.
 ~SGRoute ()
 Destructor.
void clear ()
 Clear the entire route.
void add_waypoint (const SGWayPoint &wp, int n=-1)
 Add waypoint (default), or insert waypoint at position n.
int size () const
 Get the number of waypoints (i.e.
SGWayPoint get_first () const
 Get the front waypoint.
SGWayPoint get_current () const
 Get the current waypoint.
void set_current (int n)
 Set the current waypoint.
void increment_current ()
 Increment the current waypoint pointer.
SGWayPoint get_waypoint (const int n) const
 Get the nth waypoint.
void delete_first ()
 Delete the front waypoint.
void delete_waypoint (int n=0)
 Delete waypoint waypoint with index n (last one if n < 0).
double total_distance () const
 Helper, sum the distance members of each waypoint.

Detailed Description

A class to manage a list of waypoints (i.e.

a route).

Definition at line 47 of file route.hxx.


Member Function Documentation

void SGRoute::add_waypoint ( const SGWayPoint wp,
int  n = -1 
)

Add waypoint (default), or insert waypoint at position n.

Parameters:
wp a waypoint

Definition at line 66 of file route.cxx.

void SGRoute::delete_waypoint ( int  n = 0  ) 

Delete waypoint waypoint with index n (last one if n < 0).

Delete waypoint with index n (last one if n < 0).

Definition at line 80 of file route.cxx.

SGWayPoint SGRoute::get_current (  )  const [inline]

Get the current waypoint.

Returns:
the current waypoint

Definition at line 98 of file route.hxx.

SGWayPoint SGRoute::get_first (  )  const [inline]

Get the front waypoint.

Returns:
the first waypoint.

Definition at line 86 of file route.hxx.

SGWayPoint SGRoute::get_waypoint ( const int  n  )  const [inline]

Get the nth waypoint.

Parameters:
n waypoint number
Returns:
the nth waypoint

Definition at line 148 of file route.hxx.

void SGRoute::increment_current (  )  [inline]

Increment the current waypoint pointer.

Definition at line 137 of file route.hxx.

void SGRoute::set_current ( int  n  )  [inline]

Set the current waypoint.

Parameters:
number of waypoint to make current.

Definition at line 126 of file route.hxx.

int SGRoute::size (  )  const [inline]

Get the number of waypoints (i.e.

route length )

Returns:
route length

Definition at line 80 of file route.hxx.


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

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1