libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-map
include
osmscoutmap
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
24
#include <
osmscoutmap/MapImportExport.h
>
25
26
#include <
osmscoutmap/Styles.h
>
27
28
namespace
osmscout
{
29
33
class
OSMSCOUT_MAP_API
SymbolRenderer
34
{
35
public
:
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
64
protected
:
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
MapImportExport.h
OSMSCOUT_MAP_API
#define OSMSCOUT_MAP_API
Definition
MapImportExport.h:45
Styles.h
osmscout::Projection
Definition
Projection.h:46
osmscout::SymbolRenderer
Definition
SymbolRenderer.h:34
osmscout::SymbolRenderer::BeginPrimitive
virtual void BeginPrimitive()
Definition
SymbolRenderer.h:70
osmscout::SymbolRenderer::SetBorder
virtual void SetBorder(const BorderStyleRef &borderStyle, double screenMmInPixel)=0
osmscout::SymbolRenderer::DrawRect
virtual void DrawRect(double x, double y, double w, double h)=0
osmscout::SymbolRenderer::SetFill
virtual void SetFill(const FillStyleRef &fillStyle)=0
osmscout::SymbolRenderer::~SymbolRenderer
virtual ~SymbolRenderer()=default
osmscout::SymbolRenderer::DrawPolygon
virtual void DrawPolygon(const std::vector< Vertex2D > &polygonPixels)=0
osmscout::SymbolRenderer::EndPrimitive
virtual void EndPrimitive()
Definition
SymbolRenderer.h:86
osmscout::SymbolRenderer::DrawCircle
virtual void DrawCircle(double x, double y, double radius)=0
osmscout::SymbolRenderer::Render
virtual void Render(const Projection &projection, const Symbol &symbol, const Vertex2D &mapCenter, double scaleFactor=1.0)
osmscout::SymbolRenderer::Render
virtual void Render(const Projection &projection, const Symbol &symbol, const Vertex2D &mapCenter, std::function< void()> afterRenderTransformer, std::function< void()> afterEndTransformer, double scaleFactor=1.0)
osmscout
Definition
Area.h:39
osmscout::BorderStyleRef
std::shared_ptr< BorderStyle > BorderStyleRef
Definition
Styles.h:464
osmscout::FillStyleRef
std::shared_ptr< FillStyle > FillStyleRef
Definition
Styles.h:356
Generated by
1.17.0