74 lines
1.7 KiB
C++
Executable File
74 lines
1.7 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ScreenToLocationHelper
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Own
|
|
#include "screen_location_elevation_helper_base.h"
|
|
#include <Map/map.h>
|
|
#include <Common/situation_map_logging.h>
|
|
|
|
// ESRI
|
|
#include <arcgis/SceneGraphicsView.h>
|
|
#include <arcgis/Point.h>
|
|
|
|
// Qt
|
|
#include <QObject>
|
|
#include <QTimer>
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
namespace SituationMap
|
|
{
|
|
/**
|
|
* @brief The ScreenToLocationHelper class limits the load of
|
|
* Esri::ArcGISRuntime::SceneGraphicsView::screenToLocation
|
|
* (cpu load of ~50% was recognized othjerwise)
|
|
* This class limits this to 10 computation per second.
|
|
*/
|
|
class SITUATIONMAP_EXPORT ScreenToLocationHelper : public ScreenLocationElevationHelperBase
|
|
{
|
|
Q_OBJECT
|
|
|
|
using BaseClass = ScreenLocationElevationHelperBase;
|
|
|
|
public:
|
|
/*! \name Construction, Destruction */
|
|
//@{
|
|
explicit ScreenToLocationHelper(Esri::ArcGISRuntime::SceneGraphicsView *sceneGraphicsView);
|
|
~ScreenToLocationHelper();
|
|
|
|
void stop();
|
|
|
|
ScreenToLocationHelper(const ScreenToLocationHelper &other) = delete;
|
|
ScreenToLocationHelper &operator=(ScreenToLocationHelper &other) = delete;
|
|
//@}
|
|
|
|
void screenToLocation(int windowPosX, int windowPosY);
|
|
|
|
void mainComputation() override;
|
|
|
|
Q_SIGNALS:
|
|
void mouseScenePositionChanged(const Point3D &mapCoordinate, bool isValid);
|
|
|
|
private Q_SLOTS:
|
|
void onScreenToLocationCompleted(const QUuid &taskId, const Esri::ArcGISRuntime::Point &locationMap);
|
|
|
|
protected:
|
|
LOGGER_T m_logger; ///< Interface of the Logging-Facility
|
|
|
|
class Private;
|
|
/**
|
|
* The private d->pointer to not break BC when changing internals of this class
|
|
*/
|
|
Private *d = nullptr;
|
|
};
|
|
|
|
} // namespace SituationMap
|
|
|