ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/fichier/src/mg_file.cpp
Revision: 114
Committed: Thu Jun 26 16:16:03 2008 UTC (16 years, 10 months ago) by souaissa
Original Path: magic/lib/fichier/fichier/src/mg_file.cpp
File size: 55136 byte(s)
Log Message:
Mise a jour de mg_file

File Contents

# User Rev Content
1 foucault 27 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4     // Jean Christophe Cuilli�e et Vincent FRANCOIS
5     // D�artement de G�ie M�anique - UQTR
6     //------------------------------------------------------------
7     // Le projet MAGIC est un projet de recherche du d�artement
8     // de g�ie m�anique de l'Universit�du Qu�ec �
9     // Trois Rivi�es
10     // Les librairies ne peuvent �re utilis�s sans l'accord
11     // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // mg_file.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 �11H22
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26    
27     #pragma hdrstop
28    
29     #include "mg_file.h"
30     #include "pars_argument.h"
31     #include "parse.h"
32     #include "step_surface.h"
33     #include "step_courbe.h"
34     #include "step_point.h"
35     #include "acis_surface.h"
36     #include "acis_courbe.h"
37     #include "acis_point.h"
38     #include "sld_point.h"
39     #include "sld_courbe.h"
40     #include "sld_surface.h"
41     #include "sld_fonction.h"
42     #include "lc_point.h"
43 souaissa 114 //OCC
44     #include "OCC_Surface.h"
45     #include "OCC_POINT.h"
46     #include "OCC_Courbe.h"
47     #include "OCC_FONCTION1.h"
48 foucault 27
49     //---------------------------------------------------------------------------
50     // CAD4FE Headers
51     #include "CAD4FE_MCEdge.h"
52     #include "CAD4FE_MCFace.h"
53     #include "CAD4FE_MCVertex.h"
54     #include "CAD4FE_PolySurface.h"
55     #include "CAD4FE_PolyCurve.h"
56     #include "CAD4FE_MCNode.h"
57     #include "CAD4FE_MCSegment.h"
58     #include "CAD4FE_MCTriangle.h"
59     #include "CAD4FE_m3d_MCTriangle.h"
60     //---------------------------------------------------------------------------
61    
62    
63     //---------------------------------------------------------------------------
64     #pragma package(smart_init)
65    
66     MG_FILE::MG_FILE():MG_GESTIONNAIRE()
67     {
68     }
69    
70     MG_FILE::MG_FILE(char* chemin):MG_GESTIONNAIRE()
71     {
72     code_de_lecture=lire(chemin);
73     }
74    
75     MG_FILE::~MG_FILE()
76     {
77     }
78    
79     int MG_FILE::get_code_de_lecture(void)
80     {
81     return code_de_lecture;
82     }
83    
84     long MG_FILE::cid(std::string str)
85     {
86     const char *p=str.c_str();
87     if (*p=='$') return atol(p+1);
88     return -1;
89     }
90    
91     int MG_FILE::lire(char* chemin)
92     {
93     FILE *in;
94     char ligne[3000];
95     in=fopen(chemin,"rt");
96     if (in==NULL) return 0;
97     PARS_ARGUMENT param[100];
98     PARSE parse;
99    
100     MG_GEOMETRIE *mggeo;
101     std::multimap<CAD4FE::MCVertex*, unsigned long> mapMergedRefVertices;
102     bool updatedMergedRefVertices = false;
103 souaissa 114
104 foucault 27 do
105     {
106     int ierr;
107     std::string ligne=parse.lire(in,';',&ierr);
108     parse.decode(ligne.c_str(),"@;",param);
109     const char *chaine=param[0].argument[0].c_str();
110     if ((chaine[0]=='/') && (chaine[1]=='/'))
111     {
112     if ((chaine[2]=='*')&&(chaine[3]=='i'))
113     {
114     unsigned long id;
115     sscanf(chaine,"//*i:%lu;",&id);
116     entiteidmax=id;
117     }
118     }
119     else if (param[0].argument[0]!="FIN")
120     {
121     parse.decode(ligne.c_str(),"%@=@(@);",param);
122     std::string entite=param[1].argument[0];
123     long id=atol(param[0].argument[0].c_str());
124     std::string data=param[2].argument[0] ;
125     MG_MAILLAGE *mgmai;
126     FEM_MAILLAGE *femmai;
127     if (entite=="GEOMETRIE")
128     {
129     parse.decode(data.c_str(),"@,@,@,@",param+2);
130     double unite=atof(param[2].argument[0].c_str());
131     std::string typegeo=param[3].argument[0];
132     std::string chemin=param[4].argument[0];
133     #ifdef BREP_STEP
134     if (typegeo=="STEP")
135     {
136     fichstep.change_nom((char *)chemin.c_str());
137     int code=fichstep.lire();
138     if (code==0) return 0;
139     mggeo=new MG_GEOMETRIE("STEP",id,fichstep.get_nom(),unite);
140     ajouter_mg_geometrie(mggeo);
141     }
142     #endif
143     #ifdef BREP_SAT
144     if (typegeo=="ACIS")
145     {
146     fichsat.change_nom((char *)chemin.c_str());
147     int code=fichsat.lire();
148     if (code==0) return 0;
149     mggeo=new MG_GEOMETRIE("ACIS",id,fichsat.get_nom(),unite);
150     ajouter_mg_geometrie(mggeo);
151     }
152     #endif
153     #ifdef BREP_SLD
154     if (typegeo=="SLD")
155     {
156     fonction->Connection();
157     fonction->OuvrirFichier((char *)chemin.c_str() );
158     mggeo=new MG_GEOMETRIE("SLD",id,chemin.c_str(),unite);
159     ajouter_mg_geometrie(mggeo);
160     ouvertsld=1;
161     }
162     #endif
163 souaissa 114
164     #ifdef BREP_OCC
165     if (typegeo=="OCC")
166     {
167     fonction1->OuvrirFichier((char *)chemin.c_str() );
168     mggeo=new MG_GEOMETRIE("OCC",chemin.c_str(),unite);
169     ajouter_mg_geometrie(mggeo);
170     }
171     #endif
172    
173 foucault 27 std::string nommat="";
174     if (param[5].argument[0]!="")
175 souaissa 114 nommat=param[5].argument[0];
176     mggeo->change_gest_materiau((char*)nommat.c_str());
177 foucault 27 }
178     if (entite=="VOLUME")
179     {
180     parse.decode(data.c_str(),"@,@,@,@,(&)",param+2);
181     MG_VOLUME* mgvol=new MG_VOLUME(param[2].argument[0],id);
182     mggeo->ajouter_mg_volume(mgvol);
183     int nummat=atoi((char*)param[4].argument[0].c_str());
184     mgvol->change_num_materiau(nummat);
185     int nb=atoi(param[5].argument[0].c_str());
186     if (nb!=0)
187     {
188     for (int i=0;i<nb;i++)
189     {
190     parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7);
191     char nom[3];
192     double val;
193     strcpy(nom,param[7].argument[0].c_str());
194     val=atof(param[8].argument[0].c_str());
195     mgvol->ajouter_ccf(nom,val);
196     }
197     }
198     }
199     if (entite=="COQUE")
200     {
201     parse.decode(data.c_str(),"@,@,@,@,(&)",param+2);
202     MG_COQUE* mgcoq=new MG_COQUE(param[2].argument[0],id);
203     mggeo->ajouter_mg_coque(mgcoq);
204     int nummat=atoi((char*)param[4].argument[0].c_str());
205     mgcoq->change_num_materiau(nummat);
206     int nb=atoi(param[5].argument[0].c_str());
207     if (nb!=0)
208     {
209     for (int i=0;i<nb;i++)
210     {
211     parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7);
212     char nom[3];
213     double val;
214     strcpy(nom,param[7].argument[0].c_str());
215     val=atof(param[8].argument[0].c_str());
216     mgcoq->ajouter_ccf(nom,val);
217     }
218     }
219     }
220     if (entite=="POUTRE")
221     {
222     parse.decode(data.c_str(),"@,@,@,@,(&)",param+2);
223     MG_POUTRE* mgpoutre=new MG_POUTRE(param[2].argument[0],id);
224     mggeo->ajouter_mg_poutre(mgpoutre);
225     int nummat=atoi((char*)param[4].argument[0].c_str());
226     mgpoutre->change_num_materiau(nummat);
227     int nb=atoi(param[5].argument[0].c_str());
228     if (nb!=0)
229     {
230     for (int i=0;i<nb;i++)
231     {
232     parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7);
233     char nom[3];
234     double val;
235     strcpy(nom,param[7].argument[0].c_str());
236     val=atof(param[8].argument[0].c_str());
237     mgpoutre->ajouter_ccf(nom,val);
238     }
239     }
240     }
241     if (entite=="COQUILLE")
242     {
243     parse.decode(data.c_str(),"@,@",param+2);
244     long ident=cid(param[2].argument[0]);
245     MG_VOLUME* mgvol=mggeo->get_mg_volumeid(ident);
246     MG_COQUE* mgcoq=mggeo->get_mg_coqueid(ident);
247     if (mgvol!=NULL)
248     {
249     MG_COQUILLE* mgcoq=new MG_COQUILLE(id,mgvol);
250     mggeo->ajouter_mg_coquille(mgcoq,mgvol);
251     }
252     if (mgcoq!=NULL)
253     {
254     MG_COQUILLE* mgcoquille=new MG_COQUILLE(id,mgcoq);
255     mggeo->ajouter_mg_coquille(mgcoquille,mgcoq);
256     }
257    
258     }
259     #ifdef BREP_STEP
260     if (entite=="SURFACE_STEP")
261     {
262     parse.decode(data.c_str(),"@",param+2);
263     long idstepsuf=atol(param[2].argument[0].c_str());
264     ST_SURFACE *stsurf=fichstep.lst_surface.getid(idstepsuf);
265     STEP_SURFACE* stepsurf=new STEP_SURFACE(id,stsurf);
266     mggeo->ajouter_mg_surface(stepsurf);
267     }
268     if (entite=="COURBE_STEP")
269     {
270     parse.decode(data.c_str(),"@",param+2);
271     long idstepcur=atol(param[2].argument[0].c_str());
272     ST_COURBE *stcur=fichstep.lst_courbe.getid(idstepcur);
273     STEP_COURBE* stepcur=new STEP_COURBE(id,stcur);
274     mggeo->ajouter_mg_courbe(stepcur);
275     }
276    
277     if (entite=="POINT_STEP")
278     {
279     parse.decode(data.c_str(),"@",param+2);
280     long idsteppt=atol(param[2].argument[0].c_str());
281     ST_POINT *stpt=fichstep.lst_point.getid(idsteppt);
282     STEP_POINT* steppt=new STEP_POINT(id,stpt);
283     mggeo->ajouter_mg_point(steppt);
284     }
285    
286     #endif
287     #ifdef BREP_SAT
288     if (entite=="SURFACE_SAT")
289     {
290     parse.decode(data.c_str(),"@",param+2);
291     long idsatsuf=atol(param[2].argument[0].c_str());
292     SAT_SURFACE *satsurf=fichsat.lst_surface.getid(idsatsuf);
293     ACIS_SURFACE* acissurf=new ACIS_SURFACE(id,satsurf);
294     mggeo->ajouter_mg_surface(acissurf);
295     }
296     if (entite=="COURBE_SAT")
297     {
298     parse.decode(data.c_str(),"@",param+2);
299     long idsatcur=atol(param[2].argument[0].c_str());
300     SAT_COURBE *satcur=fichsat.lst_courbe.getid(idsatcur);
301     ACIS_COURBE* aciscur=new ACIS_COURBE(id,satcur);
302     mggeo->ajouter_mg_courbe(aciscur);
303     }
304    
305     if (entite=="POINT_SAT")
306     {
307     parse.decode(data.c_str(),"@",param+2);
308     long idsatpt=atol(param[2].argument[0].c_str());
309     SAT_POINT *satpt=fichsat.lst_point.getid(idsatpt);
310     ACIS_POINT* acispt=new ACIS_POINT(id,satpt);
311     mggeo->ajouter_mg_point(acispt);
312     }
313    
314     #endif
315     #ifdef BREP_SLD
316     if (entite=="SURFACE_SLD")
317     {
318     parse.decode(data.c_str(),"@",param+2);
319     CComPtr<IFace2> swface;
320     char* idsld=(char*)param[2].argument[0].c_str();
321     SLD_SURFACE* sldsurf=new SLD_SURFACE(id,idsld,*fonction);
322     mggeo->ajouter_mg_surface(sldsurf);
323     }
324     if (entite=="COURBE_SLD")
325     {
326     parse.decode(data.c_str(),"@",param+2);
327     CComPtr<IEdge> swedge;
328     char* idsld=(char*)param[2].argument[0].c_str();
329     SLD_COURBE* sldcrb=new SLD_COURBE(id,idsld,*fonction);
330     mggeo->ajouter_mg_courbe(sldcrb);
331     }
332    
333     if (entite=="POINT_SLD")
334     {
335     parse.decode(data.c_str(),"@",param+2);
336     CComPtr<IVertex> swvertex;
337     char* idsld=(char*)param[2].argument[0].c_str();
338     SLD_POINT* sldpoint=new SLD_POINT(id,idsld,*fonction);
339     mggeo->ajouter_mg_point(sldpoint);
340     }
341    
342     #endif
343 souaissa 114
344     #ifdef BREP_OCC
345     if (entite=="SURFACE_OCC")
346     {
347     parse.decode(data.c_str(),"@",param+2);
348     Geom_Surface* surf;
349     char* idocc=(char*)param[2].argument[0].c_str();
350     OCC_SURFACE* occsurf=new OCC_SURFACE(id,surf);
351     mggeo->ajouter_mg_surface(occsurf);
352     }
353     if (entite=="COURBE_OCC")
354     {
355     parse.decode(data.c_str(),"@",param+2);
356     Geom_Curve* crb;
357     char* idocc=(char*)param[2].argument[0].c_str();
358     OCC_COURBE* occcrb=new OCC_COURBE(id,crb);
359     mggeo->ajouter_mg_courbe(occcrb);
360     }
361     if (entite=="POINT_OCC")
362     {
363     parse.decode(data.c_str(),"@",param+2);
364     Geom_CartesianPoint* pt;
365     char* idocc=(char*)param[2].argument[0].c_str();
366     OCC_POINT* occpoint=new OCC_POINT(id,pt);
367     mggeo->ajouter_mg_point(occpoint);
368     }
369     #endif
370 foucault 27 if (entite=="CAD4FE_POLYCURVE")
371     {
372 souaissa 114 CAD4FE::PolyCurve * polycurve = NULL;
373     parse.decode(data.c_str(),"@,(&)",param+2);
374     int nb = atoi(param[2].argument[0].c_str());
375    
376     if (nb == 0)
377     {
378     printf("PolyCurve %d is formed with reference vertex : ", id);
379     parse.decode(param[3].argument[0].c_str(),"@",param+4);
380     int idRefVertex;
381     idRefVertex=cid(param[4].argument[0].c_str());
382     printf("%d ;\n ", idRefVertex);
383     MG_SOMMET * refVertex = mggeo->get_mg_sommetid(idRefVertex);
384     polycurve = new CAD4FE::PolyCurve(refVertex);
385     }
386     else
387     {
388     printf("PolyCurve %d is formed with reference edges : ", id);
389 foucault 27 polycurve = new CAD4FE::PolyCurve;
390     for (int i=0;i<nb;i++)
391     {
392     parse.decode(param[3].argument[i].c_str(),"@",param+4);
393     int idRefEdge;
394     idRefEdge=cid(param[4].argument[0].c_str());
395     printf("%d ; ", idRefEdge);
396     MG_ARETE * refEdge = mggeo->get_mg_areteid(idRefEdge);
397 souaissa 114 CAD4FE::PolyCurve tmpPC(refEdge);
398 foucault 27 polycurve->Merge(tmpPC);
399     }
400     printf("\n");
401 souaissa 114 }
402    
403 foucault 27 polycurve->change_id(id);
404     mggeo->ajouter_mg_courbe(polycurve);
405     }
406    
407    
408     if (entite=="CAD4FE_POLYSURFACE")
409     {
410     CAD4FE::PolySurface * polysurface = new CAD4FE::PolySurface;
411     polysurface->change_id(id);
412     mggeo->ajouter_mg_surface(polysurface);
413    
414     parse.decode(data.c_str(),"@,(&)",param+2);
415    
416     int nb = atoi(param[2].argument[0].c_str());
417     printf("PolySurface %d is formed with reference faces : ", id);
418     for (int i=0;i<nb;i++)
419     {
420     parse.decode(param[3].argument[i].c_str(),"@",param+4);
421     int idRefFace;
422     idRefFace=cid(param[4].argument[0].c_str());
423     printf("%d ; ", idRefFace);
424    
425     MG_FACE * refFace = mggeo->get_mg_faceid(idRefFace);
426     CAD4FE::PolySurface tmpSF(refFace);
427     polysurface->Merge(tmpSF);
428     }
429    
430     printf("\n");
431     }
432     if (entite=="CAD4FE_MCEDGE")
433     {
434     parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2);
435    
436     std::string idOriginal = param[2].argument[0];
437     long idPolyCurve=cid(param[3].argument[0]);
438     CAD4FE::PolyCurve * polycurve = (CAD4FE::PolyCurve *) mggeo->get_mg_courbeid(idPolyCurve);
439    
440     // sense is not used because a MCEdge always has
441     // a sense = 1 !
442     // (because polycurve domain is equal to mcEdge domain)
443     CAD4FE::MCEdge * mcEdge = new CAD4FE::MCEdge(idOriginal, polycurve);
444     mcEdge->change_id(id);
445     mggeo->ajouter_mg_arete(mcEdge);
446    
447     int nb=atoi(param[7].argument[0].c_str());
448     if (nb!=0)
449     {
450     for (int i=0;i<nb;i++)
451     {
452     parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9);
453     char nom[3];
454     double val;
455     strcpy(nom,param[9].argument[0].c_str());
456     val=atof(param[10].argument[0].c_str());
457     mcEdge->ajouter_ccf(nom,val);
458     }
459     }
460     }
461     if (entite=="CAD4FE_MCFACE")
462     {
463 foucault 64 parse.decode(data.c_str(),"@,@,@,@,@,(&)",param+2);
464 foucault 27
465     std::string idOriginal = param[2].argument[0];
466     long idPolySurface=cid(param[3].argument[0]);
467     CAD4FE::PolySurface * polysurface = (CAD4FE::PolySurface *) mggeo->get_mg_surfaceid(idPolySurface);
468    
469     CAD4FE::MCFace * mcFace = new CAD4FE::MCFace(idOriginal, polysurface);
470     mcFace->change_id(id);
471     mggeo->ajouter_mg_face(mcFace);
472    
473     int nb=atoi(param[6].argument[0].c_str());
474     if (nb!=0)
475     {
476     for (int i=0;i<nb;i++)
477     {
478     parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8);
479     char nom[3];
480     double val;
481     strcpy(nom,param[8].argument[0].c_str());
482     val=atof(param[9].argument[0].c_str());
483     mcFace->ajouter_ccf(nom,val);
484     }
485     }
486     }
487     if (entite=="CAD4FE_MCVERTEX")
488     {
489     parse.decode(data.c_str(),"@,@,@,(&),@,(&)",param+2);
490     std::string idOriginal = param[2].argument[0];
491     long idsom=cid(param[3].argument[0]);
492     MG_SOMMET * mgsom = mggeo->get_mg_sommetid(idsom);
493     CAD4FE::MCVertex * mcVertex = new CAD4FE::MCVertex(mgsom);
494     mcVertex->change_id(id);
495     mggeo->ajouter_mg_sommet(mcVertex);
496     int nb_ref_vertex=atoi(param[4].argument[0].c_str());
497     if (nb_ref_vertex!=0)
498     {
499     for (int i=0;i<nb_ref_vertex;i++)
500     {
501     unsigned long idRefVertex=cid(param[5].argument[i]);
502     mcVertex->GetMergedRefVertices()[idRefVertex] = NULL;
503     mapMergedRefVertices.insert(std::make_pair(mcVertex,idRefVertex));
504     }
505     }
506     int nb_ccf=atoi(param[4+2].argument[0].c_str());
507     if (nb_ccf!=0)
508     {
509     for (int i=0;i<nb_ccf;i++)
510     {
511     parse.decode(param[5+2].argument[i].c_str(),"(@,@)",param+6+2);
512     char nom_ccf[3];
513     double val_ccf;
514     strcpy(nom_ccf,param[6+2].argument[0].c_str());
515     val_ccf=atof(param[7+2].argument[0].c_str());
516     mgsom->ajouter_ccf(nom_ccf,val_ccf);
517     }
518     }
519     }
520 souaissa 114
521 foucault 27 if (entite=="FACE")
522     {
523     parse.decode(data.c_str(),"@,@,(@),@,@,(&)",param+2);
524     long idsurf=cid(param[3].argument[0]);
525     int sens=atoi(param[5].argument[0].c_str());
526     MG_SURFACE* mgsurf=mggeo->get_mg_surfaceid(idsurf);
527     MG_FACE* mgface=new MG_FACE(param[2].argument[0],id,mgsurf,sens);
528     mggeo->ajouter_mg_face(mgface);
529     int nb=atoi(param[6].argument[0].c_str());
530     if (nb!=0)
531     {
532     for (int i=0;i<nb;i++)
533     {
534     parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8);
535     char nom[3];
536     double val;
537     strcpy(nom,param[8].argument[0].c_str());
538     val=atof(param[9].argument[0].c_str());
539     mgface->ajouter_ccf(nom,val);
540     }
541     }
542     }
543     if (entite=="COFACE")
544     {
545     parse.decode(data.c_str(),"@,@,@",param+2);
546     long idface=cid(param[2].argument[0]);
547     long idcoq=cid(param[3].argument[0]);
548     int sens=atoi(param[4].argument[0].c_str());
549     MG_FACE* mgface=mggeo->get_mg_faceid(idface);
550     MG_COQUILLE* mgcoq=mggeo->get_mg_coquilleid(idcoq);
551     MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(id,mgface,mgcoq,sens);
552     mgcoq->ajouter_mg_coface(mgcoface);
553     }
554     if (entite=="BOUCLE")
555     {
556     parse.decode(data.c_str(),"@,(@)",param+2);
557     long ident=cid(param[2].argument[0]);
558     MG_FACE* mgface=mggeo->get_mg_faceid(ident);
559     MG_POUTRE* mgpoutre=mggeo->get_mg_poutreid(ident);
560     if (mgface!=NULL)
561     {
562     MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgface);
563     mggeo->ajouter_mg_boucle(mgbou,mgface);
564     }
565     if (mgpoutre!=NULL)
566     {
567     MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgpoutre);
568     mggeo->ajouter_mg_boucle(mgbou,mgpoutre);
569     }
570     }
571     if (entite=="POINT")
572     {
573     parse.decode(data.c_str(),"@,@,@",param+2);
574     double xyz[3];
575     xyz[0]=atof(param[2].argument[0].c_str());
576     xyz[1]=atof(param[3].argument[0].c_str());
577     xyz[2]=atof(param[4].argument[0].c_str());
578     LC_POINT* point=new LC_POINT(id,xyz);
579     mggeo->ajouter_mg_point(point);
580     }
581     if (entite=="SOMMET")
582     {
583     parse.decode(data.c_str(),"@,@,@,(&)",param+2);
584     long idpoint=cid(param[3].argument[0]);
585     MG_POINT* mgpt=mggeo->get_mg_pointid(idpoint);
586     MG_SOMMET* mgsom=new MG_SOMMET(param[2].argument[0],id,mgpt);
587     mggeo->ajouter_mg_sommet(mgsom);
588     int nb=atoi(param[4].argument[0].c_str());
589     if (nb!=0)
590     {
591     for (int i=0;i<nb;i++)
592     {
593     parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6);
594     char nom[3];
595     double val;
596     strcpy(nom,param[6].argument[0].c_str());
597     val=atof(param[7].argument[0].c_str());
598     mgsom->ajouter_ccf(nom,val);
599     }
600     }
601     }
602     if (entite=="ARETE")
603     {
604     parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2);
605     long idcur=cid(param[3].argument[0]);
606     int sens=atoi(param[6].argument[0].c_str());
607     MG_COURBE* mgcur=mggeo->get_mg_courbeid(idcur);
608     MG_ARETE* mgarete=new MG_ARETE(param[2].argument[0],id,mgcur,sens);
609     mggeo->ajouter_mg_arete(mgarete);
610     int nb=atoi(param[7].argument[0].c_str());
611     if (nb!=0)
612     {
613     for (int i=0;i<nb;i++)
614     {
615     parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9);
616     char nom[3];
617     double val;
618     strcpy(nom,param[9].argument[0].c_str());
619     val=atof(param[10].argument[0].c_str());
620     mgarete->ajouter_ccf(nom,val);
621     }
622     }
623     }
624     if (entite=="COSOMMET")
625     {
626     parse.decode(data.c_str(),"@,@,@",param+2);
627     long idsom=cid(param[2].argument[0]);
628     long idarete=cid(param[3].argument[0]);
629     int num=atoi(param[4].argument[0].c_str());
630     MG_SOMMET* mgsom=mggeo->get_mg_sommetid(idsom);
631     MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete);
632     MG_COSOMMET* mgcosom=mggeo->ajouter_mg_cosommet(id,mgarete,mgsom);
633     if (num==1) mgarete->changer_cosommet1(mgcosom);
634     if (num==2) mgarete->changer_cosommet2(mgcosom);
635     }
636     if (entite=="COARETE")
637     {
638     parse.decode(data.c_str(),"@,@,@",param+2);
639     long idarete=cid(param[2].argument[0]);
640     long idboucle=cid(param[3].argument[0]);
641     int sens=atoi(param[4].argument[0].c_str());
642     MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete);
643     MG_BOUCLE* mgboucle=mggeo->get_mg_boucleid(idboucle);
644     MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(id,mgarete,mgboucle,sens);
645     mgboucle->ajouter_mg_coarete(mgcoarete);
646     }
647     if (entite=="VISU_COURBE")
648     {
649     parse.decode(data.c_str(),"@,@,@,@,@,@",param+2);
650     double xyz1[3];
651     double xyz2[3];
652     xyz1[0]=atof(param[2].argument[0].c_str());
653     xyz1[1]=atof(param[3].argument[0].c_str());
654     xyz1[2]=atof(param[4].argument[0].c_str());
655     xyz2[0]=atof(param[5].argument[0].c_str());
656     xyz2[1]=atof(param[6].argument[0].c_str());
657     xyz2[2]=atof(param[7].argument[0].c_str());
658     MG_VISU_COURBE* mgcrb=new MG_VISU_COURBE(id,xyz1,xyz2);
659     mggeo->ajouter_mg_visu_courbe(mgcrb);
660     }
661     if (entite=="MAILLAGE")
662     {
663     parse.decode(data.c_str(),"@",param+2);
664     long idgeo=cid(param[2].argument[0]);
665     MG_GEOMETRIE* mggeo=get_mg_geometrieid(idgeo);
666     mgmai=new MG_MAILLAGE(id,mggeo);
667     ajouter_mg_maillage(mgmai);
668     }
669     if (entite=="FEM_MAILLAGE")
670     {
671     parse.decode(data.c_str(),"@,@,@",param+2);
672     int degre=atoi(param[2].argument[0].c_str());
673     long idmai=cid(param[3].argument[0]);
674     long idgeo=cid(param[4].argument[0]);
675     MG_GEOMETRIE* mggeo=get_mg_geometrieid(idgeo);
676     MG_MAILLAGE* mgmai=get_mg_maillageid(idmai);
677     femmai=new FEM_MAILLAGE(id,mggeo,mgmai,degre);
678     ajouter_fem_maillage(femmai);
679     }
680     if (entite=="NOEUD")
681     {
682 francois 35 parse.decode(data.c_str(),"@,@,@,@,@",param+2);
683 foucault 27 long idtopo=cid(param[2].argument[0]);
684     double x=atof(param[3].argument[0].c_str());
685     double y=atof(param[4].argument[0].c_str());
686     double z=atof(param[5].argument[0].c_str());
687 francois 35 int ori=atoi(param[6].argument[0].c_str());
688 foucault 27 MG_ELEMENT_TOPOLOGIQUE* topo;
689     if (idtopo>-1)
690     {
691     topo=mggeo->get_mg_sommetid(idtopo);
692     if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo);
693     if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo);
694     if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo);
695     }
696     else topo=NULL;
697 francois 35 MG_NOEUD* noeud=new MG_NOEUD(id,topo,x,y,z,ori);
698 foucault 27 mgmai->ajouter_mg_noeud(noeud);
699     }
700     if (entite=="FEM_NOEUD")
701     {
702     parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2);
703     long idtopo=cid(param[2].argument[0]);
704     long idmai=cid(param[3].argument[0]);
705     double x=atof(param[4].argument[0].c_str());
706     double y=atof(param[5].argument[0].c_str());
707     double z=atof(param[6].argument[0].c_str());
708     int num=atoi(param[7].argument[0].c_str());
709     int numopt=atoi(param[8].argument[0].c_str());
710     MG_ELEMENT_MAILLAGE* elmai;
711     if (idmai>-1)
712     {
713     elmai=mgmai->get_mg_noeudid(idmai);
714     if (elmai==NULL) elmai=mgmai->get_mg_segmentid(idmai);
715     if (elmai==NULL) elmai=mgmai->get_mg_triangleid(idmai);
716     if (elmai==NULL) elmai=mgmai->get_mg_tetraid(idmai);
717     }
718     else elmai=NULL;
719     FEM_NOEUD* noeud;
720     if (elmai!=NULL) noeud=new FEM_NOEUD(id,elmai,x,y,z);
721     else
722     {
723     MG_ELEMENT_TOPOLOGIQUE* topo;
724     if (idtopo>-1)
725     {
726     topo=mggeo->get_mg_sommetid(idtopo);
727     if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo);
728     if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo);
729     if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo);
730     }
731     else topo=NULL;
732     noeud=new FEM_NOEUD(id,topo,x,y,z);
733     }
734     noeud->change_numero(num);
735     noeud->change_numero_opt(numopt);
736     femmai->ajouter_fem_noeud(noeud);
737     }
738     if (entite=="SEGMENT")
739     {
740 francois 35 parse.decode(data.c_str(),"@,@,@,@",param+2);
741 foucault 27 long idtopo=cid(param[2].argument[0]);
742     long idn1=cid(param[3].argument[0]);
743     long idn2=cid(param[4].argument[0]);
744 francois 35 int ori=atoi(param[5].argument[0].c_str());
745 foucault 27 MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1);
746     MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2);
747     MG_ELEMENT_TOPOLOGIQUE* topo;
748     if (idtopo>-1)
749     {
750     topo=mggeo->get_mg_areteid(idtopo);
751     if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo);
752     if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo);
753     }
754     else topo=NULL;
755 francois 35 MG_SEGMENT* seg=new MG_SEGMENT(id,topo,noeud1,noeud2,ori);
756 foucault 27 mgmai->ajouter_mg_segment(seg);
757     }
758     if (entite=="FEM_SEGMENT2")
759     {
760     parse.decode(data.c_str(),"@,@,@,@",param+2);
761     long idmai=cid(param[3].argument[0]);
762     long idn1=cid(param[4].argument[0]);
763     long idn2=cid(param[5].argument[0]);
764     FEM_NOEUD* tab[2];
765     tab[0]=femmai->get_fem_noeudid(idn1);
766     tab[1]=femmai->get_fem_noeudid(idn2);
767     MG_ELEMENT_MAILLAGE* elmai;
768     if (idmai>-1)
769     elmai=mgmai->get_mg_segmentid(idmai);
770     else elmai=NULL;
771     FEM_SEGMENT2* seg=new FEM_SEGMENT2(id,elmai,tab);
772     femmai->ajouter_fem_segment(seg);
773     }
774     if (entite=="FEM_SEGMENT3")
775     {
776     parse.decode(data.c_str(),"@,@,@,@,@",param+2);
777     long idmai=cid(param[3].argument[0]);
778     long idn1=cid(param[4].argument[0]);
779     long idn2=cid(param[5].argument[0]);
780     long idn3=cid(param[6].argument[0]);
781     FEM_NOEUD* tab[3];
782     tab[0]=femmai->get_fem_noeudid(idn1);
783     tab[1]=femmai->get_fem_noeudid(idn2);
784     tab[2]=femmai->get_fem_noeudid(idn3);
785     MG_ELEMENT_MAILLAGE* elmai;
786     if (idmai>-1)
787     elmai=mgmai->get_mg_segmentid(idmai);
788     else elmai=NULL;
789     FEM_SEGMENT3* seg=new FEM_SEGMENT3(id,elmai,tab);
790     femmai->ajouter_fem_segment(seg);
791     }
792     if (entite=="TRIANGLE")
793     {
794 francois 35 parse.decode(data.c_str(),"@,@,@,@,@",param+2);
795 foucault 27 long idtopo=cid(param[2].argument[0]);
796     long idn1=cid(param[3].argument[0]);
797     long idn2=cid(param[4].argument[0]);
798     long idn3=cid(param[5].argument[0]);
799 francois 35 int ori=atoi(param[6].argument[0].c_str());
800 foucault 27 MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1);
801     MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2);
802     MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3);
803     MG_ELEMENT_TOPOLOGIQUE* topo;
804     if (idtopo>-1)
805     {
806     topo=mggeo->get_mg_faceid(idtopo);
807     if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo);
808     }
809     else topo=NULL;
810 francois 35 mgmai->ajouter_mg_triangle(topo,noeud1,noeud2,noeud3,ori,id);
811 foucault 27 }
812     if (entite=="FEM_TRIANGLE3")
813     {
814     parse.decode(data.c_str(),"@,@,@,@,@",param+2);
815     long idmai=cid(param[3].argument[0]);
816     long idn1=cid(param[4].argument[0]);
817     long idn2=cid(param[5].argument[0]);
818     long idn3=cid(param[6].argument[0]);
819     FEM_NOEUD* tab[3];
820     tab[0]=femmai->get_fem_noeudid(idn1);
821     tab[1]=femmai->get_fem_noeudid(idn2);
822     tab[2]=femmai->get_fem_noeudid(idn3);
823     MG_ELEMENT_MAILLAGE* elmai;
824     if (idmai>-1)
825     elmai=mgmai->get_mg_triangleid(idmai);
826     else elmai=NULL;
827     FEM_TRIANGLE3* tri=new FEM_TRIANGLE3(id,elmai,tab);
828     femmai->ajouter_fem_triangle(tri);
829     }
830     if (entite=="FEM_TRIANGLE6")
831     {
832     parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2);
833     long idmai=cid(param[3].argument[0]);
834     long idn1=cid(param[4].argument[0]);
835     long idn2=cid(param[5].argument[0]);
836     long idn3=cid(param[6].argument[0]);
837     long idn4=cid(param[7].argument[0]);
838     long idn5=cid(param[8].argument[0]);
839     long idn6=cid(param[9].argument[0]);
840     FEM_NOEUD* tab[6];
841     tab[0]=femmai->get_fem_noeudid(idn1);
842     tab[1]=femmai->get_fem_noeudid(idn2);
843     tab[2]=femmai->get_fem_noeudid(idn3);
844     tab[3]=femmai->get_fem_noeudid(idn4);
845     tab[4]=femmai->get_fem_noeudid(idn5);
846     tab[5]=femmai->get_fem_noeudid(idn6);
847     MG_ELEMENT_MAILLAGE* elmai;
848     if (idmai>-1)
849     elmai=mgmai->get_mg_triangleid(idmai);
850     else elmai=NULL;
851     FEM_TRIANGLE6* tri=new FEM_TRIANGLE6(id,elmai,tab);
852     femmai->ajouter_fem_triangle(tri);
853     }
854     if (entite=="TETRAEDRE")
855     {
856 francois 35 parse.decode(data.c_str(),"@,@,@,@,@,@",param+2);
857 foucault 27 long idtopo=cid(param[2].argument[0]);
858     long idn1=cid(param[3].argument[0]);
859     long idn2=cid(param[4].argument[0]);
860     long idn3=cid(param[5].argument[0]);
861     long idn4=cid(param[6].argument[0]);
862 francois 35 int ori=atoi(param[7].argument[0].c_str());
863 foucault 27 MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1);
864     MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2);
865     MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3);
866     MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4);
867     MG_ELEMENT_TOPOLOGIQUE* topo;
868     if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo);
869     else topo=NULL;
870 francois 35 if (noeud1&&noeud2&&noeud3&&noeud4) mgmai->ajouter_mg_tetra(topo,noeud1,noeud2,noeud3,noeud4,ori,id);
871 foucault 27 }
872     if (entite=="FEM_TETRA4")
873     {
874     parse.decode(data.c_str(),"@,@,@,@,@,@",param+2);
875     long idmai=cid(param[3].argument[0]);
876     long idn1=cid(param[4].argument[0]);
877     long idn2=cid(param[5].argument[0]);
878     long idn3=cid(param[6].argument[0]);
879     long idn4=cid(param[7].argument[0]);
880     FEM_NOEUD* tab[4];
881     tab[0]=femmai->get_fem_noeudid(idn1);
882     tab[1]=femmai->get_fem_noeudid(idn2);
883     tab[2]=femmai->get_fem_noeudid(idn3);
884     tab[3]=femmai->get_fem_noeudid(idn4);
885     MG_ELEMENT_MAILLAGE* elmai;
886     if (idmai>-1)
887     elmai=mgmai->get_mg_tetraid(idmai);
888     else elmai=NULL;
889     FEM_TETRA4* tet=new FEM_TETRA4(id,elmai,tab);
890     femmai->ajouter_fem_tetra(tet);
891     }
892     if (entite=="FEM_TETRA10")
893     {
894     parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@",param+2);
895     long idmai=cid(param[3].argument[0]);
896     long idn1=cid(param[4].argument[0]);
897     long idn2=cid(param[5].argument[0]);
898     long idn3=cid(param[6].argument[0]);
899     long idn4=cid(param[7].argument[0]);
900     long idn5=cid(param[8].argument[0]);
901     long idn6=cid(param[9].argument[0]);
902     long idn7=cid(param[10].argument[0]);
903     long idn8=cid(param[11].argument[0]);
904     long idn9=cid(param[12].argument[0]);
905     long idn10=cid(param[13].argument[0]);
906     FEM_NOEUD* tab[10];
907     tab[0]=femmai->get_fem_noeudid(idn1);
908     tab[1]=femmai->get_fem_noeudid(idn2);
909     tab[2]=femmai->get_fem_noeudid(idn3);
910     tab[3]=femmai->get_fem_noeudid(idn4);
911     tab[4]=femmai->get_fem_noeudid(idn5);
912     tab[5]=femmai->get_fem_noeudid(idn6);
913     tab[6]=femmai->get_fem_noeudid(idn7);
914     tab[7]=femmai->get_fem_noeudid(idn8);
915     tab[8]=femmai->get_fem_noeudid(idn9);
916     tab[9]=femmai->get_fem_noeudid(idn10);
917     MG_ELEMENT_MAILLAGE* elmai;
918     if (idmai>-1)
919     elmai=mgmai->get_mg_tetraid(idmai);
920     else elmai=NULL;
921     FEM_TETRA10* tet=new FEM_TETRA10(id,elmai,tab);
922     femmai->ajouter_fem_tetra(tet);
923     }
924     if (entite=="SOLUTION")
925     {
926     parse.decode(data.c_str(),"@,@,@,@,(&)",param+2);
927     std::string nomsol=param[2].argument[0];
928     long idmai=cid(param[3].argument[0]);
929     int nb=atoi(param[4].argument[0].c_str());
930     std::string chemin=param[5].argument[0];
931     MG_MAILLAGE* mai=get_mg_maillageid(idmai);
932     MG_SOLUTION* sol=new MG_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol);
933     ajouter_mg_solution(sol);
934     for (int i=0;i<nb;i++)
935     sol->change_legende(i,param[6].argument[i]);
936     }
937     if (entite=="FEM_SOLUTION")
938     {
939     parse.decode(data.c_str(),"@,@,@,@,(&)",param+2);
940     std::string nomsol=param[2].argument[0];
941     long idmai=cid(param[3].argument[0]);
942     int nb=atoi(param[4].argument[0].c_str());
943     std::string chemin=param[5].argument[0];
944     FEM_MAILLAGE* mai=get_fem_maillageid(idmai);
945     FEM_SOLUTION* sol=new FEM_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol);
946     ajouter_fem_solution(sol);
947     for (int i=0;i<nb;i++)
948     sol->change_legende(i,param[6].argument[i]);
949     }
950 souaissa 114 if (entite=="CAD4FE_MCSEGMENT")
951 foucault 27 {
952     parse.decode(data.c_str(),"@,@,@",param+2);
953     long idtopo=cid(param[2].argument[0]);
954     long idn1=cid(param[3].argument[0]);
955     long idn2=cid(param[4].argument[0]);
956     CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1);
957     CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2);
958     MG_ELEMENT_TOPOLOGIQUE* topo;
959     if (idtopo>-1)
960     {
961     topo=mggeo->get_mg_areteid(idtopo);
962     if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo);
963     if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo);
964     }
965     else topo=NULL;
966     CAD4FE::MCSegment * seg = new CAD4FE::MCSegment(id,topo,noeud1,noeud2);
967     mgmai->ajouter_mg_segment(seg);
968     }
969     if (entite=="CAD4FE_MCNODE")
970     {
971     parse.decode(data.c_str(),"@,@,@,@,@",param+2);
972     long idRefTopo=cid(param[2].argument[0]);
973     long idMCTopo=cid(param[3].argument[0]);
974     double x=atof(param[4].argument[0].c_str());
975     double y=atof(param[5].argument[0].c_str());
976     double z=atof(param[6].argument[0].c_str());
977     MG_ELEMENT_TOPOLOGIQUE* refTopo=NULL;
978     if (refTopo==NULL) refTopo=mggeo->get_mg_sommetid(idRefTopo);
979     if (refTopo==NULL) refTopo=mggeo->get_mg_areteid(idRefTopo);
980     if (refTopo==NULL) refTopo=mggeo->get_mg_faceid(idRefTopo);
981     if (refTopo==NULL) refTopo=mggeo->get_mg_volumeid(idRefTopo);
982     MG_ELEMENT_TOPOLOGIQUE* mcTopo=NULL;
983     if (mcTopo==NULL) mcTopo=mggeo->get_mg_sommetid(idMCTopo);
984     if (mcTopo==NULL) mcTopo=mggeo->get_mg_areteid(idMCTopo);
985     if (mcTopo==NULL) mcTopo=mggeo->get_mg_faceid(idMCTopo);
986     if (mcTopo==NULL) mcTopo=mggeo->get_mg_volumeid(idMCTopo);
987    
988     if (mcTopo->get_dimension()==0)
989     {
990     if (updatedMergedRefVertices == false)
991     {
992     for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin();
993     itMergedRefVertices != mapMergedRefVertices.end();
994     itMergedRefVertices++)
995     {
996     CAD4FE::MCVertex * v = itMergedRefVertices->first;
997     MG_SOMMET * refV = NULL;
998     unsigned long id = itMergedRefVertices->second;
999     refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id);
1000     v->MergeRefVertex(refV);
1001     }
1002    
1003     updatedMergedRefVertices = true;
1004     }
1005     }
1006    
1007     CAD4FE::MCNode* noeud=new CAD4FE::MCNode(id,mcTopo,refTopo,x,y,z);
1008     mgmai->ajouter_mg_noeud(noeud);
1009     }
1010     if (entite=="CAD4FE_MCTRIANGLE")
1011     {
1012     parse.decode(data.c_str(),"@,@,@,@",param+2);
1013     long idtopo=cid(param[2].argument[0]);
1014     long idn1=cid(param[3].argument[0]);
1015     long idn2=cid(param[4].argument[0]);
1016     long idn3=cid(param[5].argument[0]);
1017     CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1);
1018     CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2);
1019     CAD4FE::MCNode* noeud3=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn3);
1020 souaissa 114 CAD4FE::MCSegment* mgsegment[3];
1021     CAD4FE::MCNode *mgnoeud[3]={noeud1,noeud2,noeud3};
1022     // la topo. d'un MCTriangle est obligatoirement une MCFace
1023 foucault 27 CAD4FE::MCFace* mcFace=(CAD4FE::MCFace*)mggeo->get_mg_faceid(idtopo);
1024     for (int i=0;i<3;i++)
1025 souaissa 114 {
1026     mgsegment[i]=(CAD4FE::MCSegment*)mgmai->get_mg_segment(mgnoeud[i]->get_id(),mgnoeud[(i+1)%3]->get_id());
1027     if (mgsegment[i]==NULL)
1028     {
1029     mgsegment[i]=new CAD4FE::MCSegment(mcFace,mgnoeud[i],mgnoeud[(i+1)%3]);
1030     mgmai->ajouter_mg_segment(mgsegment[i]);
1031     }
1032     }
1033 foucault 27 CAD4FE::M3D_MCTriangle *triangle = new CAD4FE::M3D_MCTriangle(id,mcFace,noeud1,noeud2,noeud3,mgsegment[0],mgsegment[1],mgsegment[2]);
1034     mgmai->ajouter_mg_triangle(triangle);
1035 souaissa 114 }
1036 foucault 27 }
1037     }
1038     while (param[0].argument[0]!="FIN");
1039 souaissa 114
1040 foucault 27 if (updatedMergedRefVertices == false)
1041     {
1042     for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin();
1043     itMergedRefVertices != mapMergedRefVertices.end();
1044     itMergedRefVertices++)
1045     {
1046     CAD4FE::MCVertex * v = itMergedRefVertices->first;
1047     MG_SOMMET * refV = NULL;
1048     unsigned long id = itMergedRefVertices->second;
1049     refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id);
1050     v->MergeRefVertex(refV);
1051     }
1052    
1053     updatedMergedRefVertices = true;
1054     }
1055    
1056 souaissa 114
1057 foucault 27 fclose(in);
1058     #ifdef BREP_SLD
1059     fonction->Fermer();
1060     #endif
1061     return 1;
1062     }
1063    
1064    
1065    
1066