head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.37; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.51; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.59; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.55; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# SGWayPoint Class Reference

A class to manage waypoints. More...

`#include <waypoint.hxx>`

List of all members.

## Public Types
enum | modetype { WGS84 = 0, SPHERICAL = 1, CARTESIAN = 2 }
| Waypoint mode. More...
## Public Methods
| SGWayPoint (const double lon=0.0, const double lat=0.0, const double alt=0.0, const modetype m=WGS84, const string s="")
| Construct a waypoint.
| ~SGWayPoint ()
| Destructor.
void | CourseAndDistance (const double cur_lon, const double cur_lat, const double cur_alt, double *course, double *distance) const
| Calculate course and distances.
void | CourseAndDistance (const SGWayPoint &wp, double *course, double *distance) const
| Calculate course and distances between a specified starting waypoint and this waypoint.
modetype | get_mode () const
double | get_target_lon () const
double | get_target_lat () const
double | get_target_alt () const
double | get_distance () const
| This value is not calculated by this class.
void | set_distance (double d)
| Set the waypoint distance value to a value of our choice.
string | get_id () const

## Detailed Description

A class to manage waypoints.

Definition at line 47 of file waypoint.hxx.

## Member Enumeration Documentation

enum SGWayPoint::modetype

| Waypoint mode. WGS84 requests all bearing and distance math be done assuming a WGS84 ellipsoid world. This is the most expensive computationally, but also the most accurate. SPHERICAL requests all bearing and distance math be done assuming the world is a perfect sphere. This is less compuntationally expensive than using wgs84 math and still a fairly good approximation of the real world, especially over shorter distances. CARTESIAN requests all math be done assuming the coordinates specify position in a Z = up world. Definition at line 63 of file waypoint.hxx. Referenced by get_mode().

## Constructor & Destructor Documentation

SGWayPoint::SGWayPoint | ( | const double | lon = 0.0,
|  | const double | lat = 0.0,
|  | const double | alt = 0.0,
|  | const modetype | m = WGS84,
|  | const string | s = ""
| ) |

  | Construct a waypoint. Parameters:
  lon | destination longitude
  lat | destination latitude
  alt | target altitude
  mode | type of coordinates/math to use
  s | waypoint identifier
Definition at line 31 of file waypoint.cxx.

## Member Function Documentation

void SGWayPoint::CourseAndDistance | ( | const SGWayPoint & | wp,
|  | double * | course,
|  | double * | distance
| ) | const

  | Calculate course and distances between a specified starting waypoint and this waypoint. Parameters:
  wp | (in) original waypoint
  course | (out) heading from current location to this waypoint
  distance | (out) distance from current location to this waypoint
Definition at line 78 of file waypoint.cxx. References CourseAndDistance(), get_target_alt(), get_target_lat(), and get_target_lon().

void SGWayPoint::CourseAndDistance | ( | const double | cur_lon,
|  | const double | cur_lat,
|  | const double | cur_alt,
|  | double * | course,
|  | double * | distance
| ) | const

  | Calculate course and distances. For WGS84 and SPHERICAL coordinates lat, lon, and course are in degrees, alt and distance are in meters. For CARTESIAN coordinates x = lon, y = lat. Course is in degrees and distance is in what ever units x and y are in. Parameters:
  cur_lon | (in) current longitude
  cur_lat | (in) current latitude
  cur_alt | (in) current altitude
  course | (out) heading from current location to this waypoint
  distance | (out) distance from current location to this waypoint
Definition at line 50 of file waypoint.cxx. References calc_gc_course_dist(). Referenced by SGRoute::add_waypoint(), and CourseAndDistance().

double SGWayPoint::get_distance | ( |  | ) | const`[inline]`

| This value is not calculated by this class. It is simply a placeholder for the user to stash a distance value. This is useful when you stack waypoints together into a route. You can calculate the distance from the previous waypoint once and save it here. Adding up all the distances here plus the distance to the first waypoint gives you the total route length. Note, you must update this value yourself, this is for your convenience only. Returns: waypoint distance holder (what ever the user has stashed here) Definition at line 145 of file waypoint.hxx.

string SGWayPoint::get_id | ( |  | ) | const`[inline]`

| Returns: waypoint id Definition at line 154 of file waypoint.hxx.

modetype SGWayPoint::get_mode | ( |  | ) | const`[inline]`

| Returns: waypoint mode Definition at line 124 of file waypoint.hxx. References modetype.

double SGWayPoint::get_target_alt | ( |  | ) | const`[inline]`

| Returns: waypoint altitude Definition at line 133 of file waypoint.hxx. Referenced by CourseAndDistance().

double SGWayPoint::get_target_lat | ( |  | ) | const`[inline]`

| Returns: waypoint latitude Definition at line 130 of file waypoint.hxx. Referenced by CourseAndDistance().

double SGWayPoint::get_target_lon | ( |  | ) | const`[inline]`

| Returns: waypoint longitude Definition at line 127 of file waypoint.hxx. Referenced by CourseAndDistance().

void SGWayPoint::set_distance | ( | double | d | ) | `[inline]`

  | Set the waypoint distance value to a value of our choice. Parameters:
  d | distance
Definition at line 151 of file waypoint.hxx.

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

- waypoint.hxx
- waypoint.cxx

@ 1.3 log @Oops, try again. @ text @d532 1 a532 1