X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNavaids%2Fpositioned.hxx;h=37f8910c1bd616a09221ef81e08ba9dafc684c8b;hb=3c5679fa40dd1c417330cab1e2ef8c4a1d244201;hp=4d1f6081fbb32252dde13bac5a38a6d2d47278ef;hpb=04b30f322de856c9993f328e15cb9a0509be65c9;p=flightgear.git diff --git a/src/Navaids/positioned.hxx b/src/Navaids/positioned.hxx index 4d1f6081f..37f8910c1 100644 --- a/src/Navaids/positioned.hxx +++ b/src/Navaids/positioned.hxx @@ -158,6 +158,16 @@ public: */ static FGPositionedRef findNextWithPartialId(FGPositionedRef aCur, const std::string& aId, Filter* aFilter = NULL); + /** + * As above, but searches using an offset index + */ + static FGPositionedRef findWithPartialId(const std::string& aId, Filter* aFilter, int aOffset, bool& aNext); + + /** + * As above, but search names instead of idents + */ + static FGPositionedRef findWithPartialName(const std::string& aName, Filter* aFilter, int aOffset, bool& aNext); + /** * Find all items with the specified ident, and return then sorted by * distance from a position @@ -166,6 +176,11 @@ public: */ static List findAllWithIdentSortedByRange(const std::string& aIdent, const SGGeod& aPos, Filter* aFilter = NULL); + /** + * As above, but searches names instead of idents + */ + static List findAllWithNameSortedByRange(const std::string& aName, const SGGeod& aPos, Filter* aFilter = NULL); + /** * Find the closest item to a position, which pass the specified filter * A cutoff range in NM must be specified, to constrain the search acceptably. @@ -182,12 +197,24 @@ public: * Very large cutoff values will make this slow. * * @result The matches (possibly less than N, depending on the filter and cutoff), - * sorted by distance from the search pos + * sorted by distance from the search pos * @param aN - number of matches to find * @param aCutoffNm - maximum distance to search within, in nautical miles */ static List findClosestN(const SGGeod& aPos, unsigned int aN, double aCutoffNm, Filter* aFilter = NULL); + /** + * Find the closest match based on partial id (with an offset to allow selecting the n-th closest). + * Cutoff distance is limited internally, to avoid making this very slow. + */ + static FGPositionedRef findClosestWithPartialId(const SGGeod& aPos, const std::string& aId, Filter* aFilter, int aOffset, bool& aNext); + + /** + * As above, but matches on name + */ + static FGPositionedRef findClosestWithPartialName(const SGGeod& aPos, const std::string& aName, Filter* aFilter, int aOffset, bool& aNext); + + /** * Map a candidate type string to a real type. Returns INVALID if the string * does not correspond to a defined type. @@ -198,6 +225,8 @@ public: * Map a type to a human-readable string */ static const char* nameForType(Type aTy); + + static FGPositioned* createUserWaypoint(const std::string& aIdent, const SGGeod& aPos); protected: FGPositioned(Type ty, const std::string& aIdent, const SGGeod& aPos, bool aIndex = true);