libosmscout  1.1.1
ElevationModule.h
Go to the documentation of this file.
1 #ifndef OSMSCOUT_CLIENT_QT_ELEVATIONMODULE_H
2 #define OSMSCOUT_CLIENT_QT_ELEVATIONMODULE_H
3 
4 /*
5  OSMScout - a Qt backend for libosmscout and libosmscout-map
6  Copyright (C) 2021 Lukas Karas
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  */
22 
23 #include <osmscout/OverlayObject.h>
24 #include <osmscout/DBThread.h>
26 
28 
29 #include <QThread>
30 #include <memory>
31 
32 namespace osmscout {
33 
38 {
39  Q_OBJECT
40 public:
41  using ElevationPoints = std::vector<osmscout::ElevationPoint>;
42 
43  class DataLoader
44  {
45  private:
46  std::vector<osmscout::DatabaseRef> database;
47  std::vector<osmscout::TypeInfoSet> contourTypes;
48  std::vector<osmscout::EleFeatureValueReader> reader;
49  public:
50  explicit DataLoader(const std::list<DBInstanceRef> &databases);
51 
52  std::vector<osmscout::ContoursData> LoadContours(const osmscout::GeoBox &box);
53  };
54 
55 public slots:
56  void onElevationProfileRequest(std::shared_ptr<OverlayWay> way,
57  int requestId,
58  osmscout::BreakerRef breaker);
59 
60 signals:
61  void error(int requestId);
62 
63  void elevationProfileAppend(ElevationModule::ElevationPoints points, int requestId);
64  void loadingFinished(int requestId);
65 
66 public:
67  ElevationModule(QThread *thread,DBThreadRef dbThread);
68 
69  ~ElevationModule() override;
70 
71 private:
72  QThread *thread;
73  DBThreadRef dbThread;
74 };
75 }
76 
77 #endif // OSMSCOUT_CLIENT_QT_ELEVATIONMODULE_H
Definition: ElevationModule.h:43
#define OSMSCOUT_CLIENT_QT_API
Definition: ClientQtImportExport.h:45
std::vector< osmscout::ElevationPoint > ElevationPoints
Definition: ElevationModule.h:41
std::shared_ptr< Breaker > BreakerRef
Definition: Breaker.h:65
Definition: Area.h:38
std::shared_ptr< DBThread > DBThreadRef
Definition: DBThread.h:239
Definition: ElevationModule.h:37