5 #include <simgear/compiler.h>
17 // encapsulate a gps integer time (fixme, assumes all times in a track
18 // are from the same day, so we don't handle midnight roll over)
25 inline GPSTime( const int hh, const int mm, const double ss ) {
26 seconds = hh*3600 + mm*60 + ss;
28 inline GPSTime( const double gpstime ) {
30 int hh = (int)(tmp / 10000);
32 int mm = (int)(tmp / 100);
35 seconds = hh*3600 + mm*60 + ss;
36 // cout << gpstime << " = " << seconds << endl;
40 inline double get_time() const { return seconds; }
41 inline double diff_sec( const GPSTime t ) const {
42 return seconds - t.seconds;
48 // encapsulate the interesting gps data for a moment in time
64 gps_time(GPSTime(0,0,0)),
75 inline double get_time() const { return gps_time.get_time(); }
79 // Manage a saved gps log (track file)
84 vector <GPSPoint> data;
91 int load( const string &file );
93 inline int size() const { return data.size(); }
95 inline GPSPoint get_point( const unsigned int i )
97 if ( i < data.size() ) {
108 GPSPoint GPSInterpolate( const GPSPoint A, const GPSPoint B,
109 const double percent );