diff --git a/src/lib/marble/BatchedPlacemarkRenderer.h b/src/lib/marble/BatchedPlacemarkRenderer.h new file mode 100644 index 000000000..5739d5bc0 --- /dev/null +++ b/src/lib/marble/BatchedPlacemarkRenderer.h @@ -0,0 +1,68 @@ +// +// This file is part of the Marble Virtual Globe. +// +// This program is free software licensed under the GNU LGPL. You can +// find a copy of this license in LICENSE.txt in the top directory of +// the source code. +// +// Copyright 2016 Torsten Rahn +// + +#ifndef MARBLE_BATCHEDPLACEMARKRENDERER_H +#define MARBLE_BATCHEDPLACEMARKRENDERER_H + +#include "marble_export.h" + +#include + + +namespace Marble +{ + +class GeoPainter; + +struct TextFragment; + +/** + * @short This class renders placemarks where the positioning + * criteria differ from those inside the default Placemark + * layer / layout classes (e.g. house numbers). + * + */ + +class MARBLE_EXPORT BatchedPlacemarkRenderer +{ + public: + enum Frame { + NoOptions = 0x0, + RoundFrame = 0x1 + }; + + Q_DECLARE_FLAGS(Frames, Frame) + + BatchedPlacemarkRenderer(GeoPainter * painter); + ~BatchedPlacemarkRenderer(); + + void addTextFragment( const QPoint& targetPosition, const QString& text, + const QColor& color, QFlags flags ); + void clearTextFragments(); + void drawTextFragments(); + +private: + QVector m_textFragments; + QPixmapCache m_pixmapCache; + GeoPainter * m_painter; +}; + +struct TextFragment +{ + QString text; + QPoint position; + QColor color; + QFlags flags; +}; + + +} + +#endif