/** * @RDE_HEADER@ * Interface-Implementation of MapObjectIndicator * $Id$ * $HeadURL$ * $Author$ */ #pragma once // Own #include "abstract_multi_point_map_object_impl.h" #include "basic_path_object_impl.h" #include // Interface // Qt #include #include #include #include //---------------------------------------------------------------------------- namespace SituationMap { // forward class GraphicalObjectPictureMarker; /** * @brief The MapObjectIndicatorImpl can be used to ease the locating of an object. * The MapObjectIndicatorImpl can by parametrized with just the UniqueMapId to point to. * updateView() will do the rest for you: * - retrieve the object to point to, * - get the bounding box of that object and * - create an indicator from the current center of the map to the object. * \note If the object to point to disappears, you are responsible for removing the MapObjectIndicatorImpl! * * A class instance consists of the following logical elements: * - mainGraphicalObject (GraphicalObjectPath displaying the line with arrowhead) * - m_pictureMarker of type GraphicalObjectPictureMarker / Image to show circle at the center of the map. * - mainGraphicalObjectText (displaying the text/name/identifier) * - tacticalAppearance (irrelevant) */ // inherent 'public', to get that implementation // inherent 'public virtual' to get that interface class SITUATIONMAPOBJECTS_EXPORT MapObjectIndicatorImpl : public BasicPathObjectImpl, public virtual MapObjectIndicator { using BaseClass = BasicPathObjectImpl; template friend class GenericObjectFactory; protected: explicit MapObjectIndicatorImpl(const QString &debugInfo = QString()); virtual ~MapObjectIndicatorImpl(); public: MapObjectIndicatorImpl(const MapObjectIndicatorImpl &other) = delete; MapObjectIndicatorImpl &operator=(MapObjectIndicatorImpl &other) = delete; Point3D startPoint() const override; Point3D endPoint() const override; void setStartAndEndPoint(const Point3D &start, const Point3D &end) override; UniqueMapId mapObjectToPointTo() override; void setMapObjectToPointTo(UniqueMapId uniqueId) override; protected: bool updateViewImpl() override; friend class MapImpl; bool init(MapImpl *mapImpl, const QString &logicalLayerName) override; // internal/admin // logical private: bool setPositions(const PositionCont &) override; //SHOULD NEVER BE CALLED private: UniqueMapId m_uniqueIdToPointTo = INVALID_MAP_ID; QSharedPointer m_pictureMarker; // circle at the center of the map int m_pictureMarkerSize = 20; int m_lineWidth = 4; QMetaObject::Connection m_extentChangedConnection; LOGGER_T m_logger; ///< Interface of the Logging-Facility }; } // namespace SituationMap