ToolMap
Loading...
Searching...
No Matches
toolmap.h
1/***************************************************************************
2 toolmap.h
3 main file for toolmap 2, contain app and main frame
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
78#ifndef TOOLMAP_H
79#define TOOLMAP_H
80
81// For compilers that support precompilation, includes "wx/wx.h".
82#include <wx/wxprec.h>
83
84// Include wxWidgets' headers
85#ifndef WX_PRECOMP
86#include <wx/wx.h>
87#endif
88
89#include <wx/sysopt.h> // for dealing with systemoptions
90#include <wx/toolbar.h>
91
92#include "../gui/logwindow_dlg.h" // log window definition
93#include "../gui/project_def_dlg.h" // project definition dialog
94#include "../gui/tocwindow_dlg.h" // Table of content (TOC) definition
95// #include "../database/db_project.h"
96#include "../gui/menumanager.h" // for menu management (enable / diable)
97
98// GIS Includes
99#include "../gis/tmlayermanager.h" // gis central manager
100
101// #include "../gui/attribution_obj_type.h"
102#include <wx/fileconf.h> // for using file configuration even on windows
103
104#include "../gis/tmattributionmanager.h" // attribution manager
105#include "../gis/tmeditmanager.h" // for editing manager
106#include "../gis/tmgisdata.h" // for GIS data access
107#include "../gis/tmscalectrl.h" // for GIS scale control combo box
108#include "../gui/main_panel.h"
109#include "../gui/openerror_dlg.h" // open error dlg
110#include "../gui/queries_panel.h" // for queries panel
111#include "../gui/shortcut_panel.h" // for shortcut panel
112#include "../gui/snapping_panel.h" // for snapping panel
113#include "../gui/tmtoolmanager.h" // for tools
114#include "projectmanager.h"
115#include "tmexportmanager.h" // export manager
116#include "tmwindowposition.h" // saving window position
117
119#include "diroperation.h"
121
122#include "../gui/tmabout_dlg.h"
123
124class MenuManager;
125class ToolbarManager;
126class ProjectManager;
128class tmStatsManager;
130
131#include <wx/mstream.h>
132
133// items from menu project.
134#define ID_MENU_NEW_PRJ_EMPTY 10300
135#define ID_MENU_NEW_PRJ_EXISTING 10301
136#define ID_MENU_OPEN_PRJ 10302
137#define ID_MENU_RECENT 10303
138#define ID_MENU_PRJ_BACKUP 10304
139#define ID_MENU_PRJ_BACKUP_MANAGER 10305
140#define ID_MENU_PRJ_SAVE_TEMPLATE 10306
141#define ID_MENU_PRJ_MERGE 10307
142#define ID_MENU_EXPORT 10307
143#define ID_MENU_EXPORT_LAYER 10308
144// #define ID_MENU_EXPORT_FULL 10309
145#define ID_MENU_PRJ_EDIT 10309
146#define ID_MENU_PRJ_DEF 10310
147#define ID_MENU_OBJ_DEF 10311
148#define ID_MENU_OBJ_ATTRIB_DEF 10312
149#define ID_MENU_PRJ_SETTINGS 10313
150
151#define ID_MENU_STATISTICS 10350
152
153#define ID_MENU_ADD_SPATIAL_DATA 10022
154#define ID_MENU_IMPORT_GIS_DATA 10112
155#define ID_MENU_EXPORT_GIS_GEOMETRIES 10113
156#define ID_MENU_ADD_GROUP 10114
157
158// #define ID_MENU_ZOOM_PREVIOUS 10313
159#define ID_MENU_ZOOM 10315
160#define ID_MENU_PAN 10316
161#define ID_MENU_ZOOM_FIT 10317
162#define ID_MENU_ZOOM_GIVEN_SCALE 10318
163#define ID_MENU_ZOOM_COORDINATE 10319
164#define ID_MENU_ZOOM_NEXT_SCALE 10320
165#define ID_MENU_PREVIOUS_SCALE 10321
166#define ID_MENU_ZOOM_SELECTED_LAYER 10322
167
168#define ID_MENU_SELECTION 10323
169
170#define ID_MENU_UNDO 10179
171// #define ID_MENU_REDO 10180
172#define ID_MENU_DRAW 10176
173#define ID_MENU_DRAW_BEZIER 10191
174#define ID_MENU_MODIFY_BEZIER 10192
175#define ID_MENU_MODIFY 10177
176#define ID_MENU_MODIFY_SHARED 10200
177#define ID_MENU_CUT_LINES 10178
178#define ID_MENU_EDIT_VERTEX_POS 10211
179#define ID_MENU_VERTEX_INSERT 10212
180#define ID_MENU_VERTEX_DELETE 10213
181#define ID_MENU_MERGE_LINES 10003
182#define ID_MENU_CREATE_INTERSECTIONS 10174
183#define ID_MENU_FLIP_LINE 10004
184#define ID_MENU_SMOOTH_LINE 10024
185#define ID_MENU_DELETE_OBJ 10122
186#define ID_MENU_ORIENT_POINT 10190
187#define ID_MENU_ADJUST_SNAPPING 10001
188#define ID_MENU_SHOW_BEZIER_SETTINGS 10078
189// #define ID_MENU_SNAPPING_ADD 10168
190// #define ID_MENU_SNAPPING_REMOVE 10169
191#define ID_MENU_SNAPPING_SHOWONMAP 10170
192#define ID_MENU_ATTRIB_TYPES 10166
193#define ID_MENU_ATTRIB_ATTRIBUTES 10175
194#define ID_MENU_ATTRIB_BATCH 10167
195#define ID_MENU_COPY_PASTE_ATTRIB 10231
196#define ID_MENU_SHORTCUTS 10183
197#define ID_MENU_CHECK_GEOM 10123
198#define ID_MENU_TOOL_DANGLING 10048
199#define ID_MENU_SELECT 10163
200#define ID_MENU_SELECT_BY_OID 10162
201#define ID_MENU_SELECT_NONE 10160
202#define ID_MENU_SELECT_INVERSE 10161
203#define ID_MENU_QUERIES 10019
204// #define ID_MENU_QUERIES_RUN 10020
205#define ID_MENUITEM11 10046
206#define ID_MENUITEM12 10047
207#define ID_MENU_TOC_WINDOW 10037
208#define ID_MENU_INFO_WINDOW 10140
209#define ID_MENU_LOG_WINDOW 10207
210#define ID_MENU_CHECK_UPDATE 10125
211#define ID_MENU_COMPONENTS 10126
212#define ID_MENU_CONTACT_US 10128
213#define ID_MENU_USER_MANUAL 10130
214#define ID_MENU_EXPORT_MODEL 10077
215
216#define ID_TOOLBAR_ZOOM 10252
217
218#define ID_CTXT_FULL_ATTRIB 21000
219#define ID_CTXT_FILTER 21001
220#define ID_CTXT_AUTODISPLAY_ATTRIB 21002
221#define ID_CTXT_EMPTY_LIST_AFTER_ATTRIB 21003
222
223const int ID_MENU_LAYOUT_DEFAULT = 15201;
224const int ID_MENU_LAYOUT_VERTICAL = 15202;
225const int ID_MENU_LAYOUT_HORIZONTAL = 15203;
226const int ID_MENU_VALIDITY = 15204;
227
228const int ID_MENU_EXPORT_CONCATENATED = wxWindow::NewControlId();
229const int ID_MENU_ZOOM_FRAME = wxWindow::NewControlId();
230const int ID_MENU_ADD_WEBDATA = wxWindow::NewControlId();
231
232const wxString g_ProgName = _T("ToolMap");
233
234// define perspectives for auimanager
235enum tmPERSPECTIVE_MODE {
236 tmPERSPECTIVE_MODE_DEFAULT = 0,
237 tmPERSPECTIVE_MODE_VERTICAL,
238 tmPERSPECTIVE_MODE_HORIZONTAL
239};
240
241/***************************************************************************/
246class ToolMapApp : public wxApp {
247 private:
248 void _RemoveLogFile();
249
250 public:
251 ToolMapApp();
252
253 virtual bool OnInit();
254
255 virtual void OnFatalException();
256};
257
258DECLARE_APP(ToolMapApp);
259
260/***************************************************************************/
265class ToolMapFrame;
266
267class tmDropFiles : public wxFileDropTarget {
268 private:
269 ToolMapFrame* m_Frame;
270
271 public:
272 tmDropFiles(ToolMapFrame* parent);
273
274 virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
275};
276
277/***************************************************************************/
284class ToolMapFrame : public wxFrame {
285 private:
286 wxMenuBar* m_MenuBar;
287 wxAcceleratorTable* m_MenuBarAcceleratorTable;
288
289 wxAuiManager* m_AuiManager;
290 AttribObjType_PANEL* m_AttribObjPanel;
291 Main_PANEL* m_MainPanel;
292 Queries_PANEL* m_QueriesPanel;
293 Shortcuts_PANEL* m_ShortCutPanel;
294 Snapping_PANEL* m_SnappingPanel;
295
296 ProjectManager* m_PManager;
297 MenuManager* m_MManager;
298
299 tmLayerManager* m_LayerManager;
300 tmScaleCtrlCombo* m_ScaleCombo;
301
302 tmAttributionManager* m_AttribManager;
303
304 tmEditManager* m_EditManager;
305 tmToolManager* m_ToolManager;
306 WebUpdateInformationBar* m_InfoBar;
307
308 tmStatsManager* m_StatManager;
309
310 wxLogWindow* m_LogWindow;
311 TocWindowDlgGen* m_TocWindow;
312 wxArrayString m_Perspectives;
313
314 void SaveAcceleratorTable();
315
316 void DisableAcceleratorTable(wxCommandEvent& event);
317
318 void EnableAcceleratorTable(wxCommandEvent& event);
319
320 void OnQuit(wxCommandEvent& event);
321
322 void OnClose(wxCloseEvent& event);
323
324 void OnAbout(wxCommandEvent& event);
325
326 void OnNewProject(wxCommandEvent& event);
327
328 void OnNewProjectExisting(wxCommandEvent& event);
329
330 void OnOpenProject(wxCommandEvent& event);
331
332 void OnOpenRecentProject(wxCommandEvent& event);
333
334 void OnEditProjectObjects(wxCommandEvent& event);
335
336 void OnEditProjectSettings(wxCommandEvent& event);
337
338 void OnEditObjectAttributes(wxCommandEvent& event);
339
340 void OnEditProject(wxCommandEvent& event);
341
342 void OnExportProjectModel(wxCommandEvent& event);
343
344 void OnLogWindow(wxCommandEvent& event);
345
346 void OnTocWindow(wxCommandEvent& event);
347
348 void OnShowObjectAttributionWindow(wxCommandEvent& event);
349
350 void OnShowQueriesWindow(wxCommandEvent& event);
351
352 void OnProjectBackup(wxCommandEvent& event);
353
354 void OnProjectBackupManage(wxCommandEvent& event);
355
356 void OnProjectSaveTemplate(wxCommandEvent& event);
357
358 void OnProjectMerge(wxCommandEvent& event);
359
360 void OnToolChanged(wxCommandEvent& event);
361
362 void OnZoomPrevious(wxCommandEvent& event);
363
364 void OnZoomToSelectedLayer(wxCommandEvent& event);
365
366 void OnZoomToFrame(wxCommandEvent& event);
367
368 void OnExportSelected(wxCommandEvent& event);
369
370 // void OnExportAll (wxCommandEvent & event);
371 void OnExportConcatenated(wxCommandEvent& event);
372
373 void OnShowShortcutWindow(wxCommandEvent& event);
374
375 void OnShowSnappingWindow(wxCommandEvent& event);
376
377 void OnShowSnappingOnMap(wxCommandEvent& event);
378
379 void OnEditSwitch(wxCommandEvent& event);
380
381 void OnEditDeleteSelected(wxCommandEvent& event);
382
383 void OnEditUndo(wxCommandEvent& event);
384
385 void OnCreateIntersections(wxCommandEvent& event);
386
387 void OnEditVertexPosition(wxCommandEvent& event);
388
389 void OnMergeSelectedLines(wxCommandEvent& event);
390
391 void OnShowAAttributionWindow(wxCommandEvent& event);
392
393 void OnAAttributionBatchWindow(wxCommandEvent& event);
394
395 void OnShowInformationDialog(wxCommandEvent& event);
396
397 void OnBezierSettings(wxCommandEvent& event);
398
399 // void OnMenuHighlightOn (wxMenuEvent & event);
400 // void OnMenuHighligntOff(wxMenuEvent & event);
401 void OnCheckUpdates(wxCommandEvent& event);
402
403 void OnContactUs(wxCommandEvent& event);
404
405 void OnImportGISData(wxCommandEvent& event);
406
407 void OnExportSelectedGISData(wxCommandEvent& event);
408
409 void OnUserManual(wxCommandEvent& event);
410
411 void OnFlipLine(wxCommandEvent& event);
412
413 void OnSmoothLine(wxCommandEvent& event);
414
415 void OnPreferences(wxCommandEvent& event);
416
417 void OnRefreshView(wxCommandEvent& event);
418
419 // selection
420 void OnSelectNone(wxCommandEvent& event);
421
422 void OnSelectByOid(wxCommandEvent& event);
423
424 void OnSelectInvert(wxCommandEvent& event);
425
426 // changing status function
427 void OnUpdateSelection(wxCommandEvent& event);
428
429 void OnEditObjectFrequency(wxCommandEvent& event);
430
431 // GIS functions
432 void OnAddGisData(wxCommandEvent& event);
433
434 void OnAddWebData(wxCommandEvent& event);
435
436 void OnAddGroup(wxCommandEvent& event);
437
438 void OnShortcutAttributionDone(wxCommandEvent& event);
439
440 // ToolsFunction
441 void OnDanglingNodes(wxCommandEvent& event);
442
443 void OnGeometryValidity(wxCommandEvent& event);
444
445 void OnCloseManagedPane(wxAuiManagerEvent& event);
446
447 void OnStatisticsUpdate(wxCommandEvent& event);
448
449 void OnStatisticsDialog(wxCommandEvent& event);
450
451 // child event function
452 // void OnMenuZoomPreviousChange(wxCommandEvent & event);
453 void _CheckUpdates(bool ismanual = false);
454
455 // view layout
456 void OnLayoutDefault(wxCommandEvent& event);
457
458 void OnLayoutVertical(wxCommandEvent& event);
459
460 void OnLayoutHorizontal(wxCommandEvent& event);
461
462 // update menu functions
463 void OnUpdateMenuProject(wxUpdateUIEvent& event);
464
465 void OnUpdateMenuPreviousZoom(wxUpdateUIEvent& event);
466
467 void OnUpdateMenuEditUndo(wxUpdateUIEvent& event);
468
469 void OnUpdateMenuEditDraw(wxUpdateUIEvent& event);
470
471 void OnUpdateMenuEditModify(wxUpdateUIEvent& event);
472
473 void OnUpdateMenuEditBezierDraw(wxUpdateUIEvent& event);
474
475 void OnUpdateMenuEditBezierModify(wxUpdateUIEvent& event);
476
477 void OnUpdateMenuBezierSettings(wxUpdateUIEvent& event);
478
479 void OnUpdateMenuEditDelete(wxUpdateUIEvent& event);
480
481 void OnUpdateMenuVertexInsert(wxUpdateUIEvent& event);
482
483 void OnUpdateMenuVertexDelete(wxUpdateUIEvent& event);
484
485 void OnUpdateMenuEditMerge(wxUpdateUIEvent& event);
486
487 void OnUpdateMenuEditPointOrient(wxUpdateUIEvent& event);
488
489 void OnUpdateMenuEditClearSelection(wxUpdateUIEvent& event);
490
491 void OnUpdateMenuEditQueryRun(wxUpdateUIEvent& event);
492
493 void OnUpdateMenuEditQueryAdd(wxUpdateUIEvent& event);
494
495 void OnUpdateMenuSnappingShowPanel(wxUpdateUIEvent& event);
496
497 void OnUpdateMenuSnappingShowOnMap(wxUpdateUIEvent& event);
498
499 void OnUpdateMenuShowShortcuts(wxUpdateUIEvent& event);
500
501 void OnUpdateMenuShowQuery(wxUpdateUIEvent& event);
502
503 void OnUpdateMenuShowTOC(wxUpdateUIEvent& event);
504
505 void OnUpdateMenuShowLog(wxUpdateUIEvent& event);
506
507 void OnUpdateMenuShowInfo(wxUpdateUIEvent& event);
508
509 void OnUpdateMenuFlipLine(wxUpdateUIEvent& event);
510
511 void OnUpdateMenuSmoothLine(wxUpdateUIEvent& event);
512
513 void OnUpdateMenuEditSharedNode(wxUpdateUIEvent& event);
514
515 void OnUpdateStatisticsDialog(wxUpdateUIEvent& event);
516
517 void OnUpdateGeometryValidity(wxUpdateUIEvent& event);
518
519 void OnUpdateMenuZoomLayer(wxUpdateUIEvent& event);
520
521 void OnSysColourChanged(wxSysColourChangedEvent& event);
522
523 void _CreateMenu();
524
525 void _CreateToolBar();
526
527 void _LoadPreference(bool reload);
528
529 void _CreatePerspectives();
530
531 DECLARE_EVENT_TABLE();
532 DECLARE_DYNAMIC_CLASS(ToolMapFrame)
533
534 public:
535 ToolMapFrame();
536
537 ToolMapFrame(wxFrame* frame, const wxString& title, wxPoint pos, wxSize size, const wxString& name);
538
540
541 bool AddLayers(const wxArrayString& filenames);
542};
543
544#endif
Definition attribution_obj_type.h:71
Definition main_panel.h:36
Deals with Recent files.
Definition menumanager.h:47
Project operations (new, open,...)
Definition projectmanager.h:68
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
Definition tocwindow_dlg.h:78
Implement the Application.
Definition toolmap.h:246
All frame's related stuff.
Definition toolmap.h:284
Definition update.h:29
Central point for object attribution.
Definition tmattributionmanager.h:57
Definition toolmap.h:267
Deals with editing data.
Definition tmeditmanager.h:87
GIS class for dealing with layers.
Definition tmlayermanager.h:57
Definition tmscalectrl.h:31
Statistics manager, link event to data and database records.
Definition tmstats.h:60
Definition tmtoolmanager.h:34
Deals with project operations.