96 lines
3.2 KiB
C++
Executable File
96 lines
3.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* GeometryModel - Renderer
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Own
|
|
#include <Map/geometry_model_renderer.h>
|
|
#include <Map/situation_map_types.h>
|
|
#include <Common/situation_map_logging.h>
|
|
#include "situation_map_export.h"
|
|
|
|
// Qt
|
|
#include <QtCore/qmap.h>
|
|
|
|
|
|
namespace SituationMap
|
|
{
|
|
|
|
class Map;
|
|
class AbstractMultiPointMapObject;
|
|
class RenderMapObjectsVisitor;
|
|
|
|
|
|
class SITUATIONMAP_EXPORT GeometryModelRendererEsri : public GeometryModelRenderer
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
|
|
friend class MapImpl;
|
|
|
|
explicit GeometryModelRendererEsri(Map *map, const QString &layerName, GeometryModel &geometryModel, QObject *parent = nullptr);
|
|
~GeometryModelRendererEsri() = default;
|
|
|
|
public:
|
|
|
|
bool render() override;
|
|
|
|
bool renderNode(const GeometryModel::Node &node) override;
|
|
|
|
bool render(QPixmap &drawable) override;
|
|
|
|
GeometryModel::Node getAssociatedNode(const AbstractMapObject *mapObject) override;
|
|
|
|
bool getNodesPickable() const override;
|
|
void setNodesPickable(bool nodesPickable) override;
|
|
|
|
bool editorMode() const override;
|
|
void setEditorMode(bool on) override;
|
|
|
|
UniqueMapId getIdFromNode(const GeometryModel::Node &node) const override;
|
|
|
|
protected:
|
|
|
|
friend class RenderMapObjectsVisitor;
|
|
|
|
bool drawNodesRecursive(const GeometryModel::Node &);
|
|
|
|
void drawPolyline(const GeometryModel::Node &, const QString &layer, const QList<QPointF> &points, SituationMap::AbstractMapObject *mapObj, bool geoCoordinates = true);
|
|
|
|
void drawParticipantSymbol( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawDictionarySymbol ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawEllipse ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawLine ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawPolyline ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawRectangle ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawSpline ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawSymbol ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
void drawText ( const GeometryModel::Node &, const QString &layer, SituationMap::AbstractMapObject *mapObj );
|
|
|
|
template<class MapObjectClass> uint setLineStyle(const GeometryModel::Node &p, MapObjectClass *objPtr) const;
|
|
template<class MapObjectClass> void setFillStyle(const GeometryModel::Node &p, MapObjectClass *objPtr) const;
|
|
|
|
bool m_editorMode;
|
|
QTimer *m_delayedRenderTimer;
|
|
QSet<UniqueMapId> m_delayedRenderIds;
|
|
|
|
protected slots:
|
|
|
|
void onDelayedRenderNodes();
|
|
|
|
void onCleanupMapObjects(const SituationMap::GeometryModel::Node &node);
|
|
|
|
void onRemoveMapObject(int uid);
|
|
void onUpdate(const SituationMap::GeometryModel::Node &node, SituationMap::GeometryModel::Attribute att, bool coordsChanged);
|
|
|
|
}; // GeometryModelRendererEsri
|
|
}
|
|
|
|
|