]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/dclgps.hxx
Projection matrix and texture size should be coherent
[flightgear.git] / src / Instrumentation / dclgps.hxx
index 5526918272d9de158473a11183c82d626dff5a87..435f7899a25e51f53e5ca4ed2a229a8eee3bcfac 100644 (file)
 #include <vector>
 #include <map>
 
-#include <Navaids/navrecord.hxx>
-#include <Navaids/navlist.hxx>
-#include <Navaids/fixlist.hxx>
-#include <Airports/simple.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
-
-using namespace std;
+#include <Navaids/positioned.hxx>
 
 class SGTime;
+class FGPositioned;
+
+// XXX fix me
+class FGNavRecord;
+class FGAirport;
+class FGFix;
 
 enum GPSDistanceUnits {
        GPS_DIST_UNITS_NM = 0,
@@ -91,6 +92,11 @@ ostream& operator << (ostream& os, GPSAppWpType type);
 
 struct GPSWaypoint {
     GPSWaypoint();
+  
+  GPSWaypoint(const std::string& aIdent, float lat, float lon, GPSWpType aType);
+  
+  static GPSWaypoint* createFromPositioned(const FGPositioned* aFix);
+  
     ~GPSWaypoint();
        string GetAprId();      // Returns the id with i, f, m or h added if appropriate. (Initial approach fix, final approach fix, etc)
        string id;
@@ -407,14 +413,13 @@ protected:
        // 
        
        // Data and lookup functions
-       // All waypoints mapped by id.
-       gps_waypoint_map _waypoints;
-private:
-       // Worker function for the below.
-       const GPSWaypoint* ActualFindFirstById(const string& id, bool exact = false);
+
+
 protected:
        // Find first of any type of waypoint by id.  (TODO - Possibly we should return multiple waypoints here).
-       const GPSWaypoint* FindFirstById(const string& id, bool &multi, bool exact = false); 
+  GPSWaypoint* FindFirstById(const string& id) const;
+  GPSWaypoint* FindFirstByExactId(const string& id) const;
+   
        FGNavRecord* FindFirstVorById(const string& id, bool &multi, bool exact = false);
        FGNavRecord* FindFirstNDBById(const string& id, bool &multi, bool exact = false);
        const FGAirport* FindFirstAptById(const string& id, bool &multi, bool exact = false);
@@ -422,6 +427,9 @@ protected:
        // Find the closest VOR to a position in RADIANS.
        FGNavRecord* FindClosestVor(double lat_rad, double lon_rad);
 
+  // helper to implement the above FindFirstXXX methods
+  FGPositioned* FindTypedFirstById(const std::string& id, FGPositioned::Type ty, bool &multi, bool exact);
+
        // Position, orientation and velocity.
        // These should be read from FG's built-in GPS logic if possible.
        // Use the property node pointers below to do this.