Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+279
@@ -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
|
||||
|
||||
Reference in new issue
Block a user