126 lines
2.9 KiB
C++
Executable File
126 lines
2.9 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* TerrainProfileProcessor
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Own
|
|
#include "map_impl.h"
|
|
#include "location_to_elevation_bulk.h"
|
|
#include <Map/terrain_profile_parameter.h>
|
|
#include "MapObjects/polyline.h"
|
|
#include "MapObjects/geo_image.h"
|
|
#include <Utils/terrain_profile_dialog.h>
|
|
|
|
|
|
// ESRI
|
|
#include <arcgis/Map.h>
|
|
#include <arcgis/Surface.h>
|
|
#include <arcgis/SpatialReference.h>
|
|
|
|
|
|
// Qt
|
|
#include <QObject>
|
|
#include <QColor>
|
|
#include <QPointF>
|
|
|
|
|
|
// forward:
|
|
namespace Esri
|
|
{
|
|
namespace ArcGISRuntime
|
|
{
|
|
class Map;
|
|
class Graphic;
|
|
class GraphicsOverlay;
|
|
class Polyline;
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
namespace SituationMap
|
|
{
|
|
class MapImpl;
|
|
|
|
|
|
class TerrainProfileProcessor : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TerrainProfileProcessor(QObject *parent = nullptr);
|
|
virtual ~TerrainProfileProcessor();
|
|
|
|
long id() const { return m_id; }
|
|
|
|
bool init(SituationMap::MapImpl *mapImpl, long id);
|
|
|
|
|
|
|
|
bool start(const TerrainProfileParameter &terrainProfileParameter);
|
|
|
|
bool isRunning() const { return m_inProgress; }
|
|
|
|
QVector< QPair< QPointF, double > > results() const;
|
|
|
|
void setTerrainProfileDialog(QPointer<TerrainProfileDialog> &terrainProfileDialog);
|
|
|
|
signals:
|
|
void locationsToElevationsCompleted(long id);
|
|
|
|
protected slots:
|
|
void onLocationsToElevationsCompleted();
|
|
void onDialogMousePositionChanged(const QPointF &curPos);
|
|
|
|
protected:
|
|
Esri::ArcGISRuntime::Polyline densifiy(TerrainProfileParameter &terrainProfileParameter);
|
|
|
|
void displayUserInput();
|
|
void removeUserInput();
|
|
|
|
void displayInputLine();
|
|
void removeInputLine();
|
|
void displayInputVertices();
|
|
void removeInputVertices();
|
|
void displayCurrentMarker(const Point3D &pointGeo);
|
|
void removeCurrentMarker();
|
|
|
|
private:
|
|
SituationMap::MapImpl *m_mapImpl = nullptr;
|
|
Esri::ArcGISRuntime::SpatialReference m_srMap;
|
|
Esri::ArcGISRuntime::Surface *m_surface = nullptr;
|
|
|
|
long m_id = -1;
|
|
TerrainProfileParameter m_terrainProfileParameter;
|
|
|
|
// Calc
|
|
LocationToElevationBulk m_locationToElevationBulk;
|
|
|
|
bool m_initialized = false;
|
|
bool m_inProgress = false;
|
|
|
|
// Out
|
|
// TerrainProfileDialog (Displaying the results)
|
|
QPointer<SituationMap::TerrainProfileDialog> m_terrainProfileDialog;
|
|
|
|
QString m_toolsLayername;
|
|
QColor m_color = Qt::magenta;
|
|
RefPointer<Polyline> m_polyline;
|
|
QVector<RefPointer<GeoImage>> m_markerCont;
|
|
RefPointer<GeoImage> m_currentMarker;
|
|
|
|
|
|
LOGGER_T m_logger;
|
|
|
|
}; // class TerrainProfileProcessor
|
|
|
|
|
|
|
|
} // namespace SituationMap
|
|
|