1 
2 ///////////////////////////////////////////////////////////
3 //                                                       //
4 //                         SAGA                          //
5 //                                                       //
6 //      System for Automated Geoscientific Analyses      //
7 //                                                       //
8 //                     Tool Library                      //
9 //                   Projection_Proj4                    //
10 //                                                       //
11 //-------------------------------------------------------//
12 //                                                       //
13 //                      crs_base.h                       //
14 //                                                       //
15 //                 Copyright (C) 2010 by                 //
16 //                      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 //    e-mail:     oconrad@saga-gis.org                   //
40 //                                                       //
41 //    contact:    Olaf Conrad                            //
42 //                Institute of Geography                 //
43 //                University of Hamburg                  //
44 //                Germany                                //
45 //                                                       //
46 ///////////////////////////////////////////////////////////
47 
48 //---------------------------------------------------------
49 #ifndef HEADER_INCLUDED__crs_base_H
50 #define HEADER_INCLUDED__crs_base_H
51 
52 
53 ///////////////////////////////////////////////////////////
54 //														 //
55 //														 //
56 //														 //
57 ///////////////////////////////////////////////////////////
58 
59 //---------------------------------------------------------
60 #include "crs_transform.h"
61 
62 
63 ///////////////////////////////////////////////////////////
64 //														 //
65 //														 //
66 //														 //
67 ///////////////////////////////////////////////////////////
68 
69 //---------------------------------------------------------
70 class CCRS_Base : public CSG_Tool
71 {
72 public:
73 	CCRS_Base(void);
74 
do_Sync_Projections(void)75 	virtual bool			do_Sync_Projections		(void)	const	{	return( false );	}
76 
77 	static CSG_Projection	Parameter_Changed		(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
78 	static bool				Parameters_Enable		(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
79 
80 
81 protected:
82 
83 	virtual bool			On_Before_Execution		(void);
84 
85 	virtual int				On_Parameter_Changed	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
86 	virtual int				On_Parameters_Enable	(CSG_Parameters *pParameters, CSG_Parameter *pParameter);
87 
88 	bool					Get_Projection			(CSG_Projection &Projection);
89 
90 
91 private:
92 
93 	CSG_Projection			m_Projection;
94 
95 
96 	bool					Set_User_Parameters		(CSG_Parameters &Parameters);
97 	bool					Add_User_Projection		(CSG_Parameters &Parameters, const CSG_String &ID, const CSG_String &Args);
98 
99 	static CSG_String		Get_User_Definition		(CSG_Parameters &Parameters);
100 	static bool				Set_User_Definition		(CSG_Parameters &Parameters, const CSG_String &Proj4);
101 
102 };
103 
104 
105 ///////////////////////////////////////////////////////////
106 //														 //
107 ///////////////////////////////////////////////////////////
108 
109 //---------------------------------------------------------
110 class CCRS_Picker : public CCRS_Base
111 {
112 public:
113 	CCRS_Picker(void);
114 
Get_MenuPath(void)115 	virtual CSG_String		Get_MenuPath		(void)	{	return( _TL("Tools") );	}
116 
117 
118 protected:
119 
120 	virtual bool			On_Execute			(void);
121 
122 };
123 
124 
125 ///////////////////////////////////////////////////////////
126 //														 //
127 ///////////////////////////////////////////////////////////
128 
129 //---------------------------------------------------------
130 class CCRS_Transform : public CCRS_Base
131 {
132 public:
CCRS_Transform(void)133 	CCRS_Transform(void)	{}
134 
135 
136 protected:
137 
138 	CSG_CRSProjector		m_Projector;
139 
140 
141 	virtual bool			On_Execute					(void);
142 
143 	virtual bool			On_Execute_Transformation	(void)	= 0;
144 
145 };
146 
147 
148 ///////////////////////////////////////////////////////////
149 //														 //
150 //														 //
151 //														 //
152 ///////////////////////////////////////////////////////////
153 
154 //---------------------------------------------------------
155 #endif // #ifndef HEADER_INCLUDED__crs_base_H
156