ToolMap
Loading...
Searching...
No Matches
tmattributionmanager.h
1/***************************************************************************
2 tmattributionmanager.h
3 Manage the attribution
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// comment doxygen
18
19#ifndef _TM_ATTIBUTION_MANAGER_H_
20#define _TM_ATTIBUTION_MANAGER_H_
21
22// For compilers that support precompilation, includes "wx/wx.h".
23#include <wx/wxprec.h>
24
25// Include wxWidgets' headers
26#ifndef WX_PRECOMP
27#include <wx/wx.h>
28#endif
29
30#include "../core/tmshortcutmemory.h" // for shortcuts in memory
31#include "../gui/attribution_obj_type.h" // for attribution PANEL
32#include "tmaattribwindow.h" // for advanced attribution
33#include "tmattributiondatalabel.h" // for label attributions
34#include "tmattributiondataline.h" // for line attribution
35#include "tmattributiondatapoint.h" // for point attribution
36#include "tmmanagerevent.h" // for shared event with other manager
37#include "tmselecteddatamemory.h" // for selection data
38#include "tocctrl.h" // for TOC ctrl
39
40class InformationDLG;
41
42class DataBaseTM;
43
44DECLARE_EVENT_TYPE(tmEVT_SHORTCUT_ATTRIBUTION_DONE, -1);
45
46/***************************************************************************/
57class tmAttributionManager : public wxEvtHandler {
58 private:
59 // member data
60 wxWindow* m_Parent;
61 AttribObjType_PANEL* m_Panel;
62 tmSelectedDataMemory* m_SelData;
63 TocCtrl* m_TocCtrl;
64 DataBaseTM* m_pDB;
65 bool m_ShortcutLoaded;
66 PrjDefMemManage* m_pPrjMem;
67 InformationDLG* m_InfoDLG;
68
69 tmLayerProperties* m_pLayerProperties;
70 tmShortcutMemory m_ShortcutMem;
71
72 // event function
73 void OnSelection(wxCommandEvent& event);
74
75 // void OnAttributeBtn (wxCommandEvent & event);
76 void OnAddBtn(wxCommandEvent& event);
77
78 void OnRemoveBtn(wxCommandEvent& event);
79
80 void OnInfoBtn(wxCommandEvent& event);
81
82 // message event functions
83 void OnLayerChanged(wxCommandEvent& event);
84
85 void OnSelectionChanged(wxCommandEvent& event);
86
87 // shortcut function
88 void OnRefreshShortcut(wxCommandEvent& event);
89
90 int LoadShortcutIntoMemory();
91
92 void ConnectShortcutEvent();
93
94 void DisconnectShortcutEvent();
95
96 void OnShortcutPressed(wxCommandEvent& event);
97
98 bool ShortcutAttributionChecking(int iCount, int shortcutlayer_type);
99
100 // query function
101 void OnRunQuery(wxCommandEvent& event);
102
103 // copy attribution function
104 void OnCopyAttribution(wxCommandEvent& event);
105
106 // advanced attribution
107 int DisplayAAttributionWindow(wxArrayString* values, PrjMemLayersArray* layers,
108 const tmLayerValueArray& arrayidname);
109
110 // verification
111 bool IsAttributionManagerReady();
112
113 bool IsOnlyOneObjSelected();
114
115 DECLARE_EVENT_TABLE()
116
117 protected:
118 public:
119 // ctor and dtor
120 tmAttributionManager(wxWindow* parent, TocCtrl* toc, AttribObjType_PANEL* panel, tmSelectedDataMemory* selection);
121
123
124 // Init attribution
125 bool InitAttributionManager(DataBaseTM* pDb, PrjDefMemManage* memprojdef);
126
128
129 // selection informations
130 int GetSelectionCount() {
131 return m_SelData->GetCount();
132 }
133
134 // advanced attribution
136
137 void AAttributionBatchShow();
138
139 // informations
141
142 // Attribution data creation
144 // orientedpoints
145 // void OrientedPointEdit();
146 // void OrientedPointDraw();
147};
148
149#endif
Definition attribution_obj_type.h:71
Definition database_tm.h:80
Definition information_dlg.h:48
Definition prjdefmemmanage.h:54
Definition tocctrl.h:30
Class for attributing data.
Definition tmattributiondata.h:43
Central point for object attribution.
Definition tmattributionmanager.h:57
void DisplayInformationsWnd()
Show the information dialog if not visible.
Definition tmattributionmanager.cpp:769
void UnInitAttributionManager()
Uninit attribution manager.
Definition tmattributionmanager.cpp:234
~tmAttributionManager()
Destructor.
Definition tmattributionmanager.cpp:190
bool InitAttributionManager(DataBaseTM *pDb, PrjDefMemManage *memprojdef)
Init attribution manager.
Definition tmattributionmanager.cpp:204
bool AAttributionButtonShow()
Advanced Attribution button is pressed.
Definition tmattributionmanager.cpp:680
static tmAttributionData * CreateAttributionData(int type)
Create an object of tmAttributionData type.
Definition tmattributionmanager.cpp:518
Storing object of layer type.
Definition tmlayerproperties.h:47
Store ID of selected data into memory.
Definition tmselecteddatamemory.h:43
unsigned int GetCount()
Count the number of selected features.
Definition tmselecteddatamemory.cpp:172
Store shortcuts for attribution in memory.
Definition tmshortcutmemory.h:65