Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
/**
* @RDE_HEADER@
* Interface of SingleFireCentral
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The SingleFireCentral class supports Indirect Single Fire.
*/
class SingleFireCentral : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
SingleFireCentral() : BaseClass() {;} ///< Contructor
virtual ~SingleFireCentral() = default; ///< Destructor
/*! \name Specific data*/
//@{
struct DetonationData
{
DetonationData() = default;
DetonationData(const Point3D &origin, double radius)
: m_origin(origin), m_radius(radius)
{}
Point3D m_origin;
double m_radius{0.0};
};
virtual void setDetonation(const DetonationData &detonationData) = 0;
virtual DetonationData detonation() const = 0;
virtual bool startDetonationAnimation() = 0;
// required???
virtual Point3D impactOrigin() const = 0;
virtual void setImpactOrigin(const Point3D &impactOrigin) = 0;
//@}
};
} // namespace SituationMap
@@ -0,0 +1,65 @@
/**
* @RDE_HEADER@
* Interface of AbstractMultiPointMapObject
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <Map/abstract_map_object.h>
#include <Map/line_style.h>
#include <Map/fill_style.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The AbstractMultiPointMapObject class serves as baseclass for
* MapObjects with a multiple coordinates.
* Therefore setPositions and positions are supported.
*/
class AbstractMultiPointMapObject : public virtual AbstractMapObject
{
using BaseClass = AbstractMapObject;
public:
/** \name Positions
* Set positions of the object.
*/
//@{
virtual PositionCont positions() const = 0;
virtual bool setPositions(const PositionCont &posCont) = 0;
virtual PositionCont positionsTranslated() const = 0;
virtual bool setPositionsTranslated(const PositionCont &posCont) = 0;
//@}
/** \name LineStyle
* See AbstractMapObject for details.
*/
//@{
virtual LineStyle lineStyle() const = 0;
virtual LineStyle &rLineStyle() = 0;
virtual void setLineStyle(const LineStyle &lineStyle) = 0;
//@}
/** \name FillStyle
* See AbstractMapObject for details.
*/
//@{
virtual FillStyle fillStyle() const = 0;
virtual FillStyle &rFillStyle() = 0;
virtual void setFillStyle(const FillStyle &FillStyle) = 0;
//@}
};
} // namespace SituationMap
@@ -0,0 +1,63 @@
/**
* @RDE_HEADER@
* Interface of AbstractSinglePointMapObject
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <Map/abstract_map_object.h>
#include <Map/line_style.h>
#include <Map/fill_style.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The AbstractSinglePointMapObject class serves as baseclass for
* MapObjects with a single coordinate.
* Therefore setOrigin and origin are supported.
*/
class AbstractSinglePointMapObject : public virtual AbstractMapObject
{
using BaseClass = AbstractMapObject;
public:
/** \name Origin
* Set origin of the object.
*/
//@{
virtual Point3D origin() const = 0;
virtual bool setOrigin(const Point3D &origin) = 0;
//@}
/** \name LineStyle
* See AbstractMapObject for details.
*/
//@{
virtual LineStyle lineStyle() const = 0;
virtual LineStyle &rLineStyle() = 0;
virtual void setLineStyle(const LineStyle &lineStyle) = 0;
//@}
/** \name FillStyle
* See AbstractMapObject for details.
*/
//@{
virtual FillStyle fillStyle() const = 0;
virtual FillStyle &rFillStyle() = 0;
virtual void setFillStyle(const FillStyle &FillStyle) = 0;
//@}
};
} // namespace SituationMap
+38
View File
@@ -0,0 +1,38 @@
/**
* @RDE_HEADER@
* Interface of AirSupport
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The AirSupport class supports AirSupport.
*/
class AirSupport : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
AirSupport() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~AirSupport() = default; ///< Destructor
virtual void setReferencedObject(const UniqueMapId &UniqueMapId) = 0;
};
} // namespace SituationMap
+90
View File
@@ -0,0 +1,90 @@
/**
* @RDE_HEADER@
* Interface of AreaFire
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The AreaFire class supports AreaFire with impacts.
*/
//class SITUATIONMAP_EXPORT
class AreaFire : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
using BaseClass = SituationMap::AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
AreaFire() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~AreaFire() = default; ///< Destructor
/*! \name Specific data - impacts */
//@{
virtual PositionCont scheduledImpacts() const = 0;
virtual PositionCont impacts() const = 0;
virtual PositionCont impactsAbsoluteHeight() const = 0;
/**
* @brief Set impacts of AreaFire.
* @param posCont Impacts to be set.
*/
virtual void setScheduledImpacts(const PositionCont &posCont, const QColor &explicitColor = QColor()) = 0;
virtual void setImpacts(const PositionCont &posCont) = 0;
virtual void setImpactsAbsoluteHeight(const PositionCont &posCont) = 0;
//@}
virtual PositionCont detonationsAbsolute() const = 0;
virtual PositionCont detonationsDraped() const = 0;
/**
* @brief Set detonation (3D) of AreaFire.
* @param detonationRadius radius to be used.
* @param detonationsPositions detonations to be set.
*/
virtual bool setDetonationsAbsolute(const PositionCont &detonationsPositions, int detonationRadius) = 0; // Absolute
virtual bool setDetonationsDraped(const PositionCont &detonationsPositions, int detonationRadius) = 0;
/*! \name Specific data - GunToTargetLine / GunToTargetTrajectory */
//@{
virtual void setGunToTargetLineSurface(const Point3D &start, const Point3D &end) = 0;
virtual void setGunToTargetTrajectory3D(const PositionCont &gunToTargetPath) = 0;
//@}
/*! \name Specific data - NonLethalArea */
//@{
virtual void setNonLethalArea(const PositionCont &nonLethalArea) = 0;
//@}
/*! \name Specific data - trajectory */
//@{
virtual PositionCont trajectory(int index) const = 0;
/**
* @brief Set trajectoryPath of AreaFire.
* @param index path index.
* @param trajectoryPath path to be set.
*/
virtual bool setTrajectory(int index, const PositionCont &trajectoryPath) = 0;
//@}
};
} // namespace SituationMap
+46
View File
@@ -0,0 +1,46 @@
/**
* @RDE_HEADER@
* Interface of BiologicalAgent
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The BiologicalAgent class supports BiologicalAgent.
*/
class BiologicalAgent : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
BiologicalAgent() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~BiologicalAgent() = default; ///< Destructor
/*! \name Specific data*/
//@{
virtual Point3D origin() const = 0;
virtual void setOrigin(const Point3D &origin) = 0;
virtual float radius() const = 0;
virtual void setRadius(float radius) = 0;
//@}
};
} // namespace SituationMap
+58
View File
@@ -0,0 +1,58 @@
/**
* @RDE_HEADER@
* Interface of BuildingOutline
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
// Qt
#include <QUrl>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The BuildingOutline class supports BuildingOutline.
*/
class BuildingOutline : public virtual AbstractMultiPointMapObject
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
BuildingOutline() : AbstractMultiPointMapObject() {;} ///< Contructor
virtual ~BuildingOutline() = default; ///< Destructor
virtual LineStyle lineStyle() const = 0;
virtual LineStyle &rLineStyle() = 0;
virtual void setLineStyle(const LineStyle &lineStyle) = 0;
virtual FillStyle fillStyle() const = 0;
virtual FillStyle &rFillStyle() = 0;
virtual void setFillStyle(const FillStyle &FillStyle) = 0;
virtual void setMarker(const Point3D &markerOrigin) = 0;
// The 3D model is using the markerOrigin
struct ModelSceneSymbolData
{
QUrl url;
float heading{0.0}; // degree, clockwise, 0 is north/12
float scale{1.0};
};
virtual ModelSceneSymbolData getModelSceneSymbolData() = 0;
virtual void setModelSceneSymbolData(const ModelSceneSymbolData &modelSceneSymbolData) = 0;
};
} // namespace SituationMap
+46
View File
@@ -0,0 +1,46 @@
/**
* @RDE_HEADER@
* Interface of ChemicalAgent
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The ChemicalAgent class supports different agent types.
*/
class ChemicalAgent : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
ChemicalAgent() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~ChemicalAgent() = default; ///< Destructor
/*! \name Specific data*/
//@{
virtual Point3D origin() const = 0;
virtual void setOrigin(const Point3D &origin) = 0;
virtual float radius() const = 0;
virtual void setRadius(float radius, unsigned int maxPointCount = 0) = 0;
//@}
};
} // namespace SituationMap
+44
View File
@@ -0,0 +1,44 @@
/**
* @RDE_HEADER@
* Interface of DangerArea
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The Cube class supports staked cubes displaying the building ownership for example.
* The cubes can have more than 3 positions.
* But be aware that there is no 'roof' yes.
*/
class Cube : public virtual AbstractMultiPointMapObject
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Cube() : BaseClass() {;} ///< Contructor
virtual ~Cube() = default; ///< Destructor
virtual double height() const = 0;
virtual void setHeight(double height) = 0;
};
} // namespace SituationMap
+37
View File
@@ -0,0 +1,37 @@
/**
* @RDE_HEADER@
* Interface of DangerArea
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The DangerArea class supports DangerAreas of different agents.
*/
class DangerArea : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
DangerArea() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~DangerArea() = default; ///< Destructor
};
} // namespace SituationMap
+48
View File
@@ -0,0 +1,48 @@
/**
* @RDE_HEADER@
* Interface of FunctionalArea
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The FunctionalArea class supports FunctionalArea.
*/
class FunctionalArea : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
FunctionalArea() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~FunctionalArea() = default; ///< Destructor
/*! \name Point symbol */
//@{
virtual Point3D pointSymbolOrigin() const = 0;
virtual void setPointSymbolOrigin(const Point3D &pointSymbolOrigin) = 0;
virtual const QString &pointSymbolSidc() const = 0;
virtual void setPointSymbolSidc(const QString &pointSymbolOriginSidc) = 0;
//@}
};
} // namespace SituationMap
+146
View File
@@ -0,0 +1,146 @@
/**
* @RDE_HEADER@
* Interface of GeoImage
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_single_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The GeoImage class supports displaying image proxies like a small dot.
* By clicking of the proxy the image and an optional description will be displayed.
*/
class GeoImage : public virtual AbstractSinglePointMapObject
{
public:
struct GeoImageData
{
MarkerSymbolType proxyMarker = MarkerSymbolType::Undefined; ///< if not set, a Diamond will be used
int proxyMarkerSize = 20;
QColor proxyMarkerColor = Qt::red;
QImage proxyImage; ///< if not set, marker will be used
QSize proxyImageDefaultSize;
QImage mainImage;
QString description;
bool pinEnabled = false;
/**
* @brief operator== Compare two objects
* @param other to be compared with
* @return true if identical, otherwise false.
*/
bool operator==(const GeoImageData &other) const
{
return ((this->description == other.description) &&
(this->mainImage == other.mainImage) &&
(this->proxyImage == other.proxyImage) &&
(this->proxyMarkerSize == other.proxyMarkerSize) &&
(this->proxyMarkerColor== other.proxyMarkerColor) &&
(this->proxyMarker == other.proxyMarker)
);
}
/**
* @brief operator!= Compare two objects
* @param other to be compared with
* @return true if NOT identical, otherwise false.
*/
bool operator!=(const GeoImageData &other) const
{
return !(*this == other);
}
QString toString() const
{
QString str = QLatin1String("GeoImage(");
if (proxyImage.isNull())
str.append(QLatin1String("noProxyImage, "));
else
str.append(QLatin1String("withProxyImage, "));
if (mainImage.isNull())
str.append(QLatin1String("noMainImage, "));
else
str.append(QLatin1String("withMainImage, "));
str.append(QStringLiteral("desc='%1')").arg(description));
return str;
}
};
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
GeoImage() : AbstractSinglePointMapObject() {;} ///< Contructor
virtual ~GeoImage() = default; ///< Destructor
/*! \name Set data in one call */
//@{
virtual GeoImageData geoImageData() const = 0;
virtual void setGeoImageData(const GeoImageData &geoImageData) = 0;
//@}
/*! \name Set data separately */
//@{
virtual MarkerSymbolType proxyMarker() const = 0;
virtual void setProxyMarker(const MarkerSymbolType &proxyMarker) = 0;
virtual int proxyMarkerSize() const = 0;
virtual void setProxyMarkerSize(int proxyMarkerSize) = 0;
virtual QColor proxyMarkerColor() const = 0;
virtual void setProxyMarkerColor(const QColor &proxyMarkerColor) = 0;
virtual QImage proxyImage() const = 0;
virtual QSize proxyImageDefaultSize() const = 0;
/**
* @brief setProxyImage to set a proxy image be displayed on the map (instead of marker)
* @param proxyImage proxy image be displayed on the map
* @param proxyImageDefaultSize default size image if (user) scale is 1.0.
* The image will be scaled to the proxyImageDefaultSize * scale.
* To ensure that the image will be displayed with high resolution, the proxyImage must have this resolution.
* Example:
* Set an image of QSize(100,100), and set a proxyImageDefaultSize of QSize(20,20).
* Initially (scale = 1.0) the image will be downscaled to QSize(20,20).
* If the uses increases the scale to 4.0, the image will be scaled to QSize(80,80)
* This should ensure a good image quality.
*/
virtual void setProxyImage(const QImage &proxyImage, const QSize &proxyImageDefaultSize) = 0;
virtual QImage mainImage() const = 0;
virtual void setMainImage(const QImage &mainImage) = 0;
virtual QString description() const = 0;
virtual void setDescription(const QString &description) = 0;
// for better visibility at 3D
virtual void setPinEnabled(bool enablePin) = 0;
virtual bool isPinEnabled() const = 0;
//@}
/*! \name Create default widget */
//@{
virtual QWidget *createWidget(QWidget *parent = nullptr) const = 0;
//@}
};
} // namespace SituationMap
+75
View File
@@ -0,0 +1,75 @@
/**
* @RDE_HEADER@
* Class Geometry
* $Id$
* $HeadURL$
* $Author$
*/
// Own
#include "geometry.h"
#include <cmath>
//----------------------------------------------------------------------------
namespace SituationMap
{
QList<QPointF> Geometry::createCircle(const QPointF &center, qreal radius, int steps)
{
QList<QPointF> circle;
circle.reserve(steps);
if (steps < 10)
steps = 10;
for (int i = 0; i < 360; i += (360 / steps))
{
double winkel = i * M_PI / 180.0;
circle << (center + QPointF(cos(winkel) * radius, sin(winkel) * radius));
}
circle << circle.value(0); // 'close' the circle
// circle.translate(center);
return circle;
}
QList<QPointF> Geometry::createArcSegment(const QPointF &center, qreal radius,
double startAngle_degree,
double angleOffset_clockwise_degree,
int stepsPer360)
{
QList<QPointF> points;
if (stepsPer360 < 10)
stepsPer360 = 10;
startAngle_degree *= -1.0;
startAngle_degree += 90;
// normalize
startAngle_degree = fmod(startAngle_degree, 360);
angleOffset_clockwise_degree = fmod(angleOffset_clockwise_degree, 360);
// steps
int steps = fabs(angleOffset_clockwise_degree) * stepsPer360 / 360;
points.reserve(steps + 1);
double startAngle_rad = startAngle_degree * M_PI / 180.0;
double angleOffset_right_rad = angleOffset_clockwise_degree * M_PI / 180.0;
for (int i = 0; i < steps; ++i)
{
// '-' to go clockwise:
double winkel_rad = (startAngle_rad - (i * angleOffset_right_rad / steps));
points << (center + QPointF(cos(winkel_rad) * radius, sin(winkel_rad) * radius));
}
// calculate very last iteration (independent from 'steps'):
double winkel_rad = (startAngle_rad - (angleOffset_right_rad));
points << (center + QPointF(cos(winkel_rad) * radius, sin(winkel_rad) * radius));
return points;
}
} // namespace SituationMap
+46
View File
@@ -0,0 +1,46 @@
/**
* @RDE_HEADER@
* Class Geometry
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include "situation_map_export.h"
// Qt
#include <QPointF>
#include <QList>
//----------------------------------------------------------------------------
namespace SituationMap
{
class SITUATIONMAP_EXPORT Geometry final
{
public:
Geometry() = default;
~Geometry() = default;
static QList<QPointF> createCircle(const QPointF &center,
qreal radius,
int steps = 72); // 72 -> 5° Schritte
static QList<QPointF> createArcSegment(const QPointF &center, qreal radius,
double startAngle_degree,
double angleOffset_clockwise_degree,
int stepsPer360 = 72); // 72 -> 5° Schritte
static const int minNumberOfVerticesPerCircle = 10;
};
} // namespace SituationMap
+58
View File
@@ -0,0 +1,58 @@
/**
* @RDE_HEADER@
* Interface of HitLine
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The HitLine class supports HitLines of different agents.
* The method setPositions() should never be called.
*/
class HitLine : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
HitLine() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~HitLine() = default; ///< Destructor
/*! \name Specific data*/
//@{
// virtual PositionCont impacts() const = 0;
/**
* @brief Start and end point:.
*/
virtual Point3D startPoint() const = 0;
virtual Point3D endPoint() const = 0;
virtual void setStartAndEndPoint(const Point3D &start, const Point3D &end) = 0;
//@}
// void setPositions(const PositionCont& posCont) //SHOULD NEVER BE CALLED
};
} // namespace SituationMap
+64
View File
@@ -0,0 +1,64 @@
/**
* @RDE_HEADER@
* Interface of LineOfSight
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The LineOfSight class supports a "single" line with two colors.
* The method setPositions() should never be called.
*/
class LineOfSight : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
LineOfSight()
: AbstractMultiPointMapObject(), AbstractEffectSimulation()
{} ///< Contructor
virtual ~LineOfSight() = default; ///< Destructor
/*! \name Specific data*/
//@{
/*!
* \brief set relvants Points
* \param observer observerPoint (
* \param obstacle obstacle point
* \param target targetPoint
* \param visibleColor color to visualize the visible part
* \param obstructedColor color to visualize the obstructed part
*/
virtual void setPoints(const Point3D &observer,
const Point3D &obstacle,
const Point3D &target,
const QColor &visibleColor = Qt::green,
const QColor &obstructedColor = Qt::red) = 0;
//@}
// void setPositions(const PositionCont& posCont) //SHOULD NEVER BE CALLED
};
} // namespace SituationMap
+35
View File
@@ -0,0 +1,35 @@
/**
* @RDE_HEADER@
* Interface of DangerArea
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_single_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief
*/
class MapObjectAttributes : public virtual AbstractSinglePointMapObject
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
MapObjectAttributes() : AbstractSinglePointMapObject() {;} ///< Contructor
virtual ~MapObjectAttributes() = default; ///< Destructor
virtual QVariantMap attributes() const = 0;
virtual void setAttributes(const QVariantMap &attributes) = 0;
};
} // namespace SituationMap
+80
View File
@@ -0,0 +1,80 @@
/**
* @RDE_HEADER@
* Interface of MapObjectIndicator
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The MapObjectIndicator points to exactly one MapObject defined by its uniqueMapId.
*
* This MapObjectIndicator should be smart, you normally don´t have to set the position,
* color or similar directly.
* Just call setMapObjectToPointTo() and updateView();
* \n The MapObjectIndicator shoud 'follow' the object to be pointed to.
* \n The color is taken from the objectToBePointedTo (if that changes, call updateView() again).
*
* <b>Some Annotations / Recommendations:</b>
* - Layer: create the MapObjectIndicator in the topmost (operational) layer (LayerType::Operational)
* - The drawOrder is internal choosen to be OVER the objectToBePointedTo
* - The method setPositions() should never be called.
*
*/
class MapObjectIndicator : public virtual AbstractMultiPointMapObject
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
MapObjectIndicator() : AbstractMultiPointMapObject() {;} ///< Contructor
virtual ~MapObjectIndicator() = default; ///< Destructor
/*! \name Specific data*/
//@{
/**
* @brief Start and end point:.
*/
virtual Point3D startPoint() const = 0;
virtual Point3D endPoint() const = 0;
virtual void setStartAndEndPoint(const Point3D &start, const Point3D &end) = 0;
/**
* @brief mapObjectToPointTo
* @return uniqueId of the object to be pointed to.
*/
virtual UniqueMapId mapObjectToPointTo() = 0;
/**
* @brief Set uniqueId of object should to be pointed to.
* @attention But there is NO automatic update yet. Caller is responsable for operforming updateView()!
* @param uniqueId of the object to be pointed to.
*/
virtual void setMapObjectToPointTo(UniqueMapId uniqueId) = 0;
//@}
// void setPositions(const PositionCont& posCont) //SHOULD NEVER BE CALLED
};
} // namespace SituationMap
+53
View File
@@ -0,0 +1,53 @@
/**
* @RDE_HEADER@
* Interface of Mine
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_single_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The SingleFire class supports Indirect Single Fire.
*/
class Mine : public virtual AbstractSinglePointMapObject
{
using BaseClass = AbstractSinglePointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Mine() : AbstractSinglePointMapObject() {;} ///< Contructor
virtual ~Mine() = default; ///< Destructor
/*! \name Specific data*/
//@{
/**
* @brief Set mine state (true = aimed/active => filled symbol).
* @return True for aimed/active, otherwise false.
*/
virtual bool state() const = 0;
/**
* @brief Set new mine state.
* @param state (true = aimed/active => filled symbol)
*/virtual void setState(bool state) = 0;
//@}
};
} // namespace SituationMap
+90
View File
@@ -0,0 +1,90 @@
/**
* @RDE_HEADER@
* Interface of MineField
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The MineField class supports MineFields with Activated and DeActivated mines.
*/
class MineField : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
using BaseClass = AbstractMapObject;
public:
enum class MineState
{
Activated, ///< live, aimed
DeActivated ///<
};
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
MineField() : AbstractMultiPointMapObject(), AbstractEffectSimulation() { ; }
virtual ~MineField() = default; ///< Destructor
/*! \name Segments */
//@{
virtual PositionCont segment(int key) const = 0;
/**
* @brief Set positions of one segment.
* @param key of segment to be set.
* @param posCont positions of segment.
* @note: is key is negativ, no fill pattern is aplied.
* If key is >=0, the pattern of the segments take over the main pattern.
*/
virtual void setSegment(int key, const PositionCont &posCont) = 0;
/**
* @brief Remove one segment
* @param key to be removed.
*/
virtual void removeSegment(int key) = 0;
/**
* @brief Remove all segments.
*/
virtual void removeSegments() = 0;
/**
* @brief Get a list of keys in use.
* @return List of keys in use.
*/
virtual QList<int> keysInUse() const = 0;
/*! \name Positions of Mines */
//@{
/**
* @brief Set all positions of mines (of all states)
* @param mineState to be set.
* @param posCont positions of mines to be set.
*/
virtual void setPositionsMine(MineState mineState, const PositionCont &posCont) = 0;
//@}
virtual bool mineVisibility(MineState mineState) const = 0;
virtual void setMineVisibility(MineState mineState, bool visible) = 0;
};
} // namespace SituationMap
+112
View File
@@ -0,0 +1,112 @@
/**
* @RDE_HEADER@
* Interface of NineLiner
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The NineLiner class supports NineLiners of different agents.
* The method setPositions() should never be called.
*/
struct NineLiner : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
class NineLinerData
{
public:
Point3D initialPoint;
Point3D targetPosition;
int friendliesBearing = -1; // friendlies is optional
double friendliesDistance = -1; // friendlies is optional
int fah = 0; //finalAttackHeading
int fahLow = 0; //finalAttackHeading-SectorLow
int fahHigh = 0; //finalAttackHeading-SectorHigh
/**
* @brief operator== Compare two objects
* @param other to be compared with
* @return true if identical, otherwise false.
*/
bool operator==(const NineLinerData &other) const
{
return ((this->initialPoint == other.initialPoint) &&
(this->targetPosition == other.targetPosition) &&
(this->friendliesBearing == other.friendliesBearing) &&
(this->friendliesDistance == other.friendliesDistance) &&
(this->fah == other.fah) &&
(this->fahLow == other.fahLow) &&
(this->fahHigh == other.fahHigh)
);
}
/**
* @brief operator!= Compare two objects
* @param other to be compared with
* @return true if NOT identical, otherwise false.
*/
bool operator!=(const NineLinerData &other) const
{
return !(*this == other);
}
QString toString() const
{
QString str;
std::ostringstream stream;
stream << " initialPoint = " << initialPoint
<< " targetPosition = " << targetPosition;
str.append(QLatin1String(stream.str().c_str()));
str.append(QStringLiteral(", friendliesBearing=%1").arg(friendliesBearing));
str.append(QStringLiteral(", friendliesDistance=%1").arg(friendliesDistance));
str.append(QStringLiteral(", fah=%1").arg(fah));
str.append(QStringLiteral(", fahLow=%1").arg(fahLow));
str.append(QStringLiteral(", fahHigh=%1").arg(fahHigh));
return str;
}
}; // class NineLinerData
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
NineLiner() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~NineLiner() = default; ///< Destructor
/*! \name Specific data*/
//@{
virtual void setNineLinerData(const NineLinerData &data) = 0;
// virtual PositionCont impacts() const = 0;
//@}
// void setPositions(const PositionCont& posCont) //SHOULD NEVER BE CALLED
};
} // namespace SituationMap
+98
View File
@@ -0,0 +1,98 @@
/**
* @RDE_HEADER@
* Interface of NuclearAgent
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The ChemicalAgent class supports different agent types.
*/
class NuclearAgent : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
NuclearAgent() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~NuclearAgent() = default; ///< Destructor
/*! \name Subsidiary polyline/polygons */
//@{
/**
* @brief Get subsidiary line with key.
* @param key to be retrieved.
* @return subsidiary line at index
*/
virtual PositionCont subsidiaryLine(int key) const = 0;
/**
* @brief Set subsidiary line with key.
* @param key to be set.
* @param positions subsidiary line to be set.
*/
struct OptionalData
{
// ctor
OptionalData() {}
// member
bool closed{false};
QSharedPointer<LineStyle> lineStyle; // default is 'empty', do not honor
QSharedPointer<FillStyle> fillStyle; // default is 'empty', do not honor
};
// virtual void setSubsidiaryLine(int key, const PositionCont &positions, bool clo = false) = 0;
virtual void setSubsidiaryLine(int key, const PositionCont &positions, const OptionalData &optData = OptionalData()) = 0;
/**
* @brief Get a list of keys in use.
* @return List of keys in use.
*/
virtual QList<int> subsidiaryKeysInUse() = 0;
/**
* @brief Remove one subsidiary line.
* @param key to be removed.
*/
virtual void removeSubsidiaryLine(int key) = 0;
/**
* @brief Remove all subsidiaryPositions.
*/
virtual void removeSubsidiaryLines() = 0;
//@}
/*! \name Impact*/
//@{
virtual Point3D impactOrigin() const = 0;
virtual void setImpactOrigin(const Point3D &impactOrigin) = 0;
//@}
/*! \name Single Detonation */
//@{
virtual void setDetonation(const Point3D &origin, double radius) = 0;
virtual bool hasDetonation() const = 0;
virtual void resetDetonation() = 0;
//@}
};
} // namespace SituationMap
+279
View File
@@ -0,0 +1,279 @@
/**
* @RDE_HEADER@
* Interface of Participant
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include <Map/abstract_map_object.h>
// Qt
#include <QString>
#include <QColor>
#include <QVector>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The Participant class supports Participant and their wide range of parameters.
*
*/
class Participant : public virtual AbstractMapObject
{
using BaseClass = AbstractMapObject;
public:
/*! \name TextModifier */
//@{
/**
* @brief The TextModifier enum contains some standard Text Modifier (MIL2525, APP6)
*/
enum class TextModifier
{
EF_ReinforcedReduced = 0, ///< E -> FrameShapeModifier; F-> reinforced of reduced
M_HigherFormation, ///< Tactical Identifier (right handed)
T_UniqueDesignation, ///< Designator (left handed)
W_DateTimeGroup,
XY_AltitudeLocation,
V_Type,
Z_Speed,
G_StaffComments,
H_AdditionalInformation,
JKLNP,
END ///< This MUST mark the end, Do NOT use on interface
};
// Some helper functions:
static inline QLatin1String toString(TextModifier value) ///< 'EF_ReinforcedReduced', ...
{
switch (value)
{
case TextModifier::EF_ReinforcedReduced:
return QLatin1String("EF_ReinforcedReduced");
case TextModifier::M_HigherFormation:
return QLatin1String("M_HigherFormation");
case TextModifier::T_UniqueDesignation:
return QLatin1String("T_UniqueDesignation");
case TextModifier::W_DateTimeGroup:
return QLatin1String("W_DateTimeGroup");
case TextModifier::XY_AltitudeLocation:
return QLatin1String("XY_AltitudeLocation");
case TextModifier::V_Type:
return QLatin1String("V_Type");
case TextModifier::Z_Speed:
return QLatin1String("Z_Speed");
case TextModifier::G_StaffComments:
return QLatin1String("G_StaffComments");
case TextModifier::H_AdditionalInformation:
return QLatin1String("H_AdditionalInformation");
case TextModifier::JKLNP:
return QLatin1String("JKLNP");
case TextModifier::END:
break;
} //switch
return QLatin1String("ERROR-TextModifier");
}
static inline QLatin1String toDisplayString(TextModifier value) ///< 'ReinforcedReduced', ...
{
switch (value)
{
case TextModifier::EF_ReinforcedReduced:
return QLatin1String("ReinforcedReduced");
case TextModifier::M_HigherFormation:
return QLatin1String("HigherFormation");
case TextModifier::T_UniqueDesignation:
return QLatin1String("UniqueDesignation");
case TextModifier::W_DateTimeGroup:
return QLatin1String("DateTimeGroup");
case TextModifier::XY_AltitudeLocation:
return QLatin1String("AltitudeLocation");
case TextModifier::V_Type:
return QLatin1String("Type");
case TextModifier::Z_Speed:
return QLatin1String("Speed");
case TextModifier::G_StaffComments:
return QLatin1String("StaffComments");
case TextModifier::H_AdditionalInformation:
return QLatin1String("AdditionalInformation");
case TextModifier::JKLNP:
return QLatin1String("JKLNP");
case TextModifier::END:
break;
} //switch
return QLatin1String("ERROR-TextModifier");
}
static QVector<TextModifier> textModifiers() ///< only relevant TextModifier items -> without 'END'
{
return
{
TextModifier::EF_ReinforcedReduced,
TextModifier::M_HigherFormation,
TextModifier::T_UniqueDesignation,
TextModifier::W_DateTimeGroup
};
}
//@}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Participant() : BaseClass() {;} ///< Contructor
virtual ~Participant() = default; ///< Destructor
/*! \name Origin*/
//@{
virtual Point3D origin() const = 0;
virtual bool setOrigin(const Point3D &origin) = 0;
virtual void setPositions(const PositionCont &posCont) = 0; ///< To enable using as AES item (template@AdapterDds)
//@}
/*! \name Symbol Display*/
//@{
virtual float userSymbolOpacity() const = 0;
virtual void setUserSymbolOpacity(float userSymbolOpacity) = 0;
virtual SymbolDataToRender symbolDataToRender(bool ignoreForcedColor = true) const = 0;
virtual QImage actualImage() const = 0;
virtual AdvancedSymbology::SymbologyType symbologyType() const = 0;
//@}
/*! \name Text Modifier*/
//@{
virtual QString textModifier(TextModifier textModifier) const = 0;
virtual void setTextModifier(TextModifier textModifier, const QString &text) = 0;
virtual bool textModifierVisibility(TextModifier textModifier) const = 0;
virtual void setTextModifierVisibility(TextModifier textModifier, bool visible) = 0;
//@}
/*! \name Graphical Modifier*/
//@{
virtual Injury injury() const = 0;
virtual QColor injuryColor() const = 0;
virtual bool setInjury(Injury injury, const QColor &injuryColor) = 0; ///< Attention: Qt::red is an int
virtual int injuryPartyId() const = 0;
virtual bool setInjury(Injury injury, int partyId) = 0; ///< Attention: Qt::red is an int
virtual bool additionalSymbol(AdditionalSymbolType additionalSymbolType) const = 0;
/*!
* \brief setAdditionalSymbol
* \param additionalSymbolType to set
* \param newState new value
* \return true if changed, otherwise false
*/
virtual bool setAdditionalSymbol(AdditionalSymbolType additionalSymbolType, bool newState) = 0;
virtual bool isMarked() const = 0;
/*!
* \brief setMarked
* \param marked new value
* \return true if changed, otherwise false
*/
virtual bool setMarked(bool marked) = 0;
//@}
/*! \name Ranges*/
//@{
virtual QVector<int> ranges() const = 0;
virtual bool setRanges(const QVector<int> &ranges) = 0;
virtual bool isRangesVisible() const = 0;
virtual void setRangesVisibility(bool visible) = 0;
//@}
/*! \name DirectionIndicator like Turret Alignment*/
//@{
struct DirectionIndicatorData
{
double directionDegree = 0.0; ///< degree, clockwise (0 means 12 on a analog clock)
int lineWidth = 2; ///< px @ sizeL==default
Qt::PenStyle lineStyle = Qt::SolidLine;
QColor color; ///< invalid, means partyColor
};
virtual void setDirectionIndicator(int key, const DirectionIndicatorData &data) = 0;
virtual void removeDirectionIndicator(int key = -1) = 0;
virtual bool isDirectionIndicatorsVisible() const = 0;
virtual void setDirectionIndicatorsVisibility(bool visible) = 0;
//@}
/*! \name Designation*/
//@{
struct DesignationData
{
Point3D spotLocation;
int code;
bool isNull() const { return spotLocation.isNull(); }
bool operator==(const DesignationData& other) const
{
return this->spotLocation == other.spotLocation && this->code == other.code;
}
bool operator!=(const DesignationData& other) const
{
return !(*this == other);
}
};
virtual bool setDesignations(const QVector<DesignationData> &designations) = 0;
//@}
/*! \name Movement Track
* First of all you have the enable the MovementTrack using enableMovementTrack().
* \n Then you can optionally preset a couple of positions using setMovementTrack() or addToMovementTrack() to an MovementTrackContainer.
* \n Afterwards movement - transmitted by setOrigin() and a following updateView() - will be added to the MovementTrackContainer.
* \n If you hide the track by setMovementTrackVisibility() the movement will still be tracked until you disable the MovementTrack.
*
* <b>Behaviour if you enabled the MovementTrack and update the origin (using setOrigin()):</b>
* - <b>Every</b> position (different to last position) is added to track.
* \n There is currently no <b>minimum movement</b> required to be added to the track.
* - The number of positions in the track is unlimited.
* - There is no time-awareness of the positions.
*/
//@{
virtual bool isMovementTrackEnabled() const = 0;
virtual void setMovementTrackEnabled(bool enable) = 0;
virtual void setMovementTrack(const PositionCont &movementTrack) = 0;
virtual void addToMovementTrack(const Point3D &addToMovementTrack) = 0;
virtual PositionCont movementTrack() const = 0;
virtual int sizeOfMovementTrack() const = 0;
virtual bool isMovementTrackVisible() const = 0;
virtual void setMovementTrackVisibility(bool visible) = 0;
//@}
private:
// Forbid some overloaded methods without effects of this object:
// virtual QString identifier() const { return QString(); }
// virtual void setIdentifier(const QString& identifier) { Q_UNUSED(identifier); }
// virtual bool visibility(ObjectAppearance appearance) const { Q_UNUSED(appearance); return true;}
// virtual void setVisibility(ObjectAppearance appearance, bool visibility) { Q_UNUSED(appearance); Q_UNUSED(visibility); };
};
} // namespace SituationMap
+39
View File
@@ -0,0 +1,39 @@
/**
* @RDE_HEADER@
* Interface of Polygon
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The Polygon class supports Polygons.
*/
class Polygon : public virtual AbstractMultiPointMapObject
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Polygon() : BaseClass() {;} ///< Contructor
virtual ~Polygon() = default; ///< Destructor
};
} // namespace SituationMap
+56
View File
@@ -0,0 +1,56 @@
/**
* @RDE_HEADER@
* Interface of Polyline
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The Polyline class supports polylines.
*/
class Polyline : public virtual AbstractMultiPointMapObject
{
using BaseClass = AbstractMultiPointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Polyline() : BaseClass() {;} ///< Contructor
virtual ~Polyline() = default; ///< Destructor
/*! \name ArrowHeads */
//@{
virtual bool arrowHeadStart() const = 0;
virtual void setArrowHeadStart(bool enable) = 0;
virtual bool arrowHeadEnd() const = 0;
virtual void setArrowHeadEnd(bool enable) = 0;
//@}
/*! \name Text on lineSegments */
//@{
virtual QString textOnSegment(uint segment) const = 0;
virtual void setTextOnSegment(uint segment, const QString &segmentText) = 0;
virtual void clearTextOnSegment(uint segment) = 0;
//@}
};
} // namespace SituationMap
+61
View File
@@ -0,0 +1,61 @@
/**
* @RDE_HEADER@
* Interface of SingleFire
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The SingleFire class supports Indirect Single Fire.
*/
class SingleFire : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
using BaseClass = AbstractMultiPointMapObject;
public:
enum class ImpactType
{
normalImpact,
doubleImpact
};
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
SingleFire() : BaseClass() {;} ///< Contructor
virtual ~SingleFire() = default; ///< Destructor
/*! \name Specific data*/
//@{
virtual Point3D impactOrigin() const = 0;
virtual void setImpactOrigin(const Point3D &impactOrigin) = 0;
virtual ImpactType impactType() const = 0;
virtual void setImpactType(ImpactType impactType = ImpactType::normalImpact) = 0;
virtual Point3D origin() const = 0;
virtual void setOrigin(const Point3D &origin) = 0;
virtual float radius() const = 0;
virtual void setRadius(float radius) = 0;
virtual void setOriginatorToTargetLineSurface(const Point3D &start, const Point3D &end) = 0;
//@}
};
} // namespace SituationMap
+123
View File
@@ -0,0 +1,123 @@
/**
* @RDE_HEADER@
* Interface of SoundArea
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
class MarkerData
{
public:
MarkerData() = default;
/// ctor for marker
MarkerData(MarkerSymbolType _markerSymbolType, int _proxyMarkerSize, const QColor &_markerColor)
: m_proxyMarker(_markerSymbolType), m_proxyMarkerSize(_proxyMarkerSize), m_proxyMarkerColor(_markerColor)
{}
/**
* @brief proxyImage to set a proxy image be displayed on the map (instead of marker)
* @param _proxyImage proxy image be displayed on the map
* @param _proxyImageDefaultSize default size image if (user) scale is 1.0.
* The image will be scaled to the proxyImageDefaultSize * scale.
* To ensure that the image will be displayed with high resolution, the proxyImage must have this resolution.
* Example:
* Set an image of QSize(100,100), and set a proxyImageDefaultSize of QSize(20,20).
* Initially (scale = 1.0) the image will be downscaled to QSize(20,20).
* If the user increases the scale to 4.0, the image will be scaled to QSize(80,80)
* This should ensure a good image quality.
*/
MarkerData(const QImage &_proxyImage, const QSize &_proxyImageDefaultSize)
: m_proxyImage(_proxyImage)
, m_proxyImageDefaultSize(_proxyImageDefaultSize)
{}
/**
* @brief operator== Compare two objects
* @param other to be compared with
* @return true if identical, otherwise false.
*/
bool operator==(const MarkerData &other) const
{
return ((this->m_proxyImage == other.m_proxyImage) &&
(this->m_proxyMarkerSize == other.m_proxyMarkerSize) &&
(this->m_proxyMarkerColor == other.m_proxyMarkerColor) &&
(this->m_proxyMarker == other.m_proxyMarker)
);
}
/**
* @brief operator!= Compare two objects
* @param other to be compared with
* @return true if NOT identical, otherwise false.
*/
bool operator!=(const MarkerData &other) const
{
return !(*this == other);
}
bool hasMarker() const { return m_proxyMarker != MarkerSymbolType::Undefined; }
bool hasProxyImage() const { return !m_proxyImage.isNull(); }
QImage proxyImage() const { return m_proxyImage; }
bool isEmpty() const { return !hasMarker() && !hasProxyImage(); }
QString toString() const
{
QString str = QLatin1String("GeoImage(");
if (m_proxyImage.isNull())
str.append(QLatin1String("noProxyImage, "));
else
str.append(QLatin1String("withProxyImage, "));
return str;
}
protected:
friend class SoundAreaImpl;
MarkerSymbolType m_proxyMarker{MarkerSymbolType::Undefined};
int m_proxyMarkerSize{20};
QColor m_proxyMarkerColor{Qt::red};
QImage m_proxyImage; ///< if not set, marker will be used
QSize m_proxyImageDefaultSize;
};
/**
* @brief The SoundArea class supports SoundArea.
*/
class SoundArea : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
SoundArea() ///< Contructor
: AbstractMultiPointMapObject(), AbstractEffectSimulation()
{}
virtual ~SoundArea() = default; ///< Destructor
/*! \name Point symbol */
//@{
virtual Point3D markerOrigin() const = 0;
virtual void setMarkerOrigin(const Point3D &origin) = 0;
virtual const MarkerData &markerData() const = 0;
virtual void setMarkerData(const MarkerData &markerData) = 0;
//@}
};
} // namespace SituationMap
+53
View File
@@ -0,0 +1,53 @@
/**
* @RDE_HEADER@
* Interface of Text
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_single_point_map_object.h"
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The Polyline class supports polylines.
*/
class Text : public virtual AbstractSinglePointMapObject
{
using BaseClass = AbstractSinglePointMapObject;
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Text() : BaseClass() {;} ///< Contructor
virtual ~Text() = default; ///< Destructor
/**
* @brief Set flag 'showAnchorMarker' to switch on additional anchor marker graphic
* @return value of flag 'showAnchorPosition'
*
* If 'showAnchorMarker' is switched on, some additional graphic is drawn to visualize anchor points of text lines. Per default 'showAnchorMarker' is switched off.
*/
virtual void setShowAnchorMarker(bool on) = 0;
/**
* @brief Get flag 'showAnchorPosition'
* @return value of flag 'showAnchorMarker'
*/
virtual bool showAnchorMarker() const = 0;
};
} // namespace SituationMap
+111
View File
@@ -0,0 +1,111 @@
/**
* @RDE_HEADER@
* Interface of VirtualMine
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include "abstract_multi_point_map_object.h"
#include <Map/abstract_effect_simulation.h>
//----------------------------------------------------------------------------
namespace SituationMap
{
/**
* @brief The ChemicalAgent class supports different agent types.
*/
class VirtualMine : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation
{
public:
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Don't use "= default" because of bug in VS2015 JT 2016/11/7
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
VirtualMine() : AbstractMultiPointMapObject(), AbstractEffectSimulation() {;} ///< Contructor
virtual ~VirtualMine() = default; ///< Destructor
/*! \name Subsidiary polyline/polygons */
//@{
/**
* @brief Get subsidiary line with key.
* @param key to be retrieved.
* @return subsidiary line at index
*/
virtual PositionCont subsidiaryLine(int key) const = 0;
/**
* @brief Set subsidiary line with key.
* @param key to be set.
* @param positions subsidiary line to be set.
*/
struct OptionalData
{
// ctor
OptionalData() {}
// member
bool closed{false};
QSharedPointer<LineStyle> lineStyle; // default is 'empty', do not honor
QSharedPointer<FillStyle> fillStyle; // default is 'empty', do not honor
};
// virtual void setSubsidiaryLine(int key, const PositionCont &positions, bool clo = false) = 0;
virtual void setSubsidiaryLine(int key, const PositionCont &positions, const OptionalData &optData = OptionalData()) = 0;
/**
* @brief Get a list of keys in use.
* @return List of keys in use.
*/
virtual QList<int> subsidiaryKeysInUse() = 0;
/**
* @brief Remove one subsidiary line.
* @param key to be removed.
*/
virtual void removeSubsidiaryLine(int key) = 0;
/**
* @brief Remove all subsidiaryPositions.
*/
virtual void removeSubsidiaryLines() = 0;
//@}
/*! \name 3D marker / SimpleMarkerSceneSymbol (via renderer) */
//@{
virtual bool has3DMarkerRenderer() const = 0;
virtual void set3DMarkerRenderer(const Point3D &markerOrigin, const QVariantMap &attribMap) = 0;
//@}
/*! \name 3D marker / SimpleMarkerSceneSymbol (explicit symbol) */
//@{
struct SceneSymbolData
{
// ctor
SceneSymbolData() {}
// member
Point3D markerOrigin;
QColor color{Qt::gray};
double radius{1.0};
bool cone{false}; // cone - sphere
double heading{0.0};
double pitch{0.0};
double roll{0.0};
};
virtual bool has3DMarkerSceneSymbol() const = 0;
virtual void set3DMarkerSceneSymbol(const Point3D &markerOrigin, const SceneSymbolData &sceneSymbolData) = 0;
//@}
};
} // namespace SituationMap