397 lines
9.7 KiB
C++
Executable File
397 lines
9.7 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Class SidcDefinitions
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#pragma once
|
|
|
|
// Own
|
|
#include "advanced_symbology_export.h"
|
|
#include "symbol_dictionary_types.h"
|
|
#include "../SymbologyImpl/advanced_symbology_logging.h" // ToDo
|
|
|
|
|
|
// Qt
|
|
#include <QString>
|
|
#include <QVector>
|
|
|
|
#include <QPixmap>
|
|
|
|
//----------------------------------------------------------------------------
|
|
namespace AdvancedSymbology
|
|
{
|
|
|
|
static const QLatin1String ETS_SYMBOL_KEYWORD("ETS");
|
|
|
|
|
|
// forward:
|
|
class SymbolDictionary;
|
|
class EsriDictionaryProcessor;
|
|
|
|
struct ModifierData;
|
|
|
|
/**
|
|
* @brief The SidcDefinitions class contains a row of enum definitions common to the AdvancedSymbology.
|
|
* A couple (like SidcDefinitions::modifierList) require a loaded SymbolDictionary.
|
|
*/
|
|
class ADVANCED_SYMBOLOGY_EXPORT SidcDefinitions
|
|
{
|
|
public:
|
|
|
|
/*! \name Construction, Destruction */
|
|
//@{
|
|
///< Constructor
|
|
explicit SidcDefinitions(AdvancedSymbology::SymbolDictionary *symbolDictionary, const char *loggerName = "SidcDefinitions");
|
|
|
|
///< Destructor
|
|
virtual ~SidcDefinitions() = default;
|
|
//@}
|
|
|
|
|
|
//
|
|
// Counting startw with 1
|
|
//
|
|
|
|
//
|
|
// Version : digit 1,2
|
|
//
|
|
|
|
|
|
//
|
|
// StandardIdentity : digit 3,4
|
|
//
|
|
|
|
enum class ShapeType
|
|
{
|
|
Undefined,
|
|
Circle,
|
|
Clover,
|
|
Curve,
|
|
Diamond,
|
|
Rectangle,
|
|
Square
|
|
};
|
|
static QLatin1String toString(ShapeType value);
|
|
|
|
// StandardIdentity, 1st digit
|
|
enum class Context
|
|
{
|
|
Reality, ///< 0
|
|
Exercise, ///< 1
|
|
Simulation ///< 2
|
|
};
|
|
static QLatin1String toString(Context value);
|
|
static QPixmap toPixmap(Context value);
|
|
static QVector<Context> contexts();
|
|
|
|
// StandardIdentity, 2nd digit
|
|
enum class Identity
|
|
{
|
|
Pending, ///< 0
|
|
Unknown, ///< 1
|
|
|
|
AssumedFriend, ///< 2
|
|
Friend, ///< 3
|
|
|
|
Neutral, ///< 4
|
|
|
|
SuspectJoker, ///< 5
|
|
HostileFaker ///< 6
|
|
};
|
|
static QLatin1String toString(Identity value);
|
|
static QPixmap toPixmap(Identity value);
|
|
static QVector<Identity> identities();
|
|
|
|
|
|
struct ADVANCED_SYMBOLOGY_EXPORT StandardIdentity
|
|
{
|
|
Context context = Context::Reality; ///< 1st digit
|
|
Identity identity = Identity::Unknown; ///< 2nd digit
|
|
ShapeType getShape() const; // BattleDimension missing!!!!!!!
|
|
};
|
|
|
|
|
|
//
|
|
// : StandardIdentity
|
|
//
|
|
|
|
|
|
//
|
|
// Symbol Set : digit 5,6 TODO: maybe generated out of esri stylx file, becasuse it depends on MIL/APP ???
|
|
//
|
|
enum class SymbolSet
|
|
{
|
|
Unknown, ///< 0
|
|
Air,
|
|
AirMissle,
|
|
Space = 5,
|
|
SpaceMissle,
|
|
LandUnit = 10,
|
|
LandCivilian_UnitOrganisation,
|
|
LandEquipment = 15,
|
|
LandInstallation = 20,
|
|
ControlMeasure = 25,
|
|
DismountedIndividual = 27, // APP6D, not MIL2525D
|
|
SeaSurface = 30,
|
|
SeaSubSurface = 35,
|
|
MineWarfare,
|
|
Activities = 40,
|
|
Atmospheric = 45,
|
|
Oceanographic,
|
|
MeteorologicalSpace = 50,
|
|
SignalsIntelligence_Space,
|
|
SignalsIntelligence_Air,
|
|
SignalsIntelligence_Land,
|
|
SignalsIntelligence_Surface,
|
|
SignalsIntelligence_Subsurface,
|
|
Cyberspace = 60
|
|
};
|
|
static QLatin1String toString(SymbolSet value);
|
|
static QPixmap toPixmap(SymbolSet value);
|
|
static QVector<SymbolSet> symbolSets();
|
|
|
|
template<typename T> static SymbolSet castToSymbolSet(T value)
|
|
{
|
|
SymbolSet symbolSet = static_cast<SymbolSet>(value);
|
|
if (!symbolSets().contains(symbolSet))
|
|
symbolSet = SymbolSet::Unknown;
|
|
return symbolSet;
|
|
} // template<typename T> SymbolSet castToSymbolSet(T value)
|
|
|
|
|
|
//
|
|
// Status : digit 7
|
|
//
|
|
enum class Status
|
|
{
|
|
Present = 0, ///< exeption, no Unknown
|
|
Planned_Anticipated_Suspect = 1,
|
|
Present_FullCapable = 2,
|
|
Present_Damaged = 3,
|
|
Present_Destroyed = 4,
|
|
Present_FullToCapacity = 5
|
|
};
|
|
static QLatin1String toString(Status value);
|
|
static QPixmap toPixmap(Status value);
|
|
static QVector<Status> statuss();
|
|
|
|
|
|
|
|
//
|
|
// HQ TF Dummy : digit 8
|
|
//
|
|
enum class HQTFDummy
|
|
{
|
|
Unknown, ///< 0
|
|
FeintDummy, ///< 1
|
|
Headquarters, ///< 2
|
|
FeintDummy_Headquarters, ///< 3
|
|
TaskForce, ///< 4
|
|
FeintDummy_TaskForce, ///< 5
|
|
TaskForce_Headquarters, ///< 6
|
|
FeintDummy_TaskForce_Headquarters, ///< 7
|
|
};
|
|
static QLatin1String toString(HQTFDummy value);
|
|
static QPixmap toPixmap(HQTFDummy value);
|
|
static QVector<HQTFDummy> hQTFDummy();
|
|
|
|
// some helper functions:
|
|
struct HQTFDummyConverter
|
|
{
|
|
|
|
static void toBool(const HQTFDummy &hqTfDummy,
|
|
bool &headquarters,
|
|
bool &taskForce,
|
|
bool &feintDummy);
|
|
|
|
|
|
static uint toHqTfDummyAsInt(bool headquarters,
|
|
bool taskForce,
|
|
bool feintDummy);
|
|
|
|
static HQTFDummy toHqTfDummy(bool headquarters,
|
|
bool taskForce,
|
|
bool feintDummy);
|
|
};
|
|
|
|
|
|
|
|
//
|
|
// Amplifier : digit 9,10
|
|
//
|
|
|
|
// Amplifier-Group : 1st digit
|
|
enum class AmplifierGroup
|
|
{
|
|
Unknown,
|
|
|
|
Echelon_BrigadeAndBelow,
|
|
Echelon_DivisionAndAbove,
|
|
|
|
Mobility_OnLand,
|
|
Mobility_OnSnow,
|
|
Mobility_OnWater,
|
|
|
|
Naval_TowedArry,
|
|
};
|
|
static QLatin1String toString(AmplifierGroup value);
|
|
static QPixmap toPixmap(AmplifierGroup value);
|
|
static QVector<AmplifierGroup> amplifierGroups();
|
|
|
|
// Depending on AmplifierGroup :
|
|
// Amplifier-Echelon/Mobility/Naval - 2nd digit
|
|
|
|
enum class EchelonBrigadeAndBelow
|
|
{
|
|
Unknown = 0,
|
|
TeamCrew,
|
|
Squad,
|
|
Section,
|
|
PlatoonDetachment,
|
|
CompanyBatteryTroop,
|
|
BattalionSquadron,
|
|
RegimentGroup,
|
|
Brigade
|
|
};
|
|
static QLatin1String toString(EchelonBrigadeAndBelow value);
|
|
static QPixmap toPixmap(EchelonBrigadeAndBelow value);
|
|
static QVector<EchelonBrigadeAndBelow> echelonBrigadeAndBelows();
|
|
|
|
// OR
|
|
|
|
enum class EchelonDivisionAndAbove
|
|
{
|
|
Unknown = 0,
|
|
Division,
|
|
CorpsMEF,
|
|
Army,
|
|
Army_GroupFront,
|
|
RegionTheater,
|
|
Command
|
|
};
|
|
static QLatin1String toString(EchelonDivisionAndAbove value);
|
|
static QVector<EchelonDivisionAndAbove> echelonDivisionAndAboves();
|
|
|
|
|
|
// OR
|
|
|
|
enum class MobilityOnLand
|
|
{
|
|
Unknown = 0,
|
|
WheeledLimitedCrossCountry,
|
|
WheeledCrossCountry,
|
|
Tracked,
|
|
WheeledAndTrackedCombination,
|
|
Towed,
|
|
Rail,
|
|
PackAnimal
|
|
};
|
|
static QLatin1String toString(MobilityOnLand value);
|
|
static QPixmap toPixmap(MobilityOnLand value);
|
|
static QVector<MobilityOnLand> mobilityOnLands();
|
|
|
|
// OR
|
|
|
|
enum class MobilityOnSnow
|
|
{
|
|
Unknown = 0,
|
|
OverSnow,
|
|
Sled
|
|
};
|
|
static QLatin1String toString(MobilityOnSnow value);
|
|
static QPixmap toPixmap(MobilityOnSnow value);
|
|
static QVector<MobilityOnSnow> mobilityOnSnows();
|
|
|
|
|
|
// OR
|
|
|
|
enum class MobilityOnWater
|
|
{
|
|
Unknown = 0,
|
|
Barge,
|
|
Amphibious
|
|
};
|
|
static QLatin1String toString(MobilityOnWater value);
|
|
static QPixmap toPixmap(MobilityOnWater value);
|
|
static QVector<MobilityOnWater> mobilityOnWaters();
|
|
|
|
// OR
|
|
|
|
enum class NavalTowedArray
|
|
{
|
|
Unknown = 0,
|
|
ShortTowedArray,
|
|
LongTowedArray
|
|
};
|
|
static QLatin1String toString(NavalTowedArray value);
|
|
static QPixmap toPixmap(NavalTowedArray value);
|
|
static QVector<NavalTowedArray> navalTowedArrays();
|
|
|
|
//
|
|
// : Amplifier
|
|
//
|
|
|
|
|
|
|
|
/*! \name Methods requiring a loaded SymbolDictionary*/
|
|
//@{
|
|
|
|
//
|
|
// Modifier
|
|
//
|
|
|
|
/**
|
|
* @brief Provides a list of all modifier keys
|
|
*/
|
|
QStringList modifierKeys() const;
|
|
|
|
/**
|
|
* @brief A List of all modifiers of a symbolSet
|
|
* @param symbolSet symbol set
|
|
* @param modifierSector sector of the modifier, range of values [1,2]
|
|
* @see SymbolSet
|
|
*/
|
|
QVector<ModifierData> modifierList(SidcDefinitions::SymbolSet symbolSet, unsigned int modifierSector) const;
|
|
//@}
|
|
|
|
|
|
|
|
protected:
|
|
SymbolDictionary *m_symbolDictionary = nullptr;
|
|
const EsriDictionaryProcessor *m_esriDictProcessor = nullptr;
|
|
|
|
LOGGER_T m_logger; ///< Interface of the Logging-Facility
|
|
|
|
}; // class SidcDefinitions
|
|
|
|
|
|
|
|
// move to different place!?!? Todo check
|
|
/**
|
|
* Stores data to each symbol modifier. Each symbol can have a list of sector 1 and sector 2 modifiers
|
|
*/
|
|
struct ModifierData
|
|
{
|
|
QString m_modifierKey; /*!< 5 digits key from ESRI stylx : SymbolSet<2>ModifierValue<2>ModifierSector<1> */
|
|
SidcDefinitions::SymbolSet m_symbolSet; /*!< Symbol set matching to the modifier */
|
|
unsigned int m_modifierSector; /*!< Modifier sector, can be 1 or 2 */
|
|
unsigned int m_modifierValue; /*!< Value of modifier depending on symbol set and modifier sector */
|
|
QString m_modifierName; /*!< Name of modifier to show at GUI */
|
|
QPixmap m_modifierIcon; /*!< Icon of the modifier */
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SidcDefinitions::ShapeType &value);
|
|
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SidcDefinitions::Identity &value);
|
|
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SidcDefinitions::SymbolSet &value);
|
|
ADVANCED_SYMBOLOGY_EXPORT std::ostream &operator<< (std::ostream &stream, const AdvancedSymbology::SidcDefinitions::Status &value);
|
|
|
|
|
|
} // namespace AdvancedSymbology
|