Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+293
@@ -0,0 +1,293 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Interface-Implementation of Participant
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Own
|
||||
#include <MapObjects/participant.h> // Interface
|
||||
#include <MapImpl/abstract_map_object_impl.h>
|
||||
#include <MapImpl/coordinate_translation.h>
|
||||
#include <GraphicalObjects/graphical_object_range.h>
|
||||
#include <GraphicalObjects/graphical_object_text.h>
|
||||
#include <GraphicalObjects/graphical_object_path.h>
|
||||
#include <GraphicalObjects/graphical_object_picture_marker.h>
|
||||
#include <Common/simple_value.h>
|
||||
#include "situation_map_objects_export.h"
|
||||
|
||||
|
||||
// Qt
|
||||
#include <QString>
|
||||
#include <QColor>
|
||||
#include <QSet>
|
||||
#include <QSharedPointer>
|
||||
|
||||
|
||||
// forward:
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
namespace SituationMap
|
||||
{
|
||||
|
||||
// forward:
|
||||
class BasicPathObjectImpl;
|
||||
class ParticipantImplMessage;
|
||||
|
||||
|
||||
struct TextModifierData
|
||||
{
|
||||
QString text;
|
||||
GraphicalObjectText *goText = nullptr;
|
||||
QPoint offset;
|
||||
|
||||
HorizontalAlignment horizontalAlignment = HorizontalAlignment::Left;
|
||||
VerticalAlignment verticalAlignment = VerticalAlignment::Bottom;
|
||||
|
||||
bool visible = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// inherent 'public', to get that implementation
|
||||
// inherent 'public virtual' to get that interface
|
||||
|
||||
|
||||
/**
|
||||
* @brief The ParticipantImpl class implements the Participant.
|
||||
*
|
||||
* @internal Internal: Though this class derives from AbstractMapObject like many others this class is special.
|
||||
* In contrast to most other sub classes the Participant does NOT call some baseclass methods (like updateView):
|
||||
*/
|
||||
class SITUATIONMAPOBJECTS_EXPORT ParticipantImpl : public AbstractMapObjectImpl, public virtual Participant
|
||||
{
|
||||
using BaseClass = AbstractMapObjectImpl;
|
||||
|
||||
template <typename> friend class GenericObjectFactory;
|
||||
friend class FunctionalAreaImpl;
|
||||
protected:
|
||||
explicit ParticipantImpl(const QString &debugInfo = QString());
|
||||
virtual ~ParticipantImpl();
|
||||
|
||||
public:
|
||||
void initTextModifierData();
|
||||
|
||||
|
||||
ParticipantImpl(const ParticipantImpl &other) = delete;
|
||||
ParticipantImpl &operator=(ParticipantImpl &other) = delete;
|
||||
|
||||
void setDebugInfo(const QString &debugInfo) override;
|
||||
|
||||
QString toString() const override;
|
||||
|
||||
|
||||
// Data access:
|
||||
Point3D origin() const override;
|
||||
bool setOrigin(const Point3D &origin) override;
|
||||
|
||||
/*! Just to enable using as AES item (template@AdapterDds) !*/
|
||||
void setPositions(const PositionCont &posCont) override;
|
||||
|
||||
void boundingBox(BoundingBox &bbox) const override;
|
||||
QColor majorColor() const override;
|
||||
|
||||
|
||||
float userSymbolOpacity() const override;
|
||||
void setUserSymbolOpacity(float userSymbolOpacity) override;
|
||||
|
||||
SymbolDataToRender symbolDataToRender(bool ignoreForcedColor = true) const override;
|
||||
QImage actualImage() const override;
|
||||
|
||||
AdvancedSymbology::SymbologyType symbologyType() const override;
|
||||
|
||||
// Scale : ('overload' AbstractMapObjectImpl)
|
||||
float scale() const override;
|
||||
void setScale(float scale) override;
|
||||
// : Scale
|
||||
|
||||
|
||||
QString textModifier(TextModifier textModifier) const override;
|
||||
void setTextModifier(TextModifier textModifier, const QString &text) override;
|
||||
bool textModifierVisibility(TextModifier textModifier) const override;
|
||||
void setTextModifierVisibility(TextModifier textModifier, bool visible) override;
|
||||
|
||||
Injury injury() const override;
|
||||
QColor injuryColor() const override;
|
||||
bool setInjury(Injury injury, const QColor &injuryColor) override; ///< Attention: 'Qt::red' is an int
|
||||
|
||||
int injuryPartyId() const override;
|
||||
bool setInjury(Injury injury, int partyId) override; ///< Attention: 'Qt::red' is an int
|
||||
|
||||
bool setPartyIdChanged(int partyId = -1) override;
|
||||
|
||||
bool additionalSymbol(AdditionalSymbolType additionalSymbolType) const override;
|
||||
bool setAdditionalSymbol(AdditionalSymbolType additionalSymbolType, bool newState) override;
|
||||
|
||||
bool isMarked() const override;
|
||||
bool setMarked(bool marked) override;
|
||||
|
||||
/*! \name DirectionIndicator like Turret Alignment*/
|
||||
//@{
|
||||
void setDirectionIndicator(int key, const DirectionIndicatorData &data) override;
|
||||
void removeDirectionIndicator(int key = -1) override;
|
||||
|
||||
bool isDirectionIndicatorsVisible() const override;
|
||||
void setDirectionIndicatorsVisibility(bool visible) override;
|
||||
//@}
|
||||
|
||||
QVector<int> ranges() const override;
|
||||
bool setRanges(const QVector<int> &ranges) override;
|
||||
bool isRangesVisible() const override;
|
||||
void setRangesVisibility(bool visible) override;
|
||||
|
||||
bool setDesignations(const QVector<DesignationData> &designations) override;
|
||||
|
||||
|
||||
bool isMovementTrackEnabled() const override;
|
||||
void setMovementTrackEnabled(bool enable) override;
|
||||
|
||||
void setMovementTrack(const PositionCont &movementTrack) override;
|
||||
void addToMovementTrack(const Point3D &addToMovementTrack) override;
|
||||
PositionCont movementTrack() const override;
|
||||
int sizeOfMovementTrack() const override;
|
||||
|
||||
bool isMovementTrackVisible() const override;
|
||||
void setMovementTrackVisibility(bool enable) override;
|
||||
|
||||
|
||||
// CHECK :
|
||||
QString identifier() const override { return QString();}
|
||||
virtual void setIdentifier(const QString &identifier) override { Q_UNUSED(identifier); }
|
||||
|
||||
void setVisibility(ObjectAppearance appearance, bool visibility) override { Q_UNUSED(appearance); Q_UNUSED(visibility);}
|
||||
// : CHECK
|
||||
|
||||
|
||||
int numberOfValuesChanged(); ///< For Unit/Module Test
|
||||
|
||||
|
||||
protected:
|
||||
friend class MapImpl;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
bool updateViewImplPre() override { return true; } // no tactical Appearance is necessary
|
||||
bool updateViewImpl() override;
|
||||
bool updateViewImplTextModifier();
|
||||
|
||||
bool updateViewImplDirectionIndicators();
|
||||
bool updateViewImplRanges();
|
||||
bool updateViewImplDesignation();
|
||||
|
||||
bool updateViewImplPost() override
|
||||
{
|
||||
// reset changed flags:
|
||||
BaseClass::updateViewImplPost();
|
||||
m_userSymbolOpacity.reset();
|
||||
m_scale.reset();
|
||||
m_injuryData.changed = false;
|
||||
m_marked.reset();
|
||||
m_directionIndicatorsVisibility.reset();
|
||||
m_ranges.reset();
|
||||
m_extensionsChanged = false;
|
||||
m_designationData.reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool init(MapImpl *mapImpl, const QString &logicalLayerName) override;
|
||||
|
||||
// internal/admin
|
||||
void onSymbolResultReady();
|
||||
|
||||
|
||||
// logical
|
||||
OriginTranslated m_origin;
|
||||
double m_height = 0;
|
||||
|
||||
SimpleValue<float> m_userSymbolOpacity = 1.0; // 0..1
|
||||
|
||||
SimpleValue<float> m_scale = 1.0; // 'overload' AbstractMapObjectImpl
|
||||
|
||||
public:
|
||||
const QColor &partyColor() const override;
|
||||
QColor partyColor(int partyId, bool isOutOfDate = false) const override;
|
||||
|
||||
protected:
|
||||
TextModifierData m_textModifierCont[static_cast<int>(TextModifier::END)];
|
||||
|
||||
// Extensions :
|
||||
struct InjuryData
|
||||
{
|
||||
SituationMap::Injury injury = SituationMap::Injury::NoInjury;
|
||||
QColor injuryColor;
|
||||
int injuryPartyId = -1;
|
||||
|
||||
bool changed = true;
|
||||
|
||||
void resetChanged() { changed = true; }
|
||||
|
||||
bool partyIdValid() const
|
||||
{
|
||||
return injuryPartyId >= 0;
|
||||
}
|
||||
};
|
||||
|
||||
InjuryData m_injuryData;
|
||||
const QColor &injuryColorInternal();
|
||||
|
||||
QSet<AdditionalSymbolType> m_additionalSymbols;
|
||||
|
||||
SimpleValue<bool> m_marked = false;
|
||||
|
||||
SymbolDataToRender m_symDataToRender;
|
||||
float m_scale4XmlSymbolWithSymbolSpecificScale = 0;
|
||||
|
||||
QMap<int, DirectionIndicatorData> m_directionIndicatorCont;
|
||||
QSharedPointer<GraphicalObjectPictureMarker> m_directionIndicatorPms;
|
||||
SimpleValue<bool> m_directionIndicatorsVisibility = true;
|
||||
|
||||
SimpleValue< QVector<int> > m_ranges;
|
||||
bool m_rangesVisibility = false;
|
||||
QVector< QSharedPointer<GraphicalObjectRange> > m_graphObjRanges;
|
||||
|
||||
|
||||
SimpleValue< QVector<Participant::DesignationData> > m_designationData; // Key = PRF Code
|
||||
QVector<QSharedPointer<BasicPathObjectImpl>> m_designationMapObjects;
|
||||
|
||||
|
||||
PositionsTranslated m_movementTrackCoords;
|
||||
bool m_movementTrackEnabled = false;
|
||||
bool m_movementTrackVisibility = true;
|
||||
QSharedPointer<GraphicalObjectPath> m_movementTrack;
|
||||
|
||||
bool m_extensionsChanged = true;
|
||||
// : Extensions
|
||||
|
||||
AdvancedSymbology::SymbolDictionary *m_dictionary = nullptr;
|
||||
AdvancedSymbology::SymbolResultWatcher m_symbolResultWatcher;
|
||||
|
||||
|
||||
private:
|
||||
LOGGER_T m_logger; ///< Interface of the Logging-Facility
|
||||
|
||||
// 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(appearance);};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace SituationMap
|
||||
|
||||
Reference in new issue
Block a user