#include <iosfwd>
// Simgear
-#include <simgear/math/SGMath.hxx>
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/props/props.hxx>
{
// forward decls
-class Route;
+class RouteBase;
class Waypt;
class NavdataVisitor;
-
+
typedef SGSharedPtr<Waypt> WayptRef;
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 {
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)
public:
virtual ~Waypt();
- Route* owner() const
+ RouteBase* owner() const
{ return _owner; }
/**
*/
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;
* For some waypoint types this will always return 0.
*/
virtual double magvarDeg() const;
+
+ /**
+ * return the assoicated heading or radial for this waypoint.
+ * The exact meaning varies by type - for a hold it's the inbound radial,
+ * for a DME intercept it's the heading to hold, and so on.
+ */
+ virtual double headingRadialDeg() const;
protected:
friend class NavdataVisitor;
- Waypt(Route* aOwner);
+ Waypt(RouteBase* aOwner);
/**
* Persistence helper - read node properties from a file
*/
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;
/**
* 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 SGReferenced
{
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: