iVS3D v2.0.0
Loading...
Searching...
No Matches
geomap.h
1#ifndef IVS3D_GEOMAPPLUGIN_H
2#define IVS3D_GEOMAPPLUGIN_H
3
4// Std
5#include <cmath>
6#include <memory>
7#include <algorithm>
8
9// Qt
10#include <QCheckBox>
11#include <QLabel>
12#include <QLayout>
13#include <QMap>
14#include <QObject>
15#include <QPushButton>
16#include <QSpinBox>
17#include <QWidget>
18#include <QTabWidget>
19
20// iVS3D-core
21#include "../iVS3D-core/model/progressable.h"
22#include "../iVS3D-core/model/reader/reader.h"
23#include "../iVS3D-core/plugin/signalobject.h"
24
25// iVS3D-pluginInterface
26#include "../iVS3D-pluginInterface/ialgorithm.h"
27
28#include "maphandler.h"
29
30#define DESCRIPTION_STYLE "color: rgb(58, 58, 58); border-left: 6px solid rgb(58, 58, 58); " \
31 "border-top-right-radius: 5px; border-bottom-right-radius: 5px; " \
32 "background-color: lightblue;"
33
34#define NAME_Polygon "Polygon"
51class GeoMap : public IAlgorithm
52{
53 Q_OBJECT
54
55 // implement interface as plugin, use the iid as identifier
56 Q_PLUGIN_METADATA(IID "iVS3D.IAlgorithm")
57
58 // declare this as implementation of IAlgorithm interface
59 Q_INTERFACES(IAlgorithm)
60
61 //--- METHOD DECLARATION ---//
62
63 public:
69 GeoMap();
70
74 virtual ~GeoMap();
75
84 QWidget* getSettingsWidget(QWidget* parent) override;
85
90 QString getName() const override;
91
105 std::vector<uint> sampleImages(const std::vector<uint>& imageList,
106 Progressable* receiver, volatile bool* stopped,
107 bool useCuda, LogFileParent* logFile) override;
108
116 void initialize(Reader* reader, QMap<QString, QVariant> buffer, signalObject* sigObj) override;
117
122 void setSettings(QMap<QString, QVariant> settings) override;
123
128 QMap<QString, QVariant> getSettings() override;
129
138 QMap<QString, QVariant> generateSettings(Progressable* receiver, bool useCuda,
139 volatile bool* stopped) override;
140
141 public slots:
142
148 void onGpsClicked(QPointF gpsPoint, bool used);
149
153 void onNewMetaData();
158 void onKeyframesChanged(std::vector<uint> keyframes);
159
164 void onGpsSelected(QPolygonF polyF);
165
166
167 private:
168 void createSettingsWidget(QWidget* parent);
169
170 void readMetaData();
172 std::vector<unsigned int> getKeyframesFromGps();
174 std::vector<unsigned int> getFramesInsidePolygon();
175
176 QPointF gpsHashToLatLong(QVariant hash);
177 QGeoCoordinate gpsHashtoGeoCo(QVariant hash);
178
179 void initializeQmlMap();
180 void reinitializeQmlMap();
181
182 double distanceBetweenPoints(int first, int second);
183 double greatCircleDistance(QPointF first, QPointF second);
184 //--- MEMBER DECLARATION ---//
185
186 private:
189
192
195
197 QWidget* mpMapWidget;
198
200 std::shared_ptr<MapHandler> mpMapHandler;
201
203 QMap<QString, QVariant> mBuffer;
204
206 QList<QVariant> mMetaData;
207
209 QList<QPair<QPointF, bool>> mGpsData;
210
211 QPolygonF mPolygon;
212
213 bool mIsQmlMapInitialized;
214
217
218};
219
220#endif // IVS3D_GEOMAPPLUGIN_H
The GeoMapPlugin allows the user to select the images, which are to be used for the 3D reconstruction...
Definition geomap.h:52
void onGpsClicked(QPointF gpsPoint, bool used)
onGpsClicked slot triggered when gps point on the map is clicked
Definition geomap.cpp:147
std::shared_ptr< MapHandler > mpMapHandler
Pointer to map handler.
Definition geomap.h:200
std::vector< uint > sampleImages(const std::vector< uint > &imageList, Progressable *receiver, volatile bool *stopped, bool useCuda, LogFileParent *logFile) override
sampleImages selects the keyframes from the given images. The computation is based on the images prov...
Definition geomap.cpp:65
void onGpsSelected(QPolygonF polyF)
onGpsSelected Slot is triggered when a new user selcted polyogn is created
Definition geomap.cpp:284
virtual ~GeoMap()
Destroy object of GeoMapPlugin.
Definition geomap.cpp:37
bool mIsGpsAvailable
Flag indicating if GPS data is available.
Definition geomap.h:216
Reader * mpReader
Pointer to reader object of iVS3D-core.
Definition geomap.h:191
void onKeyframesChanged(std::vector< uint > keyframes)
onKeyframesChanged Slot is triggerd if the core emtis new keyframes
Definition geomap.cpp:177
QString getName() const override
getName returns the display name for the plugin. This name is presented to the user.
Definition geomap.cpp:59
GeoMap()
Construct and initialize plugin with default parameterization.
Definition geomap.cpp:16
void onNewMetaData()
onNewMetaData Slot is triggerd if the core loads new meta data
Definition geomap.cpp:165
QList< QPair< QPointF, bool > > mGpsData
List of GPS data associated with the images.
Definition geomap.h:209
void setSettings(QMap< QString, QVariant > settings) override
setter for plugin's settings
Definition geomap.cpp:125
QMap< QString, QVariant > generateSettings(Progressable *receiver, bool useCuda, volatile bool *stopped) override
generateSettings tries to generate the best settings for the current input
Definition geomap.cpp:140
QWidget * mpQuickViewContainerWidget
Pointer to QML container widget.
Definition geomap.h:194
QList< QVariant > mMetaData
List of available meta data.
Definition geomap.h:206
QWidget * getSettingsWidget(QWidget *parent) override
getSettingsWidget is provides an QWidget to display plugin specific settings to the user....
Definition geomap.cpp:44
std::vector< unsigned int > getKeyframesFromGps()
these are the localy stored keyframes
Definition geomap.cpp:317
QMap< QString, QVariant > getSettings() override
getter for plugin's settings
Definition geomap.cpp:132
QWidget * mpMapWidget
Pointer to the map widget.
Definition geomap.h:197
void initialize(Reader *reader, QMap< QString, QVariant > buffer, signalObject *sigObj) override
initialize the the IAlgorithm and the settings widget with plausible values from the Reader.
Definition geomap.cpp:95
signalObject * mpSigObj
Pointer to signal object of iVS3D-core.
Definition geomap.h:188
std::vector< unsigned int > getFramesInsidePolygon()
these are all frames inside the user created polygon
Definition geomap.cpp:330
QMap< QString, QVariant > mBuffer
Buffered data form last call to sampleImages.
Definition geomap.h:203
The IAlgorithm interface is used to include plugin implementations for different sampling algorithms....
Definition ialgorithm.h:35
The LogFileParent class logs progress as well as information about a process (e.g....
Definition LogFileParent.h:30
The Progressable interface is used to by multithreaded actions such as sampling or exporting to repor...
Definition progressable.h:18
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
Definition signalobject.h:10