FlightGear next
poidb.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: (C) Christian Schmitt, March 2013
3 * SPDX_FileComment: points of interest management routines
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#pragma once
8
9#include <map>
10
11#include <simgear/compiler.h>
12
13#include <simgear/math/SGGeod.hxx>
16
17// forward decls
18class SGPath;
19class sg_gzifstream;
20
21// load and initialize the POI database
22//bool poiDBInit(const SGPath& path);
23
24namespace flightgear
25{
26
28{
29public:
30 POILoader();
31 ~POILoader() = default;
32
33 // Load POIs from the specified poi.dat (or poi.dat.gz) file
34 void loadPOIs(const NavDataCache::SceneryLocation& sceneryLocation,
35 std::size_t bytesReadSoFar,
36 std::size_t totalSizeOfAllDatFiles);
37
38private:
39 void throwExceptionIfStreamError(const sg_gzifstream& input_stream);
40
41
42 PositionedID readPOIFromStream(std::istream& aStream, unsigned int lineNumber,
44
45 NavDataCache* _cache = nullptr;
46 SGPath _path;
47
48 using POIKey = std::tuple<FGPositioned::Type, std::string>;
49 // Maps (type, ident, name) tuples already loaded to their locations.
50 std::multimap<POIKey, SGVec3d> _loadedPOIs;
51};
52
53
54} // of namespace flightgear
55
void loadPOIs(const NavDataCache::SceneryLocation &sceneryLocation, std::size_t bytesReadSoFar, std::size_t totalSizeOfAllDatFiles)
Definition poidb.cxx:63
FlightPlan.hxx - defines a full flight-plan object, including departure, cruise, arrival information ...
Definition Addon.cxx:53
int64_t PositionedID