]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/route_mgr.hxx
Cleanup, no functional change
[flightgear.git] / src / Autopilot / route_mgr.hxx
index f3c939f0ecd23bcbe1ab3a99b130c7957d3fb398..696d43d618854f965fb24b4cb2889375e72a7fbe 100644 (file)
 #define _ROUTE_MGR_HXX 1
 
 #include <simgear/props/props.hxx>
-#include <simgear/route/waypoint.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
-#include <Navaids/route.hxx>
+#include <Navaids/FlightPlan.hxx>
 
 // forward decls
 class SGPath;
 class PropertyWatcher;
 
-class FGAirport;
-class FGRunway;
-
-typedef SGSharedPtr<FGAirport> FGAirportRef;
-
 /**
  * Top level route manager class
  * 
@@ -61,8 +55,8 @@ public:
          
   int currentIndex() const;
   
-  void setFlightPlan(flightgear::FlightPlan* plan);
-  flightgear::FlightPlan* flightPlan() const;
+  void setFlightPlan(const flightgear::FlightPlanRef& plan);
+  flightgear::FlightPlanRef flightPlan() const;
   
   void clearRoute();
   
@@ -90,12 +84,12 @@ public:
    * route could not be activated for some reason
    */
   bool activate();
-
+  
   /**
-   * Step to the next waypoint on the active route
+   * deactivate the route if active
    */
-  void sequence();
-  
+  void deactivate();
+
   /**
    * Set the current waypoint to the specified index.
    */
@@ -105,14 +99,12 @@ public:
   bool loadRoute(const SGPath& p);
   
   flightgear::WayptRef waypointFromString(const std::string& target);
-  
-  /**
-   * Helper command to setup current airport/runway if necessary
-   */
-  void initAtPosition();
 
 private:
-    flightgear::FlightPlan* _plan;
+    bool commandDefineUserWaypoint(const SGPropertyNode* arg);
+    bool commandDeleteUserWaypoint(const SGPropertyNode* arg);
+    
+    flightgear::FlightPlanRef _plan;
   
     time_t _takeoffTime;
     time_t _touchdownTime;
@@ -178,12 +170,6 @@ private:
     InputListener *listener;
     SGPropertyNode_ptr mirror;    
   
-    virtual void departureChanged();
-    void buildDeparture(flightgear::WayptRef enroute, flightgear::WayptVec& wps);
-    
-    virtual void arrivalChanged();
-    void buildArrival(flightgear::WayptRef enroute, flightgear::WayptVec& wps);
-    
     /**
      * Helper to keep various pieces of state in sync when the route is
      * modified (waypoints added, inserted, removed). Notably, this fires the
@@ -195,18 +181,6 @@ private:
     
     virtual void currentWaypointChanged();
     
-    /**
-     * Check if we've reached the final waypoint. 
-     * Returns true if we have.
-     */
-    bool checkFinished();
-    
-    /**
-     * Predicate for helping the UI - test if at least one waypoint was
-     * entered by the user (as opposed to being generated by the route-manager)
-     */
-    bool haveUserWaypoints() const;
-    
 // tied getters and setters
     const char* getDepartureICAO() const;
     const char* getDepartureName() const;