ToolMap
Loading...
Searching...
No Matches
projectmanager.h
Go to the documentation of this file.
1/***************************************************************************
2 projectmanager.h
3 Class used for opening, closing, backuping the project
4 -------------------
5 copyright : (C) 2007 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17/***************************************************************************/
26#ifndef _PROJECTMANAGER_H
27#define _PROJECTMANAGER_H
28
29// For compilers that support precompilation, includes "wx/wx.h".
30#include <wx/wxprec.h>
31
32// Include wxWidgets' headers
33#ifndef WX_PRECOMP
34#include <wx/wx.h>
35#endif
36
37// include
38// #include "../database/db_project.h" // for project in memory (creation)
39#include <wx/busyinfo.h> // informations message for busy time
40
41#include "../gis/tmattributionmanager.h" // for attribution manager
42#include "../gis/tmeditmanager.h" // for editing stuff
43#include "../gui/menumanager.h" // for menu management (recent, greyed,...)
44#include "../gui/objectattribution_dlg.h" // for displaying object definition dlg.
45#include "../gui/project_def_dlg.h" // new project definition dialog
46#include "../gui/projectdefnew_dlg.h" // for the first dialog (creating the db)
47#include "../gui/projectproperties_dlg.h" // for displaying project properties dlg.
48#include "../gui/queries_panel.h" // for queries panel
49#include "../gui/shortcut_panel.h" // for shortcut panel
50#include "../gui/snapping_panel.h" // for snapping panel
51#include "../gui/tmtoolmanager.h" // for tool manager (dangling nodes)
52
53class MenuManager;
54
55class ObjectManager;
56
57class tmStatsManager;
58
59class DataBaseTM;
60
61/***************************************************************************/
68class ProjectManager : public wxObject {
69 private:
70 bool bProjectIsOpen;
71 DataBaseTM* m_DB;
72 wxFrame* m_Parent;
73 MenuManager* m_pMManager;
74 ObjectManager* m_Obj;
75 wxStatusBar* m_ParentStatus;
76 tmLayerManager* m_LayerManager;
77 tmAttributionManager* m_AttribManager;
78 Queries_PANEL* m_QueriesPanel;
79 Shortcuts_PANEL* m_ShortcutPanel;
80 Snapping_PANEL* m_SnappingPanel;
81 tmEditManager* m_EditManager;
82 PrjDefMemManage* m_PrjMem;
83 tmToolManager* m_ToolManager;
84 tmStatsManager* m_StatManager;
85
86 DECLARE_CLASS(ProjectManager)
87
88 bool IsDataBasePath(const wxString& path);
89
90 bool PMAddDefaultQueries();
91
92 bool _copy_directory(wxString from, wxString to);
93
94 bool CleanDirectory(const wxString& path);
95
96 bool CheckDirectoryContent(const wxString& path) const;
97
98 public:
99 ProjectManager(wxFrame* parent);
100
102
103 // project operations
104 bool CreateNewProject();
105
106 void CloseProject();
107
108 int OpenProject(const wxString& path);
109
110 bool EditProjectObjectDefinition();
111
112 bool EditObjectFrequency(int id);
113
114 bool EditProjectSettings();
115
116 bool EditProject(int notebooknumber);
117
118 bool BackupProject(const wxString& backup_comment = wxEmptyString);
119
120 bool MergeProjects(const wxString& slave_project_name, bool beVerbose = true);
121
122 // project infos
123 wxString GetProjectName();
124
125 // setter and getter
126 void SetMenuManager(MenuManager* pMenu) {
127 m_pMManager = pMenu;
128 }
129
130 MenuManager* GetMenuManager() {
131 return m_pMManager;
132 }
133
134 ObjectManager* GetObjectManager() {
135 return m_Obj;
136 }
137
138 void SetStatusBar(wxStatusBar* status) {
139 m_ParentStatus = status;
140 }
141
142 void SetAttributionManager(tmAttributionManager* pAManager) {
143 m_AttribManager = pAManager;
144 }
145
146 void SetQueriesPanel(Queries_PANEL* queriespanel) {
147 m_QueriesPanel = queriespanel;
148 }
149
150 void SetShortcutPanel(Shortcuts_PANEL* panel) {
151 m_ShortcutPanel = panel;
152 }
153
154 void SetSnappingPanel(Snapping_PANEL* panel) {
155 m_SnappingPanel = panel;
156 }
157
158 void SetEditManager(tmEditManager* editmanager) {
159 m_EditManager = editmanager;
160 }
161
162 DataBaseTM* GetDatabase() {
163 return m_DB;
164 }
165
166 void SetToolManager(tmToolManager* tm) {
167 m_ToolManager = tm;
168 }
169
170 void SetStatManager(tmStatsManager* statmanager) {
171 m_StatManager = statmanager;
172 }
173
174 void SetLayerManager(tmLayerManager* layermanager) {
175 m_LayerManager = layermanager;
176 }
177
178 bool IsProjectOpen() {
179 return bProjectIsOpen;
180 }
181
182 // project defintion into memory
183 bool LoadProjectDefintion(short int message = 0);
184
186};
187
188/***************************************************************************/
193class ObjectManager : public wxObject {
194 private:
195 AttribObjType_PANEL* m_panel;
196
197 void InitValues();
198
199 public:
200 // ctor
201 ObjectManager() {
202 InitValues();
203 }
204
206 InitValues();
207 SetPanel(panel);
208 }
209
210 // setter
211 void SetPanel(AttribObjType_PANEL* panel) {
212 m_panel = panel;
213 }
214
215 // functions
216 bool UpdateObjectLists(DataBaseTM* pDB);
217};
218
219#endif
Definition attribution_obj_type.h:71
Definition database_tm.h:80
Deals with Recent files.
Definition menumanager.h:47
Deals with objects in the attribution panels.
Definition projectmanager.h:193
bool UpdateObjectLists(DataBaseTM *pDB)
Update the point, the poly and the line list.
Definition projectmanager.cpp:859
Definition prjdefmemmanage.h:54
Project operations (new, open,...)
Definition projectmanager.h:68
bool LoadProjectDefintion(short int message=0)
Load project defintion from database to memory.
Definition projectmanager.cpp:790
PrjDefMemManage * GetMemoryProjectDefinition()
Get the project definition.
Definition projectmanager.cpp:838
bool CreateNewProject()
Create a new Toolmap project.
Definition projectmanager.cpp:70
bool EditProject(int notebooknumber)
Edit the project (layers,...)
Definition projectmanager.cpp:313
int OpenProject(const wxString &path)
Open ToolMap project.
Definition projectmanager.cpp:535
wxString GetProjectName()
Get the actual project name.
Definition projectmanager.cpp:765
~ProjectManager()
Destructor.
Definition projectmanager.cpp:57
void CloseProject()
Close the active database.
Definition projectmanager.cpp:488
Display the Queries Panel.
Definition queries_panel.h:103
Definition shortcut_panel.h:87
The panel used for setting the snapping.
Definition snapping_panel.h:75
Central point for object attribution.
Definition tmattributionmanager.h:57
Deals with editing data.
Definition tmeditmanager.h:87
GIS class for dealing with layers.
Definition tmlayermanager.h:57
Statistics manager, link event to data and database records.
Definition tmstats.h:60
Definition tmtoolmanager.h:34