1 | #include <locale.h> |
---|
2 | |
---|
3 | #include <wx/app.h> |
---|
4 | #include <wx/utils.h> |
---|
5 | |
---|
6 | #include <api_core.h> |
---|
7 | #include <saga_api.h> |
---|
8 | |
---|
9 | int Callback(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2){ |
---|
10 | return( 1 ); |
---|
11 | } |
---|
12 | |
---|
13 | TSG_PFNC_UI_Callback Get_Callback(void){ |
---|
14 | return( &Callback ); |
---|
15 | } |
---|
16 | |
---|
17 | void cleanAbstract(CSG_String abstract,char**res){ |
---|
18 | char* tmp=strdup(abstract.b_str()); |
---|
19 | CSG_String val=CSG_String("")+tmp; |
---|
20 | if(val.Contains("\r")){ |
---|
21 | val.Replace("\r","<br/>"); |
---|
22 | } |
---|
23 | if(val.Contains("\n")){ |
---|
24 | val.Replace("\n","<br/>"); |
---|
25 | } |
---|
26 | if(val.Contains("<")){ |
---|
27 | val.Replace("<","<"); |
---|
28 | } |
---|
29 | if(val.Contains(">")){ |
---|
30 | val.Replace(">",">"); |
---|
31 | } |
---|
32 | free(tmp); |
---|
33 | if(val.is_Empty()) |
---|
34 | *res=NULL; |
---|
35 | else |
---|
36 | *res=strdup(val.b_str()); |
---|
37 | } |
---|
38 | |
---|
39 | void printBasicMetadata(FILE* stdout,CSG_Parameter* param,bool out=false,bool range=false,bool min=true,bool tin=false,char* tname=NULL,char* ttitle=NULL){ |
---|
40 | fprintf(stdout," [%s]\n",(CSG_String(param->Get_Identifier())+(range?(min?"_MIN":"_MAX"):(tin?CSG_String("_")+tname:""))).b_str()); |
---|
41 | fprintf(stdout," Title = %s\n",(CSG_String(param->Get_Name())+(range?(min?" (min value)":" (max value)"):(tin&&ttitle!=NULL?ttitle:""))).b_str()); |
---|
42 | if(CSG_String(param->Get_Description()).is_Empty()) |
---|
43 | fprintf(stdout," Abstract = %s\n",CSG_String(param->Get_Name()).b_str()); |
---|
44 | else{ |
---|
45 | char* tmp=strdup(CSG_String(param->Get_Description()).b_str()); |
---|
46 | CSG_String val=CSG_String("")+tmp; |
---|
47 | if(val.Contains("\r")){ |
---|
48 | val.Replace("\r","<br/>"); |
---|
49 | } |
---|
50 | if(val.Contains("\n")){ |
---|
51 | val.Replace("\n","<br/>"); |
---|
52 | } |
---|
53 | if(val.Contains("<")){ |
---|
54 | val.Replace("<","<"); |
---|
55 | } |
---|
56 | if(val.Contains(">")){ |
---|
57 | val.Replace(">",">"); |
---|
58 | } |
---|
59 | free(tmp); |
---|
60 | fprintf(stdout," Abstract = %s\n",val.b_str()); |
---|
61 | } |
---|
62 | if(!out){ |
---|
63 | if(param->is_Option() || param->is_Optional()){ |
---|
64 | fprintf(stdout," minOccurs = 0\n"); |
---|
65 | if(param->is_Option()) |
---|
66 | fprintf(stdout," maxOccurs = 1\n"); |
---|
67 | else{ |
---|
68 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("_list"))) |
---|
69 | fprintf(stdout," maxOccurs = 1024\n"); |
---|
70 | else |
---|
71 | fprintf(stdout," maxOccurs = 1\n"); |
---|
72 | } |
---|
73 | }else{ |
---|
74 | if(param->is_Input()) |
---|
75 | fprintf(stdout," minOccurs = 1\n"); |
---|
76 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("_list"))) |
---|
77 | fprintf(stdout," maxOccurs = 1024\n"); |
---|
78 | else |
---|
79 | fprintf(stdout," maxOccurs = 1\n"); |
---|
80 | } |
---|
81 | } |
---|
82 | if(range){ |
---|
83 | |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | void printGrids(FILE* stdout){ |
---|
88 | fprintf(stdout," <ComplexData>\n"); |
---|
89 | fprintf(stdout," <Default>\n"); |
---|
90 | fprintf(stdout," mimeType = image/tiff\n"); |
---|
91 | fprintf(stdout," </Default>\n"); |
---|
92 | fprintf(stdout," <Supported>\n"); |
---|
93 | fprintf(stdout," mimeType = application/x-ogc-envi\n"); |
---|
94 | fprintf(stdout," </Supported>\n"); |
---|
95 | fprintf(stdout," <Supported>\n"); |
---|
96 | fprintf(stdout," mimeType = application/x-ogc-aaigrid\n"); |
---|
97 | fprintf(stdout," </Supported>\n"); |
---|
98 | fprintf(stdout," </ComplexData>\n"); |
---|
99 | } |
---|
100 | |
---|
101 | void printShapes(FILE* stdout){ |
---|
102 | fprintf(stdout," <ComplexData>\n"); |
---|
103 | fprintf(stdout," <Default>\n"); |
---|
104 | fprintf(stdout," mimeType = text/xml\n"); |
---|
105 | fprintf(stdout," encoding = utf-8\n"); |
---|
106 | fprintf(stdout," </Default>\n"); |
---|
107 | fprintf(stdout," <Supported>\n"); |
---|
108 | fprintf(stdout," mimeType = application/vnd.google-earth.kml+xml\n"); |
---|
109 | fprintf(stdout," </Supported>\n"); |
---|
110 | fprintf(stdout," <Supported>\n"); |
---|
111 | fprintf(stdout," mimeType = application/json\n"); |
---|
112 | fprintf(stdout," </Supported>\n"); |
---|
113 | fprintf(stdout," </ComplexData>\n"); |
---|
114 | } |
---|
115 | |
---|
116 | void printTables(FILE* stdout){ |
---|
117 | fprintf(stdout," <ComplexData>\n"); |
---|
118 | fprintf(stdout," <Default>\n"); |
---|
119 | fprintf(stdout," mimeType = text/csv\n"); |
---|
120 | fprintf(stdout," encoding = utf-8\n"); |
---|
121 | fprintf(stdout," </Default>\n"); |
---|
122 | fprintf(stdout," <Supported>\n"); |
---|
123 | fprintf(stdout," mimeType = text/csv\n"); |
---|
124 | fprintf(stdout," encoding = base64\n"); |
---|
125 | fprintf(stdout," </Supported>\n"); |
---|
126 | fprintf(stdout," </ComplexData>\n"); |
---|
127 | } |
---|
128 | |
---|
129 | void printPoints(FILE* stdout){ |
---|
130 | fprintf(stdout," <ComplexData>\n"); |
---|
131 | fprintf(stdout," <Default>\n"); |
---|
132 | fprintf(stdout," mimeType = application/x-ogc-lasf\n"); |
---|
133 | fprintf(stdout," extension = las\n"); |
---|
134 | fprintf(stdout," </Default>\n"); |
---|
135 | fprintf(stdout," </ComplexData>\n"); |
---|
136 | } |
---|
137 | |
---|
138 | int main(int argc, char *argv[]) { |
---|
139 | if( !wxInitialize() ){ |
---|
140 | fprintf(stderr,"initialisation failed"); |
---|
141 | return -1; |
---|
142 | } |
---|
143 | setlocale(LC_NUMERIC, "C"); |
---|
144 | static bool g_bShow_Messages = false; |
---|
145 | SG_Set_UI_Callback(Get_Callback()); |
---|
146 | #if SAGA_MAJOR_VERSION == 2 |
---|
147 | int n = SG_Get_Module_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false); |
---|
148 | if( SG_Get_Module_Library_Manager().Get_Count() <= 0 ) |
---|
149 | #else |
---|
150 | int n = SG_Get_Tool_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false); |
---|
151 | if( SG_Get_Tool_Library_Manager().Get_Count() <= 0 ) |
---|
152 | #endif |
---|
153 | { |
---|
154 | fprintf(stderr,"could not load any tool library"); |
---|
155 | return -2; |
---|
156 | } |
---|
157 | |
---|
158 | #if SAGA_MAJOR_VERSION == 2 |
---|
159 | for(int i=0;i<SG_Get_Module_Library_Manager().Get_Count();i++) |
---|
160 | #else |
---|
161 | for(int i=0;i<SG_Get_Tool_Library_Manager().Get_Count();i++) |
---|
162 | #endif |
---|
163 | { |
---|
164 | |
---|
165 | #if SAGA_MAJOR_VERSION == 2 |
---|
166 | CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(i); |
---|
167 | #else |
---|
168 | CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(i); |
---|
169 | #endif |
---|
170 | int lc=library->Get_Count(); |
---|
171 | if(!library->Get_Library_Name().Contains("io_")) { |
---|
172 | |
---|
173 | for(int j=0;j<lc;j++){ |
---|
174 | #if SAGA_MAJOR_VERSION == 2 |
---|
175 | CSG_Module * module=library->Get_Module(j); |
---|
176 | #else |
---|
177 | CSG_Tool * module=library->Get_Tool(j); |
---|
178 | #endif |
---|
179 | if(module!=NULL && !module->needs_GUI() /*&& !module->is_Interactive()*/ ){ |
---|
180 | |
---|
181 | mkdir(library->Get_Library_Name().b_str(),0755); |
---|
182 | |
---|
183 | FILE *stdout1=fopen((library->Get_Library_Name()+"/"+module->Get_ID()+".zcfg").b_str(),"w+"); |
---|
184 | fprintf(stdout1,"[%d]\n",j); |
---|
185 | fprintf(stdout1," Title = %s\n",module->Get_Name().b_str()); |
---|
186 | if(CSG_String(module->Get_Description()).is_Empty() || |
---|
187 | module->Get_Description().Length()<module->Get_Name().Length() ) |
---|
188 | fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str()); |
---|
189 | else{ |
---|
190 | char *val0; |
---|
191 | cleanAbstract(module->Get_Description(),&val0); |
---|
192 | if(val0==NULL) |
---|
193 | fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str()); |
---|
194 | else{ |
---|
195 | fprintf(stdout1," Abstract = %s\n",val0); |
---|
196 | free(val0); |
---|
197 | } |
---|
198 | } |
---|
199 | fprintf(stdout1," storeSupported = true\n"); |
---|
200 | fprintf(stdout1," statusSupported = true\n"); |
---|
201 | fprintf(stdout1," serviceType = SAGA\n"); |
---|
202 | fprintf(stdout1," serviceProvider = %s\n",library->Get_Library_Name().b_str()); |
---|
203 | CSG_Parameters * params=module->Get_Parameters(); |
---|
204 | int pc=params->Get_Count(); |
---|
205 | |
---|
206 | fprintf(stdout1," <DataInputs>\n"); |
---|
207 | for(int k=0;k<pc;k++){ |
---|
208 | CSG_Parameter * param=params->Get_Parameter(k); |
---|
209 | |
---|
210 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("parameters"),true)){ |
---|
211 | int pc0=param->asParameters()->Get_Count(); |
---|
212 | int l; |
---|
213 | fprintf(stderr,"%s\n",CSG_String(param->Get_Name()).b_str()); |
---|
214 | for(l=0;l<pc0;l++){ |
---|
215 | CSG_Parameter * param0=param->asParameters()->Get_Parameter(l); |
---|
216 | fprintf(stderr,"%s\n",CSG_String(param0->Get_Type_Identifier()).b_str()); |
---|
217 | } |
---|
218 | } |
---|
219 | |
---|
220 | // Node should be used for defining Complex ComplexData |
---|
221 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("color"))){ |
---|
222 | |
---|
223 | } |
---|
224 | else if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("date"),true)){ |
---|
225 | printBasicMetadata(stdout1,param,false,true,true); |
---|
226 | fprintf(stdout1," <LiteralData>\n"); |
---|
227 | fprintf(stdout1," dataType = date\n"); |
---|
228 | fprintf(stdout1," <Default/>\n"); |
---|
229 | fprintf(stdout1," </LiteralData>\n"); |
---|
230 | |
---|
231 | } |
---|
232 | else if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("range"),true)){ |
---|
233 | |
---|
234 | param->Restore_Default(); |
---|
235 | |
---|
236 | printBasicMetadata(stdout1,param,false,true,true); |
---|
237 | fprintf(stdout1," <LiteralData>\n"); |
---|
238 | fprintf(stdout1," dataType = float\n"); |
---|
239 | CSG_Parameter_Range *range=param->asRange(); |
---|
240 | fprintf(stdout1," <Default>\n"); |
---|
241 | #if SAGA_MAJOR_VERSION == 2 |
---|
242 | fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->Get_Data())->Get_LoVal()); |
---|
243 | #else |
---|
244 | //fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->asDataObject())->Get_Min()); |
---|
245 | #endif |
---|
246 | fprintf(stdout1," </Default>\n"); |
---|
247 | fprintf(stdout1," </LiteralData>\n"); |
---|
248 | |
---|
249 | printBasicMetadata(stdout1,param,false,true,false); |
---|
250 | fprintf(stdout1," <LiteralData>\n"); |
---|
251 | fprintf(stdout1," dataType = float\n"); |
---|
252 | fprintf(stdout1," <Default>\n"); |
---|
253 | #if SAGA_MAJOR_VERSION == 2 |
---|
254 | fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->Get_Data())->Get_HiVal()); |
---|
255 | #else |
---|
256 | //fprintf(stdout1," value = %f\n",((CSG_Parameter_Range*)param->asDataObject())->Get_Max()); |
---|
257 | #endif |
---|
258 | fprintf(stdout1," </Default>\n"); |
---|
259 | fprintf(stdout1," </LiteralData>\n"); |
---|
260 | |
---|
261 | } |
---|
262 | else if(param!=NULL && !param->is_Output() |
---|
263 | && |
---|
264 | !CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("parameters"),true) |
---|
265 | && |
---|
266 | !CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("grid_system"),true) |
---|
267 | && |
---|
268 | !CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("node"),true)){ |
---|
269 | |
---|
270 | printBasicMetadata(stdout1,param); |
---|
271 | |
---|
272 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("file"),true)){ |
---|
273 | if(CSG_String(param->Get_Description()).Contains(CSG_String("HTML"))){ |
---|
274 | fprintf(stdout1," <ComplexData>\n"); |
---|
275 | fprintf(stdout1," <Default>\n"); |
---|
276 | fprintf(stdout1," mimeType = text/html\n"); |
---|
277 | fprintf(stdout1," encoding = utf-8\n"); |
---|
278 | fprintf(stdout1," </Default>\n"); |
---|
279 | fprintf(stdout1," <ComplexData>\n"); |
---|
280 | } |
---|
281 | else{ |
---|
282 | fprintf(stdout1," <ComplexData>\n"); |
---|
283 | fprintf(stdout1," <Default>\n"); |
---|
284 | if(CSG_String(param->Get_Description()).Contains(CSG_String("HTML"))){ |
---|
285 | fprintf(stdout1," mimeType = text/html\n"); |
---|
286 | }else |
---|
287 | if(CSG_String(param->Get_Description()).Contains(CSG_String("SVG"))){ |
---|
288 | fprintf(stdout1," mimeType = image/svg+xml\n"); |
---|
289 | }else |
---|
290 | fprintf(stdout1," mimeType = text/plain\n"); |
---|
291 | if(CSG_String(param->Get_Description()).Contains(CSG_String("ASCII"))){ |
---|
292 | fprintf(stdout1," encoding = ascii\n"); |
---|
293 | }else |
---|
294 | fprintf(stdout1," encoding = utf-8\n"); |
---|
295 | fprintf(stdout1," </Default>\n"); |
---|
296 | fprintf(stdout1," </ComplexData>\n"); |
---|
297 | } |
---|
298 | } |
---|
299 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("shapes")) || |
---|
300 | CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("tin")) ){ |
---|
301 | printShapes(stdout1); |
---|
302 | } |
---|
303 | if(CSG_String(param->Get_Type_Identifier()).Contains("points")){ |
---|
304 | printPoints(stdout1); |
---|
305 | } |
---|
306 | if(CSG_String(param->Get_Type_Identifier()).Contains("grid") || |
---|
307 | CSG_String(param->Get_Type_Identifier()).Contains("data_")){ |
---|
308 | printGrids(stdout1); |
---|
309 | } |
---|
310 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("table"))){ |
---|
311 | printTables(stdout1); |
---|
312 | } |
---|
313 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("text"))){ |
---|
314 | fprintf(stdout1," <LiteralData>\n"); |
---|
315 | fprintf(stdout1," dataType = string\n"); |
---|
316 | fprintf(stdout1," <Default>\n"); |
---|
317 | #if SAGA_MAJOR_VERSION == 2 |
---|
318 | if( !param->Get_Data()->Get_Default().is_Empty() ){ |
---|
319 | fprintf(stdout1," value = %s\n",param->Get_Data()->Get_Default().b_str()); |
---|
320 | } |
---|
321 | #else |
---|
322 | if( !param->Get_Default().is_Empty() ){ |
---|
323 | fprintf(stdout1," value = %s\n",param->Get_Default().b_str()); |
---|
324 | } |
---|
325 | #endif |
---|
326 | fprintf(stdout1," </Default>\n"); |
---|
327 | fprintf(stdout1," </LiteralData>\n"); |
---|
328 | } |
---|
329 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("double"),true) |
---|
330 | || |
---|
331 | CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("degree"),true) |
---|
332 | || |
---|
333 | CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("integer"),true)){ |
---|
334 | fprintf(stdout1," <LiteralData>\n"); |
---|
335 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("double"),true) || |
---|
336 | CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("degree"),true)) |
---|
337 | fprintf(stdout1," dataType = float\n"); |
---|
338 | else |
---|
339 | fprintf(stdout1," dataType = integer\n"); |
---|
340 | |
---|
341 | fprintf(stdout1," <Default>\n"); |
---|
342 | #if SAGA_MAJOR_VERSION == 2 |
---|
343 | if( !param->Get_Data()->Get_Default().is_Empty() ){ |
---|
344 | fprintf(stdout1," value = %s\n",param->Get_Data()->Get_Default().b_str()); |
---|
345 | } |
---|
346 | #else |
---|
347 | if( !param->Get_Default().is_Empty() ){ |
---|
348 | fprintf(stdout1," value = %s\n",param->Get_Default().b_str()); |
---|
349 | } |
---|
350 | #endif |
---|
351 | if(param->asValue()->has_Minimum() && param->asValue()->has_Maximum()){ |
---|
352 | fprintf(stdout1," rangeMin = %f\n",param->asValue()->Get_Minimum()); |
---|
353 | fprintf(stdout1," rangeMax = %f\n",param->asValue()->Get_Maximum()); |
---|
354 | fprintf(stdout1," rangeClosure = c\n"); |
---|
355 | } |
---|
356 | fprintf(stdout1," </Default>\n"); |
---|
357 | fprintf(stdout1," </LiteralData>\n"); |
---|
358 | } |
---|
359 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("boolean"),true)){ |
---|
360 | fprintf(stdout1," <LiteralData>\n"); |
---|
361 | fprintf(stdout1," dataType = bool\n"); |
---|
362 | fprintf(stdout1," <Default>\n"); |
---|
363 | #if SAGA_MAJOR_VERSION == 2 |
---|
364 | if( !param->Get_Data()->Get_Default().is_Empty() ){ |
---|
365 | fprintf(stdout1," value = %s\n",(param->Get_Data()->Get_Default().Contains("0")?"false":"true")); |
---|
366 | } |
---|
367 | #else |
---|
368 | if( !param->Get_Default().is_Empty() ){ |
---|
369 | fprintf(stdout1," value = %s\n",(param->Get_Default().Contains("0")?"false":"true")); |
---|
370 | } |
---|
371 | #endif |
---|
372 | fprintf(stdout1," </Default>\n"); |
---|
373 | fprintf(stdout1," </LiteralData>\n"); |
---|
374 | } |
---|
375 | if(CSG_String(param->Get_Type_Identifier()).is_Same_As(CSG_String("choice"),true)){ |
---|
376 | CSG_Parameter_Choice* choice=param->asChoice(); |
---|
377 | if(choice!=NULL){ |
---|
378 | fprintf(stdout1," <LiteralData>\n"); |
---|
379 | fprintf(stdout1," dataType = string\n"); |
---|
380 | fprintf(stdout1," AllowedValues = "); |
---|
381 | int clen=choice->Get_Count(); |
---|
382 | if(clen>0){ |
---|
383 | for(int l=0;l<clen;l++){ |
---|
384 | //fprintf(stdout1,"%d",l); |
---|
385 | fprintf(stdout1,"%s",(CSG_String(choice->Get_Item(l))).b_str()); |
---|
386 | if(l+1<clen) |
---|
387 | fprintf(stdout1,","); |
---|
388 | } |
---|
389 | fprintf(stdout1,"\n"); |
---|
390 | } |
---|
391 | fprintf(stdout1," <Default>\n"); |
---|
392 | #if SAGA_MAJOR_VERSION == 2 |
---|
393 | if( !param->Get_Data()->Get_Default().is_Empty() ){ |
---|
394 | fprintf(stdout1," value = %s\n",CSG_String(choice->Get_Item(atoi(param->Get_Data()->Get_Default()))).b_str()); |
---|
395 | } |
---|
396 | #else |
---|
397 | if( !param->Get_Default().is_Empty() ){ |
---|
398 | fprintf(stdout1," value = %s\n",CSG_String(choice->Get_Item(atoi(param->Get_Default()))).b_str()); |
---|
399 | } |
---|
400 | #endif |
---|
401 | fprintf(stdout1," </Default>\n"); |
---|
402 | fprintf(stdout1," </LiteralData>\n"); |
---|
403 | } |
---|
404 | } |
---|
405 | } |
---|
406 | } |
---|
407 | fprintf(stdout1," </DataInputs>\n"); |
---|
408 | fprintf(stdout1," <DataOutputs>\n"); |
---|
409 | |
---|
410 | bool hasOutput=false; |
---|
411 | |
---|
412 | for(int k=0;k<pc;k++){ |
---|
413 | CSG_Parameter * param=params->Get_Parameter(k); |
---|
414 | if(param!=NULL && param->is_Output()){ |
---|
415 | hasOutput=true; |
---|
416 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("tin"))){ |
---|
417 | char* tinOut[5]={ |
---|
418 | (char*)"POINTS", |
---|
419 | (char*)"CENTER", |
---|
420 | (char*)"EDGES", |
---|
421 | (char*)"TRIANGLES", |
---|
422 | (char*)"POLYGONS" |
---|
423 | }; |
---|
424 | for(int l=0;l<5;l++){ |
---|
425 | char *ttitle=(char*)malloc((strlen(tinOut[l])+8)*sizeof(char)); |
---|
426 | sprintf(ttitle,"%s Shapes",tinOut[l]); |
---|
427 | printBasicMetadata(stdout1,param,true,false,true,true,tinOut[l],ttitle); |
---|
428 | printShapes(stdout1); |
---|
429 | } |
---|
430 | } |
---|
431 | else { |
---|
432 | printBasicMetadata(stdout1,param,true); |
---|
433 | |
---|
434 | if(CSG_String(param->Get_Type_Identifier()).Contains("points")){ |
---|
435 | printPoints(stdout1); |
---|
436 | } |
---|
437 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("shapes"))){ |
---|
438 | printShapes(stdout1); |
---|
439 | } |
---|
440 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("grid")) || |
---|
441 | CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("data_object"))){ |
---|
442 | printGrids(stdout1); |
---|
443 | } |
---|
444 | if(CSG_String(param->Get_Type_Identifier()).Contains(CSG_String("table"))){ |
---|
445 | printTables(stdout1); |
---|
446 | } |
---|
447 | |
---|
448 | } |
---|
449 | } |
---|
450 | } |
---|
451 | fprintf(stdout1,"</DataOutputs>\n"); |
---|
452 | fclose(stdout1); |
---|
453 | if(!hasOutput) |
---|
454 | unlink((library->Get_Library_Name()+"/"+module->Get_ID()+".zcfg").b_str()); |
---|
455 | } |
---|
456 | } |
---|
457 | } |
---|
458 | } |
---|
459 | wxUninitialize(); |
---|
460 | |
---|
461 | return 0; |
---|
462 | } |
---|