00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _WAYPOINT_HXX
00028 #define _WAYPOINT_HXX
00029
00030 #include <simgear/compiler.h>
00031
00032 #include <simgear/math/SGMath.hxx>
00033 #include <simgear/math/SGGeod.hxx>
00034
00035 #include <string>
00036
00037
00042 class SGWayPoint {
00043
00044 public:
00045
00056 enum modetype {
00057 WGS84 = 0,
00058 };
00059
00060 private:
00061 SGGeod pos;
00062 std::string id;
00063 std::string name;
00064
00065
00066 double _distance;
00067 double _track;
00068 double _speed;
00069
00070 public:
00071
00081 SGWayPoint( const double lon = 0.0, const double lat = 0.0,
00082 const double alt = 0.0, const modetype m = WGS84,
00083 const std::string& s = "", const std::string& n = "" );
00084
00088 SGWayPoint(const SGGeod& pos, const std::string& s, const std::string& n);
00089
00091 ~SGWayPoint();
00092
00105 void CourseAndDistance( const double cur_lon, const double cur_lat,
00106 const double cur_alt,
00107 double *course, double *dist ) const;
00108
00109 void CourseAndDistance(const SGGeod& current,
00110 double& course, double& dist ) const;
00111
00119 void CourseAndDistance( const SGWayPoint &wp,
00120 double *course, double *dist ) const;
00121
00123 inline double get_target_lon() const { return pos.getLongitudeDeg(); }
00124
00126 inline double get_target_lat() const { return pos.getLatitudeDeg(); }
00127
00129 inline double get_target_alt() const { return pos.getElevationM(); }
00130
00131 inline const SGGeod& get_target() const { return pos; }
00132
00143 inline double get_distance() const { return _distance; }
00144
00149 inline void set_distance( double d ) { _distance = d; }
00150
00151 inline double get_track() const { return _track; }
00152 inline void set_track(double t) { _track = t; }
00153
00154 inline double get_speed() const { return _speed; }
00155 inline void set_speed(double v) { _speed = v; }
00156
00158 inline const std::string& get_id() const { return id; }
00159
00161 inline const std::string& get_name() const { return name; }
00162
00163 };
00164
00165
00166 #endif // _WAYPOINT_HXX