]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/route.hxx
Prepare and implement reinit methods for instruments
[flightgear.git] / src / Navaids / route.hxx
index e0ddb63346c54d4e2a309362af274e17991fdedd..33d45ce2a5cbd46cafab29fa4c486359bd2b7b49 100644 (file)
@@ -32,7 +32,6 @@
 #include <iosfwd>
 
 // Simgear
-#include <simgear/math/SGMath.hxx>
 #include <simgear/structure/SGReferenced.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
 #include <simgear/props/props.hxx>
@@ -46,10 +45,10 @@ namespace flightgear
 {
 
 // forward decls
-class Route;
+class RouteBase;
 class Waypt;
 class NavdataVisitor;
-
+  
 typedef SGSharedPtr<Waypt> WayptRef;
 
 typedef enum {
@@ -67,7 +66,12 @@ typedef enum {
   WPT_GENERATED     = 1 << 7,
   
   WPT_DEPARTURE     = 1 << 8,
-  WPT_ARRIVAL       = 1 << 9
+  WPT_ARRIVAL       = 1 << 9,
+  
+  /// waypoint generated by VNAV / speed management profile,
+  /// for step climbs or top of descent
+  WPT_PSEUDO        = 1 << 10,
+  WPT_APPROACH      = 1 << 11
 } WayptFlag;
 
 typedef enum {
@@ -75,9 +79,14 @@ typedef enum {
        RESTRICT_AT,
        RESTRICT_ABOVE,
        RESTRICT_BELOW,
-  SPEED_RESTRICT_MACH
+  SPEED_RESTRICT_MACH,  ///< encode an 'AT' restriction in Mach, not IAS
+  RESTRICT_DELETE,      ///< ignore underlying restriction (on a leg)
+  RESTRICT_COMPUTED,    ///< data is computed, not a real restriction
+  SPEED_COMPUTED_MACH   ///< variant on above to encode a Mach value
 } RouteRestriction;
 
+bool isMachRestrict(RouteRestriction rr);
+  
 /**
  * Abstract base class for waypoints (and things that are treated similarly
  * by navigation systems)
@@ -87,7 +96,7 @@ class Waypt : public SGReferenced
 public:
   virtual ~Waypt();
   
-       Route* owner() const 
+       RouteBase* owner() const 
                { return _owner; }
   
   /**
@@ -136,12 +145,15 @@ public:
         */
        virtual bool flag(WayptFlag aFlag) const;
        
+  virtual unsigned int flags() const
+  { return _flags; }
+  
   void setFlag(WayptFlag aFlag, bool aV = true);
   
   /**
    * Factory method
    */
-  static WayptRef createFromProperties(Route* aOwner, SGPropertyNode_ptr aProp);
+  static WayptRef createFromProperties(RouteBase* aOwner, SGPropertyNode_ptr aProp);
   
   void saveAsNode(SGPropertyNode* node) const;
   
@@ -174,7 +186,7 @@ public:
 protected:
   friend class NavdataVisitor;
   
-       Waypt(Route* aOwner);
+       Waypt(RouteBase* aOwner);
   
   /**
    * Persistence helper - read node properties from a file
@@ -186,7 +198,7 @@ protected:
    */
   virtual void writeToProperties(SGPropertyNode_ptr aProp) const;
   
-  typedef Waypt* (FactoryFunction)(Route* aOwner) ;
+  typedef Waypt* (FactoryFunction)(RouteBase* aOwner) ;
   static void registerFactory(const std::string aNodeType, FactoryFunction* aFactory);
   
   double _altitudeFt;
@@ -198,16 +210,16 @@ private:
   /**
    * Create an instance of a concrete subclass, or throw an exception
    */
-  static Waypt* createInstance(Route* aOwner, const std::string& aTypeName);
+  static Waypt* createInstance(RouteBase* aOwner, const std::string& aTypeName);
 
-       Route* _owner;
+       RouteBase* _owner;
        unsigned short _flags;
   mutable double _magVarDeg; 
 };
 
 typedef std::vector<WayptRef> WayptVec;
   
-class Route
+class RouteBase
 {
 public:
   /**
@@ -217,9 +229,9 @@ public:
   
   static void loadAirportProcedures(const SGPath& aPath, FGAirport* aApt);
   
-  static void dumpRouteToFile(const WayptVec& aRoute, const std::string& aName);
+  static void dumpRouteToKML(const WayptVec& aRoute, const std::string& aName);
   
-  static void dumpRouteToLineString(const std::string& aIdent,
+  static void dumpRouteToKMLLineString(const std::string& aIdent,
     const WayptVec& aRoute, std::ostream& aStream);
 private: