SAGA API Version 9.14
Loading...
Searching...
No Matches
map_shapes_points.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_points.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
58// //
59// //
60// //
62
63//---------------------------------------------------------
71
72
74// //
76
77//---------------------------------------------------------
79{
80 if( (m_Size.Field >= 0 && pShape->is_NoData(m_Size.Field)) || (m_Stretch.Value >= 0 && pShape->is_NoData(m_Stretch.Value)) )
81 {
82 return;
83 }
84
85 //-----------------------------------------------------
86 int Size;
87
88 if( CSG_Map_Shapes_Point::Draw_Initialize(dc_Map, Size, pShape, Flags) )
89 {
90 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
91 {
92 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
93 {
94 TSG_Point_Int p = dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
95
96 Draw_Symbol(dc_Map, p.x, p.y, Size);
97 }
98 }
99
100 //-------------------------------------------------
101 if( (Flags & LAYER_DRAW_FLAG_SELECTION) != 0 )
102 {
104 }
105 }
106}
107
108//---------------------------------------------------------
109void CSG_Map_Shapes_Points::Draw_Label(CSG_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
110{
111 TSG_Point_Int p(dc_Map.World2DC(pShape->Get_Extent().Get_Center()));
112
113 dc_Map.DrawText(SG_DC_TEXTALIGN_CENTER, p.x, p.y, Label, m_Label.Effect, m_Label.Effect_Color, m_Label.Effect_Size);
114}
115
116
118// //
119// //
120// //
122
123//---------------------------------------------------------
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
bool Set_Object(CSG_Data_Object *pObject)
CSG_Parameters m_Parameters
Definition map_layer.h:149
void Draw_Symbol(wxDC &dc, int x, int y, int size)
class CSG_Map_Shapes_Point::CSize m_Size
CSG_Map_Shapes_Point(CSG_Shapes *pShapes=NULL)
virtual void Draw_Initialize(CSG_Map_DC &dc_Map, int Flags)
virtual void Draw_Label(CSG_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
CSG_Map_Shapes_Points(CSG_Shapes *pShapes=NULL)
virtual void Draw_Shape(CSG_Map_DC &dc_Map, CSG_Shape *pShape, int Flags=0)
class CSG_Map_Shapes::CLabel m_Label
class CSG_Map_Shapes::CStretch m_Stretch
CSG_Point Get_Center(void) const
Definition geo_tools.h:519
virtual int Get_Point_Count(void) const =0
virtual int Get_Part_Count(void) const =0
virtual TSG_Point Get_Point(int iPoint=0) const =0
virtual const CSG_Rect & Get_Extent(void)=0
virtual TSG_Shape_Type Get_Type(void) const
Definition shapes.h:814
bool is_NoData(int Field) const
#define SG_DC_TEXTALIGN_CENTER
Definition dc_helper.h:135
struct SSG_Point_Int TSG_Point_Int
#define LAYER_DRAW_FLAG_SELECTION
Definition map_layer.h:75
CSG_String SG_Get_ShapeType_Name(TSG_Shape_Type Type)
Definition shapes.cpp:65
@ SHAPE_TYPE_Points
Definition shapes.h:103