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_Data_Manager.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_Data_Manager_H
52 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Data_Manager_H
53 
54 
55 ///////////////////////////////////////////////////////////
56 //														 //
57 //														 //
58 //														 //
59 ///////////////////////////////////////////////////////////
60 
61 //---------------------------------------------------------
62 #include <saga_api/saga_api.h>
63 
64 #include "wksp_base_manager.h"
65 
66 
67 ///////////////////////////////////////////////////////////
68 //														 //
69 //														 //
70 //														 //
71 ///////////////////////////////////////////////////////////
72 
73 //---------------------------------------------------------
74 class CWKSP_Data_Manager : public CWKSP_Base_Manager
75 {
76 public:
77 	CWKSP_Data_Manager(void);
78 	virtual ~CWKSP_Data_Manager(void);
79 
80 	bool							Initialise			(void);
81 	bool							Finalise			(void);
82 
Get_Type(void)83 	virtual TWKSP_Item				Get_Type			(void)		{	return( WKSP_ITEM_Data_Manager );	}
84 
85 	virtual wxString				Get_Name			(void);
86 	virtual wxString				Get_Description		(void);
87 
88 	virtual wxMenu *				Get_Menu			(void);
89 
90 	virtual bool					On_Command			(int Cmd_ID);
91 	virtual bool					On_Command_UI		(wxUpdateUIEvent &event);
92 
93 	virtual CSG_Parameters *		Get_Parameters		(void);
94 	virtual void					Parameters_Changed	(void);
95 	virtual int						On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
96 
97 	CWKSP_Base_Manager *			Get_Manager			(TSG_Data_Object_Type Type, bool bAdd = false);
Get_Manager(int i)98 	CWKSP_Base_Manager *			Get_Manager			(int i)		{	return( (CWKSP_Base_Manager *)Get_Item(i) );	}
99 	void							Del_Manager			(CWKSP_Base_Item *pItem);
100 
Get_Tables(void)101 	class CWKSP_Table_Manager *		Get_Tables			(void)		{	return( m_pTables      );	}
Get_Shapes(void)102 	class CWKSP_Shapes_Manager *	Get_Shapes			(void)		{	return( m_pShapes      );	}
Get_TINs(void)103 	class CWKSP_TIN_Manager *		Get_TINs			(void)		{	return( m_pTINs        );	}
Get_PointClouds(void)104 	class CWKSP_PointCloud_Manager *Get_PointClouds		(void)		{	return( m_pPointClouds );	}
Get_Grids(void)105 	class CWKSP_Grid_Manager *		Get_Grids			(void)		{	return( m_pGrids       );	}
106 
107 	class CWKSP_Layer *				Get_Layer			(CSG_Data_Object *pObject);
108 
Get_Menu_Files(void)109 	class CWKSP_Data_Menu_Files *	Get_Menu_Files		(void)		{	return( m_pMenu_Files );	}
110 
111 	CWKSP_Base_Item *				Open				(const wxString &File, int DataType);
112 	bool							Open				(const wxString &File);
113 	bool							Open				(int DataType);
114 	bool							Open_CMD			(int Cmd_ID);
115 	bool							Open_Browser		(void);
116 	bool							Open_Browser		(wxArrayString &Projects, const wxString &Directory);
117 
118 	bool							Save_Modified		(class CWKSP_Base_Item *pItem = NULL, bool bSelections = false);
119 	bool							Save_Modified_Sel	(void);
120 	bool							Close				(bool bSilent);
121 
122 	class CWKSP_Data_Item *			Add					(class CSG_Data_Object *pObject);
123 	class CWKSP_Data_Item *			Get					(class CSG_Data_Object *pObject);
124 	bool							Update				(class CSG_Data_Object *pObject, class CSG_Parameters *pParameters);
125 	bool							Update_Views		(class CSG_Data_Object *pObject);
126 	bool							Show				(class CSG_Data_Object *pObject, int Flags = 0);
127 	bool							asImage				(class CSG_Data_Object *pObject, class CSG_Grid *pImage);
128 
129 	bool							Get_Colors			(class CSG_Data_Object *pObject, class CSG_Colors *pColors);
130 	bool							Set_Colors			(class CSG_Data_Object *pObject, class CSG_Colors *pColors);
131 	bool							Get_Parameters		(class CSG_Data_Object *pObject, class CSG_Parameters *pParameters);
132 	bool							Set_Parameters		(class CSG_Data_Object *pObject, class CSG_Parameters *pParameters);
133 
Get_Numbering(void)134 	int								Get_Numbering		(void)	const	{	return( m_Numbering );	}
135 
136 	size_t							MultiSelect_Count	(void);
137 	bool							MultiSelect_Check	(void);
138 	bool							MultiSelect_Update	(void);
139 
140 
141 private:
142 
143 	int								m_Numbering;
144 
145 	wxArrayTreeItemIds				m_Sel_Items;
146 
147 	CSG_Parameters					m_Sel_Parms[2];
148 
149 	class CWKSP_Project				*m_pProject;
150 
151 	class CWKSP_Data_Menu_Files		*m_pMenu_Files;
152 
153 	class CWKSP_Table_Manager		*m_pTables;
154 
155 	class CWKSP_Shapes_Manager		*m_pShapes;
156 
157 	class CWKSP_TIN_Manager			*m_pTINs;
158 
159 	class CWKSP_PointCloud_Manager	*m_pPointClouds;
160 
161 	class CWKSP_Grid_Manager		*m_pGrids;
162 
163 
164 	static int						_Modified_Changed	(class CSG_Parameter  *pParameter, int Flags);
165 	bool							_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, const wxString &Directory, bool bSelections);
166 	bool							_Modified_Get		(class CSG_Parameters *pParameters, class CWKSP_Base_Item *pItem, const wxString &Directory, class CSG_Data_Object *pObject);
167 	bool							_Modified_Save		(class CSG_Parameters *pParameters);
168 
169 };
170 
171 //---------------------------------------------------------
172 extern CWKSP_Data_Manager			*g_pData;
173 
174 
175 ///////////////////////////////////////////////////////////
176 //														 //
177 //														 //
178 //														 //
179 ///////////////////////////////////////////////////////////
180 
181 //---------------------------------------------------------
182 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Data_Manager_H
183