Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/Map/viewpoint2D.h
T
2026-08-13 18:33:10 +02:00

66 lines
1.5 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Class Viewpoint2D
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include "situation_map_types.h"
#include <Common/situation_map_logging.h>
#include <situation_map_export.h>
// Qt
#include <QString>
class QJsonObject;
//----------------------------------------------------------------------------
namespace SituationMap
{
//----------------------------------------------------------------------------
// for 2D:
class SITUATIONMAP_EXPORT Viewpoint2D
{
public:
static constexpr double defaultScale = 999999.9;
Viewpoint2D(const QPointF &centerGeo = QPointF(), double scale = defaultScale, double rotation = 0);
bool isNull() const;
void resetViewpoint();
QPointF centerGeo() const;
void setCenterGeo(const QPointF &centerGeo);
double scale() const;
void setScale(double scale);
double rotation() const;
void setRotation(double rotation);
static Viewpoint2D read(const QJsonObject &json);
QJsonObject toJsonObject() const;
QString toString() const;
protected:
QPointF m_centerGeo; ///< lon, lat
double m_scale = defaultScale; // '0' may lead to an ESRI exception. Try to avoid and use another value
double m_rotation = 0; ///< absoluteAngleDegrees
};
//----------------------------------------------------------------------------
SITUATIONMAP_EXPORT std::ostream &operator<< (std::ostream &stream,
const SituationMap::Viewpoint2D &value);
} // namespace SituationMap