libosmscout 1.1.1
Loading...
Searching...
No Matches
SymbolRenderer.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_MAP_SYMBOLRENDERER_H
2#define OSMSCOUT_MAP_SYMBOLRENDERER_H
3
4/*
5 This source is part of the libosmscout-map library
6 Copyright (C) 2010 Tim Teulings
7 Copyright (C) 2022 Lukas Karas
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*/
23
25
26#include <osmscoutmap/Styles.h>
27
28namespace osmscout {
29
34{
35public:
36 virtual ~SymbolRenderer() = default;
37
46 virtual void Render(const Projection &projection,
47 const Symbol &symbol,
48 const Vertex2D &mapCenter,
49 std::function<void()> afterRenderTransformer,
50 std::function<void()> afterEndTransformer,
51 double scaleFactor=1.0);
52
59 virtual void Render(const Projection &projection,
60 const Symbol &symbol,
61 const Vertex2D &mapCenter,
62 double scaleFactor=1.0);
63
64protected:
65 virtual void SetFill(const FillStyleRef &fillStyle) = 0;
66
67 virtual void SetBorder(const BorderStyleRef &borderStyle,
68 double screenMmInPixel) = 0;
69
70 virtual void BeginPrimitive()
71 {
72 // Default implementation is empty
73 };
74
75 virtual void DrawPolygon(const std::vector<Vertex2D> &polygonPixels) = 0;
76
77 virtual void DrawRect(double x,
78 double y,
79 double w,
80 double h) = 0;
81
82 virtual void DrawCircle(double x,
83 double y,
84 double radius) = 0;
85
86 virtual void EndPrimitive()
87 {
88 // Default implementation is empty
89 };
90};
91}
92
93#endif // OSMSCOUT_MAP_SYMBOLRENDERER_H
#define OSMSCOUT_MAP_API
Definition MapImportExport.h:45
Definition Projection.h:46
Definition SymbolRenderer.h:34
virtual void BeginPrimitive()
Definition SymbolRenderer.h:70
virtual void SetBorder(const BorderStyleRef &borderStyle, double screenMmInPixel)=0
virtual void DrawRect(double x, double y, double w, double h)=0
virtual void SetFill(const FillStyleRef &fillStyle)=0
virtual ~SymbolRenderer()=default
virtual void DrawPolygon(const std::vector< Vertex2D > &polygonPixels)=0
virtual void EndPrimitive()
Definition SymbolRenderer.h:86
virtual void DrawCircle(double x, double y, double radius)=0
virtual void Render(const Projection &projection, const Symbol &symbol, const Vertex2D &mapCenter, double scaleFactor=1.0)
virtual void Render(const Projection &projection, const Symbol &symbol, const Vertex2D &mapCenter, std::function< void()> afterRenderTransformer, std::function< void()> afterEndTransformer, double scaleFactor=1.0)
Definition Area.h:39
std::shared_ptr< BorderStyle > BorderStyleRef
Definition Styles.h:464
std::shared_ptr< FillStyle > FillStyleRef
Definition Styles.h:356