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_Layer_Legend.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_Layer_Legend_H
64 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Layer_Legend_H
65 
66 
67 ///////////////////////////////////////////////////////////
68 //														 //
69 //														 //
70 //														 //
71 ///////////////////////////////////////////////////////////
72 
73 //---------------------------------------------------------
74 enum
75 {
76 	LEGEND_VERTICAL	= 0,
77 	LEGEND_HORIZONTAL
78 };
79 
80 
81 ///////////////////////////////////////////////////////////
82 //														 //
83 //														 //
84 //														 //
85 ///////////////////////////////////////////////////////////
86 
87 //---------------------------------------------------------
88 class CWKSP_Layer_Legend
89 {
90 public: ///////////////////////////////////////////////////
91 	CWKSP_Layer_Legend(class CWKSP_Layer *pLayer);
92 
93 	wxSize						Get_Size			(double Zoom, double Zoom_Map);
94 
95 	void						Draw				(wxDC &dc, double Zoom, double Zoom_Map, wxPoint Position, wxSize *pSize = NULL);
96 
Get_Orientation(void)97 	int							Get_Orientation		(void)	{	return( m_Orientation );	}
98 	void						Set_Orientation		(int Orientation);
99 
100 
101 protected: ////////////////////////////////////////////////
102 
103 	bool						m_Orientation;
104 
105 	int							m_xBox, m_dxBox, m_xTick, m_dxTick, m_xText;
106 
107 	double						m_Zoom, m_Zoom_Map;
108 
109 	wxPoint						m_Position;
110 
111 	wxSize						m_Size;
112 
113 	wxPen						m_oldPen;
114 
115 	wxBrush						m_oldBrush;
116 
117 	wxFont						m_oldFont;
118 
119 	class CWKSP_Layer			*m_pLayer;
120 
121 	class CWKSP_Layer_Classify	*m_pClassify;
122 
123 
124 	void						_Set_Size			(int xSet, int yAdd);
125 	void						_Set_Font			(wxDC &dc, int Style);
126 
127 	void						_Draw_Title			(wxDC &dc, int Style, wxString Text);
128 	void						_Draw_Label			(wxDC &dc, int y, wxString Text, int yAlign);
129 
130 	void						_Draw_Box			(wxDC &dc, int y, int dy, int Style, int LineColor, int FillColor, wxString Text);
131 	void						_Draw_Box			(wxDC &dc, int y, int dy, int Style, int iClass);
132 	void						_Draw_Boxes			(wxDC &dc, int y, int Style, double zFactor = 1.0);
133 
134 	void						_Draw_Point			(wxDC &dc, class CWKSP_Shapes_Point   *pLayer);
135 	void						_Draw_Line			(wxDC &dc, class CWKSP_Shapes_Line    *pLayer);
136 	void						_Draw_Polygon		(wxDC &dc, class CWKSP_Shapes_Polygon *pLayer);
137 	void						_Draw_TIN			(wxDC &dc, class CWKSP_TIN            *pLayer);
138 	void						_Draw_PointCloud	(wxDC &dc, class CWKSP_PointCloud     *pLayer);
139 	void						_Draw_Grid			(wxDC &dc, class CWKSP_Grid           *pLayer);
140 	void						_Draw_Grids			(wxDC &dc, class CWKSP_Grids          *pLayer);
141 
142 	void						_Draw_Layer_Image	(wxDC &dc, int y, class CWKSP_Layer *pLayer);
143 
144 	void						_Draw_Continuum		(wxDC &dc, int y, double zFactor);
145 	void						_Draw_Continuum_V	(wxDC &dc, int y, double yToDC, double zMin, double zMax, double zFactor, double dz, int dyFont);
146 	void						_Draw_Continuum_H	(wxDC &dc, int y, double yToDC, double zMin, double zMax, double zFactor, double dz, int dyFont);
147 
148 };
149 
150 
151 ///////////////////////////////////////////////////////////
152 //														 //
153 //														 //
154 //														 //
155 ///////////////////////////////////////////////////////////
156 
157 //---------------------------------------------------------
158 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Layer_Legend_H
159