SAGA API Version 9.14
Loading...
Searching...
No Matches
map_shapes_point.cpp
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// map_shapes_point.cpp //
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// e-mail: oconrad@saga-gis.org //
41// //
42// contact: Olaf Conrad //
43// Institute of Geography //
44// University of Hamburg //
45// Germany //
46// //
48
49//---------------------------------------------------------
50#include "../dc_helper.h"
51
52#include "map_symbology.h"
53
54#include "map_layer.h"
55
56//---------------------------------------------------------
57#include <wx/filename.h>
58
59#include "../saga_gui/res/xpm/default.xpm"
60
61
63// //
64// //
65// //
67
68//---------------------------------------------------------
69#define SYMBOL_TYPE_Image 13
70#define SYMBOL_TYPE_Arrow 14
71#define SYMBOL_TYPE_Beachball 15
72
73
75// //
76// //
77// //
79
80//---------------------------------------------------------
90
91
93// //
95
96//---------------------------------------------------------
98{
100
101 //-----------------------------------------------------
102 // Display...
103
104 BrushList_Add(Parameters, "NODE_DISPLAY", "DISPLAY_BRUSH", _TL("Fill Style"), _TL(""));
105
106 Parameters.Add_Bool ("NODE_DISPLAY", "OUTLINE" , _TL("Outline" ), _TL(""), true)->Set_Collapsed();
107 Parameters.Add_Color ("OUTLINE" , "OUTLINE_COLOR", _TL("Color" ), _TL(""), SG_GET_RGB(0, 0, 0));
108 Parameters.Add_Int ("OUTLINE" , "OUTLINE_SIZE" , _TL("Size" ), _TL(""), 1, 1, true);
109
110 Parameters.Add_Choice("NODE_DISPLAY", "DISPLAY_SYMBOL_TYPE", _TL("Symbol Type"), _TL(""), CSG_String::Format("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s",
111 _TL("circle"),
112 _TL("square"),
113 _TL("rhombus"),
114 _TL("triangle (up)"),
115 _TL("triangle (down)"),
116 _TL("circle with square"),
117 _TL("circle with rhombus"),
118 _TL("circle with triangle (up)"),
119 _TL("circle with triangle (down)"),
120 _TL("circle in square"),
121 _TL("circle in rhombus"),
122 _TL("circle in triangle (up)"),
123 _TL("circle in triangle (down)"),
124 _TL("image"),
125 _TL("arrow"),
126 _TL("beachball plot")), 0
127 );
128
129 Parameters.Add_FilePath("DISPLAY_SYMBOL_TYPE", "DISPLAY_SYMBOL_IMAGE", _TL("Image Symbol File"), _TL(""), CSG_String::Format(
130 "%s|*.bmp;*.ico;*.gif;*.jpg;*.jif;*.jpeg;*.pcx;*.png;*.pnm;*.tif;*.tiff;*.xpm|"
131 "%s (*.png)|*.png|"
132 "%s (*.jpg)|*.jpg;*.jif;*.jpeg|"
133 "%s (*.tif)|*.tif;*.tiff|"
134 "%s (*.gif)|*.gif|"
135 "%s (*.bmp)|*.bmp|"
136 "%s (*.pcx)|*.pcx|"
137 "%s (*.xpm)|*.xpm|"
138 "%s|*.*",
139 _TL("Recognized File Types" ),
140 _TL("Portable Network Graphics" ),
141 _TL("JPEG - JFIF Compliant" ),
142 _TL("Tagged Image File Format" ),
143 _TL("Graphics Interchange Format"),
144 _TL("Windows or OS/2 Bitmap" ),
145 _TL("Zsoft Paintbrush" ),
146 _TL("X11 Pixel Map" ),
147 _TL("All Files" ))
148 );
149
150 Parameters.Add_Choice("DISPLAY_SYMBOL_TYPE", "ARROW_DIRECTION" , _TL("Direction" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
151 Parameters.Add_Int ("ARROW_DIRECTION" , "ARROW_OFFSET" , _TL("Offset" ), _TL(""), 0.);
152 Parameters.Add_Choice("ARROW_DIRECTION" , "ARROW_ORIENTATION", _TL("Orientation"), _TL(""), CSG_String::Format("%s|%s", _TL("clockwise"), _TL("counterclockwise")));
153 Parameters.Add_Choice("ARROW_DIRECTION" , "ARROW_UNIT" , _TL("Unit" ), _TL(""), CSG_String::Format("%s|%s", _TL("degree"), _TL("radians")));
154 Parameters.Add_Choice("ARROW_DIRECTION" , "ARROW_STYLE" , _TL("Style" ), _TL(""), CSG_String::Format("%s|%s|%s", _TL("simple"), _TL("center"), _TL("circle")));
155 Parameters.Add_Int ("ARROW_DIRECTION" , "ARROW_WIDTH" , _TL("Line Width" ), _TL(""), 2, 1, true);
156
157 Parameters.Add_Choice("DISPLAY_SYMBOL_TYPE", "BEACHBALL_STRIKE" , _TL("Strike" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
158 Parameters.Add_Choice("DISPLAY_SYMBOL_TYPE", "BEACHBALL_DIP" , _TL("Dip" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
159 Parameters.Add_Choice("DISPLAY_SYMBOL_TYPE", "BEACHBALL_RAKE" , _TL("Rake" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
160
161 //-----------------------------------------------------
162 // Images...
163
164 Parameters.Add_Choice("NODE_DISPLAY", "IMAGE_FIELD", _TL("Image Field"),
165 _TL("Field that provides file paths (either absolute or relative to this data set) to images to be displayed besides the points."),
166 CSG_String::Format("<%s>", _TL("not set"))
167 );
168
169 Parameters.Add_Choice("IMAGE_FIELD", "IMAGE_ALIGN_X", _TL("Horizontal Align"), _TL(""), CSG_String::Format("%s|%s|%s", _TL("left"), _TL("center"), _TL("right" )), 0);
170 Parameters.Add_Choice("IMAGE_FIELD", "IMAGE_ALIGN_Y", _TL("Vertical Align" ), _TL(""), CSG_String::Format("%s|%s|%s", _TL("top" ), _TL("center"), _TL("bottom")), 0);
171 Parameters.Add_Double("IMAGE_FIELD", "IMAGE_OFFSET" , _TL("Offset" ), _TL("Offset distance to symbol relative to symbol's size."), 1., 0., true);
172 Parameters.Add_Double("IMAGE_FIELD", "IMAGE_SCALE" , _TL("Size Scaling" ), _TL("Scales image size relative to symbol's size."), 10., 0.1, true);
173 Parameters.Add_Choice("IMAGE_FIELD", "IMAGE_FIT" , _TL("Fit Size to..." ), _TL(""), CSG_String::Format("%s|%s|%s", _TL("overall"), _TL("width"), _TL("height")), 0);
174
175 //-----------------------------------------------------
176 // Size...
177
178 Parameters.Add_Choice("NODE_SIZE" , "SIZE_FIELD" , _TL("Field" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
179 Parameters.Add_Choice("SIZE_FIELD", "SIZE_SCALE" , _TL("Field Values" ), _TL(""), CSG_String::Format("%s|%s", _TL("take as size"), _TL("scale to size range")), 1);
180 Parameters.Add_Range ("SIZE_FIELD", "SIZE_RANGE" , _TL("Size Range" ), _TL(""), 2., 10., 0., true);
181 Parameters.Add_Double("NODE_SIZE" , "SIZE_DEFAULT", _TL("Size" ), _TL(""), 5., 0., true);
182 Parameters.Add_Choice("NODE_SIZE" , "SIZE_TYPE" , _TL("Size relates to..."), _TL(""), CSG_String::Format("%s|%s", _TL("Screen"), _TL("Map Units")), 0);
183
184 //-----------------------------------------------------
185 // Label...
186
187 Parameters.Add_Choice("LABEL_FIELD" , "LABEL_ANGLE_FIELD", _TL("Rotation Value" ), _TL(""), CSG_String::Format("<%s>", _TL("not set")));
188 Parameters.Add_Double("LABEL_ANGLE_FIELD", "LABEL_ANGLE" , _TL("Default Rotation"), _TL("rotation clockwise in degree"), 0., -360., true, 360., true);
189 Parameters.Add_Node ("LABEL_FIELD" , "LABEL_PLACEMENT" , _TL("Placement" ), _TL(""));
190 Parameters.Add_Choice("LABEL_PLACEMENT" , "LABEL_PLACEMENT_X", _TL("Horizontal" ), _TL(""), CSG_String::Format("%s|%s|%s", _TL("left" ), _TL("center"), _TL("right")), 1);
191 Parameters.Add_Double("LABEL_PLACEMENT_X", "LABEL_OFFSET_X" , _TL("Offset" ), _TL("Offset distance to symbol (either screen or map units)."), 0., 0., true);
192 Parameters.Add_Choice("LABEL_PLACEMENT" , "LABEL_PLACEMENT_Y", _TL("Vertical" ), _TL(""), CSG_String::Format("%s|%s|%s", _TL("above"), _TL("center"), _TL("below")), 2);
193 Parameters.Add_Double("LABEL_PLACEMENT_Y", "LABEL_OFFSET_Y" , _TL("Offset" ), _TL("Offset distance to symbol (either screen or map units)."), 0., 0., true);
194
195 //-----------------------------------------------------
196 return( true );
197}
198
199
201// //
203
204//---------------------------------------------------------
206{
207 //-----------------------------------------------------
208 if( Flags & PARAMETER_CHECK_VALUES )
209 {
210 if( Parameter.Cmp_Identifier("COLORS_FONT") )
211 {
212 return( CSG_Map_Shapes::Parameter_Changed(Parameters, Parameters["STRETCH_FIELD"], Flags) );
213 }
214 }
215
216 //-----------------------------------------------------
217 if( Flags & PARAMETER_CHECK_ENABLE )
218 {
219 if( Parameter.Cmp_Identifier("DISPLAY_SYMBOL_TYPE") )
220 {
221 int Value = Parameter.asInt();
222
223 Parameters.Set_Enabled("DISPLAY_SYMBOL_IMAGE", Value == SYMBOL_TYPE_Image );
224 Parameters.Set_Enabled("ARROW_DIRECTION" , Value == SYMBOL_TYPE_Arrow );
225 Parameters.Set_Enabled("BEACHBALL_STRIKE" , Value == SYMBOL_TYPE_Beachball);
226 Parameters.Set_Enabled("BEACHBALL_DIP" , Value == SYMBOL_TYPE_Beachball);
227 Parameters.Set_Enabled("BEACHBALL_RAKE" , Value == SYMBOL_TYPE_Beachball);
228 }
229
230 if( Parameter.Cmp_Identifier("LABEL_FIELD") )
231 {
232 bool Value = Parameter.asInt() < m_pObject->asShapes()->Get_Field_Count();
233
234 Parameters.Set_Enabled("LABEL_ANGLE_FIELD" , Value);
235 Parameters.Set_Enabled("LABEL_ANGLE" , Value);
236 Parameters.Set_Enabled("LABEL_PLACEMENT" , Value);
237 }
238
239 if( Parameter.Cmp_Identifier("LABEL_PLACEMENT_X") )
240 {
241 Parameters.Set_Enabled("LABEL_OFFSET_X" , Parameter.asInt() != 1);
242 }
243
244 if( Parameter.Cmp_Identifier("LABEL_PLACEMENT_Y") )
245 {
246 Parameters.Set_Enabled("LABEL_OFFSET_Y" , Parameter.asInt() != 1);
247 }
248
249 if( Parameter.Cmp_Identifier("LABEL_ANGLE_FIELD") )
250 {
251 Parameters.Set_Enabled("LABEL_ANGLE" , Get_Fields_Choice(Parameter) < 0);
252 }
253
254 if( Parameter.Cmp_Identifier("SIZE_FIELD") )
255 {
256 int Value = Get_Fields_Choice(Parameter);
257
258 Parameters.Set_Enabled("SIZE_SCALE" , Value >= 0);
259 Parameters.Set_Enabled("SIZE_RANGE" , Value >= 0);
260 Parameters.Set_Enabled("SIZE_DEFAULT" , Value < 0);
261 }
262
263 if( Parameter.Cmp_Identifier("SIZT_SCALE") )
264 {
265 Parameters.Set_Enabled("SIZE_RANGE", Parameter.asInt() == 1);
266 }
267
268 if( Parameter.Cmp_Identifier("IMAGE_FIELD") )
269 {
270 Parameter.Set_Children_Enabled(Parameter.asInt() < m_pObject->asShapes()->Get_Field_Count());
271 }
272 }
273
274 return( CSG_Map_Shapes::Parameter_Changed(Parameters, Parameter, Flags) );
275}
276
277
279// //
281
282//---------------------------------------------------------
284{
286
287 //-----------------------------------------------------
288 Set_Fields_Choice(m_Parameters["IMAGE_FIELD" ], false, true);
289 Set_Fields_Choice(m_Parameters["SIZE_FIELD" ], true, true);
290 Set_Fields_Choice(m_Parameters["LABEL_ANGLE_FIELD"], true, true);
291 Set_Fields_Choice(m_Parameters["ARROW_DIRECTION" ], true, false);
292 Set_Fields_Choice(m_Parameters["BEACHBALL_STRIKE" ], true, false);
293 Set_Fields_Choice(m_Parameters["BEACHBALL_DIP" ], true, false);
294 Set_Fields_Choice(m_Parameters["BEACHBALL_RAKE" ], true, false);
295
296 //-----------------------------------------------------
297 return( true );
298}
299
300
302// //
304
305//---------------------------------------------------------
307{
309
310 //-----------------------------------------------------
311 m_Symbol.Type = m_Parameters["DISPLAY_SYMBOL_TYPE"].asInt();
312
313 switch( m_Symbol.Type )
314 {
315 //-----------------------------------------------------
317 if( !SG_File_Exists (m_Parameters["DISPLAY_SYMBOL_IMAGE"].asString())
318 || !m_Symbol.Image.LoadFile(m_Parameters["DISPLAY_SYMBOL_IMAGE"].asString()) )
319 {
320 m_Symbol.Image = wxBitmap(default_xpm).ConvertToImage();
321 }
322 else
323 {
324 m_Symbol_Image.Destroy();
325 }
326 break;
327
328 //-----------------------------------------------------
330 m_Arrow.Field = Get_Fields_Choice(m_Parameters["ARROW_DIRECTION"]);
331 m_Arrow.Offset = m_Parameters["ARROW_OFFSET" ].asDouble();
332 m_Arrow.Orientation = m_Parameters["ARROW_ORIENTATION"].asInt ();
333 m_Arrow.Unit = m_Parameters["ARROW_UNIT" ].asInt ();
334 m_Arrow.Style = m_Parameters["ARROW_STYLE" ].asInt ();
335 m_Arrow.Width = m_Parameters["ARROW_WIDTH" ].asInt ();
336 break;
337
338 //-----------------------------------------------------
340 m_Beachball.Strike = Get_Fields_Choice(m_Parameters["BEACHBALL_STRIKE"]);
341 m_Beachball.Dip = Get_Fields_Choice(m_Parameters["BEACHBALL_DIP" ]);
342 m_Beachball.Rake = Get_Fields_Choice(m_Parameters["BEACHBALL_RAKE" ]);
343 break;
344 }
345
346 //-----------------------------------------------------
347 m_Image.Field = m_Parameters["IMAGE_FIELD"].asInt();
348
349 if( m_Image.Field >= m_pObject->asShapes()->Get_Field_Count() )
350 {
351 m_Image.Field = -1;
352 }
353 else
354 {
355 m_Image.Offset = m_Parameters["IMAGE_OFFSET"].asDouble();
356 m_Image.Scale = m_Parameters["IMAGE_SCALE" ].asDouble();
357 m_Image.Fit = m_Parameters["IMAGE_FIT" ].asInt();
358
359 switch( m_Parameters["IMAGE_ALIGN_X"].asInt() )
360 {
361 default: m_Image.Align = SG_DC_TEXTALIGN_LEFT ; break;
362 case 1: m_Image.Align = SG_DC_TEXTALIGN_XCENTER; break;
363 case 2: m_Image.Align = SG_DC_TEXTALIGN_RIGHT ; break;
364 }
365
366 switch( m_Parameters["IMAGE_ALIGN_Y"].asInt() )
367 {
368 default: m_Image.Align |= SG_DC_TEXTALIGN_TOP ; break;
369 case 1: m_Image.Align |= SG_DC_TEXTALIGN_YCENTER; break;
370 case 2: m_Image.Align |= SG_DC_TEXTALIGN_BOTTOM ; break;
371 }
372 }
373
374 //-----------------------------------------------------
375 m_Size.Unit = m_Parameters["SIZE_TYPE" ].asInt(); // screen pixels, map units
376 m_Size.Adjust = m_Parameters["SIZE_SCALE"].asInt(); // adjust to size range
377
378 if( (m_Size.Field = Get_Fields_Choice(m_Parameters["SIZE_FIELD"])) >= 0
379 && (m_Size.Scale = m_pObject->asShapes()->Get_Maximum(m_Size.Field) - m_pObject->asShapes()->Get_Minimum(m_Size.Field)) > 0. )
380 {
381 m_Size.Offset = m_Parameters["SIZE_RANGE.MIN"].asDouble();
382 m_Size.Scale = (m_Parameters["SIZE_RANGE.MAX"].asDouble() - m_Size.Offset) / m_Size.Scale;
383 m_Size.Minimum = m_pObject->asShapes()->Get_Minimum(m_Size.Field);
384 }
385 else
386 {
387 m_Size.Field = -1;
388 m_Size.Offset = m_Parameters["SIZE_DEFAULT"].asDouble();
389 m_Size.Scale = 0.;
390 m_Size.Minimum = 0.;
391 }
392
393 //-----------------------------------------------------
394 switch( m_Parameters["LABEL_PLACEMENT_X"].asInt() )
395 {
396 default: m_Label_Point.Align = SG_DC_TEXTALIGN_LEFT ; break;
397 case 1: m_Label_Point.Align = SG_DC_TEXTALIGN_XCENTER; break;
398 case 0: m_Label_Point.Align = SG_DC_TEXTALIGN_RIGHT ; break;
399 }
400
401 switch( m_Parameters["LABEL_PLACEMENT_Y"].asInt() )
402 {
403 default: m_Label_Point.Align |= SG_DC_TEXTALIGN_TOP ; break;
404 case 1: m_Label_Point.Align |= SG_DC_TEXTALIGN_YCENTER; break;
405 case 0: m_Label_Point.Align |= SG_DC_TEXTALIGN_BOTTOM ; break;
406 }
407
408 m_Label_Point.Angle = m_Parameters["LABEL_ANGLE"].asDouble();
409 m_Label_Point.Angle_Field = Get_Fields_Choice(m_Parameters["LABEL_ANGLE_FIELD"]);
410
411 //-----------------------------------------------------
412 m_bOutline = m_Parameters["OUTLINE"].asBool();
413 m_Pen = wxPen(!m_bOutline ? m_pSymbology->Get_Single_Color() : SG_Get_wxColor(m_Parameters["OUTLINE_COLOR"].asColor()), !m_bOutline ? 1 : m_Parameters["OUTLINE_SIZE"].asInt(), wxPENSTYLE_SOLID);
414 m_Brush = wxBrush(m_pSymbology->Get_Single_Color(), BrushList_Get_Style("DISPLAY_BRUSH"));
415
416 //-----------------------------------------------------
417 return( true );
418}
419
420
422// //
424
425//---------------------------------------------------------
426bool CSG_Map_Shapes_Point::Get_Style_Size(int &minSize, int &maxSize, double &Minimum, double &Scale, wxString *pName)
427{
428 if( m_Size.Field >= 0 )
429 {
430 minSize = (int)(m_Size.Offset);
431 maxSize = (int)(m_Size.Offset + m_Size.Scale * (m_pObject->asShapes()->Get_Maximum(m_Size.Field) - m_Size.Minimum));
432 Minimum = m_Size.Minimum;
433 Scale = m_Size.Scale;
434
435 if( pName )
436 {
437 pName->Printf(m_pObject->asShapes()->Get_Field_Name(m_Size.Field));
438 }
439
440 return( true );
441 }
442
443 return( false );
444}
445
446
448// //
450
451//---------------------------------------------------------
453{
454 dc_Map.SetBrush(m_Brush);
455 dc_Map.SetPen (m_Pen );
456
457 m_Symbol.Type = m_Parameters("DISPLAY_SYMBOL_TYPE")->asInt();
458
459 if( (Flags & LAYER_DRAW_FLAG_THUMBNAIL) != 0 )
460 {
461 if( m_Symbol.Type == SYMBOL_TYPE_Image
463 {
464 m_Symbol.Type = 0;
465 }
466 }
467}
468
469//---------------------------------------------------------
470inline bool CSG_Map_Shapes_Point::Draw_Initialize(CSG_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, int Flags)
471{
472 if( m_Brush.IsTransparent() && !m_bOutline ) // nothing to draw !
473 {
474 return( false );
475 }
476
477 //-----------------------------------------------------
478 if( (Flags & LAYER_DRAW_FLAG_SELECTION) == 0 ) // don't change pen/brush drawing selection !
479 {
480 int Color;
481
482 if( !Get_Class_Color(pShape, Color) && !m_bNoData )
483 {
484 return( false );
485 }
486
487 if( m_Symbol.Type == SYMBOL_TYPE_Arrow && m_Arrow.Style != 2 )
488 {
489 if( !m_Brush.IsTransparent() )
490 {
491 wxBrush Brush(m_Brush); Brush.SetColour(SG_Get_wxColor(Color)); dc_Map.SetBrush(Brush);
492 }
493
494 wxPen Pen(SG_Get_wxColor(Color), 2); dc_Map.SetPen(Pen);
495 }
496 else
497 {
498 if( !m_Brush.IsTransparent() )
499 {
500 wxBrush Brush(m_Brush); Brush.SetColour(SG_Get_wxColor(Color)); dc_Map.SetBrush(Brush);
501 }
502
503 if( !m_bOutline )
504 {
505 wxPen Pen (m_Pen ); Pen .SetColour(SG_Get_wxColor(Color)); dc_Map.SetPen (Pen );
506 }
507 }
508 }
509
510 //-----------------------------------------------------
511 m_Label_Point.Offset.x = m_Parameters("LABEL_OFFSET_X")->asDouble();
512 m_Label_Point.Offset.y = m_Parameters("LABEL_OFFSET_Y")->asDouble();
513
514 switch( m_Parameters("LABEL_FIELD_SIZE_TYPE")->asInt() )
515 {
516 default: m_Label_Point.Offset *= dc_Map.Scale (); break;
517 case 1: m_Label_Point.Offset *= dc_Map.World2DC(); break;
518 }
519
520 //-----------------------------------------------------
521 double _Size = m_Size.Field < 0 ? m_Size.Offset : pShape->asDouble(m_Size.Field);
522
523 if( m_Size.Adjust ) // adjust to size range
524 {
525 _Size = m_Size.Offset + m_Size.Scale * (_Size - m_Size.Minimum);
526 }
527
528 switch( m_Size.Unit )
529 {
530 default: _Size *= dc_Map.Scale (); break;
531 case 1: _Size *= dc_Map.World2DC(); break;
532 }
533
534 return( (Size = (int)(0.5 + _Size)) > 0 );
535}
536
537//---------------------------------------------------------
539{
540 if( m_Size.Field >= 0 && pShape->is_NoData(m_Size.Field) )
541 {
542 return;
543 }
544
545 int Size;
546
547 if( !Draw_Initialize(dc_Map, Size, pShape, Flags) )
548 {
549 return;
550 }
551
552 //-----------------------------------------------------
553 int Type = m_Symbol.Type;
554
555 if( (Flags & LAYER_DRAW_FLAG_THUMBNAIL) != 0 && (Type == SYMBOL_TYPE_Image || Type == SYMBOL_TYPE_Arrow || Type == SYMBOL_TYPE_Beachball) )
556 {
557 Type = 0;
558 }
559
560 if( (Flags & LAYER_DRAW_FLAG_SELECTION) != 0 && (Type == SYMBOL_TYPE_Image) )
561 {
562 Type = 0;
563 }
564
565
566 TSG_Point_Int p(dc_Map.World2DC(pShape->Get_Point()));
567
568 switch( Type )
569 {
570 default:
571 Draw_Symbol(dc_Map, p.x, p.y, Size);
572 break;
573
574 //-----------------------------------------------------
576 {
577 double d = (double)m_Symbol.Image.GetWidth() / (double)m_Symbol.Image.GetHeight();
578
579 int sx = d > 1.0 ? Size : (int)(0.5 + Size * d);
580 int sy = d <= 1.0 ? Size : (int)(0.5 + Size / d);
581
582 if( sx > 0 && sy > 0 )
583 {
584 wxRect r(p.x - sx, p.y - sy, 2 * sx, 2 * sy);
585
586 if( (Flags & LAYER_DRAW_FLAG_SELECTION) != 0 )
587 {
588 r.Inflate(1); dc_Map.DrawRectangle(r);
589 }
590
591 dc_Map.DrawBitmap(wxBitmap(m_Symbol.Image.Scale(2 * sx, 2 * sy)), p.x - sx, p.y - sy, true);
592 }
593 }
594 break;
595
596 //-----------------------------------------------------
598 if( !pShape->is_NoData(m_Arrow.Field) )
599 {
600 _Arrow_Draw(dc_Map, p.x, p.y, Size, pShape->asDouble(m_Arrow.Field));
601 }
602 break;
603
604 //-----------------------------------------------------
606 if( !pShape->is_NoData(m_Beachball.Strike)
607 && !pShape->is_NoData(m_Beachball.Dip )
608 && !pShape->is_NoData(m_Beachball.Rake ) )
609 {
610 _Beachball_Draw(dc_Map, p.x, p.y, Size,
611 pShape->asDouble(m_Beachball.Strike),
612 pShape->asDouble(m_Beachball.Dip ),
613 pShape->asDouble(m_Beachball.Rake )
614 );
615 }
616 break;
617 }
618
619 //---------------------------------------------
620 if( (Flags & LAYER_DRAW_FLAG_THUMBNAIL) == 0 && m_Image.Field >= 0 )
621 {
622 _Image_Draw(dc_Map, p.x, p.y, Size, pShape->asString(m_Image.Field));
623 }
624}
625
626//---------------------------------------------------------
627void CSG_Map_Shapes_Point::Draw_Label(CSG_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
628{
629 TSG_Point_Int p(dc_Map.World2DC(pShape->Get_Point()));
630
631 if( m_Label_Point.Offset.x > 0. )
632 {
633 if( (m_Label_Point.Align & SG_DC_TEXTALIGN_LEFT ) != 0 ) p.x += m_Label_Point.Offset.x; else
634 if( (m_Label_Point.Align & SG_DC_TEXTALIGN_RIGHT ) != 0 ) p.x -= m_Label_Point.Offset.x;
635 }
636
637 if( m_Label_Point.Offset.y > 0. )
638 {
639 if( (m_Label_Point.Align & SG_DC_TEXTALIGN_TOP ) != 0 ) p.y += m_Label_Point.Offset.y; else
640 if( (m_Label_Point.Align & SG_DC_TEXTALIGN_BOTTOM) != 0 ) p.y -= m_Label_Point.Offset.y;
641 }
642
643 double Angle = m_Label_Point.Angle_Field < 0 ? m_Label_Point.Angle : pShape->asDouble(m_Label_Point.Angle_Field);
644
645 dc_Map.DrawText(m_Label_Point.Align, p.x, p.y, Angle, Label, m_Label.Effect, m_Label.Effect_Color, m_Label.Effect_Size);
646}
647
648
650// //
652
653//---------------------------------------------------------
654#define DRAW_CIRCLE(d) { int s = d == 1. ? Size : (int)((d) * Size);\
655 dc.DrawCircle(x, y, s);\
656}
657
658//---------------------------------------------------------
659#define DRAW_SQUARE(d) { int s = d == 1. ? Size : (int)((d) * Size);\
660 dc.DrawRectangle(x - s, y - s, 1 + 2 * s, 1 + 2 * s);\
661}
662
663//---------------------------------------------------------
664#define DRAW_RHOMBUS(d) { int s = d == 1. ? Size : (int)((d) * Size); wxPoint p[4];\
665 p[0].y = p[2].y = y;\
666 p[1].x = p[3].x = x;\
667 p[0].x = x - s;\
668 p[2].x = x + s;\
669 p[1].y = y - s;\
670 p[3].y = y + s;\
671 dc.DrawPolygon(4, p);\
672}
673
674//---------------------------------------------------------
675#define DRAW_TRIANGLE_UP(d) { int s = d == 1. ? Size : (int)((d) * Size); wxPoint p[3];\
676 p[0].y = p[1].y = y + (s / 2);\
677 p[2].y = y - (s - 1);\
678 p[0].x = x - (int)(0.8660254038 * s);\
679 p[1].x = x + (int)(0.8660254038 * s);\
680 p[2].x = x;\
681 dc.DrawPolygon(3, p);\
682}
683
684//---------------------------------------------------------
685#define DRAW_TRIANGLE_DOWN(d) { int s = d == 1. ? Size : (int)((d) * Size); wxPoint p[3];\
686 p[0].y = p[1].y = y - (s / 2);\
687 p[2].y = y + (s - 1);\
688 p[0].x = x - (int)(0.8660254038 * s);\
689 p[1].x = x + (int)(0.8660254038 * s);\
690 p[2].x = x;\
691 dc.DrawPolygon(3, p);\
692}
693
694//---------------------------------------------------------
695void CSG_Map_Shapes_Point::Draw_Symbol(wxDC &dc, int x, int y, int Size)
696{
697 switch( m_Symbol.Type )
698 {
699 default: DRAW_CIRCLE (1.0) ; break; // circle
700 case 1: DRAW_SQUARE (1.0) ; break; // square
701 case 2: DRAW_RHOMBUS (1.0) ; break; // rhombus
702 case 3: DRAW_TRIANGLE_UP (1.0) ; break; // triangle up
703 case 4: DRAW_TRIANGLE_DOWN(1.0) ; break; // triangle down
704 case 5: DRAW_CIRCLE (1.0); DRAW_SQUARE (0.7); break; // square in circle
705 case 6: DRAW_CIRCLE (1.0); DRAW_RHOMBUS (1.0); break; // rhombus in circle
706 case 7: DRAW_CIRCLE (1.0); DRAW_TRIANGLE_UP (1.0); break; // triangle up in circle
707 case 8: DRAW_CIRCLE (1.0); DRAW_TRIANGLE_DOWN(1.0); break; // triangle down in circle
708 case 9: DRAW_SQUARE (1.0); DRAW_CIRCLE (0.9); break; // circle in square
709 case 10: DRAW_RHOMBUS (1.0); DRAW_CIRCLE (0.7); break; // circle in rhombus
710 case 11: DRAW_TRIANGLE_UP (1.0); DRAW_CIRCLE (0.5); break; // circle in triangle up
711 case 12: DRAW_TRIANGLE_DOWN(1.0); DRAW_CIRCLE (0.5); break; // circle in triangle down
712 }
713}
714
715//---------------------------------------------------------
716void CSG_Map_Shapes_Point::Draw_Symbol(CSG_Map_DC &dc, int x, int y, int Size)
717{
718 switch( m_Symbol.Type )
719 {
720 default: DRAW_CIRCLE (1.0) ; break; // circle
721 case 1: DRAW_SQUARE (1.0) ; break; // square
722 case 2: DRAW_RHOMBUS (1.4) ; break; // rhombus
723 case 3: DRAW_TRIANGLE_UP (2.0) ; break; // triangle up
724 case 4: DRAW_TRIANGLE_DOWN(2.0) ; break; // triangle down
725 case 5: DRAW_CIRCLE (1.0); DRAW_SQUARE (0.7); break; // square in circle
726 case 6: DRAW_CIRCLE (1.0); DRAW_RHOMBUS (1.0); break; // rhombus in circle
727 case 7: DRAW_CIRCLE (1.0); DRAW_TRIANGLE_UP (1.0); break; // triangle up in circle
728 case 8: DRAW_CIRCLE (1.0); DRAW_TRIANGLE_DOWN(1.0); break; // triangle down in circle
729 case 9: DRAW_SQUARE (1.0); DRAW_CIRCLE (1.0); break; // circle in square
730 case 10: DRAW_RHOMBUS (1.4); DRAW_CIRCLE (1.0); break; // circle in rhombus
731 case 11: DRAW_TRIANGLE_UP (2.0); DRAW_CIRCLE (1.0); break; // circle in triangle up
732 case 12: DRAW_TRIANGLE_DOWN(2.0); DRAW_CIRCLE (1.0); break; // circle in triangle down
733 }
734}
735
736
738// //
740
741//---------------------------------------------------------
742void CSG_Map_Shapes_Point::_Image_Draw(CSG_Map_DC &dc_Map, int x, int y, int size, const wxString &file)
743{
744 wxFileName fn(file);
745
746 if( fn.IsRelative() )
747 {
748 fn.MakeAbsolute(SG_File_Get_Path(m_pObject->asShapes()->Get_File_Name()).c_str());
749 }
750
751 wxImage Image;
752
753 if( fn.Exists() && Image.LoadFile(fn.GetFullPath()) )
754 {
755 double s = m_Image.Scale * size;
756 double o = m_Image.Offset * size;
757
758 int sx = Image.GetWidth ();
759 int sy = Image.GetHeight();
760
761 double d = (double)sx / (double)sy;
762
763 switch( m_Image.Fit )
764 {
765 default:
766 sx = d > 1. ? s : (int)(0.5 + s * d);
767 sy = d <= 1. ? s : (int)(0.5 + s / d);
768 break;
769
770 case 1: // width
771 sx = s;
772 sy = (int)(0.5 + s / d);
773 break;
774
775 case 2: // height
776 sx = (int)(0.5 + s * d);
777 sy = s;
778 break;
779 }
780
781 if( sx > 1 && sy > 1 )
782 {
783 if( m_Image.Align & SG_DC_TEXTALIGN_LEFT ) { x += o ; } else
784 if( m_Image.Align & SG_DC_TEXTALIGN_XCENTER ) { x -= sx / 2; } else
785 if( m_Image.Align & SG_DC_TEXTALIGN_RIGHT ) { x -= o + sx; }
786
787 if( m_Image.Align & SG_DC_TEXTALIGN_TOP ) { y += o ; } else
788 if( m_Image.Align & SG_DC_TEXTALIGN_YCENTER ) { y -= sy / 2; } else
789 if( m_Image.Align & SG_DC_TEXTALIGN_BOTTOM ) { y -= o + sy; }
790
791 dc_Map.DrawBitmap(wxBitmap(Image.Scale(sx, sy)), x, y, true);
792 }
793 }
794}
795
796
798// //
800
801//---------------------------------------------------------
802void CSG_Map_Shapes_Point::_Arrow_Draw(CSG_Map_DC &dc_Map, int x, int y, int size, double angle)
803{
804 static double Template[4][2] =
805 {
806 { 0.0, -1.0 },
807 { 0.0, 1.0 },
808 { 0.3, -0.5 },
809 { -0.3, -0.5 }
810 };
811
812 angle += m_Arrow.Offset;
813
814 if( m_Arrow.Unit == 0 ) // degree
815 {
816 angle *= M_DEG_TO_RAD;
817 }
818
819 if( m_Arrow.Orientation == 0 ) // clockwise
820 {
821 angle *= -1.;
822 }
823
824 double sin_a = (1 + size) * sin(angle), cos_a = (1 + size) * cos(angle);
825
826 #define ROTATE(i) {\
827 x + (int)(Template[i][0] * cos_a + Template[i][1] * sin_a),\
828 y + (int)(Template[i][1] * cos_a - Template[i][0] * sin_a) }
829
830 int Arrow[4][2] =
831 {
832 ROTATE(0), ROTATE(1), ROTATE(2), ROTATE(3)
833 };
834
835 switch( m_Arrow.Style )
836 {
837 case 1: // arrow with center point
838 dc_Map.DrawCircle(x, y, m_Arrow.Width);
839 break;
840
841 case 2: // arrow in circle
842 dc_Map.DrawCircle(x, y, size);
843 break;
844 }
845
846 dc_Map.DrawLine(Arrow[0][0], Arrow[0][1], Arrow[1][0], Arrow[1][1]);
847 dc_Map.DrawLine(Arrow[0][0], Arrow[0][1], Arrow[2][0], Arrow[2][1]);
848 dc_Map.DrawLine(Arrow[0][0], Arrow[0][1], Arrow[3][0], Arrow[3][1]);
849}
850
851
853// //
855
856//---------------------------------------------------------
857void CSG_Map_Shapes_Point::_Beachball_Draw(CSG_Map_DC &dc_Map, int x, int y, int size, double strike, double dip, double rake)
858{
859 const double dArc = 5.;
860
861 strike *= M_DEG_TO_RAD; dip *= M_DEG_TO_RAD; rake *= M_DEG_TO_RAD;
862
863 CSG_Shapes Plot(SHAPE_TYPE_Polygon);
864
865 Plot.Add_Shape(); // 0, unit circle
866
867 for(double a=0.; a<M_PI_360; a+=dArc*M_DEG_TO_RAD)
868 {
869 Plot.Get_Shape(0)->Add_Point(sin(a), cos(a));
870 }
871
872 CSG_Vector N(3);
873
874 N[0] = 0; N[1] = 0; N[2] = 1;
875
876 SG_VectorR3_Rotate(N, 1, dip);
877 SG_VectorR3_Rotate(N, 2, strike);
878
879 _Beachball_Get_Plane(Plot.Add_Shape(), Plot.Get_Shape(0), N); // 1, fault plane
880
881 N[0] = 0; N[1] = -1; N[2] = 0;
882
883 rake = fmod(rake, M_PI_360); if( rake < -M_PI_180 ) rake += M_PI_360; else if( rake > M_PI_180 ) rake -= M_PI_360;
884
885 SG_VectorR3_Rotate(N, 2, -rake);
886 SG_VectorR3_Rotate(N, 1, dip);
887 SG_VectorR3_Rotate(N, 2, strike);
888
889 _Beachball_Get_Plane(Plot.Add_Shape(), Plot.Get_Shape(0), N); // 2, auxiliary plane
890
891 //-----------------------------------------------------
892 SG_Shape_Get_Intersection(Plot.Get_Shape(0), Plot.Get_Shape(1)->asPolygon(), Plot.Add_Shape()); // 3
893 SG_Shape_Get_Difference (Plot.Get_Shape(0), Plot.Get_Shape(1)->asPolygon(), Plot.Add_Shape()); // 4
894
895 CSG_Shape_Polygon *pPlot[2];
896
897 if( rake < 0. )
898 {
899 SG_Shape_Get_Difference (Plot.Get_Shape(3), Plot.Get_Shape(2)->asPolygon(), pPlot[0] = (CSG_Shape_Polygon *)Plot.Add_Shape());
900 SG_Shape_Get_Intersection(Plot.Get_Shape(4), Plot.Get_Shape(2)->asPolygon(), pPlot[1] = (CSG_Shape_Polygon *)Plot.Add_Shape());
901 }
902 else
903 {
904 SG_Shape_Get_Intersection(Plot.Get_Shape(3), Plot.Get_Shape(2)->asPolygon(), pPlot[0] = (CSG_Shape_Polygon *)Plot.Add_Shape());
905 SG_Shape_Get_Difference (Plot.Get_Shape(4), Plot.Get_Shape(2)->asPolygon(), pPlot[1] = (CSG_Shape_Polygon *)Plot.Add_Shape());
906 }
907
908 //-----------------------------------------------------
909 dc_Map.DrawCircle(x, y, size);
910
911 wxBrush b = dc_Map.Get_DC().GetBrush(); dc_Map.SetBrush(*wxWHITE_BRUSH);
912
913 for(int i=0; i<2; i++)
914 {
915 // SG_Shape_Get_Offset(pPlot[i], -0.01, dArc);
916 _Beachball_Get_Scaled(pPlot[i], x, y, size);
917
918 if( pPlot[i]->Get_Area() > 1 )
919 {
920 wxPoint *Points = new wxPoint[pPlot[i]->Get_Point_Count(0)];
921
922 for(int iPoint=0; iPoint<pPlot[i]->Get_Point_Count(0); iPoint++)
923 {
924 CSG_Point p(pPlot[i]->Get_Point(iPoint, 0));
925 Points[iPoint].x = (int)(p.x + 0.5);
926 Points[iPoint].y = (int)(p.y + 0.5);
927 }
928
929 dc_Map.DrawPolygon(pPlot[i]->Get_Point_Count(0), Points);
930
931 delete[](Points);
932 }
933 }
934
935 dc_Map.SetBrush(b);
936}
937
938//---------------------------------------------------------
939void CSG_Map_Shapes_Point::_Beachball_Get_Plane(CSG_Shape *pPlane, CSG_Shape *pCircle, const CSG_Vector &Normal)
940{
941 CSG_Vector Ez(3); Ez[2] = 1.0;
942
943 double Slope = Normal.Get_Angle(Ez);
944 double Azimuth = M_PI_090 + atan2(Normal[1], Normal[0]);
945
946 if( Slope > M_PI_090 )
947 {
948 Azimuth += M_PI_180;
949 Slope = M_PI_090 - (Slope - M_PI_090);
950 }
951
952 TSG_Point A, C;
953
954 A.x = sin(Azimuth - M_PI_090); // strike
955 A.y = cos(Azimuth - M_PI_090);
956
957 if( Slope < M_PI_090 )
958 {
959 double d = -2. * tan(Slope / 2.); // stereographic projection
960
961 C.x = d * sin(Azimuth);
962 C.y = d * cos(Azimuth);
963
964 pPlane->Add_Part(((CSG_Shape_Polygon *)pCircle)->Get_Part(0));
965
966 _Beachball_Get_Scaled(pPlane, C.x, C.y, SG_Get_Distance(A, C));
967 }
968 else
969 {
970 A.x *= 1.1; A.y *= 1.1;
971
972 pPlane->Add_Point(-A.x, -A.y);
973 pPlane->Add_Point( A.x, A.y);
974 pPlane->Add_Point( A.x - A.y, A.y + A.x);
975 pPlane->Add_Point(-A.x - A.y, -A.y + A.x);
976 }
977}
978
979//---------------------------------------------------------
980void CSG_Map_Shapes_Point::_Beachball_Get_Scaled(CSG_Shape *pShape, double x, double y, double size)
981{
982 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
983 {
984 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
985 {
986 TSG_Point Point = pShape->Get_Point(iPoint, iPart);
987
988 Point.x = x + size * Point.x;
989 Point.y = y - size * Point.y;
990
991 pShape->Set_Point(Point, iPoint, iPart);
992 }
993 }
994}
995
996
998// //
999// //
1000// //
1002
1003//---------------------------------------------------------
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
#define SG_GET_RGB(r, g, b)
Definition api_core.h:1345
#define _TL(s)
Definition api_core.h:1619
const SG_Char * Get_File_Name(bool bNative=true) const
class CSG_Shapes * asShapes(bool bPolymorph=false) const
void SetBrush(const wxBrush &Brush)
Definition map_dc.cpp:495
void SetPen(const wxPen &Pen)
Definition map_dc.cpp:482
void DrawPolygon(int n, const wxPoint points[], int xoffset=0, int yoffset=0, wxPolygonFillMode fill_style=wxODDEVEN_RULE)
Definition map_dc.cpp:578
void DrawCircle(int x, int y, int radius)
Definition map_dc.cpp:556
void DrawBitmap(const wxBitmap &bitmap, int x, int y, bool useAlpha=false)
Definition map_dc.cpp:600
void DrawLine(int x1, int y1, int x2, int y2)
Definition map_dc.cpp:524
wxMemoryDC & Get_DC(void)
Definition map_dc.h:96
const double & Scale(void) const
Definition map_dc.h:122
const double & World2DC(void) const
Definition map_dc.h:131
void DrawText(int Align, int x, int y, const wxString &Text)
Definition map_dc.cpp:616
void DrawRectangle(int x1, int y1, int width, int height)
Definition map_dc.cpp:535
bool Set_Fields_Choice(CSG_Parameter &Choice, bool bNumeric, bool bAddNone, bool bSelectNone=false)
static int Get_Fields_Choice(CSG_Parameter &Choice)
CSG_Data_Object * m_pObject
Definition map_layer.h:151
bool Set_Object(CSG_Data_Object *pObject)
CSG_Parameters m_Parameters
Definition map_layer.h:149
class CSG_Map_Symbology * m_pSymbology
Definition map_layer.h:153
void Draw_Symbol(wxDC &dc, int x, int y, int size)
class CSG_Map_Shapes_Point::CSize m_Size
class CSG_Map_Shapes_Point::CLabel_Point m_Label_Point
CSG_Map_Shapes_Point(CSG_Shapes *pShapes=NULL)
bool Get_Style_Size(int &minSize, int &maxSize, double &Minimum, double &Scale, wxString *pName)
virtual void Draw_Shape(CSG_Map_DC &dc_Map, CSG_Shape *pShape, int Flags=0)
virtual bool Add_Parameters(CSG_Parameters &Parameters)
virtual bool DataObject_Changed(void)
virtual void Draw_Label(CSG_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
class CSG_Map_Shapes_Point::CImage m_Image
class CSG_Map_Shapes_Point::CArrow m_Arrow
virtual bool Parameter_Changed(CSG_Parameters &Parameters, CSG_Parameter &Parameter, int Flags)
class CSG_Map_Shapes_Point::CBeachball m_Beachball
class CSG_Map_Shapes_Point::CSymbol m_Symbol
virtual bool Parameters_Changed(void)
virtual void Draw_Initialize(CSG_Map_DC &dc_Map, int Flags)
virtual bool Add_Parameters(CSG_Parameters &Parameters)
CSG_Parameter * BrushList_Add(CSG_Parameters &Parameters, const CSG_String &ParentID, const CSG_String &Identifier, const CSG_String &Name, const CSG_String &Description) const
virtual bool Parameter_Changed(CSG_Parameters &Parameters, CSG_Parameter &Parameter, int Flags)
wxBrushStyle BrushList_Get_Style(const CSG_String &Identifier)
bool Get_Class_Color(CSG_Shape *pShape, int &Color)
class CSG_Map_Shapes::CLabel m_Label
wxBrush m_Brush
Definition map_layer.h:666
virtual bool Parameters_Changed(void)
virtual bool DataObject_Changed(void)
bool Set_Collapsed(bool bOn=true)
bool Set_Children_Enabled(bool bEnabled=true)
bool Cmp_Identifier(const CSG_String &Identifier) const
int asInt(void) const
Definition parameters.h:287
CSG_Parameter * Add_Choice(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const CSG_String &Items, int Default=0)
void Set_Enabled(bool bEnabled=true)
CSG_Parameter * Add_FilePath(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, const SG_Char *Filter=NULL, const SG_Char *Default=NULL, bool bSave=false, bool bDirectory=false, bool bMultiple=false)
CSG_Parameter * Add_Double(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Value=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
CSG_Parameter * Add_Int(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0, int Minimum=0, bool bMinimum=false, int Maximum=0, bool bMaximum=false)
CSG_Parameter * Add_Node(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool bCollapsed=false)
CSG_Parameter * Add_Color(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, int Value=0)
CSG_Parameter * Add_Bool(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, bool Value=false)
CSG_Parameter * Add_Range(const CSG_String &ParentID, const CSG_String &ID, const CSG_String &Name, const CSG_String &Description, double Range_Min=0.0, double Range_Max=0.0, double Minimum=0.0, bool bMinimum=false, double Maximum=0.0, bool bMaximum=false)
virtual int Get_Point_Count(void) const
Definition shapes.h:501
virtual int Get_Point_Count(void) const =0
virtual int Add_Part(class CSG_Shape_Part *pPart, bool bRevert=false)
Definition shapes.h:171
virtual int Add_Point(double x, double y, int iPart=0)=0
virtual int Get_Part_Count(void) const =0
virtual TSG_Point Get_Point(int iPoint=0) const =0
virtual int Set_Point(double x, double y, int iPoint=0, int iPart=0)=0
virtual TSG_Shape_Type Get_Type(void) const
Definition shapes.h:814
static CSG_String Format(const char *Format,...)
const SG_Char * c_str(void) const
bool is_NoData(int Field) const
double asDouble(int Field) const
const SG_Char * asString(int Field, int Decimals=-99) const
double Get_Angle(const CSG_Vector &Vector) const
wxColour SG_Get_wxColor(int Color)
Definition dc_helper.cpp:70
#define SG_DC_TEXTALIGN_YCENTER
Definition dc_helper.h:128
#define SG_DC_TEXTALIGN_BOTTOM
Definition dc_helper.h:129
#define SG_DC_TEXTALIGN_LEFT
Definition dc_helper.h:124
#define SG_DC_TEXTALIGN_XCENTER
Definition dc_helper.h:125
#define SG_DC_TEXTALIGN_RIGHT
Definition dc_helper.h:126
#define SG_DC_TEXTALIGN_TOP
Definition dc_helper.h:127
double SG_Get_Distance(double ax, double ay, double bx, double by, bool bPolar)
#define A
#define C
struct SSG_Point TSG_Point
struct SSG_Point_Int TSG_Point_Int
#define LAYER_DRAW_FLAG_THUMBNAIL
Definition map_layer.h:74
#define LAYER_DRAW_FLAG_SELECTION
Definition map_layer.h:75
#define DRAW_SQUARE(d)
#define DRAW_TRIANGLE_DOWN(d)
#define SYMBOL_TYPE_Arrow
#define SYMBOL_TYPE_Image
#define DRAW_TRIANGLE_UP(d)
#define DRAW_RHOMBUS(d)
#define DRAW_CIRCLE(d)
#define SYMBOL_TYPE_Beachball
#define ROTATE(i)
bool SG_VectorR3_Rotate(double Vector[3], size_t Axis, double Angle)
#define M_PI_360
Definition mat_tools.h:106
#define M_PI_090
Definition mat_tools.h:100
#define M_PI_180
Definition mat_tools.h:102
#define M_DEG_TO_RAD
Definition mat_tools.h:109
#define PARAMETER_CHECK_ENABLE
Definition parameters.h:191
#define PARAMETER_CHECK_VALUES
Definition parameters.h:190
CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition shapes.cpp:65
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Intersection(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
@ SHAPE_TYPE_Polygon
Definition shapes.h:105
@ SHAPE_TYPE_Point
Definition shapes.h:102
SAGA_API_DLL_EXPORT bool SG_Shape_Get_Difference(CSG_Shape *pSubject, CSG_Shape_Polygon *pClip, CSG_Shape *pSolution=NULL)
double x
Definition geo_tools.h:129
double y
Definition geo_tools.h:129