1 /**********************************************************
2  * Version $Id$
3  *********************************************************/
4 
5 ///////////////////////////////////////////////////////////
6 //                                                       //
7 //                         SAGA                          //
8 //                                                       //
9 //      System for Automated Geoscientific Analyses      //
10 //                                                       //
11 //                    User Interface                     //
12 //                                                       //
13 //                    Program: SAGA                      //
14 //                                                       //
15 //-------------------------------------------------------//
16 //                                                       //
17 //                  WKSP_Shapes_Line.h                   //
18 //                                                       //
19 //          Copyright (C) 2005 by Olaf Conrad            //
20 //                                                       //
21 //-------------------------------------------------------//
22 //                                                       //
23 // This file is part of 'SAGA - System for Automated     //
24 // Geoscientific Analyses'. SAGA is free software; you   //
25 // can redistribute it and/or modify it under the terms  //
26 // of the GNU General Public License as published by the //
27 // Free Software Foundation, either version 2 of the     //
28 // License, or (at your option) any later version.       //
29 //                                                       //
30 // SAGA is distributed in the hope that it will be       //
31 // useful, but WITHOUT ANY WARRANTY; without even the    //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A  //
33 // PARTICULAR PURPOSE. See the GNU General Public        //
34 // License for more details.                             //
35 //                                                       //
36 // You should have received a copy of the GNU General    //
37 // Public License along with this program; if not, see   //
38 // <http://www.gnu.org/licenses/>.                       //
39 //                                                       //
40 //-------------------------------------------------------//
41 //                                                       //
42 //    contact:    Olaf Conrad                            //
43 //                Institute of Geography                 //
44 //                University of Goettingen               //
45 //                Goldschmidtstr. 5                      //
46 //                37077 Goettingen                       //
47 //                Germany                                //
48 //                                                       //
49 //    e-mail:     oconrad@saga-gis.org                   //
50 //                                                       //
51 ///////////////////////////////////////////////////////////
52 
53 //---------------------------------------------------------
54 
55 
56 ///////////////////////////////////////////////////////////
57 //														 //
58 //														 //
59 //														 //
60 ///////////////////////////////////////////////////////////
61 
62 //---------------------------------------------------------
63 #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Line_H
64 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Line_H
65 
66 
67 ///////////////////////////////////////////////////////////
68 //														 //
69 //														 //
70 //														 //
71 ///////////////////////////////////////////////////////////
72 
73 //---------------------------------------------------------
74 #include "wksp_shapes.h"
75 
76 
77 ///////////////////////////////////////////////////////////
78 //														 //
79 //														 //
80 //														 //
81 ///////////////////////////////////////////////////////////
82 
83 //---------------------------------------------------------
84 class CWKSP_Shapes_Line : public CWKSP_Shapes
85 {
86 public:
87 	CWKSP_Shapes_Line(CSG_Shapes *pShapes);
88 
Get_Def_Pen(void)89 	wxPen						Get_Def_Pen				(void)	{	return( m_Pen      );	}
90 	bool						Get_Style_Size			(int &min_Size, int &max_Size, double &min_Value, double &dValue, wxString *pName);
91 
92 
93 protected:
94 
95 	bool						m_bPoints;
96 
97 	int							m_iSize, m_Size_Type, m_Line_Style, m_Effect,
98 								m_Label_Style, m_Label_Freq, m_Label_Align, m_Label_Orient;
99 
100 	double						m_Size, m_dSize, m_Size_Min;
101 
102 	wxColour					m_Effect_Color;
103 
104 	wxPen						m_Pen;
105 
106 
107 	virtual void				On_Create_Parameters	(void);
108 	virtual void				On_DataObject_Changed	(void);
109 	virtual void				On_Parameters_Changed	(void);
110 
111 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
112 
113 	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map, int Flags);
114 	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
115 	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
116 
117 	virtual void				Edit_Shape_Draw_Move	(wxDC &dc, const CSG_Rect &rWorld, const wxPoint &Point);
118 	virtual void				Edit_Shape_Draw			(CWKSP_Map_DC &dc_Map);
119 	virtual int					Edit_Shape_HitTest		(CSG_Point Point, double max_Dist, int &iPart, int &iPoint);
120 	virtual void				Edit_Snap_Point_ToLine	(CSG_Point Point, CSG_Point &snap_Point, double &snap_Dist, CSG_Shape *pShape);
121 
122 
123 private:
124 
125 	virtual void				_Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int xOffset = 0, int yOffset = 0);
126 
127 };
128 
129 
130 ///////////////////////////////////////////////////////////
131 //														 //
132 //														 //
133 //														 //
134 ///////////////////////////////////////////////////////////
135 
136 //---------------------------------------------------------
137 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Line_H
138