ToolMap
Loading...
Searching...
No Matches
tmexportdata.h
1/***************************************************************************
2 tmexportdata.h
3 main class for the process of exporting data
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_EXPORTDATA_H_
20#define _TM_EXPORTDATA_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 <wx/progdlg.h>
31
32#include "../database/databaseresult.h"
33#include "projectdefmemory.h" // for ProjectDefMemoryLayers definition
34
35class DataBaseTM;
36
37class PrjDefMemManage;
38
39class tmPercent;
40
41/***************************************************************************/
48class tmExportData : public wxObject {
49 private:
50 bool m_ExportAttributEnumerationCode;
51
52 void InitMemberValues();
53
54 double m_CropBufferDistance;
55
56 protected:
57 DataBaseTM* m_pDB;
58 wxString m_Extension;
59 bool m_Overwrite;
60 bool m_EmptyLayer;
61
62 // protected functions
63 wxFileName* GetFileName(ProjectDefMemoryLayers* myLayer, const wxString& path);
64
65 wxFileName* GetFileNamePrj(ProjectDefMemoryLayers* myLayer, const wxString& path);
66
67 int GetSizeOfEnum(const PrjMemFieldCodedValArray& mCodedVal);
68
69 bool GetSimpleAttribData(PRJDEF_LAYERS_TYPE layertype, long layerindex);
70
71 bool GetSimpleAttribDataWithSpatial(PRJDEF_LAYERS_TYPE layertype, long layerindex);
72
74
75 virtual bool SetPolyExportInfo(ProjectDefMemoryLayers* layer) {
76 return false;
77 }
78
79 public:
80 // ctor
82
83 tmExportData(DataBaseTM* database);
84
85 void Create(DataBaseTM* database);
86
88
89 // informations
90 int GetSizeOfObjDesc(int layerindex);
91
92 wxString GetFileExtension();
93
94 void SetExportAttributEnumeration(bool useAttributCode) {
95 m_ExportAttributEnumerationCode = useAttributCode;
96 }
97
98 bool DoExportAttributEnumerationCode() {
99 return m_ExportAttributEnumerationCode;
100 }
101
102 // create export file
103 virtual bool CreateEmptyExportFile(ProjectDefMemoryLayers* myLayer, const wxString& path) {
104 return false;
105 }
106
107 virtual bool CreatePrjFile(ProjectDefMemoryLayers* myLayer, const wxString& path, PRJDEF_PROJ_TYPE proj) {
108 return false;
109 }
110
111 virtual bool AddOptFields(const PrjMemFieldArray& myfields) {
112 return false;
113 }
114
115 virtual bool AddGenericFields(int iSize) {
116 return false;
117 }
118
119 virtual bool AddFIDField() {
120 return false;
121 }
122
123 virtual void SetFrame(wxRealPoint* points, int nbvertex) {
124 ;
125 }
126
127 virtual bool WriteLines(ProjectDefMemoryLayers* myLayer) {
128 return false;
129 }
130
131 virtual bool WritePoints(ProjectDefMemoryLayers* myLayer) {
132 return false;
133 }
134
135 virtual bool WritePolygons(ProjectDefMemoryLayers* myLayer) {
136 return false;
137 }
138
139 virtual bool WriteLabels(ProjectDefMemoryLayers* myLayer) {
140 return false;
141 }
142
143 virtual long WriteConcatGeometries(ProjectDefMemoryLayers* layer, wxProgressDialog* progDlg, tmPercent* percent) {
144 return false;
145 }
146
147 virtual bool AddConcatAttributs(ProjectDefMemoryLayers* layer, PrjDefMemManage* projdef, long loop,
148 wxProgressDialog* progDlg, tmPercent* percent) {
149 return false;
150 }
151
152 virtual bool SetAttributsBasic(DataBaseResult& results) {
153 return false;
154 }
155
156 virtual bool SetAttributsAdvanced(DataBaseResult& results, ProjectDefMemoryLayers* layer) {
157 return false;
158 }
159
160 virtual bool GetPolyExportInfo(ProjectDefMemoryLayers* layer, bool usefastexport) {
161 return false;
162 }
163
164 virtual bool CreateSpatialIndex(ProjectDefMemoryLayers* layer) {
165 return false;
166 }
167
168 virtual bool HasFeatures() {
169 return false;
170 }
171
172 virtual void SetEmptyLayer();
173
174 virtual bool DeleteLayer(ProjectDefMemoryLayers* layer, const wxString& path) {
175 return false;
176 }
177
178 void SetCropBufferDistance(double value) {
179 m_CropBufferDistance = value;
180 }
181
182 double GetCropBufferDistance() {
183 return m_CropBufferDistance;
184 }
185
186 void SetOverwrite(bool value) {
187 m_Overwrite = value;
188 }
189
190 bool DoOverwrite() {
191 return m_Overwrite;
192 }
193};
194
195#endif
Definition databaseresult.h:30
Definition database_tm.h:80
Definition prjdefmemmanage.h:54
Storing layers properties in memory.
Definition projectdefmemory.h:246
Parent class for exporting data.
Definition tmexportdata.h:48
bool GetAdvancedAttribution(ProjectDefMemoryLayers *layer)
Process the query for getting advanced values from database.
Definition tmexportdata.cpp:276
wxFileName * GetFileName(ProjectDefMemoryLayers *myLayer, const wxString &path)
Create a file name.
Definition tmexportdata.cpp:87
void Create(DataBaseTM *database)
Creator.
Definition tmexportdata.cpp:65
bool GetSimpleAttribDataWithSpatial(PRJDEF_LAYERS_TYPE layertype, long layerindex)
Process query for getting simple attributs and spatial data.
Definition tmexportdata.cpp:232
~tmExportData()
destructor
Definition tmexportdata.cpp:75
int GetSizeOfEnum(const PrjMemFieldCodedValArray &mCodedVal)
Get the max size of the items stored into array.
Definition tmexportdata.cpp:128
int GetSizeOfObjDesc(int layerindex)
Getting size of Object Desc column.
Definition tmexportdata.cpp:148
wxString GetFileExtension()
Return extension without the leading dot.
Definition tmexportdata.cpp:173
bool GetSimpleAttribData(PRJDEF_LAYERS_TYPE layertype, long layerindex)
Process query for getting simple attributs.
Definition tmexportdata.cpp:187
tmExportData()
Constructor.
Definition tmexportdata.cpp:43
wxFileName * GetFileNamePrj(ProjectDefMemoryLayers *myLayer, const wxString &path)
Create a prj file name.
Definition tmexportdata.cpp:108
Definition tmpercent.h:36
Storing project properties in memory.