1
2 ///////////////////////////////////////////////////////////
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // User Interface //
9 // //
10 // Program: SAGA //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // WKSP_Shapes_Points.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. SAGA is free software; you //
22 // can redistribute it and/or modify it under the terms //
23 // of the GNU General Public License as published by the //
24 // Free Software Foundation, either version 2 of the //
25 // License, or (at your option) any later version. //
26 // //
27 // SAGA is distributed in the hope that it will be //
28 // useful, but WITHOUT ANY WARRANTY; without even the //
29 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
30 // PARTICULAR PURPOSE. See the GNU General Public //
31 // License for more details. //
32 // //
33 // You should have received a copy of the GNU General //
34 // Public License along with this program; if not, see //
35 // <http://www.gnu.org/licenses/>. //
36 // //
37 //-------------------------------------------------------//
38 // //
39 // contact: Olaf Conrad //
40 // Institute of Geography //
41 // University of Goettingen //
42 // Germany //
43 // //
44 // e-mail: oconrad@saga-gis.org //
45 // //
46 ///////////////////////////////////////////////////////////
47
48 //---------------------------------------------------------
49 #include <saga_gdi/sgdi_helper.h>
50
51 #include "wksp_shapes_points.h"
52
53
54 ///////////////////////////////////////////////////////////
55 // //
56 // //
57 // //
58 ///////////////////////////////////////////////////////////
59
60 //---------------------------------------------------------
CWKSP_Shapes_Points(CSG_Shapes * pShapes)61 CWKSP_Shapes_Points::CWKSP_Shapes_Points(CSG_Shapes *pShapes)
62 : CWKSP_Shapes_Point(pShapes)
63 {}
64
65
66 ///////////////////////////////////////////////////////////
67 // //
68 ///////////////////////////////////////////////////////////
69
70 //---------------------------------------------------------
Draw_Shape(CWKSP_Map_DC & dc_Map,CSG_Shape * pShape,int Selection)71 void CWKSP_Shapes_Points::Draw_Shape(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection)
72 {
73 if( (m_iSize >= 0 && pShape->is_NoData(m_iSize)) || (m_fValue >= 0 && pShape->is_NoData(m_fValue)) )
74 return;
75
76 //-----------------------------------------------------
77 int Size;
78
79 if( CWKSP_Shapes_Point::Draw_Initialize(dc_Map, Size, pShape, Selection) )
80 {
81 for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
82 {
83 for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
84 {
85 TSG_Point_Int p = dc_Map.World2DC(pShape->Get_Point(iPoint, iPart));
86
87 Draw_Symbol(dc_Map.dc, p.x, p.y, Size);
88 }
89 }
90
91 //-------------------------------------------------
92 if( Selection )
93 {
94 CWKSP_Shapes_Point::Draw_Initialize(dc_Map, 0);
95 }
96 }
97 }
98
99 //---------------------------------------------------------
Draw_Label(CWKSP_Map_DC & dc_Map,CSG_Shape * pShape,const wxString & Label)100 void CWKSP_Shapes_Points::Draw_Label(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label)
101 {
102 TSG_Point_Int p(dc_Map.World2DC(pShape->Get_Extent().Get_Center()));
103
104 Draw_Text(dc_Map.dc, TEXTALIGN_CENTER, p.x, p.y, Label, m_Label_Eff, m_Label_Eff_Color, m_Label_Eff_Size);
105 }
106
107
108 ///////////////////////////////////////////////////////////
109 // //
110 // //
111 // //
112 ///////////////////////////////////////////////////////////
113
114 //---------------------------------------------------------
115