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_Point.h                   //
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 //                Goldschmidtstr. 5                      //
43 //                37077 Goettingen                       //
44 //                Germany                                //
45 //                                                       //
46 //    e-mail:     oconrad@saga-gis.org                   //
47 //                                                       //
48 ///////////////////////////////////////////////////////////
49 
50 //---------------------------------------------------------
51 #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Point_H
52 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Point_H
53 
54 
55 ///////////////////////////////////////////////////////////
56 //														 //
57 //														 //
58 //														 //
59 ///////////////////////////////////////////////////////////
60 
61 //---------------------------------------------------------
62 #include "wksp_shapes.h"
63 
64 
65 ///////////////////////////////////////////////////////////
66 //														 //
67 //														 //
68 //														 //
69 ///////////////////////////////////////////////////////////
70 
71 //---------------------------------------------------------
72 class CWKSP_Shapes_Point : public CWKSP_Shapes
73 {
74 public:
75 	CWKSP_Shapes_Point(CSG_Shapes *pShapes);
76 
Get_Outline(void)77 	bool						Get_Outline				(void)	{	return( m_bOutline );	}
Get_Def_Pen(void)78 	wxPen						Get_Def_Pen				(void)	{	return( m_Pen      );	}
Get_Def_Brush(void)79 	wxBrush						Get_Def_Brush			(void)	{	return( m_Brush    );	}
80 
81 	bool						Get_Style_Size			(int &min_Size, int &max_Size, double &min_Value, double &dValue, wxString *pName);
82 
83 	void						Draw_Symbol				(wxDC &dc, int x, int y, int size);
84 
85 
86 protected:
87 
88 	bool						m_bOutline;
89 
90 	int							m_iSize, m_Size_Type, m_Size_Scale, m_Symbol_Type, m_iLabel_Angle, m_Label_Align,
91 								m_Image_Field, m_Image_Align, m_Image_Fit, m_Beachball[3];
92 
93 	double						m_Size, m_dSize, m_Size_Min, m_Label_Offset, m_Label_Angle, m_Image_Offset, m_Image_Scale;
94 
95 	wxColour					m_Sel_Color_Fill;
96 
97 	wxPen						m_Pen;
98 
99 	wxBrush						m_Brush;
100 
101 	wxImage						m_Symbol;
102 
103 
104 	virtual void				On_Create_Parameters	(void);
105 	virtual void				On_DataObject_Changed	(void);
106 	virtual void				On_Parameters_Changed	(void);
107 
108 	virtual int					On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
109 
110 	virtual void				Draw_Initialize			(CWKSP_Map_DC &dc_Map, int Flags);
111 	virtual bool				Draw_Initialize			(CWKSP_Map_DC &dc_Map, int &Size, CSG_Shape *pShape, int Selection);
112 	virtual void				Draw_Shape				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, int Selection);
113 	virtual void				Draw_Label				(CWKSP_Map_DC &dc_Map, CSG_Shape *pShape, const wxString &Label);
114 
115 
116 private:
117 
118 	void						_Image_Draw				(wxDC &dc, int x, int y, int size, const wxString &file);
119 
120 	void						_Beachball_Draw			(wxDC &dc, int x, int y, int size, double strike, double dip, double rake);
121 	void						_Beachball_Get_Plane	(CSG_Shape *pPlane, CSG_Shape *pCircle, const CSG_Vector &Normal);
122 	void						_Beachball_Get_Scaled	(CSG_Shape *pShape, double x, double y, double size);
123 
124 };
125 
126 
127 ///////////////////////////////////////////////////////////
128 //														 //
129 //														 //
130 //														 //
131 ///////////////////////////////////////////////////////////
132 
133 //---------------------------------------------------------
134 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Shapes_Point_H
135