ToolMap
Loading...
Searching...
No Matches
prjdefmemmanage.h
1/***************************************************************************
2 prjdefmemmanage.h
3 Manage the project in memory
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
40#ifndef PRJDEFMEMMANAGE_H
41#define PRJDEFMEMMANAGE_H
42
43// For compilers that support precompilation, includes "wx/wx.h".
44#include <wx/wxprec.h>
45
46// Include wxWidgets' headers
47#ifndef WX_PRECOMP
48#include <wx/wx.h>
49#endif
50
51// for Memory class definition
52#include "projectdefmemory.h"
53
55 private:
56 // variables
57 ProjectDefMemoryLayers* m_pActiveLayer;
58 ProjectDefMemoryFields* m_pActiveField;
59 int m_iActualObj;
60 int m_iActualField;
61 int m_iActualCodedVal;
62 int m_iActualLayers;
63
64 // member functions
65 void InitDefaultValues();
66
67 public:
68 // variables
69 wxString m_PrjPath;
70 wxString m_PrjName;
71 wxString m_PrjAuthors;
72 wxString m_PrjSummary;
73 PRJDEF_UNIT_TYPE m_PrjUnitType;
74 PRJDEF_PROJ_TYPE m_PrjProjType;
75 PrjMemLayersArray m_PrjLayerArray;
76 PrjMemScaleArray m_ScaleArray;
77
78 wxArrayLong m_StoreDeleteIDObj;
79 wxArrayLong m_StoreDeleteScale;
80 wxArrayLong m_StoreDeleteLayers;
81
82 // ctor - dtor
84
86
87 // layer members functions
88 ProjectDefMemoryLayers* AddLayer();
89
90 int RemoveLayer(int iIndex = -1); // remove last item by default...
91 bool RemoveLayer(const wxString& layerName);
92
93 ProjectDefMemoryLayers* FindLayer(const wxString& layerName);
94
95 ProjectDefMemoryLayers* FindLayer(unsigned int iIndex = 0);
96
97 ProjectDefMemoryLayers* FindLayerByRealID(unsigned int iIndex);
98
99 void SetActiveLayer(ProjectDefMemoryLayers* ActiveLayer) {
100 m_pActiveLayer = ActiveLayer;
101 }
102
103 ProjectDefMemoryLayers* GetActiveLayer() {
104 return m_pActiveLayer;
105 }
106
107 int GetCountLayers() {
108 return m_PrjLayerArray.GetCount();
109 }
110
111 ProjectDefMemoryLayers* GetNextLayer();
112
113 // object members functions
114 ProjectDefMemoryObjects* AddObject();
115
116 int RemoveObject(int iIndex = -1); // remove last
117 bool RemoveObject(const wxString& ObjectName);
118
119 ProjectDefMemoryObjects* FindObject(const wxString& ObjectName);
120
121 ProjectDefMemoryObjects* FindObject(unsigned int iIndex = 0);
122
123 ProjectDefMemoryObjects* GetNextObjects();
124
125 int GetCountObject();
126
127 // field members functions
128 ProjectDefMemoryFields* AddField();
129
130 int RemoveField(int iIndex = -1); // remove last
131 bool RemoveField(const wxString& FieldName);
132
133 ProjectDefMemoryFields* FindField(const wxString& FieldName);
134
135 ProjectDefMemoryFields* FindField(unsigned int iIndex = 0);
136
137 ProjectDefMemoryFields* GetNextField();
138
139 int GetCountFields();
140
141 void SetActiveField(ProjectDefMemoryFields* ActiveField) {
142 m_pActiveField = ActiveField;
143 }
144
145 ProjectDefMemoryFields* GetActiveField() {
146 return m_pActiveField;
147 }
148
149 // coded values belonging to fields
150 ProjectDefMemoryFieldsCodedVal* AddCodedValue();
151
152 int RemoveCodedValue(int iIndex = -1); // remove last
153 bool RemoveCodedValue(const wxString& ValueName);
154
155 ProjectDefMemoryFieldsCodedVal* FindCodedValue(const wxString& ValueName, int& IndexPos);
156
157 ProjectDefMemoryFieldsCodedVal* GetNextCodedValue();
158
159 int GetCountCodedValue();
160
161 // scale functions
162 ProjectDefMemoryScale* AddScale(const long& scale, const int& DBindex = -1);
163
164 ProjectDefMemoryScale* FindScale(const long& oldscale);
165
166 bool RemoveScale(const long& oldscale);
167
168 // copy function
170};
171
172#endif
Definition prjdefmemmanage.h:54
ProjectDefMemoryLayers * FindLayerByRealID(unsigned int iIndex)
Find field based on real ID.
Definition prjdefmemmanage.cpp:134
PrjDefMemManage & operator=(const PrjDefMemManage &source)
Overloading = operator.
Definition prjdefmemmanage.cpp:517
Storing coded val linked to a field in memory.
Definition projectdefmemory.h:137
Storing Fields property in memory.
Definition projectdefmemory.h:198
Storing layers properties in memory.
Definition projectdefmemory.h:246
Storing object properties in memory.
Definition projectdefmemory.h:168
Definition projectdefmemory.h:276
Storing project properties in memory.