-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGS_WHIP.CPP
13214 lines (11582 loc) · 530 KB
/
GS_WHIP.CPP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**********************************************************
Name: GS_WHIP
Module description:
Author: Paolo Carlio, Roberto Poltini
(c) Copyright 1998-2016 by IREN ACQUA GAS S.p.A.
Modification history:
Notes and restrictions on use:
**********************************************************/
/*********************************************************/
/* INCLUDES */
/*********************************************************/
#include "stdafx.h"
#define INITGUID
#import "msado15.dll" no_namespace rename ("EOF", "EndOfFile") rename ("EOS", "ADOEOS")
#include "adslib.h"
#include "scene.h" // per funzionalità topologiche (definizione di POLYGON)
#include "topoads.h" // per funzionalità topologiche
#include "mapads.h" // per funzionalità map-topologiche
#include "core_rxmfcapi.h" // per AcColorSettings
#include "MapODRecord.h"
#include "..\gs_def.h" // definizioni globali
#include "gs_error.h" // codici errori
#include "gs_opcod.h"
#include "gs_resbf.h" // gestione resbuf
#include "gs_utily.h"
#include "gs_init.h"
#include "gs_prjct.h"
#include "gs_graph.h"
#include "gs_area.h"
#include "gs_attbl.h" // per gestione blocchi attributi
#include "gs_filtr.h"
#include "gs_dbref.h" // funzioni per tabelle OD
#include "gs_netw.h"
#include "gs_ade.h"
#include "gs_whip.h"
#define QGIS_XML_INDENT _T(" ")
/*************************************************************************/
/* PRIVATE FUNCTIONS */
/*************************************************************************/
int gsc_clean_sinott(presbuf maschera, TCHAR *topo_var, int mode, presbuf AnchorMask);
int gsc_whip(C_STRING &sinottico, C_STRING &dwf_dir, C_STRING &addr_inet,
C_STRING &text_descr, C_STRING &prefix, int flag_script, int flag_dwf,
int flag_dwg, int flag_url, int flag_descr, int flag_pre);
int gsc_pgviewAddAlfaNumAttrib(C_CLASS *pCls, C_2STR_LIST &Name_Alias_list,
C_STRING &Stm);
int gsc_pgviewAddGeomAttrib(C_CLASS *pCls, C_RB_LIST &GeomTableStru, C_STRING &Stm,
bool Lbl = false);
int gsc_pgviewGetAuxiliaryInfoOnView(C_CLASS *pCls, TCHAR *ViewType,
C_2STR_LIST *pName_Alias_list = NULL,
C_STRING *pViewName = NULL, C_STRING *pFullRefView = NULL,
TCHAR *RuleType = NULL, C_STRING *pRuleName = NULL, C_STRING *pFullRefFuncName = NULL,
C_STRING *pFullRefFunctionRefreshEntity = NULL);
int gsc_pgviewGetLockTableStm(C_CLASS *pCls, C_STRING &Stm,
bool EntityTable = true, bool GeomTable = true,
bool LabelTable = true, bool GrpLabelTable = true);
int gsc_pgviewGetUpdEntityTableStm(C_CLASS *pCls, C_2STR_LIST *pName_Alias_list,
TCHAR *Entity_id_param, C_STRING &Stm);
int gsc_pgviewAddRulesOnGeomView(C_CLASS *pCls);
void gsc_pgviewGetFunctionNameWithParamOnInsertGeomView(C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnInsertGeomView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity,
C_2STR_LIST *pName_Alias_list = NULL);
void gsc_pgviewGetFunctionNameWithParamOnUpdateGeomView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnUpdateGeomView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity,
C_2STR_LIST *pName_Alias_list = NULL);
void gsc_pgviewGetFunctionNameWithParamOnDeleteGeomView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnDeleteGeomView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity);
int gsc_pgviewAddRulesOnLblView(C_CLASS *pCls);
void gsc_pgviewGetFunctionNameWithParamOnInsertLblView(C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnInsertLblView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity,
C_2STR_LIST *pName_Alias_list);
void gsc_pgviewGetFunctionNameWithParamOnUpdateLblView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnUpdateLblView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity,
C_2STR_LIST *pName_Alias_list);
void gsc_pgviewGetFunctionNameWithParamOnDeleteLblView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionOnDeleteLblView(C_CLASS *pCls, C_STRING &FullRefFuncName,
C_STRING &FullRefView,
C_STRING &FullRefFunctionRefreshEntity);
int gsc_ADOTypeToPLPGSQLType(DataTypeEnum ADOType, C_STRING &PLPGSQLType);
int gsc_AttribNameToPLPGSQLVariable(C_STRING &AttribName, C_STRING &PLPGSQLVariable);
int gsc_FuncFromGphToPLPGSQLFunc(C_CLASS *pCls, TCHAR *calc_func, C_STRING &PLPGSQLFunc);
int gsc_pgviewAddDefaultCalcFieldsNotOnInsertFunctionRefreshEntity(C_CLASS *pCls, C_STRING &Stm);
int gsc_pgviewAddCalcFieldsFromGraphFunctionRefreshEntity(C_CLASS *pCls, bool insert_mode, C_STRING &Stm);
int gsc_pgviewAddFieldsNoFromGraphFunctionRefreshEntity(C_CLASS *pCls, C_STRING &Stm);
int gsc_pgviewAddValidationFieldsFunctionRefreshEntity(C_CLASS *pCls, C_STRING &Stm);
void gsc_pgviewGetFunctionNameWithParamRefreshEntity(C_STRING &ullRefFuncName, C_STRING &FuncNameWithParam);
int gsc_pgviewAddFunctionRefreshEntity(C_CLASS *pCls, C_STRING &FullRefFuncName);
void gsc_LispAddVarToListVarPLPGSQL(const TCHAR *PLPGSQLVariable, DataTypeEnum DataType,
C_STR_LIST &IntegerVarList, C_STR_LIST &DoubleVarList,
C_STR_LIST &CharVarList, C_STR_LIST &GeomVarList,
C_STR_LIST &BoolVarList, C_STR_LIST &DateVarList,
C_STR_LIST &TimestampVarList);
void gsc_LispAddVarToListVarPLPGSQL(C_STRING &PLPGSQLVariable, DataTypeEnum DataType,
C_STR_LIST &IntegerVarList, C_STR_LIST &DoubleVarList,
C_STR_LIST &CharVarList, C_STR_LIST &GeomVarList,
C_STR_LIST &BoolVarList, C_STR_LIST &DateVarList,
C_STR_LIST &TimestampVarList);
int gsc_check_geometry_columns_table(C_DBCONNECTION *pConn);
int gsc_check_geometry_columns_table(int prj, C_INT_LIST &ClsCodeList);
bool gsc_getQGIS_isValidValuesList(C_STRING &SupportFile, C_ATTRIB *pAttrib,
C_ATTRIB_LIST *pAttribList, C_2STR_LIST &ValuesList);
int gsc_CreateHistoryGEOsimClass(C_CLASS *pCls,
C_STRING &HistoryGeomTableRef, C_STRING &HistoryAlfanumTableRef);
int gsc_CreateHistoryQryFunction(C_DBCONNECTION *pConn, C_STRING &HistoryTableRef, C_STRING &ent_key_attrib);
// roby shape
int gsc_setGoogleEarthODRecord(C_INT_LIST &ClsCodeList, bool AllCharDataType, C_INT_INT_LIST &EmptyClsSubCodeList);
int gsc_setGoogleEarthODRecord(C_SELSET &ss, bool AllCharDataType = true);
void gsc_getGoogleEarthODTableNameFromCls(C_CLASS *pCls, C_STRING &ODTableName);
int gsc_writeScriptForShapeExport(C_STRING &ScriptPath, C_INT_LIST &ClassCodeList, C_STRING &ShapeDir,
C_INT_INT_LIST *pEmptyClsSubCodeList = NULL);
int gsc_updateAcMapODTableRecord(C_CLASS *pCls, C_RB_LIST &ColValues,
bool AllCharDataType, AcMapODTableRecord &Record);
int gsc_setGoogleEarthODRecord(ads_name ent, AcMapODTable *pTable, AcMapODTableRecord &NewRecord,
AcMapODRecordIterator *pIter);
int gsc_setGoogleEarthODRecord(C_CLASS *pCls, C_RB_LIST &ColValues,
AcMapODTable *pTable, bool AllCharDataType, AcMapODRecordIterator *pIter);
/*************************************************************************/
/*.doc gsc_pg_del_geometry_column <internal> */
/*+
Questa funzione cancella nella tabella public.geometry_columns una riga con la
definizione di una colonna geometrica.
parametri:
C_DBCONNECTION *pConn; Connessione OLE-DB (input)
C_STRING &TableRef; Tabella
C_STRING &GeomField; Campo geometrico
Restituisce GS_GOOD in caso di successo altrimenti restituisce GS_BAD.
-*/
/*************************************************************************/
int gsc_pg_del_geometry_column(C_DBCONNECTION *pConn, C_STRING &TableRef, C_STRING &GeomField)
{
C_STRING Stm, Catalog, Schema, Name, _GeomField(GeomField), Version;
if (pConn->getPostGIS_Version(Version) == GS_BAD) return GS_BAD;
// Da postgis 2 in poi la geometry_columns è una vista
if (Version.startWith(_T("1")) == false)
return GS_GOOD;
if (pConn->split_FullRefTable(TableRef, Catalog, Schema, Name) == GS_BAD)
return GS_BAD;
// Correggo la stringa secondo la sintassi SQL
if (Catalog.len() == 0) Catalog = _T("''");
else if (pConn->Str2SqlSyntax(Catalog) == GS_BAD) return GS_BAD;
if (Schema.len() == 0) Schema = _T("''");
else if (pConn->Str2SqlSyntax(Schema) == GS_BAD) return GS_BAD;
if (pConn->Str2SqlSyntax(Name) == GS_BAD) return GS_BAD;
if (pConn->Str2SqlSyntax(_GeomField) == GS_BAD) return GS_BAD;
// cancello riga in public.geometry_columns
Stm = _T("DELETE FROM public.geometry_columns WHERE f_table_catalog = ");
Stm += Catalog;
Stm += _T(" AND f_table_schema = ");
Stm += Schema;
Stm += _T(" AND f_table_name = ");
Stm += Name;
Stm += _T(" AND f_geometry_column = ");
Stm += _GeomField;
return pConn->ExeCmd(Stm);
}
/*************************************************************************/
/*.doc gsc_pg_insert_geometry_column <internal> */
/*+
Questa funzione inserisce nella tabella public.geometry_columns una riga con la
definizione di una colonna geometrica.
parametri:
C_DBCONNECTION *pConn; Connessione OLE-DB (input)
Restituisce GS_GOOD in caso di successo altrimenti restituisce GS_BAD.
-*/
/*************************************************************************/
int gsc_pg_insert_geometry_column(C_DBCONNECTION *pConn, C_STRING &TableRef,
C_STRING &GeomField, int CoordDim, C_STRING &SRID, int ClsType)
{
C_STRING Stm, Catalog, Schema, Name, _GeomField(GeomField), GeomDescr, Version;
C_INT_STR *pGeomDescr;
if (pConn->getPostGIS_Version(Version) == GS_BAD) return GS_BAD;
// Da postgis 2 in poi la geometry_columns è una vista
if (Version.startWith(_T("1")) == false)
return GS_GOOD;
if (pConn->split_FullRefTable(TableRef, Catalog, Schema, Name) == GS_BAD)
return GS_BAD;
// Cerco la descrizione SQL del tipo geometrico
if ((pGeomDescr = (C_INT_STR *) pConn->get_GeomTypeDescrListPtr()->search_key(ClsType)) == NULL)
{ GS_ERR_COD = eGSInvClassType; return GS_BAD; }
GeomDescr = pGeomDescr->get_name();
// Correggo la stringa secondo la sintassi SQL
if (Catalog.len() == 0) Catalog = _T("''");
else if (pConn->Str2SqlSyntax(Catalog) == GS_BAD) return GS_BAD;
if (Schema.len() == 0) Schema = _T("''");
else if (pConn->Str2SqlSyntax(Schema) == GS_BAD) return GS_BAD;
if (pConn->Str2SqlSyntax(Name) == GS_BAD) return GS_BAD;
if (pConn->Str2SqlSyntax(GeomDescr) == GS_BAD) return GS_BAD;
if (pConn->Str2SqlSyntax(_GeomField) == GS_BAD) return GS_BAD;
// cancello riga in public.geometry_columns
if (gsc_pg_del_geometry_column(pConn, TableRef, GeomField) == GS_BAD) return GS_BAD;
Stm = _T("INSERT INTO public.geometry_columns (f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type) VALUES (");
Stm += Catalog;
Stm += _T(", ");
Stm += Schema;
Stm += _T(", ");
Stm += Name;
Stm += _T(", ");
Stm += _GeomField;
Stm += _T(", ");
Stm += CoordDim;
Stm += _T(", ");
Stm += SRID;
Stm += _T(", ");
Stm += GeomDescr;
Stm += _T(")");
return pConn->ExeCmd(Stm);
}
/*************************************************************************/
/*.doc gs_whip <external> */
/*+
Questa funzione LISP lancia la procedura che consente di creare
da un sinottico n files tipo DWF.
I parametri LISP sono:
<name_sinot> <dir_dwf> <inet_addr> <descr> <prefix> <f_script> <f_dwf>
<f_dwg> <f_url> <f_prefix> <f_descr>
Restituisce TRUE in caso di successo altrimenti restituisce NIL.
-*/
/*************************************************************************/
int gs_whip(void)
{
C_STRING name_sinot, dir_dwf, inet_addr, descr, prefix;
int flag_script = 0, flag_dwg = 0, flag_url = 0, flag_dwf = 0, flag_descr = 0, flag_prefix = 0;
presbuf arg;
acedRetNil();
// ricavo i valori impostati
arg = acedGetArgs();
if (arg == NULL || arg->restype != RTSTR) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else name_sinot = arg->resval.rstring; // nome sinottico
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSTR) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else dir_dwf = arg->resval.rstring; // direttorio dei DWF
arg = arg->rbnext;
if (arg->restype == RTNIL) inet_addr = GS_EMPTYSTR; // indirizzo Internet vuoto
else if (arg == NULL || arg->restype != RTSTR) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else inet_addr = arg->resval.rstring; // indirizzo Internet pieno
arg = arg->rbnext;
if (arg->restype == RTNIL) descr = GS_EMPTYSTR; // descrizione maschera URL vuota
else if (arg == NULL || arg->restype != RTSTR) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else descr = arg->resval.rstring; // descrizione maschera URL piena
arg = arg->rbnext;
if (arg->restype == RTNIL) prefix = GS_EMPTYSTR; // descrizione prefisso vuota
else if (arg == NULL || arg->restype != RTSTR) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else prefix = arg->resval.rstring; // descrizione prefisso piena
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_script = arg->resval.rint; // lancio file script
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_dwf = arg->resval.rint; // genarazione dei file .DWF
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_dwg = arg->resval.rint; // generazione dei file .DWG
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_url = arg->resval.rint; // modalità inserimento URL
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_descr = arg->resval.rint; // modalità mascheramento URL
arg = arg->rbnext;
if (arg == NULL || arg->restype != RTSHORT) { GS_ERR_COD = eGSInvalidArg; return RTERROR; }
else flag_prefix = arg->resval.rint; // modalità inserimento prefisso
// chiamo la funzione che carica il sinottico e individua le aree
// di estrazione per le classi selezionate
if (gsc_whip(name_sinot, dir_dwf, inet_addr, descr, prefix,
flag_script, flag_dwf, flag_dwg, flag_url, flag_descr, flag_prefix) == GS_BAD)
{ acedRetNil(); return RTERROR; }
acedRetT();
return RTNORM;
}
/*********************************************************************/
/*.doc gsc_whip <internal> */
/*+
Questa funzione estrae il sinottico scelto effettua l'eventuale 'pulizia'
dello stesso e prepara le n zone spaziali di estrazuine classi;
in coda scrive un file di SCRIPT con la sequenza _NEW... estrazione classi
salvatggio file .DWF replicata tante volte quante sono le zone spaziali
individuate dal sinottico.
Parametri:
C_STRING &sinottico : nome del sinottico scelto (con path completa);
C_STRING &dwf_dir : direttorio di salvataggio dei file .DWF
C_STRING &addr_inet : indirizzo internet da usarsi come percorso per i file URL
C_STRING &text_desrc : eventualte testo maschera dell'URL
int flag_script : flag che indica se lanciare il file di script che si
ottiene (1) oppuer no (0).
int flag_dwf : flag che indica se generare anche i file .DWF
int flag_dwg : flag che indica se generare anche i file .DWG
int flag_url : flag che indica se usare testi già presenti (1) sul sinottico
oppure generarne di nuovi (0);
int flag_descr : flag che indica se mascherare (1) l'URL nel sinottico
oppure no (0);
La funzione restituisce GS_BAD in caso di errore altrimenti GS_GOOD.
-*/
/*********************************************************************/
int gsc_whip(C_STRING &sinottico, C_STRING &dwf_dir, C_STRING &addr_inet,
C_STRING &text_descr, C_STRING &prefix,
int flag_script, int flag_dwf, int flag_dwg, int flag_url,
int flag_descr, int flag_pre)
{
int f = 0, k = 0, result, num_vert = 0, lan = 0, FlagTxt;
long lungh_selset_text, lungh_selset_poly, i = 0, old_error = 0, loopCount = 1;
double h_text, altezza = 0.0, ent_area = 0.0;
TCHAR cod[4], cod_prj[3];
TCHAR *point = NULL, *StrNum = NULL;
C_STRING path_new, etichetta, inet_addr_dwf, pc3file, level1, WhereSql, style_text;
C_STRING fileclass, filedwg, filescript, fileurl, sinoturl, filedwf, string;
C_STR_LIST lista_url, val_style_text;
C_REAL_LIST val_h_text;
C_STR *nod, *nod2;
C_REAL *nod1;
FILE *file, *filescr, *furl, *filemove=NULL;
C_POINT_LIST list_vert_poly, url_ins_point, pt_allin_text;
C_RB_LIST p_estract_cond, rb, entmask, entita, AnchorMask;
C_STRING list_class, list_point, riga, stile_testo;
ade_id dwg_id = ADE_NULLID, var_id = ADE_NULLID;
ads_name sel_set, sel_text, ent, ss_poly;
ads_point p_centroid, ptAllinText;
C_INT_LIST val_gen_text, val_allinOriz_text, val_allinVert_text;
C_INT *pInt;
presbuf p;
C_STRING destFile, pathFile, ext, name, dir, alias, dbfiledwf;
C_DBCONNECTION *pConn;
C_RB_LIST ColValues;
C_PROJECT *pPrj = NULL;
double x1, y1, x2, y2;
C_STRING filename, x, y;
_RecordsetPtr pRs;
// verifico l'abilitazione dell' utente;
if (gsc_check_op(opWhip) == GS_BAD) return GS_BAD;
// verifico che non esistano aree di lavoro attive
if (GS_CURRENT_WRK_SESSION) { GS_ERR_COD = eGSSessionsFound; return GS_BAD; }
// ricavo la lingua di AUTOCAD
if (gsc_GetAcadLanguage(&lan) == GS_BAD)
{ GS_ERR_COD = eGSUnknowAutoCadLanguage; return GS_BAD; }
// Setta l'ambiente ADE per lavorare in una sessione di GEOsim.
// In particolare disabilito la richiesta di map di salvataggio oggetti modificati
C_MAP_ENV MapEnv;
MapEnv.SetEnv4GEOsim();
// converto nel file sinottico eventuali "\" in "/"
sinottico.strtran(_T("\\"), _T("/"));
// converto nel percorso internet eventuali "\" in "/"
addr_inet.strtran(_T("\\"), _T("/"));
// converto nel direttorio dei file .DWF eventuali "\" in "/"
dwf_dir.strtran(_T("\\"), _T("/"));
// effettuo l'attach e l'activate del sinottico
if (gsc_ADEdrv2nethost(sinottico.get_name(), path_new) == GS_BAD) return GS_BAD;
if ((dwg_id = gsc_dsattach(path_new.get_name())) != ADE_NULLID)
if (gsc_dwgactivate(dwg_id) != GS_GOOD) return GS_BAD;
// imposto condizione spaziale con ALL // settare errore
if ((p_estract_cond << acutBuildList(RTLB, RTSTR, ALL_SPATIAL_COND, RTLE, 0)) == NULL) return GS_BAD;
if (ade_qrydefine(GS_EMPTYSTR, GS_EMPTYSTR, GS_EMPTYSTR, _T("Location"),
p_estract_cond.get_head(), GS_EMPTYSTR) == ADE_NULLID)
{ GS_ERR_COD = eGSQryCondNotDef; return GS_BAD; }
// setto la modalità di estrazione
if (ade_qrysettype(_T("draw"), FALSE, GS_EMPTYSTR, GS_EMPTYSTR) != RTNORM) return GS_BAD;
// effettuo l'estrazione del disegno (sinottico)
ade_qryexecute();
// effettuo uno ZOOM Estensione del disegno
if (gsc_callCmd(_T("_.ZOOM"), RTSTR, _T("_E"), 0) != RTNORM) return GS_BAD;
// attivo al chiamata per ripulire il disegno da eventuali errori
int cnt = 0, num_error = 1, val_topo = 16 + 32 + 64;
do
{
// filtro su tutti gli oggetti presenti sul piano GEOSHAPE
if ((entmask << acutBuildList(8, _T("GEOSHAPE"), 0)) == NULL) return GS_BAD;
// filtro su tutti gli oggetti da preservare dalla pulizia del disegno
if ((AnchorMask << acutBuildList(8, _T("GEOURL"), 0)) == NULL) return GS_BAD;
result = gsc_clean_sinott(entmask.get_head(), _T("NODE_ERROR"), val_topo,
AnchorMask.get_head());
if (result == GS_CAN) return GS_GOOD; // sono stati trovati errori
else if (result == GS_BAD) return GS_BAD; // la funzione ha fallito per qualche motivo
if (acedSSGet(_T("_X"), NULL, NULL, entmask.get_head(), sel_set) != RTNORM)
{ GS_ERR_COD = eGSInvalidLayer; return GS_BAD; }
// creo la topologia di tipo poligono (3 = poligono)
if ((var_id = tpm_varalloc()) == ADE_NULLID) return GS_BAD;
if ((tpm_mntbuild (var_id, _T("gswhip"), GS_EMPTYSTR, 3, NULL, sel_set, NULL)) != RTNORM)
ads_ssfree(sel_set);
else num_error = 0;
} while ((num_error != 0) && (cnt++ < 10));
ads_ssfree(sel_set);
// se dopo dieci tentativi non sono riuscito a costruire la topologia poligono
// avverto l'utente di controllare il sinottico e correggerlo opportunamente
//"\nImpossibile creare la topologia: controllare il disegno"
if (num_error != 0)
{ acutPrintf(_T("%s"), gsc_msg(789)); return GS_BAD; }
// creo un nuovo piano su cui scaricare il risultato di creazione di polilinee
// chiuse dalla topologia creata
C_COLOR color;
color.setAutoCADColorIndex(3);
if (gsc_set_charact_layer(_T("gswhip"), NULL, &color) == GS_BAD)
return GS_BAD;
// Memorizzo ultima entita
ads_name last;
if (acdbEntLast(last) != RTNORM) ads_name_clear(last);
// creo l'insieme di polilinee chiuse dalla topologia precedente che serviranno
// in seguito per individuare le zone da caricare al fini di ottenere i file .DWF
if (gsc_callCmd(_T("_.MAPCLPLINE"),
RTSTR, _T("gswhip"), // Nome topologia
RTSTR, _T("gswhip"), // Nome layer
RTSTR, _T("_N"), // Raggrup. Polig. complessi
RTSTR, _T("_N"), // Dati Oggetto
RTSTR, _T("_N"), // Link Db
0) != RTNORM) return GS_BAD;
// nel caso siano stati inseriti dei nuovi nuovi oggetti grafici
acedSSAdd(NULL, NULL, ss_poly);
while (gsc_mainentnext(last, last) == GS_GOOD)
acedSSAdd(last, ss_poly, ss_poly);
// Commentato per baco map (si sono dimenticati di includere map_topoclose nelle lib)
//if (map_topoClose(_T("gswhip"), _T("gswhip"), FALSE, FALSE, FALSE, ss_poly) == RTERROR)
// return GS_BAD;
// verifico se il gruppo di selezione è vuoto o ritorna errore
if (ads_sslength(ss_poly, &lungh_selset_poly) != RTNORM)
{
resbuf p;
acedGetVar(_T("ERRNO"), &p);
if (p.resval.rint != 0) { ads_ssfree(ss_poly); return GS_BAD; }
}
else if (lungh_selset_poly == 0) { ads_ssfree(ss_poly); return GS_GOOD; }
// apro il file delle classi selezionate e compongo la lista delle stesse da scivere nel
// file di script
fileclass = dwf_dir;
fileclass += _T('/');
fileclass += _T("geowhip.sel");
if ((file = gsc_fopen(fileclass.get_name(), _T("r"))) == NULL)
{ gsc_fclose(file); GS_ERR_COD = eGSOpenFile; return GS_BAD; }
// leggo il codice progetto
if (fwscanf(file, _T("%s"), cod_prj) == EOF)
{ gsc_fclose(file); GS_ERR_COD = eGSReadFile; return GS_BAD; }
list_class.clear();
list_class += _T("(setq lista_class_sel '(");
f = 0;
k = 0;
while (fwscanf(file, _T("%s"), cod) != EOF)
{
// testo se spezzare la lista delle classi scelte (se troppo lunga)
if (k > 0)
{
if (k % 25 == 0)
{
list_class += _T("))\n(setq list");
list_class += f++;
list_class += _T(" '(");
}
else list_class += _T(" ");
}
list_class += cod;
k++;
}
list_class += _T("))\n");
if (f > 0)
{
list_class += _T("(setq lista_class_sel (append lista_class_sel");
for (int qq = 0; qq < f; qq++)
{
list_class += _T(" list");
list_class += qq;
}
list_class += _T("))\n");
}
// chiudo il file delle classi selezionate
if (gsc_fclose(file) == GS_BAD) return GS_BAD;
if (flag_pre)
{
destFile = dwf_dir;
destFile += _T('/');
destFile += ACCESSGEOWHIPDB;
pathFile = GEOsimAppl::GEODIR + _T("\\") + GEOSAMPLEDIR + _T("\\") + ACCESSGEOWHIPSAMPLEDB;
// eventuale creazione del database
if ((gsc_path_exist(pathFile) == GS_GOOD) && (gsc_path_exist(destFile) == GS_BAD))
gsc_copyfile(pathFile, destFile);
C_2STR_LIST UDLProp(_T("Data Source"), destFile.get_name());
pConn = get_pDBCONNECTION_LIST()->get_Connection(NULL, &UDLProp);
if (prefix.len() > 0)
{
level1 = prefix;
level1 += _T("-");
WhereSql = _T("Level=");
WhereSql += _T("'");
WhereSql += prefix;
WhereSql += _T("'");
}
else
{
prefix = GS_EMPTYSTR;
WhereSql = GS_EMPTYSTR;
}
if (pConn->DelRows(_T("Coord"), WhereSql.get_name()) == GS_BAD) return GS_BAD;
if (pConn->InitInsRow(_T("Coord"), pRs) == GS_BAD) return GS_BAD;
}
// apro il file script
filescript = dwf_dir;
filescript += _T('/');
filescript += _T("geowhip.scr");
if ((filescr = gsc_fopen(filescript.get_name(), _T("w"))) == NULL)
{ gsc_fclose(filescr); GS_ERR_COD = eGSOpenFile; return GS_BAD; }
// apro il file url
fileurl = dwf_dir;
fileurl += _T('/');
fileurl += _T("geourl.scr");
if ((furl = gsc_fopen(fileurl.get_name(), _T("w"))) == NULL)
{ gsc_fclose(furl); GS_ERR_COD = eGSOpenFile; return GS_BAD; }
// memorizzo il valore di OSMODE e lo setto a 0 per disabilitarlo
if (fwprintf(furl, _T("(setq PrevOSMODE (getvar \"OSMODE\"))\nOSMODE 0\n")) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scrivo sul file di url l'apertura di un nuovo file
if (fwprintf(furl, _T("(command \"_.NEW\" \"_Y\" \"\")\n")) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scrivo nel file url la riga che apre il file sinottico
riga = _T("(command \"_.OPEN\" \"_Y\" \"");
riga += sinottico;
riga += _T("\")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
riga = _T("(command \"_.ZOOM\" \"_E\")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scrivo la riga che rende attivo il piano su cui inserire le etichette a cui
// agganciare l'URL
riga = _T("(command \"-LAYER\" \"_S\" \"geourl\" \"\")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// se flag_url=TRUE cerco tutti i testi presenti sul piano GEOURL inseriti dall'utente
if (flag_url)
{
C_RB_LIST Descr;
if ((entmask << acutBuildList(RTDXF0, _T("TEXT"), 8, _T("GEOURL"), 0)) == NULL)
return GS_BAD;
if (acedSSGet(_T("_X"), NULL, NULL, entmask.get_head(), sel_text) != RTNORM)
{ GS_ERR_COD = eGSInvalidLayer; return GS_BAD; }
// verifico se vi è corrispondenza biunivoca fra le poligonali ed i testi
// identificativi delle stesse
if (ads_sslength(sel_text, &lungh_selset_text) != RTNORM)
{
resbuf p;
acedGetVar(_T("ERRNO"), &p);
if (p.resval.rint != 0) { ads_ssfree(sel_text); return GS_BAD; }
}
else if (lungh_selset_text == 0) { ads_ssfree(sel_text); return GS_GOOD; }
if (lungh_selset_poly != lungh_selset_text)
//"\nMancata corrispondenza fra poligoni ed etichette"
{ acutPrintf(gsc_msg(788)); return GS_BAD; }
// scorro la lista delle entità trovate e ricavo il punto di inserimento e il
// valore del testo
i = 0;
while (acedSSName(sel_text, i++, ent) == RTNORM)
{
// ricavo il valore del testo
if (gsc_getInfoText(ent, &string) == GS_BAD)
{ads_ssfree(sel_text); return GS_BAD; }
string.alltrim();
gsc_strsep(string.get_name(), _T('-'), _T(' '));
if ((nod = new C_STR) == NULL)
{ GS_ERR_COD=eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
if (nod->set_name(string.get_name()) == GS_BAD)
{ ads_ssfree(sel_text); return GS_BAD; }
lista_url.add_tail(nod);
// ricavo il valore dell'altezza testo
if (gsc_getInfoText(ent, NULL, NULL, &h_text) == GS_BAD)
{ads_ssfree(sel_text);return GS_BAD; }
if ((nod1 = new C_REAL) == NULL)
{ GS_ERR_COD=eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
if (nod1->set_key(h_text) == GS_BAD) { ads_ssfree(sel_text);return GS_BAD; }
val_h_text.add_tail(nod1);
// ricavo lo stile del testo inserito
if (gsc_getInfoText(ent, NULL, &style_text) == GS_BAD)
{ads_ssfree(sel_text); return GS_BAD; }
if ((nod2 = new C_STR) == NULL)
{ GS_ERR_COD=eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
if (nod2->set_name(style_text.get_name()) == GS_BAD)
{ ads_ssfree(sel_text); return GS_BAD; }
val_style_text.add_tail(nod2);
Descr << acdbEntGet(ent);
// ricavo il flag di generazione testo
FlagTxt = 0;
if ((p = Descr.SearchType(71)) != NULL) FlagTxt = p->resval.rint;
if ((pInt = new C_INT(FlagTxt)) == NULL)
{ GS_ERR_COD = eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
val_gen_text.add_tail(pInt);
// ricavo il flag di allineamento orizzontale testo
FlagTxt = 0;
if ((p = Descr.SearchType(72)) != NULL) FlagTxt = p->resval.rint;
if ((pInt = new C_INT(FlagTxt)) == NULL)
{ GS_ERR_COD = eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
val_allinOriz_text.add_tail(pInt);
// ricavo il flag di allineamento verticale testo
FlagTxt = 0;
if ((p = Descr.SearchType(73)) != NULL) FlagTxt = p->resval.rint;
if ((pInt = new C_INT(FlagTxt)) == NULL)
{ GS_ERR_COD = eGSOutOfMem; ads_ssfree(sel_text); return GS_BAD; }
val_allinVert_text.add_tail(pInt);
// ricavo il punto di allineamento testo
ads_point_clear(ptAllinText);
if ((p = Descr.SearchType(11)) != NULL) ads_point_set(p->resval.rpoint, ptAllinText);
pt_allin_text.add_point(ptAllinText);
// ricavo il punto di inserimento
url_ins_point.add_ins_point(ent);
((C_POINT*)url_ins_point.get_cursor())->point[Z] = i;
}
}
// cancello tutti gli eventuali testi presenti sul piano GEOURL
riga = _T("(command \"_.ERASE\" (ssget \"X\" '((0 . \"TEXT\") (8 . \"GEOURL\")))\"\")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
k = 1; i = 0;
// scorro ss_poly e creo le zone spaziali di estrazione
while (acedSSName(ss_poly, i++, ent) == RTNORM)
{
// Modifiche Paolino ...
// la prima volta carica l' eventuale dwt, la seconda volta no !!!
// scrivo l'apertura di un nuovo file
if (loopCount == 1)
{
if (fwprintf(filescr, _T("(command \"_.NEW\" \"_Y\" \"\")\n")) < 0)
{ gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
}
else
{
if (flag_dwf == GS_GOOD)
{
if (fwprintf(filescr, _T("(command \"_.NEW\" \"_Y\" \"\")\n")) < 0)
{ gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
}
else
if (fwprintf(filescr, _T("(command \"_.NEW\" \"\")\n")) < 0)
{ gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
}
loopCount++;
stile_testo.clear();
// scrivo l'apertura di un nuovo file
// if (fwprintf(filescr, _T("(command \"_.NEW\" \"_Y\" \"\")\n")) < 0)
// { gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scrivo la lista delle classi
if (fwprintf(filescr, list_class.get_name()) < 0)
{ gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
list_vert_poly.remove_all();
if (list_vert_poly.add_vertex_point(ent, GS_GOOD) == GS_BAD)
{ ads_ssfree(ss_poly); return GS_BAD; }
// ricavo le coordinate del centroide dell'oggetto
if (gsc_get_centroidpoint(ent, p_centroid) == GS_BAD) return GS_BAD;
if (flag_url) // uso i testi inseriti sul sinottico con il loro p.to di inserimento
{
C_POINT *punto;
// cerco nella lista dei punti testo-utente il più vicino al centroide trovato
punto = url_ins_point.get_nearest(p_centroid);
rb << acutBuildList(RT3DPOINT, punto->point ,0);
// ricavo l'altezza del testo
altezza = (val_h_text.getptr_at((int) punto->point[Z]))->get_key_double();
// ricavo il valore dello stile associato al testo
stile_testo += (val_style_text.getptr_at((int) punto->point[Z]))->get_name();
// ricavo il valore del testo associato al punto
// copio in etichetta il valore che userò per agganciarlo all'URL del DWF
etichetta = level1;
etichetta += (lista_url.getptr_at((int) punto->point[Z]))->get_name();
etichetta.strtran(_T("\\"), _T("/"));
rb.get_head()->resval.rpoint[Z] = 0;
//((C_POINT*)url_ins_point.getptr_at((int)punto->point[Z]))->point[Z] = 0;
}
else // costruisco le etichette di URL in modo automatico con il prefisso 'sinot'
{
C_RB_LIST rb1;
etichetta = level1;
etichetta += _T("sinot");
etichetta += k;
// calcolo l'area dell'oggetto
if ((rb1 << ade_expreval(ent, _T(".area"), _T("real"))) == NULL)
{ GS_ERR_COD = eGSInvalidGraphCalc; return GS_BAD; }
ent_area = rb1.get_head()->resval.rreal;
// in funzione della sessione determino l'altezza del testo che inserirò
// come 'etichetta' di URL
altezza = ent_area/5000;
stile_testo += _T("STANDARD");
}
riga.clear();
riga += _T("(command \"_.TEXT\" \"_S\" \"");
riga += stile_testo.get_name();
riga += _T("\" '(");
if ((StrNum = gsc_rb2str(rb.get_head())) == NULL) return GS_BAD;
gsc_strsep(StrNum, _T(' '), _T(',')); // sostituisco eventuali ',' con ' '
riga += StrNum;
free(StrNum);
riga += _T(") ");
riga += altezza;
riga += _T(" 0.0 \""); // rotazione
riga += etichetta;
riga += _T("\")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
if (flag_dwg) // costruisco il nome del file .DWG da salvare
{
filedwg = dwf_dir;
filedwg += _T('/');
filedwg += etichetta;
filedwg += _T(".dwg");
if (gsc_path_conv(filedwg) == GS_BAD) return GS_BAD;
// converto nel filedwg eventuali "\" in "/"
filedwg.strtran(_T("\\"), _T("/"));
}
// costruisco il nome del file .DWF da salvare
filedwf = dwf_dir;
filedwf += _T('/');
filedwf += etichetta;
filedwf += _T(".dwf");
dbfiledwf = _T("./dwf/");
dbfiledwf += etichetta;
dbfiledwf += _T(".dwf");
if (gsc_path_conv(filedwf) == GS_BAD) return GS_BAD;
// converto nel filedwf eventuali "\" in "/"
filedwf.strtran(_T("\\"), _T("/"));
// costruisco l'indirizzo internet per l'URL
inet_addr_dwf = addr_inet;
inet_addr_dwf += etichetta;
inet_addr_dwf += _T(".dwf");
k++;
// scrivo la riga per effettuare l'attach dell'url che mi interessa
riga = _T("(command \"-hyperlink\" \"I\" \"O\" (entlast) \"\" \"");
riga += inet_addr_dwf;
riga += _T("\" \"\"");
if (flag_descr)
{
riga += _T("\"");
riga += text_descr;
riga += _T("\"");
}
else riga += _T("\"\"");
riga += _T(")\n");
if (fwprintf(furl, riga.get_name()) < 0)
{ gsc_fclose(furl); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scorro la lista dei vertici del poligono e costruisco la lista
// completa da scrivere sul file di script
if ((num_vert = list_vert_poly.get_count()) > 0)
{
presbuf p;
p = list_vert_poly.to_rb();
list_point.clear();
list_point += _T("(setq lista_punti '(");
f = 0;
// MODIFICA PAOLA
x1 = y1 = 1000000000000000;
x2 = y2 = 0;
for (int k=0; k<num_vert; k++)
{
// testo se spezzare la lista dei punti poligono
if (k > 0)
{
if (k % 5 == 0)
{
list_point += _T("))\n(setq list");
list_point += f++;
list_point += _T(" '(");
}
else list_point += _T(" ");
}
if (p->restype == RTPOINT || p->restype == RT3DPOINT)
list_point += _T("(");
if ((StrNum = gsc_rb2str(p)) == NULL) return GS_BAD;
gsc_strsep(StrNum, _T(' '), _T(',')); // sostituisco eventuali ',' con ' '
list_point += StrNum;
free(StrNum);
if (p->restype == RTPOINT || p->restype == RT3DPOINT)
list_point += _T(")");
// solo per rettangoli
if (num_vert == 4)
{
if (x1 >= p->resval.rpoint[0])
x1 = p->resval.rpoint[0];
if (y1 >= p->resval.rpoint[1])
y1 = p->resval.rpoint[1];
if (x2 <= p->resval.rpoint[0])
x2 = p->resval.rpoint[0];
if (y2 <= p->resval.rpoint[1])
y2 = p->resval.rpoint[1];
}
p = p->rbnext;
}
list_point += _T("))\n");
}
if (f > 0)
{
list_point += _T("(setq lista_punti (append lista_punti");
for (int qq = 0; qq < f; qq++)
{
list_point += _T(" list");
list_point += qq;
}
list_point += _T("))\n");
}
// scrivo sul file di script la lista dei punti che passerò a gs_extract_4_whip
if (fwprintf(filescr, list_point.get_name()) < 0)
{ gsc_fclose(filescr); GS_ERR_COD = eGSWriteFile; return GS_BAD; }
// scrivo sul file di script la chiamata a gs_extract_4_whip