SAGA API Version 9.14
Loading...
Searching...
No Matches
mapping.h
Go to the documentation of this file.
1
3// //
4// SAGA //
5// //
6// System for Automated Geoscientific Analyses //
7// //
8// Application Programming Interface //
9// //
10// Library: SAGA_API //
11// //
12//-------------------------------------------------------//
13// //
14// mapping.h //
15// //
16// Copyright (C) 2026 by //
17// Olaf Conrad //
18// //
19//-------------------------------------------------------//
20// //
21// This file is part of 'SAGA - System for Automated //
22// Geoscientific Analyses'. SAGA is free software; you //
23// can redistribute it and/or modify it under the terms //
24// of the GNU General Public License as published by the //
25// Free Software Foundation, either version 2 of the //
26// License, or (at your option) any later version. //
27// //
28// SAGA is distributed in the hope that it will be //
29// useful, but WITHOUT ANY WARRANTY; without even the //
30// implied warranty of MERCHANTABILITY or FITNESS FOR A //
31// PARTICULAR PURPOSE. See the GNU General Public //
32// License for more details. //
33// //
34// You should have received a copy of the GNU General //
35// Public License along with this program; if not, see //
36// <http://www.gnu.org/licenses/>. //
37// //
38//-------------------------------------------------------//
39// //
40// contact: Olaf Conrad //
41// Institute of Geography //
42// University of Hamburg //
43// Germany //
44// //
45// e-mail: oconrad@saga-gis.org //
46// //
48
49//---------------------------------------------------------
50#ifndef _HEADER_INCLUDED__SAGA_API__mapping_H
51#define _HEADER_INCLUDED__SAGA_API__mapping_H
52
53
55// //
56// //
57// //
59
60//---------------------------------------------------------
61#include "../geo_tools.h"
62
63
65// //
66// //
67// //
69
70//---------------------------------------------------------
72{
73public:
74
75 CMap_Canvas(void);
76 virtual ~CMap_Canvas(void);
77
78 CMap_Canvas (int Width, int Height, int Background = -1);
79 bool Create (int Width, int Height, int Background = -1);
80
81 bool Clear (void);
82
83 bool Save (const char *File);
84 bool Save (const wchar_t *File);
85 bool Save (const CSG_String &File);
86
87 bool Draw_Map (class CMap &Map, int x = 0, int y = 0, int Frame = 0);
88 bool Draw_ScaleBar (class CMap &Map, int x = 0, int y = 0, int Width = 400, int Height = 30, int Style = 0x18);
89 bool Draw_Legend (class CMap_Layer &Layer, int x = 0, int y = 0, double Zoom = 1.);
90
91
92private:
93
94 friend class CMap; friend class CMap_Layer;
95
96 class wxMemoryDC *m_pDC = NULL;
97
98 class wxBitmap *m_pBitmap = NULL;
99
100};
101
102
104// //
106
107//---------------------------------------------------------
109{
110public:
111
112 CMap(void);
113 virtual ~CMap(void);
114
115 CMap (const CSG_Rect &rWorld, int Width, int Height, double Scale = 1., int Background = -1, bool bAlpha = false);
116 bool Create (const CSG_Rect &rWorld, int Width, int Height, double Scale = 1., int Background = -1, bool bAlpha = false);
117
118 bool Clear (void);
119
120 const CSG_Rect & Get_Extent (void) const;
121
122 int Get_Width (void) const;
123 int Get_Height (void) const;
124
125 bool Draw (CMap_Canvas &Canvas, int x, int y, int Frame = 0);
126
127 bool Draw (class CMap_Base_Layer &Layer);
128
129 bool Save (const char *File);
130 bool Save (const wchar_t *File);
131 bool Save (const CSG_String &File);
132
133
134private:
135
136 friend class CMap_Base_Layer;
137
138 class CSG_Map_DC *m_pDC = NULL;
139
140};
141
142
144// //
146
147//---------------------------------------------------------
149{
150public:
151 CMap_Base_Layer(void);
152 virtual ~CMap_Base_Layer(void);
153
154 const SG_Char * List_Parameters (bool bDescription = true, bool bConstraints = true, bool bValue = true) const;
155
156 bool Set_Parameter (const SG_Char *ID, const char *Value);
157 bool Set_Parameter (const SG_Char *ID, const wchar_t *Value);
158 bool Set_Parameter (const SG_Char *ID, const CSG_String &Value);
159 bool Set_Parameter (const SG_Char *ID, int Value);
160 bool Set_Parameter (const SG_Char *ID, double Value);
161 bool Set_Parameter (const SG_Char *ID, const CSG_Colors &Value);
162
163 virtual CSG_Parameters & Get_Parameters (void) const = 0;
164
165 bool Draw (CMap &Map);
166
167
168protected:
169
170 virtual bool On_Draw (class CSG_Map_DC &dc_Map) = 0;
171
172 virtual CSG_String Get_Name (void) const = 0;
173
174};
175
176//---------------------------------------------------------
178{
179public:
180 CMap_Layer(void);
181 virtual ~CMap_Layer(void);
182
184 bool Create (CSG_Data_Object &Layer);
185
186 bool Destroy (void);
187
188 virtual CSG_Parameters & Get_Parameters (void) const;
189
190 bool Classify_Unique (int maxCount = 1024 , int ColorsID = -1, const SG_Char *Field = NULL);
191 bool Classify_Equal (int Count, double Minimum, double Maximum, int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
192 bool Classify_Equal (int Count = 10 , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
193 bool Classify_Defined (double Interval, double Offset , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
194 bool Classify_Defined (double Interval , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
195 bool Classify_Quantile (int Count = 10, bool bHistogram = true , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
196 bool Classify_Geometric (int Count = 10, bool bIncreasing = true , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
197 bool Classify_Natural (int Count = 10 , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
198 bool Classify_StdDev (double StdDev, double StdDev_Max = 4. , int ColorsID = -1, const SG_Char *Field = NULL, const SG_Char *Normalize = NULL);
199
200 bool Draw_Legend (CMap_Canvas &Canvas, int x, int y, double Zoom = 1.);
201
202
203protected:
204
205 virtual bool On_Draw (class CSG_Map_DC &dc_Map);
206
207 virtual CSG_String Get_Name (void) const;
208
209
210private:
211
212 class CSG_Map_Layer *m_pLayer = NULL;
213
214 class CSG_Map_Classify *m_pClassify = NULL;
215
216
217 bool _Classify_Initialize (const SG_Char *Field, const SG_Char *Normalize);
218 bool _Classify_Finalize (int ColorsID);
219
220};
221
222//---------------------------------------------------------
224{
225public:
226 CMap_Graticule(void);
227 virtual ~CMap_Graticule(void);
228
230 bool Create (const CSG_Projection &Projection);
231
232 virtual CSG_Parameters & Get_Parameters (void) const;
233
234
235protected:
236
238
240
241
242 virtual bool On_Draw (class CSG_Map_DC &dc_Map);
243
244 virtual CSG_String Get_Name (void) const;
245
246};
247
248//---------------------------------------------------------
250{
251public:
252 CMap_BaseMap(void);
253 virtual ~CMap_BaseMap(void);
254
256 bool Create (const CSG_Projection &Projection);
257
258 virtual CSG_Parameters & Get_Parameters (void) const;
259
260
261protected:
262
264
266
267
268 virtual bool On_Draw (class CSG_Map_DC &dc_Map);
269
270 virtual CSG_String Get_Name (void) const;
271
272};
273
274
276// //
277// //
278// //
280
281//---------------------------------------------------------
282#endif // #ifndef _HEADER_INCLUDED__SAGA_API__mapping_H
#define SAGA_API_DLL_EXPORT
Definition api_core.h:94
#define SG_Char
Definition api_core.h:536
CMap_Base_Layer(void)
Definition mapping.cpp:306
const SG_Char * List_Parameters(bool bDescription=true, bool bConstraints=true, bool bValue=true) const
Definition mapping.cpp:314
virtual CSG_String Get_Name(void) const =0
virtual bool On_Draw(class CSG_Map_DC &dc_Map)=0
bool Draw(CMap &Map)
Definition mapping.cpp:350
virtual CSG_Parameters & Get_Parameters(void) const =0
bool Set_Parameter(const SG_Char *ID, const char *Value)
Definition mapping.cpp:324
virtual bool On_Draw(class CSG_Map_DC &dc_Map)
Definition mapping.cpp:605
class CSG_Map_BaseMap * m_pLayer
Definition mapping.h:263
CSG_Projection m_Projection
Definition mapping.h:265
CMap_BaseMap(void)
Definition mapping.cpp:571
virtual CSG_String Get_Name(void) const
Definition mapping.cpp:611
virtual CSG_Parameters & Get_Parameters(void) const
Definition mapping.cpp:599
bool Create(const CSG_Projection &Projection)
Definition mapping.cpp:591
bool Draw_Legend(class CMap_Layer &Layer, int x=0, int y=0, double Zoom=1.)
Definition mapping.cpp:165
friend class CMap
Definition mapping.h:94
bool Save(const char *File)
Definition mapping.cpp:122
bool Draw_Map(class CMap &Map, int x=0, int y=0, int Frame=0)
Definition mapping.cpp:149
bool Create(int Width, int Height, int Background=-1)
Definition mapping.cpp:92
bool Clear(void)
Definition mapping.cpp:109
CMap_Canvas(void)
Definition mapping.cpp:67
friend class CMap_Layer
Definition mapping.h:94
bool Draw_ScaleBar(class CMap &Map, int x=0, int y=0, int Width=400, int Height=30, int Style=0x18)
Definition mapping.cpp:155
class CSG_Map_Graticule * m_pLayer
Definition mapping.h:237
virtual CSG_Parameters & Get_Parameters(void) const
Definition mapping.cpp:546
CMap_Graticule(void)
Definition mapping.cpp:518
virtual CSG_String Get_Name(void) const
Definition mapping.cpp:558
virtual bool On_Draw(class CSG_Map_DC &dc_Map)
Definition mapping.cpp:552
bool Create(const CSG_Projection &Projection)
Definition mapping.cpp:538
CSG_Projection m_Projection
Definition mapping.h:239
virtual CSG_String Get_Name(void) const
Definition mapping.cpp:436
bool Draw_Legend(CMap_Canvas &Canvas, int x, int y, double Zoom=1.)
Definition mapping.cpp:497
bool Classify_Unique(int maxCount=1024, int ColorsID=-1, const SG_Char *Field=NULL)
Definition mapping.cpp:486
bool Classify_Equal(int Count, double Minimum, double Maximum, int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:487
virtual bool On_Draw(class CSG_Map_DC &dc_Map)
Definition mapping.cpp:430
bool Destroy(void)
Definition mapping.cpp:409
bool Classify_Geometric(int Count=10, bool bIncreasing=true, int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:492
bool Classify_Quantile(int Count=10, bool bHistogram=true, int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:491
CMap_Layer(void)
Definition mapping.cpp:363
bool Classify_Defined(double Interval, double Offset, int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:489
bool Classify_Natural(int Count=10, int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:493
bool Classify_StdDev(double StdDev, double StdDev_Max=4., int ColorsID=-1, const SG_Char *Field=NULL, const SG_Char *Normalize=NULL)
Definition mapping.cpp:494
virtual CSG_Parameters & Get_Parameters(void) const
Definition mapping.cpp:422
bool Create(CSG_Data_Object &Layer)
Definition mapping.cpp:383
friend class CMap_Base_Layer
Definition mapping.h:136
bool Clear(void)
Definition mapping.cpp:204
bool Draw(CMap_Canvas &Canvas, int x, int y, int Frame=0)
Definition mapping.cpp:222
bool Save(const char *File)
Definition mapping.cpp:279
bool Create(const CSG_Rect &rWorld, int Width, int Height, double Scale=1., int Background=-1, bool bAlpha=false)
Definition mapping.cpp:198
CMap(void)
Definition mapping.cpp:178
int Get_Width(void) const
Definition mapping.cpp:213
int Get_Height(void) const
Definition mapping.cpp:214
const CSG_Rect & Get_Extent(void) const
Definition mapping.cpp:210