1 |
//------------------------------------------------------------ |
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 <string.h> |
30 |
#include "mg_file.h" |
31 |
#include "pars_argument.h" |
32 |
#include "parse.h" |
33 |
#ifdef BREP_STEP |
34 |
#include "step_surface.h" |
35 |
#include "step_courbe.h" |
36 |
#include "step_point.h" |
37 |
#endif |
38 |
#ifdef BREP_SAT |
39 |
#include "acis_surface.h" |
40 |
#include "acis_courbe.h" |
41 |
#include "acis_point.h" |
42 |
#endif |
43 |
#ifdef BREP_SLD |
44 |
#include "sld_point.h" |
45 |
#include "sld_courbe.h" |
46 |
#include "sld_surface.h" |
47 |
#include "sld_fonction.h" |
48 |
#endif |
49 |
#include "lc_point.h" |
50 |
#include "fem_segment2.h" |
51 |
#include "fem_segment3.h" |
52 |
#include "fem_triangle3.h" |
53 |
#include "fem_triangle6.h" |
54 |
#include "fem_quadrangle4.h" |
55 |
#include "fem_quadrangle8.h" |
56 |
#include "fem_tetra4.h" |
57 |
#include "xfem_tetra4.h" |
58 |
#include "fem_tetra10.h" |
59 |
#include "fem_hexa8.h" |
60 |
#include "fem_hexa20.h" |
61 |
//OCC |
62 |
#ifdef BREP_OCC |
63 |
#include "occ_surface.h" |
64 |
#include "occ_point.h" |
65 |
#include "occ_courbe.h" |
66 |
#include "occ_fonction1.h" |
67 |
#include "TopoDS_Shape.hxx" |
68 |
#include "TopoDS.hxx" |
69 |
#endif |
70 |
//--------------------------------------------------------------------------- |
71 |
// CAD4FE Headers |
72 |
#ifdef WINDOWS_VERSION |
73 |
#include "CAD4FE_MCEdge.h" |
74 |
#include "CAD4FE_MCFace.h" |
75 |
#include "CAD4FE_MCVertex.h" |
76 |
#include "CAD4FE_PolySurface.h" |
77 |
#include "CAD4FE_PolyCurve.h" |
78 |
#include "CAD4FE_MCNode.h" |
79 |
#include "CAD4FE_MCSegment.h" |
80 |
#include "CAD4FE_MCTriangle.h" |
81 |
#include "CAD4FE_m3d_MCTriangle.h" |
82 |
#endif |
83 |
//--------------------------------------------------------------------------- |
84 |
|
85 |
|
86 |
//--------------------------------------------------------------------------- |
87 |
#pragma package(smart_init) |
88 |
|
89 |
MG_FILE::MG_FILE():MG_GESTIONNAIRE() |
90 |
{ |
91 |
} |
92 |
|
93 |
MG_FILE::MG_FILE(char* chemin):MG_GESTIONNAIRE() |
94 |
{ |
95 |
code_de_lecture=lire(chemin); |
96 |
} |
97 |
|
98 |
MG_FILE::~MG_FILE() |
99 |
{ |
100 |
} |
101 |
|
102 |
int MG_FILE::get_code_de_lecture(void) |
103 |
{ |
104 |
return code_de_lecture; |
105 |
} |
106 |
|
107 |
long MG_FILE::cid(std::string str) |
108 |
{ |
109 |
const char *p=str.c_str(); |
110 |
if (*p=='$') return atol(p+1); |
111 |
return -1; |
112 |
} |
113 |
|
114 |
int MG_FILE::lire(char* chemin) |
115 |
{ |
116 |
FILE *in; |
117 |
char ligne[3000]; |
118 |
in=fopen(chemin,"rt"); |
119 |
if (in==NULL) return 0; |
120 |
PARS_ARGUMENT param[100]; |
121 |
PARSE parse; |
122 |
|
123 |
MG_GEOMETRIE *mggeo; |
124 |
#ifdef WINDOWS_VERSION |
125 |
std::multimap<CAD4FE::MCVertex*, unsigned long> mapMergedRefVertices; |
126 |
#endif |
127 |
bool updatedMergedRefVertices = false; |
128 |
|
129 |
do |
130 |
{ |
131 |
int ierr; |
132 |
std::string ligne=parse.lire(in,';',&ierr); |
133 |
parse.decode(ligne.c_str(),"@;",param); |
134 |
const char *chaine=param[0].argument[0].c_str(); |
135 |
if ((chaine[0]=='/') && (chaine[1]=='/')) |
136 |
{ |
137 |
if ((chaine[2]=='*')&&(chaine[3]=='i')) |
138 |
{ |
139 |
unsigned long id; |
140 |
sscanf(chaine,"//*i:%lu;",&id); |
141 |
entiteidmax=id; |
142 |
} |
143 |
} |
144 |
else if (param[0].argument[0]!="FIN") |
145 |
{ |
146 |
parse.decode(ligne.c_str(),"%@=@(@);",param); |
147 |
std::string entite=param[1].argument[0]; |
148 |
long id=atol(param[0].argument[0].c_str()); |
149 |
std::string data=param[2].argument[0] ; |
150 |
MG_MAILLAGE *mgmai; |
151 |
FEM_MAILLAGE *femmai; |
152 |
if (entite=="GEOMETRIE") |
153 |
{ |
154 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
155 |
double unite=atof(param[2].argument[0].c_str()); |
156 |
std::string typegeo=param[3].argument[0]; |
157 |
std::string chemin=param[4].argument[0]; |
158 |
#ifdef BREP_STEP |
159 |
if (typegeo=="STEP") |
160 |
{ |
161 |
fichstep.change_nom((char *)chemin.c_str()); |
162 |
int code=fichstep.lire(); |
163 |
if (code==0) return 0; |
164 |
mggeo=new MG_GEOMETRIE((char*)"STEP",id,fichstep.get_nom(),unite); |
165 |
ajouter_mg_geometrie(mggeo); |
166 |
} |
167 |
#endif |
168 |
#ifdef BREP_SAT |
169 |
if (typegeo=="ACIS") |
170 |
{ |
171 |
fichsat.change_nom((char *)chemin.c_str()); |
172 |
int code=fichsat.lire(); |
173 |
if (code==0) return 0; |
174 |
mggeo=new MG_GEOMETRIE((char*)"ACIS",id,fichsat.get_nom(),unite); |
175 |
ajouter_mg_geometrie(mggeo); |
176 |
} |
177 |
#endif |
178 |
#ifdef BREP_SLD |
179 |
if (typegeo=="SLD") |
180 |
{ |
181 |
fonction->Connection(); |
182 |
fonction->OuvrirFichier((char *)chemin.c_str() ); |
183 |
mggeo=new MG_GEOMETRIE((char*)"SLD",id,chemin.c_str(),unite); |
184 |
ajouter_mg_geometrie(mggeo); |
185 |
ouvertsld=1; |
186 |
} |
187 |
#endif |
188 |
|
189 |
#ifdef BREP_OCC |
190 |
if (typegeo=="OCC") |
191 |
{ |
192 |
fonction1->OuvrirFichier((char *)chemin.c_str() ); |
193 |
mggeo=new MG_GEOMETRIE((char*)"OCC",id,chemin.c_str(),unite); |
194 |
ajouter_mg_geometrie(mggeo); |
195 |
} |
196 |
#endif |
197 |
|
198 |
std::string nommat=""; |
199 |
if (param[5].argument[0]!="") |
200 |
nommat=param[5].argument[0]; |
201 |
mggeo->change_gest_materiau((char*)nommat.c_str()); |
202 |
} |
203 |
if (entite=="GEOMETRIE_EPS") |
204 |
{ |
205 |
parse.decode(data.c_str(),"@",param+2); |
206 |
double val=atof((char*)param[2].argument[0].c_str()); |
207 |
mggeo->change_valeur_precision(val); |
208 |
} |
209 |
if (entite=="GROUPE_TOPOLOGIQUE") |
210 |
{ |
211 |
parse.decode(data.c_str(),"@,(&)",param+2); |
212 |
MG_GROUPE_TOPOLOGIQUE* mggt=new MG_GROUPE_TOPOLOGIQUE(id); |
213 |
mggeo->ajouter_mg_groupe_topologique(mggt); |
214 |
int nb=atoi(param[2].argument[0].c_str()); |
215 |
for (int i=0;i<nb;i++) |
216 |
{ |
217 |
unsigned long id2=cid(param[3].argument[i].c_str()); |
218 |
MG_ELEMENT_TOPOLOGIQUE* ele; |
219 |
ele=mggeo->get_mg_sommetid(id2); |
220 |
if (ele==NULL) ele=mggeo->get_mg_areteid(id2); |
221 |
if (ele==NULL) ele=mggeo->get_mg_faceid(id2); |
222 |
if (ele==NULL) ele=mggeo->get_mg_volumeid(id2); |
223 |
if (ele!=NULL) mggt->ajouter(ele); |
224 |
} |
225 |
|
226 |
} |
227 |
if (entite=="VOLUME") |
228 |
{ |
229 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
230 |
MG_VOLUME* mgvol=new MG_VOLUME(param[2].argument[0],id); |
231 |
mggeo->ajouter_mg_volume(mgvol); |
232 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
233 |
mgvol->change_num_materiau(nummat); |
234 |
int nb=atoi(param[5].argument[0].c_str()); |
235 |
if (nb!=0) |
236 |
{ |
237 |
for (int i=0;i<nb;i++) |
238 |
{ |
239 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
240 |
char nom[3]; |
241 |
double val; |
242 |
strcpy(nom,param[7].argument[0].c_str()); |
243 |
val=atof(param[8].argument[0].c_str()); |
244 |
mgvol->ajouter_ccf(nom,val); |
245 |
} |
246 |
} |
247 |
} |
248 |
if (entite=="COQUE") |
249 |
{ |
250 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
251 |
MG_COQUE* mgcoq=new MG_COQUE(param[2].argument[0],id); |
252 |
mggeo->ajouter_mg_coque(mgcoq); |
253 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
254 |
mgcoq->change_num_materiau(nummat); |
255 |
int nb=atoi(param[5].argument[0].c_str()); |
256 |
if (nb!=0) |
257 |
{ |
258 |
for (int i=0;i<nb;i++) |
259 |
{ |
260 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
261 |
char nom[3]; |
262 |
double val; |
263 |
strcpy(nom,param[7].argument[0].c_str()); |
264 |
val=atof(param[8].argument[0].c_str()); |
265 |
mgcoq->ajouter_ccf(nom,val); |
266 |
} |
267 |
} |
268 |
} |
269 |
if (entite=="POUTRE") |
270 |
{ |
271 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
272 |
MG_POUTRE* mgpoutre=new MG_POUTRE(param[2].argument[0],id); |
273 |
mggeo->ajouter_mg_poutre(mgpoutre); |
274 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
275 |
mgpoutre->change_num_materiau(nummat); |
276 |
int nb=atoi(param[5].argument[0].c_str()); |
277 |
if (nb!=0) |
278 |
{ |
279 |
for (int i=0;i<nb;i++) |
280 |
{ |
281 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
282 |
char nom[3]; |
283 |
double val; |
284 |
strcpy(nom,param[7].argument[0].c_str()); |
285 |
val=atof(param[8].argument[0].c_str()); |
286 |
mgpoutre->ajouter_ccf(nom,val); |
287 |
} |
288 |
} |
289 |
} |
290 |
if (entite=="COQUILLE") |
291 |
{ |
292 |
parse.decode(data.c_str(),"@,@",param+2); |
293 |
long ident=cid(param[2].argument[0]); |
294 |
MG_VOLUME* mgvol=mggeo->get_mg_volumeid(ident); |
295 |
MG_COQUE* mgcoq=mggeo->get_mg_coqueid(ident); |
296 |
if (mgvol!=NULL) |
297 |
{ |
298 |
MG_COQUILLE* mgcoq=new MG_COQUILLE(id,mgvol); |
299 |
mggeo->ajouter_mg_coquille(mgcoq,mgvol); |
300 |
} |
301 |
if (mgcoq!=NULL) |
302 |
{ |
303 |
MG_COQUILLE* mgcoquille=new MG_COQUILLE(id,mgcoq); |
304 |
mggeo->ajouter_mg_coquille(mgcoquille,mgcoq); |
305 |
} |
306 |
|
307 |
} |
308 |
#ifdef BREP_STEP |
309 |
if (entite=="SURFACE_STEP") |
310 |
{ |
311 |
parse.decode(data.c_str(),"@",param+2); |
312 |
long idstepsuf=atol(param[2].argument[0].c_str()); |
313 |
ST_SURFACE *stsurf=fichstep.lst_surface.getid(idstepsuf); |
314 |
STEP_SURFACE* stepsurf=new STEP_SURFACE(id,stsurf); |
315 |
mggeo->ajouter_mg_surface(stepsurf); |
316 |
} |
317 |
if (entite=="COURBE_STEP") |
318 |
{ |
319 |
parse.decode(data.c_str(),"@",param+2); |
320 |
long idstepcur=atol(param[2].argument[0].c_str()); |
321 |
ST_COURBE *stcur=fichstep.lst_courbe.getid(idstepcur); |
322 |
STEP_COURBE* stepcur=new STEP_COURBE(id,stcur); |
323 |
mggeo->ajouter_mg_courbe(stepcur); |
324 |
} |
325 |
|
326 |
if (entite=="POINT_STEP") |
327 |
{ |
328 |
parse.decode(data.c_str(),"@",param+2); |
329 |
long idsteppt=atol(param[2].argument[0].c_str()); |
330 |
ST_POINT *stpt=fichstep.lst_point.getid(idsteppt); |
331 |
STEP_POINT* steppt=new STEP_POINT(id,stpt); |
332 |
mggeo->ajouter_mg_point(steppt); |
333 |
} |
334 |
|
335 |
#endif |
336 |
#ifdef BREP_SAT |
337 |
if (entite=="SURFACE_SAT") |
338 |
{ |
339 |
parse.decode(data.c_str(),"@",param+2); |
340 |
long idsatsuf=atol(param[2].argument[0].c_str()); |
341 |
SAT_SURFACE *satsurf=fichsat.lst_surface.getid(idsatsuf); |
342 |
ACIS_SURFACE* acissurf=new ACIS_SURFACE(id,satsurf); |
343 |
mggeo->ajouter_mg_surface(acissurf); |
344 |
} |
345 |
if (entite=="COURBE_SAT") |
346 |
{ |
347 |
parse.decode(data.c_str(),"@",param+2); |
348 |
long idsatcur=atol(param[2].argument[0].c_str()); |
349 |
SAT_COURBE *satcur=fichsat.lst_courbe.getid(idsatcur); |
350 |
ACIS_COURBE* aciscur=new ACIS_COURBE(id,satcur); |
351 |
mggeo->ajouter_mg_courbe(aciscur); |
352 |
} |
353 |
|
354 |
if (entite=="POINT_SAT") |
355 |
{ |
356 |
parse.decode(data.c_str(),"@",param+2); |
357 |
long idsatpt=atol(param[2].argument[0].c_str()); |
358 |
SAT_POINT *satpt=fichsat.lst_point.getid(idsatpt); |
359 |
ACIS_POINT* acispt=new ACIS_POINT(id,satpt); |
360 |
mggeo->ajouter_mg_point(acispt); |
361 |
} |
362 |
|
363 |
#endif |
364 |
#ifdef BREP_SLD |
365 |
if (entite=="SURFACE_SLD") |
366 |
{ |
367 |
parse.decode(data.c_str(),"@",param+2); |
368 |
CComPtr<IFace2> swface; |
369 |
char* idsld=(char*)param[2].argument[0].c_str(); |
370 |
SLD_SURFACE* sldsurf=new SLD_SURFACE(id,idsld,*fonction); |
371 |
mggeo->ajouter_mg_surface(sldsurf); |
372 |
} |
373 |
if (entite=="COURBE_SLD") |
374 |
{ |
375 |
parse.decode(data.c_str(),"@",param+2); |
376 |
CComPtr<IEdge> swedge; |
377 |
char* idsld=(char*)param[2].argument[0].c_str(); |
378 |
SLD_COURBE* sldcrb=new SLD_COURBE(id,idsld,*fonction); |
379 |
mggeo->ajouter_mg_courbe(sldcrb); |
380 |
} |
381 |
|
382 |
if (entite=="POINT_SLD") |
383 |
{ |
384 |
parse.decode(data.c_str(),"@",param+2); |
385 |
CComPtr<IVertex> swvertex; |
386 |
char* idsld=(char*)param[2].argument[0].c_str(); |
387 |
SLD_POINT* sldpoint=new SLD_POINT(id,idsld,*fonction); |
388 |
mggeo->ajouter_mg_point(sldpoint); |
389 |
} |
390 |
|
391 |
#endif |
392 |
|
393 |
#ifdef BREP_OCC |
394 |
|
395 |
if (entite=="SURFACE_OCC") |
396 |
{ |
397 |
parse.decode(data.c_str(),"@",param+2); |
398 |
long idocc=atol(param[2].argument[0].c_str()); |
399 |
const TopoDS_Shape& occshape=fonction1->GetShape(idocc); |
400 |
TopoDS_Face occface=TopoDS::Face(occshape); |
401 |
OCC_SURFACE* occsurf=new OCC_SURFACE(id,occface, *fonction1); |
402 |
mggeo->ajouter_mg_surface(occsurf); |
403 |
} |
404 |
if (entite=="COURBE_OCC") |
405 |
{ |
406 |
parse.decode(data.c_str(),"@",param+2); |
407 |
long idocc=atol(param[2].argument[0].c_str()); |
408 |
const TopoDS_Shape& occshape=fonction1->GetShape(idocc); |
409 |
TopoDS_Edge occedge=TopoDS::Edge(occshape); |
410 |
OCC_COURBE* occcrb=new OCC_COURBE(id,occedge, *fonction1); |
411 |
mggeo->ajouter_mg_courbe(occcrb); |
412 |
} |
413 |
if (entite=="POINT_OCC") |
414 |
{ |
415 |
parse.decode(data.c_str(),"@",param+2); |
416 |
long idocc=atol(param[2].argument[0].c_str()); |
417 |
const TopoDS_Shape& occshape=fonction1->GetShape(idocc); |
418 |
TopoDS_Vertex occvertex=TopoDS::Vertex(occshape); |
419 |
OCC_POINT* occpoint=new OCC_POINT(id,occvertex, *fonction1); |
420 |
mggeo->ajouter_mg_point(occpoint); |
421 |
} |
422 |
#endif |
423 |
#ifdef WINDOWS_VERSION |
424 |
if (entite=="CAD4FE_POLYCURVE") |
425 |
{ |
426 |
CAD4FE::PolyCurve * polycurve = NULL; |
427 |
parse.decode(data.c_str(),"@,(&)",param+2); |
428 |
int nb = atoi(param[2].argument[0].c_str()); |
429 |
|
430 |
if (nb == 0) |
431 |
{ |
432 |
printf("PolyCurve %d is formed with reference vertex : ", id); |
433 |
parse.decode(param[3].argument[0].c_str(),"@",param+4); |
434 |
int idRefVertex; |
435 |
idRefVertex=cid(param[4].argument[0].c_str()); |
436 |
printf("%d ;\n ", idRefVertex); |
437 |
MG_SOMMET * refVertex = mggeo->get_mg_sommetid(idRefVertex); |
438 |
polycurve = new CAD4FE::PolyCurve(refVertex); |
439 |
} |
440 |
else |
441 |
{ |
442 |
printf("PolyCurve %d is formed with reference edges : ", id); |
443 |
polycurve = new CAD4FE::PolyCurve; |
444 |
for (int i=0;i<nb;i++) |
445 |
{ |
446 |
parse.decode(param[3].argument[i].c_str(),"@",param+4); |
447 |
int idRefEdge; |
448 |
idRefEdge=cid(param[4].argument[0].c_str()); |
449 |
printf("%d ; ", idRefEdge); |
450 |
MG_ARETE * refEdge = mggeo->get_mg_areteid(idRefEdge); |
451 |
CAD4FE::PolyCurve tmpPC(refEdge); |
452 |
polycurve->Merge(tmpPC); |
453 |
} |
454 |
printf("\n"); |
455 |
} |
456 |
|
457 |
polycurve->change_id(id); |
458 |
mggeo->ajouter_mg_courbe(polycurve); |
459 |
} |
460 |
|
461 |
|
462 |
if (entite=="CAD4FE_POLYSURFACE") |
463 |
{ |
464 |
CAD4FE::PolySurface * polysurface = new CAD4FE::PolySurface; |
465 |
polysurface->change_id(id); |
466 |
mggeo->ajouter_mg_surface(polysurface); |
467 |
|
468 |
parse.decode(data.c_str(),"@,(&)",param+2); |
469 |
|
470 |
int nb = atoi(param[2].argument[0].c_str()); |
471 |
printf("PolySurface %d is formed with reference faces : ", id); |
472 |
for (int i=0;i<nb;i++) |
473 |
{ |
474 |
parse.decode(param[3].argument[i].c_str(),"@",param+4); |
475 |
int idRefFace; |
476 |
idRefFace=cid(param[4].argument[0].c_str()); |
477 |
printf("%d ; ", idRefFace); |
478 |
|
479 |
MG_FACE * refFace = mggeo->get_mg_faceid(idRefFace); |
480 |
CAD4FE::PolySurface tmpSF(refFace); |
481 |
polysurface->Merge(tmpSF); |
482 |
} |
483 |
|
484 |
printf("\n"); |
485 |
} |
486 |
if (entite=="CAD4FE_MCEDGE") |
487 |
{ |
488 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
489 |
|
490 |
std::string idOriginal = param[2].argument[0]; |
491 |
long idPolyCurve=cid(param[3].argument[0]); |
492 |
CAD4FE::PolyCurve * polycurve = (CAD4FE::PolyCurve *) mggeo->get_mg_courbeid(idPolyCurve); |
493 |
|
494 |
// sense is not used because a MCEdge always has |
495 |
// a sense = 1 ! |
496 |
// (because polycurve domain is equal to mcEdge domain) |
497 |
CAD4FE::MCEdge * mcEdge = new CAD4FE::MCEdge(idOriginal, polycurve); |
498 |
mcEdge->change_id(id); |
499 |
mggeo->ajouter_mg_arete(mcEdge); |
500 |
|
501 |
int nb=atoi(param[7].argument[0].c_str()); |
502 |
if (nb!=0) |
503 |
{ |
504 |
for (int i=0;i<nb;i++) |
505 |
{ |
506 |
parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9); |
507 |
char nom[3]; |
508 |
double val; |
509 |
strcpy(nom,param[9].argument[0].c_str()); |
510 |
val=atof(param[10].argument[0].c_str()); |
511 |
mcEdge->ajouter_ccf(nom,val); |
512 |
} |
513 |
} |
514 |
} |
515 |
if (entite=="CAD4FE_MCFACE") |
516 |
{ |
517 |
parse.decode(data.c_str(),"@,@,@,@,@,(&)",param+2); |
518 |
|
519 |
std::string idOriginal = param[2].argument[0]; |
520 |
long idPolySurface=cid(param[3].argument[0]); |
521 |
CAD4FE::PolySurface * polysurface = (CAD4FE::PolySurface *) mggeo->get_mg_surfaceid(idPolySurface); |
522 |
|
523 |
CAD4FE::MCFace * mcFace = new CAD4FE::MCFace(idOriginal, polysurface); |
524 |
mcFace->change_id(id); |
525 |
mggeo->ajouter_mg_face(mcFace); |
526 |
|
527 |
int nb=atoi(param[6].argument[0].c_str()); |
528 |
if (nb!=0) |
529 |
{ |
530 |
for (int i=0;i<nb;i++) |
531 |
{ |
532 |
parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8); |
533 |
char nom[3]; |
534 |
double val; |
535 |
strcpy(nom,param[8].argument[0].c_str()); |
536 |
val=atof(param[9].argument[0].c_str()); |
537 |
mcFace->ajouter_ccf(nom,val); |
538 |
} |
539 |
} |
540 |
} |
541 |
if (entite=="CAD4FE_MCVERTEX") |
542 |
{ |
543 |
parse.decode(data.c_str(),"@,@,@,(&),@,(&)",param+2); |
544 |
std::string idOriginal = param[2].argument[0]; |
545 |
long idsom=cid(param[3].argument[0]); |
546 |
MG_SOMMET * mgsom = mggeo->get_mg_sommetid(idsom); |
547 |
CAD4FE::MCVertex * mcVertex = new CAD4FE::MCVertex(mgsom); |
548 |
mcVertex->change_id(id); |
549 |
mggeo->ajouter_mg_sommet(mcVertex); |
550 |
int nb_ref_vertex=atoi(param[4].argument[0].c_str()); |
551 |
if (nb_ref_vertex!=0) |
552 |
{ |
553 |
for (int i=0;i<nb_ref_vertex;i++) |
554 |
{ |
555 |
unsigned long idRefVertex=cid(param[5].argument[i]); |
556 |
mcVertex->GetMergedRefVertices()[idRefVertex] = NULL; |
557 |
mapMergedRefVertices.insert(std::make_pair(mcVertex,idRefVertex)); |
558 |
} |
559 |
} |
560 |
int nb_ccf=atoi(param[4+2].argument[0].c_str()); |
561 |
if (nb_ccf!=0) |
562 |
{ |
563 |
for (int i=0;i<nb_ccf;i++) |
564 |
{ |
565 |
parse.decode(param[5+2].argument[i].c_str(),"(@,@)",param+6+2); |
566 |
char nom_ccf[3]; |
567 |
double val_ccf; |
568 |
strcpy(nom_ccf,param[6+2].argument[0].c_str()); |
569 |
val_ccf=atof(param[7+2].argument[0].c_str()); |
570 |
mgsom->ajouter_ccf(nom_ccf,val_ccf); |
571 |
} |
572 |
} |
573 |
} |
574 |
#endif |
575 |
if (entite=="FACE") |
576 |
{ |
577 |
parse.decode(data.c_str(),"@,@,(@),@,@,(&)",param+2); |
578 |
long idsurf=cid(param[3].argument[0]); |
579 |
int sens=atoi(param[5].argument[0].c_str()); |
580 |
MG_SURFACE* mgsurf=mggeo->get_mg_surfaceid(idsurf); |
581 |
MG_FACE* mgface=new MG_FACE(param[2].argument[0],id,mgsurf,sens); |
582 |
mggeo->ajouter_mg_face(mgface); |
583 |
int nb=atoi(param[6].argument[0].c_str()); |
584 |
if (nb!=0) |
585 |
{ |
586 |
for (int i=0;i<nb;i++) |
587 |
{ |
588 |
parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8); |
589 |
char nom[3]; |
590 |
double val; |
591 |
strcpy(nom,param[8].argument[0].c_str()); |
592 |
val=atof(param[9].argument[0].c_str()); |
593 |
mgface->ajouter_ccf(nom,val); |
594 |
} |
595 |
} |
596 |
} |
597 |
if (entite=="COFACE") |
598 |
{ |
599 |
parse.decode(data.c_str(),"@,@,@",param+2); |
600 |
long idface=cid(param[2].argument[0]); |
601 |
long idcoq=cid(param[3].argument[0]); |
602 |
int sens=atoi(param[4].argument[0].c_str()); |
603 |
MG_FACE* mgface=mggeo->get_mg_faceid(idface); |
604 |
MG_COQUILLE* mgcoq=mggeo->get_mg_coquilleid(idcoq); |
605 |
MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(id,mgface,mgcoq,sens); |
606 |
mgcoq->ajouter_mg_coface(mgcoface); |
607 |
} |
608 |
if (entite=="BOUCLE") |
609 |
{ |
610 |
parse.decode(data.c_str(),"@,(@)",param+2); |
611 |
long ident=cid(param[2].argument[0]); |
612 |
MG_FACE* mgface=mggeo->get_mg_faceid(ident); |
613 |
MG_POUTRE* mgpoutre=mggeo->get_mg_poutreid(ident); |
614 |
if (mgface!=NULL) |
615 |
{ |
616 |
MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgface); |
617 |
mggeo->ajouter_mg_boucle(mgbou,mgface); |
618 |
} |
619 |
if (mgpoutre!=NULL) |
620 |
{ |
621 |
MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgpoutre); |
622 |
mggeo->ajouter_mg_boucle(mgbou,mgpoutre); |
623 |
} |
624 |
} |
625 |
if (entite=="POINT") |
626 |
{ |
627 |
parse.decode(data.c_str(),"@,@,@",param+2); |
628 |
double xyz[3]; |
629 |
xyz[0]=atof(param[2].argument[0].c_str()); |
630 |
xyz[1]=atof(param[3].argument[0].c_str()); |
631 |
xyz[2]=atof(param[4].argument[0].c_str()); |
632 |
LC_POINT* point=new LC_POINT(id,xyz); |
633 |
mggeo->ajouter_mg_point(point); |
634 |
} |
635 |
if (entite=="SOMMET") |
636 |
{ |
637 |
parse.decode(data.c_str(),"@,@,@,(&)",param+2); |
638 |
long idpoint=cid(param[3].argument[0]); |
639 |
MG_POINT* mgpt=mggeo->get_mg_pointid(idpoint); |
640 |
MG_SOMMET* mgsom=new MG_SOMMET(param[2].argument[0],id,mgpt); |
641 |
mggeo->ajouter_mg_sommet(mgsom); |
642 |
int nb=atoi(param[4].argument[0].c_str()); |
643 |
if (nb!=0) |
644 |
{ |
645 |
for (int i=0;i<nb;i++) |
646 |
{ |
647 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
648 |
char nom[3]; |
649 |
double val; |
650 |
strcpy(nom,param[6].argument[0].c_str()); |
651 |
val=atof(param[7].argument[0].c_str()); |
652 |
mgsom->ajouter_ccf(nom,val); |
653 |
} |
654 |
} |
655 |
} |
656 |
if (entite=="ARETE") |
657 |
{ |
658 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
659 |
long idcur=cid(param[3].argument[0]); |
660 |
int sens=atoi(param[6].argument[0].c_str()); |
661 |
MG_COURBE* mgcur=mggeo->get_mg_courbeid(idcur); |
662 |
MG_ARETE* mgarete=new MG_ARETE(param[2].argument[0],id,mgcur,sens); |
663 |
mggeo->ajouter_mg_arete(mgarete); |
664 |
int nb=atoi(param[7].argument[0].c_str()); |
665 |
if (nb!=0) |
666 |
{ |
667 |
for (int i=0;i<nb;i++) |
668 |
{ |
669 |
parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9); |
670 |
char nom[3]; |
671 |
double val; |
672 |
strcpy(nom,param[9].argument[0].c_str()); |
673 |
val=atof(param[10].argument[0].c_str()); |
674 |
mgarete->ajouter_ccf(nom,val); |
675 |
} |
676 |
} |
677 |
} |
678 |
if (entite=="COSOMMET") |
679 |
{ |
680 |
parse.decode(data.c_str(),"@,@,@",param+2); |
681 |
long idsom=cid(param[2].argument[0]); |
682 |
long idarete=cid(param[3].argument[0]); |
683 |
int num=atoi(param[4].argument[0].c_str()); |
684 |
MG_SOMMET* mgsom=mggeo->get_mg_sommetid(idsom); |
685 |
MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete); |
686 |
MG_COSOMMET* mgcosom=mggeo->ajouter_mg_cosommet(id,mgarete,mgsom); |
687 |
if (num==1) mgarete->changer_cosommet1(mgcosom); |
688 |
if (num==2) mgarete->changer_cosommet2(mgcosom); |
689 |
} |
690 |
if (entite=="COARETE") |
691 |
{ |
692 |
parse.decode(data.c_str(),"@,@,@",param+2); |
693 |
long idarete=cid(param[2].argument[0]); |
694 |
long idboucle=cid(param[3].argument[0]); |
695 |
int sens=atoi(param[4].argument[0].c_str()); |
696 |
MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete); |
697 |
MG_BOUCLE* mgboucle=mggeo->get_mg_boucleid(idboucle); |
698 |
MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(id,mgarete,mgboucle,sens); |
699 |
mgboucle->ajouter_mg_coarete(mgcoarete); |
700 |
} |
701 |
if (entite=="VISU_COURBE") |
702 |
{ |
703 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
704 |
double xyz1[3]; |
705 |
double xyz2[3]; |
706 |
xyz1[0]=atof(param[2].argument[0].c_str()); |
707 |
xyz1[1]=atof(param[3].argument[0].c_str()); |
708 |
xyz1[2]=atof(param[4].argument[0].c_str()); |
709 |
xyz2[0]=atof(param[5].argument[0].c_str()); |
710 |
xyz2[1]=atof(param[6].argument[0].c_str()); |
711 |
xyz2[2]=atof(param[7].argument[0].c_str()); |
712 |
MG_VISU_COURBE* mgcrb=new MG_VISU_COURBE(id,xyz1,xyz2); |
713 |
mggeo->ajouter_mg_visu_courbe(mgcrb); |
714 |
} |
715 |
if (entite=="MAILLAGE") |
716 |
{ |
717 |
parse.decode(data.c_str(),"@",param+2); |
718 |
long idgeo=cid(param[2].argument[0]); |
719 |
MG_GEOMETRIE* mggeo=get_mg_geometrieid(idgeo); |
720 |
mgmai=new MG_MAILLAGE(id,mggeo); |
721 |
ajouter_mg_maillage(mgmai); |
722 |
} |
723 |
if (entite=="FEM_MAILLAGE") |
724 |
{ |
725 |
parse.decode(data.c_str(),"@,@,@",param+2); |
726 |
int degre=atoi(param[2].argument[0].c_str()); |
727 |
long idmai=cid(param[3].argument[0]); |
728 |
long idgeo=cid(param[4].argument[0]); |
729 |
MG_GEOMETRIE* mggeo=get_mg_geometrieid(idgeo); |
730 |
MG_MAILLAGE* mgmai=get_mg_maillageid(idmai); |
731 |
femmai=new FEM_MAILLAGE(id,mggeo,mgmai,degre); |
732 |
ajouter_fem_maillage(femmai); |
733 |
} |
734 |
if (entite=="NOEUD") |
735 |
{ |
736 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
737 |
long idtopo=cid(param[2].argument[0]); |
738 |
double x=atof(param[3].argument[0].c_str()); |
739 |
double y=atof(param[4].argument[0].c_str()); |
740 |
double z=atof(param[5].argument[0].c_str()); |
741 |
int ori=atoi(param[6].argument[0].c_str()); |
742 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
743 |
if (idtopo>-1) |
744 |
{ |
745 |
topo=mggeo->get_mg_sommetid(idtopo); |
746 |
if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo); |
747 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
748 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
749 |
} |
750 |
else topo=NULL; |
751 |
MG_NOEUD* noeud=new MG_NOEUD(id,topo,x,y,z,ori); |
752 |
mgmai->ajouter_mg_noeud(noeud); |
753 |
} |
754 |
if (entite=="FEM_NOEUD") |
755 |
{ |
756 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
757 |
long idtopo=cid(param[2].argument[0]); |
758 |
long idmai=cid(param[3].argument[0]); |
759 |
double x=atof(param[4].argument[0].c_str()); |
760 |
double y=atof(param[5].argument[0].c_str()); |
761 |
double z=atof(param[6].argument[0].c_str()); |
762 |
int num=atoi(param[7].argument[0].c_str()); |
763 |
int numopt=atoi(param[8].argument[0].c_str()); |
764 |
MG_ELEMENT_MAILLAGE* elmai; |
765 |
if (idmai>-1) |
766 |
{ |
767 |
elmai=mgmai->get_mg_noeudid(idmai); |
768 |
if (elmai==NULL) elmai=mgmai->get_mg_segmentid(idmai); |
769 |
if (elmai==NULL) elmai=mgmai->get_mg_triangleid(idmai); |
770 |
if (elmai==NULL) elmai=mgmai->get_mg_tetraid(idmai); |
771 |
} |
772 |
else elmai=NULL; |
773 |
FEM_NOEUD* noeud; |
774 |
if (elmai!=NULL) noeud=new FEM_NOEUD(id,elmai,x,y,z); |
775 |
else |
776 |
{ |
777 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
778 |
if (idtopo>-1) |
779 |
{ |
780 |
topo=mggeo->get_mg_sommetid(idtopo); |
781 |
if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo); |
782 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
783 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
784 |
} |
785 |
else topo=NULL; |
786 |
noeud=new FEM_NOEUD(id,topo,x,y,z); |
787 |
} |
788 |
noeud->change_numero(num); |
789 |
noeud->change_numero_opt(numopt); |
790 |
femmai->ajouter_fem_noeud(noeud); |
791 |
} |
792 |
if (entite=="FEM_NOEUD_DEF") |
793 |
{ |
794 |
parse.decode(data.c_str(),"@,@,@",param+2); |
795 |
double x=atof(param[2].argument[0].c_str()); |
796 |
double y=atof(param[3].argument[0].c_str()); |
797 |
double z=atof(param[4].argument[0].c_str()); |
798 |
FEM_NOEUD* noeud=femmai->get_fem_noeudid(id); |
799 |
noeud->change_dx(x); |
800 |
noeud->change_dy(y); |
801 |
noeud->change_dz(z); |
802 |
femmai->active_deforme(); |
803 |
} |
804 |
if (entite=="FEM_NOEUD_REAC") |
805 |
{ |
806 |
parse.decode(data.c_str(),"@,@,@",param+2); |
807 |
double x=atof(param[2].argument[0].c_str()); |
808 |
double y=atof(param[3].argument[0].c_str()); |
809 |
double z=atof(param[4].argument[0].c_str()); |
810 |
FEM_NOEUD* noeud=femmai->get_fem_noeudid(id); |
811 |
noeud->change_rx(x); |
812 |
noeud->change_ry(y); |
813 |
noeud->change_rz(z); |
814 |
femmai->active_reaction();; |
815 |
} |
816 |
if (entite=="SEGMENT") |
817 |
{ |
818 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
819 |
long idtopo=cid(param[2].argument[0]); |
820 |
long idn1=cid(param[3].argument[0]); |
821 |
long idn2=cid(param[4].argument[0]); |
822 |
int ori=atoi(param[5].argument[0].c_str()); |
823 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
824 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
825 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
826 |
if (idtopo>-1) |
827 |
{ |
828 |
topo=mggeo->get_mg_areteid(idtopo); |
829 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
830 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
831 |
} |
832 |
else topo=NULL; |
833 |
MG_SEGMENT* seg=new MG_SEGMENT(id,topo,noeud1,noeud2,ori); |
834 |
mgmai->ajouter_mg_segment(seg); |
835 |
} |
836 |
if (entite=="FEM_SEGMENT2") |
837 |
{ |
838 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
839 |
long idtopo=cid(param[2].argument[0]); |
840 |
long idmai=cid(param[3].argument[0]); |
841 |
long idn1=cid(param[4].argument[0]); |
842 |
long idn2=cid(param[5].argument[0]); |
843 |
FEM_NOEUD* tab[2]; |
844 |
tab[0]=femmai->get_fem_noeudid(idn1); |
845 |
tab[1]=femmai->get_fem_noeudid(idn2); |
846 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
847 |
if (idtopo>-1) |
848 |
topo=mggeo->get_mg_areteid(idtopo); |
849 |
MG_ELEMENT_MAILLAGE* elmai; |
850 |
if (idmai>-1) |
851 |
elmai=mgmai->get_mg_segmentid(idmai); |
852 |
else elmai=NULL; |
853 |
FEM_SEGMENT2* seg=new FEM_SEGMENT2(id,topo,elmai,tab); |
854 |
femmai->ajouter_fem_element1(seg); |
855 |
} |
856 |
if (entite=="FEM_SEGMENT3") |
857 |
{ |
858 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
859 |
long idtopo=cid(param[2].argument[0]); |
860 |
long idmai=cid(param[3].argument[0]); |
861 |
long idn1=cid(param[4].argument[0]); |
862 |
long idn2=cid(param[5].argument[0]); |
863 |
long idn3=cid(param[6].argument[0]); |
864 |
FEM_NOEUD* tab[3]; |
865 |
tab[0]=femmai->get_fem_noeudid(idn1); |
866 |
tab[1]=femmai->get_fem_noeudid(idn2); |
867 |
tab[2]=femmai->get_fem_noeudid(idn3); |
868 |
MG_ELEMENT_MAILLAGE* elmai; |
869 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
870 |
if (idtopo>-1) |
871 |
topo=mggeo->get_mg_areteid(idtopo); |
872 |
if (idmai>-1) |
873 |
elmai=mgmai->get_mg_segmentid(idmai); |
874 |
else elmai=NULL; |
875 |
FEM_SEGMENT3* seg=new FEM_SEGMENT3(id,topo,elmai,tab); |
876 |
femmai->ajouter_fem_element1(seg); |
877 |
} |
878 |
if (entite=="TRIANGLE") |
879 |
{ |
880 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
881 |
long idtopo=cid(param[2].argument[0]); |
882 |
long idn1=cid(param[3].argument[0]); |
883 |
long idn2=cid(param[4].argument[0]); |
884 |
long idn3=cid(param[5].argument[0]); |
885 |
int ori=atoi(param[6].argument[0].c_str()); |
886 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
887 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
888 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
889 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
890 |
if (idtopo>-1) |
891 |
{ |
892 |
topo=mggeo->get_mg_faceid(idtopo); |
893 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
894 |
} |
895 |
mgmai->ajouter_mg_triangle(topo,noeud1,noeud2,noeud3,ori,id); |
896 |
} |
897 |
if (entite=="QUADRANGLE") |
898 |
{ |
899 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
900 |
long idtopo=cid(param[2].argument[0]); |
901 |
long idn1=cid(param[3].argument[0]); |
902 |
long idn2=cid(param[4].argument[0]); |
903 |
long idn3=cid(param[5].argument[0]); |
904 |
long idn4=cid(param[6].argument[0]); |
905 |
int ori=atoi(param[7].argument[0].c_str()); |
906 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
907 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
908 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
909 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
910 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
911 |
if (idtopo>-1) |
912 |
{ |
913 |
topo=mggeo->get_mg_faceid(idtopo); |
914 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
915 |
} |
916 |
else topo=NULL; |
917 |
mgmai->ajouter_mg_quadrangle(topo,noeud1,noeud2,noeud3,noeud4,ori,id); |
918 |
} |
919 |
if (entite=="FEM_TRIANGLE3") |
920 |
{ |
921 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
922 |
long idtopo=cid(param[2].argument[0]); |
923 |
long idmai=cid(param[3].argument[0]); |
924 |
long idn1=cid(param[4].argument[0]); |
925 |
long idn2=cid(param[5].argument[0]); |
926 |
long idn3=cid(param[6].argument[0]); |
927 |
FEM_NOEUD* tab[3]; |
928 |
tab[0]=femmai->get_fem_noeudid(idn1); |
929 |
tab[1]=femmai->get_fem_noeudid(idn2); |
930 |
tab[2]=femmai->get_fem_noeudid(idn3); |
931 |
MG_ELEMENT_MAILLAGE* elmai; |
932 |
if (idmai>-1) |
933 |
elmai=mgmai->get_mg_triangleid(idmai); |
934 |
else elmai=NULL; |
935 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
936 |
if (idtopo>-1) |
937 |
topo=mggeo->get_mg_areteid(idtopo); |
938 |
FEM_TRIANGLE3* tri=new FEM_TRIANGLE3(id,topo,elmai,tab); |
939 |
femmai->ajouter_fem_element2(tri); |
940 |
} |
941 |
if (entite=="FEM_TRIANGLE6") |
942 |
{ |
943 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2); |
944 |
long idtopo=cid(param[2].argument[0]); |
945 |
long idmai=cid(param[3].argument[0]); |
946 |
long idn1=cid(param[4].argument[0]); |
947 |
long idn2=cid(param[5].argument[0]); |
948 |
long idn3=cid(param[6].argument[0]); |
949 |
long idn4=cid(param[7].argument[0]); |
950 |
long idn5=cid(param[8].argument[0]); |
951 |
long idn6=cid(param[9].argument[0]); |
952 |
FEM_NOEUD* tab[6]; |
953 |
tab[0]=femmai->get_fem_noeudid(idn1); |
954 |
tab[1]=femmai->get_fem_noeudid(idn2); |
955 |
tab[2]=femmai->get_fem_noeudid(idn3); |
956 |
tab[3]=femmai->get_fem_noeudid(idn4); |
957 |
tab[4]=femmai->get_fem_noeudid(idn5); |
958 |
tab[5]=femmai->get_fem_noeudid(idn6); |
959 |
MG_ELEMENT_MAILLAGE* elmai; |
960 |
if (idmai>-1) |
961 |
elmai=mgmai->get_mg_triangleid(idmai); |
962 |
else elmai=NULL; |
963 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
964 |
if (idtopo>-1) |
965 |
topo=mggeo->get_mg_areteid(idtopo); |
966 |
FEM_TRIANGLE6* tri=new FEM_TRIANGLE6(id,topo,elmai,tab); |
967 |
femmai->ajouter_fem_element2(tri); |
968 |
} |
969 |
if (entite=="FEM_QUADRANGLE4") |
970 |
{ |
971 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
972 |
long idtopo=cid(param[2].argument[0]); |
973 |
long idmai=cid(param[3].argument[0]); |
974 |
long idn1=cid(param[4].argument[0]); |
975 |
long idn2=cid(param[5].argument[0]); |
976 |
long idn3=cid(param[6].argument[0]); |
977 |
long idn4=cid(param[7].argument[0]); |
978 |
FEM_NOEUD* tab[4]; |
979 |
tab[0]=femmai->get_fem_noeudid(idn1); |
980 |
tab[1]=femmai->get_fem_noeudid(idn2); |
981 |
tab[2]=femmai->get_fem_noeudid(idn3); |
982 |
tab[3]=femmai->get_fem_noeudid(idn4); |
983 |
MG_ELEMENT_MAILLAGE* elmai; |
984 |
if (idmai>-1) |
985 |
elmai=mgmai->get_mg_quadrangleid(idmai); |
986 |
else elmai=NULL; |
987 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
988 |
if (idtopo>-1) |
989 |
topo=mggeo->get_mg_areteid(idtopo); |
990 |
FEM_QUADRANGLE4* quad=new FEM_QUADRANGLE4(id,topo,elmai,tab); |
991 |
femmai->ajouter_fem_element2(quad); |
992 |
} |
993 |
if (entite=="FEM_QUADRANGLE8") |
994 |
{ |
995 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
996 |
long idtopo=cid(param[2].argument[0]); |
997 |
long idmai=cid(param[3].argument[0]); |
998 |
long idn1=cid(param[4].argument[0]); |
999 |
long idn2=cid(param[5].argument[0]); |
1000 |
long idn3=cid(param[6].argument[0]); |
1001 |
long idn4=cid(param[7].argument[0]); |
1002 |
long idn5=cid(param[8].argument[0]); |
1003 |
long idn6=cid(param[9].argument[0]); |
1004 |
long idn7=cid(param[10].argument[0]); |
1005 |
long idn8=cid(param[11].argument[0]); |
1006 |
FEM_NOEUD* tab[8]; |
1007 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1008 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1009 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1010 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1011 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1012 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1013 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1014 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1015 |
MG_ELEMENT_MAILLAGE* elmai; |
1016 |
if (idmai>-1) |
1017 |
elmai=mgmai->get_mg_quadrangleid(idmai); |
1018 |
else elmai=NULL; |
1019 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1020 |
if (idtopo>-1) |
1021 |
topo=mggeo->get_mg_areteid(idtopo); |
1022 |
FEM_QUADRANGLE8* quad=new FEM_QUADRANGLE8(id,topo,elmai,tab); |
1023 |
femmai->ajouter_fem_element2(quad); |
1024 |
} |
1025 |
if (entite=="TETRAEDRE") |
1026 |
{ |
1027 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
1028 |
long idtopo=cid(param[2].argument[0]); |
1029 |
long idn1=cid(param[3].argument[0]); |
1030 |
long idn2=cid(param[4].argument[0]); |
1031 |
long idn3=cid(param[5].argument[0]); |
1032 |
long idn4=cid(param[6].argument[0]); |
1033 |
int ori=atoi(param[7].argument[0].c_str()); |
1034 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
1035 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
1036 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
1037 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
1038 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
1039 |
if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo); |
1040 |
else topo=NULL; |
1041 |
if (noeud1&&noeud2&&noeud3&&noeud4) mgmai->ajouter_mg_tetra(topo,noeud1,noeud2,noeud3,noeud4,ori,id); |
1042 |
} |
1043 |
if (entite=="HEXAEDRE") |
1044 |
{ |
1045 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
1046 |
long idtopo=cid(param[2].argument[0]); |
1047 |
long idn1=cid(param[3].argument[0]); |
1048 |
long idn2=cid(param[4].argument[0]); |
1049 |
long idn3=cid(param[5].argument[0]); |
1050 |
long idn4=cid(param[6].argument[0]); |
1051 |
long idn5=cid(param[7].argument[0]); |
1052 |
long idn6=cid(param[8].argument[0]); |
1053 |
long idn7=cid(param[9].argument[0]); |
1054 |
long idn8=cid(param[10].argument[0]); |
1055 |
int ori=atoi(param[11].argument[0].c_str()); |
1056 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
1057 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
1058 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
1059 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
1060 |
MG_NOEUD* noeud5=mgmai->get_mg_noeudid(idn5); |
1061 |
MG_NOEUD* noeud6=mgmai->get_mg_noeudid(idn6); |
1062 |
MG_NOEUD* noeud7=mgmai->get_mg_noeudid(idn7); |
1063 |
MG_NOEUD* noeud8=mgmai->get_mg_noeudid(idn8); |
1064 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
1065 |
if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo); |
1066 |
else topo=NULL; |
1067 |
mgmai->ajouter_mg_hexa(topo,noeud1,noeud2,noeud3,noeud4,noeud5,noeud6,noeud7,noeud8,ori,id); |
1068 |
} |
1069 |
if (entite=="FEM_TETRA4") |
1070 |
{ |
1071 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
1072 |
long idtopo=cid(param[2].argument[0]); |
1073 |
long idmai=cid(param[3].argument[0]); |
1074 |
long idn1=cid(param[4].argument[0]); |
1075 |
long idn2=cid(param[5].argument[0]); |
1076 |
long idn3=cid(param[6].argument[0]); |
1077 |
long idn4=cid(param[7].argument[0]); |
1078 |
long etat=atoi(param[8].argument[0].c_str()); |
1079 |
FEM_NOEUD* tab[4]; |
1080 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1081 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1082 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1083 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1084 |
MG_ELEMENT_MAILLAGE* elmai; |
1085 |
if (idmai>-1) |
1086 |
elmai=mgmai->get_mg_tetraid(idmai); |
1087 |
else elmai=NULL; |
1088 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1089 |
if (idtopo>-1) |
1090 |
topo=mggeo->get_mg_areteid(idtopo); |
1091 |
FEM_TETRA4* tet=new FEM_TETRA4(id,topo,elmai,tab); |
1092 |
tet->change_etat(etat); |
1093 |
femmai->ajouter_fem_element3(tet); |
1094 |
} |
1095 |
if (entite=="XFEM_TETRA4") |
1096 |
{ |
1097 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
1098 |
unsigned long idtet=cid(param[2].argument[0]); |
1099 |
unsigned long idn1=cid(param[3].argument[0]); |
1100 |
unsigned long idn2=cid(param[4].argument[0]); |
1101 |
unsigned long idn3=cid(param[5].argument[0]); |
1102 |
unsigned long idn4=cid(param[6].argument[0]); |
1103 |
int etat=atoi(param[7].argument[0].c_str()); |
1104 |
FEM_TETRA4* tet=(FEM_TETRA4*)femmai->get_fem_element3id(idtet); |
1105 |
FEM_NOEUD* tab[4]; |
1106 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1107 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1108 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1109 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1110 |
XFEM_TETRA4* xtet=new XFEM_TETRA4(tet,tab); |
1111 |
femmai->ajouter_xfem_element3(xtet); |
1112 |
tet->change_etat(etat); |
1113 |
} |
1114 |
if (entite=="FEM_TETRA10") |
1115 |
{ |
1116 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1117 |
long idtopo=cid(param[2].argument[0]); |
1118 |
long idmai=cid(param[3].argument[0]); |
1119 |
long idn1=cid(param[4].argument[0]); |
1120 |
long idn2=cid(param[5].argument[0]); |
1121 |
long idn3=cid(param[6].argument[0]); |
1122 |
long idn4=cid(param[7].argument[0]); |
1123 |
long idn5=cid(param[8].argument[0]); |
1124 |
long idn6=cid(param[9].argument[0]); |
1125 |
long idn7=cid(param[10].argument[0]); |
1126 |
long idn8=cid(param[11].argument[0]); |
1127 |
long idn9=cid(param[12].argument[0]); |
1128 |
long idn10=cid(param[13].argument[0]); |
1129 |
FEM_NOEUD* tab[10]; |
1130 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1131 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1132 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1133 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1134 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1135 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1136 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1137 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1138 |
tab[8]=femmai->get_fem_noeudid(idn9); |
1139 |
tab[9]=femmai->get_fem_noeudid(idn10); |
1140 |
MG_ELEMENT_MAILLAGE* elmai; |
1141 |
if (idmai>-1) |
1142 |
elmai=mgmai->get_mg_tetraid(idmai); |
1143 |
else elmai=NULL; |
1144 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1145 |
if (idtopo>-1) |
1146 |
topo=mggeo->get_mg_areteid(idtopo); |
1147 |
FEM_TETRA10* tet=new FEM_TETRA10(id,topo,elmai,tab); |
1148 |
femmai->ajouter_fem_element3(tet); |
1149 |
} |
1150 |
if (entite=="FEM_HEXA8") |
1151 |
{ |
1152 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
1153 |
long idtopo=cid(param[2].argument[0]); |
1154 |
long idmai=cid(param[3].argument[0]); |
1155 |
long idn1=cid(param[4].argument[0]); |
1156 |
long idn2=cid(param[5].argument[0]); |
1157 |
long idn3=cid(param[6].argument[0]); |
1158 |
long idn4=cid(param[7].argument[0]); |
1159 |
long idn5=cid(param[8].argument[0]); |
1160 |
long idn6=cid(param[9].argument[0]); |
1161 |
long idn7=cid(param[10].argument[0]); |
1162 |
long idn8=cid(param[11].argument[0]); |
1163 |
FEM_NOEUD* tab[8]; |
1164 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1165 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1166 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1167 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1168 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1169 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1170 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1171 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1172 |
MG_ELEMENT_MAILLAGE* elmai; |
1173 |
if (idmai>-1) |
1174 |
elmai=mgmai->get_mg_hexaid(idmai); |
1175 |
else elmai=NULL; |
1176 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1177 |
if (idtopo>-1) |
1178 |
topo=mggeo->get_mg_areteid(idtopo); |
1179 |
FEM_HEXA8* hex=new FEM_HEXA8(id,topo,elmai,tab); |
1180 |
femmai->ajouter_fem_element3(hex); |
1181 |
} |
1182 |
if (entite=="FEM_HEXA20") |
1183 |
{ |
1184 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1185 |
long idtopo=cid(param[2].argument[0]); |
1186 |
long idmai=cid(param[3].argument[0]); |
1187 |
long idn1=cid(param[4].argument[0]); |
1188 |
long idn2=cid(param[5].argument[0]); |
1189 |
long idn3=cid(param[6].argument[0]); |
1190 |
long idn4=cid(param[7].argument[0]); |
1191 |
long idn5=cid(param[8].argument[0]); |
1192 |
long idn6=cid(param[9].argument[0]); |
1193 |
long idn7=cid(param[10].argument[0]); |
1194 |
long idn8=cid(param[11].argument[0]); |
1195 |
long idn9=cid(param[12].argument[0]); |
1196 |
long idn10=cid(param[13].argument[0]); |
1197 |
long idn11=cid(param[14].argument[0]); |
1198 |
long idn12=cid(param[15].argument[0]); |
1199 |
long idn13=cid(param[16].argument[0]); |
1200 |
long idn14=cid(param[17].argument[0]); |
1201 |
long idn15=cid(param[18].argument[0]); |
1202 |
long idn16=cid(param[19].argument[0]); |
1203 |
long idn17=cid(param[20].argument[0]); |
1204 |
long idn18=cid(param[21].argument[0]); |
1205 |
long idn19=cid(param[22].argument[0]); |
1206 |
long idn20=cid(param[23].argument[0]); |
1207 |
FEM_NOEUD* tab[20]; |
1208 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1209 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1210 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1211 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1212 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1213 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1214 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1215 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1216 |
tab[8]=femmai->get_fem_noeudid(idn9); |
1217 |
tab[9]=femmai->get_fem_noeudid(idn10); |
1218 |
tab[10]=femmai->get_fem_noeudid(idn11); |
1219 |
tab[11]=femmai->get_fem_noeudid(idn12); |
1220 |
tab[12]=femmai->get_fem_noeudid(idn13); |
1221 |
tab[13]=femmai->get_fem_noeudid(idn14); |
1222 |
tab[14]=femmai->get_fem_noeudid(idn15); |
1223 |
tab[15]=femmai->get_fem_noeudid(idn16); |
1224 |
tab[16]=femmai->get_fem_noeudid(idn17); |
1225 |
tab[17]=femmai->get_fem_noeudid(idn18); |
1226 |
tab[18]=femmai->get_fem_noeudid(idn19); |
1227 |
tab[19]=femmai->get_fem_noeudid(idn20); |
1228 |
MG_ELEMENT_MAILLAGE* elmai; |
1229 |
if (idmai>-1) |
1230 |
elmai=mgmai->get_mg_hexaid(idmai); |
1231 |
else elmai=NULL; |
1232 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1233 |
if (idtopo>-1) |
1234 |
topo=mggeo->get_mg_areteid(idtopo); |
1235 |
FEM_HEXA20* hex=new FEM_HEXA20(id,topo,elmai,tab); |
1236 |
femmai->ajouter_fem_element3(hex); |
1237 |
} |
1238 |
if (entite=="SOLUTION") |
1239 |
{ |
1240 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
1241 |
int typeentite=atoi(param[2].argument[0].c_str()); |
1242 |
int typesolution=atoi(param[3].argument[0].c_str()); |
1243 |
std::string nomsol=param[4].argument[0]; |
1244 |
long idmai=cid(param[5].argument[0]); |
1245 |
int nb=atoi(param[6].argument[0].c_str()); |
1246 |
std::string chemin=param[7].argument[0]; |
1247 |
MG_MAILLAGE* mai=get_mg_maillageid(idmai); |
1248 |
MG_SOLUTION* sol=new MG_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol,typeentite,typesolution); |
1249 |
ajouter_mg_solution(sol); |
1250 |
for (int i=0;i<nb;i++) |
1251 |
sol->change_legende(i,param[8].argument[i]); |
1252 |
} |
1253 |
if (entite=="FEM_SOLUTION") |
1254 |
{ |
1255 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
1256 |
int typeentite=atoi(param[2].argument[0].c_str()); |
1257 |
int typesolution=atoi(param[3].argument[0].c_str()); |
1258 |
std::string nomsol=param[4].argument[0]; |
1259 |
long idmai=cid(param[5].argument[0]); |
1260 |
int nb=atoi(param[6].argument[0].c_str()); |
1261 |
std::string chemin=param[7].argument[0]; |
1262 |
FEM_MAILLAGE* mai=get_fem_maillageid(idmai); |
1263 |
FEM_SOLUTION* sol=new FEM_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol,typeentite,typesolution); |
1264 |
ajouter_fem_solution(sol); |
1265 |
for (int i=0;i<nb;i++) |
1266 |
sol->change_legende(i,param[8].argument[i]); |
1267 |
} |
1268 |
#ifdef WINDOWS_VERSION |
1269 |
if (entite=="CAD4FE_MCSEGMENT") |
1270 |
{ |
1271 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1272 |
long idtopo=cid(param[2].argument[0]); |
1273 |
long idn1=cid(param[3].argument[0]); |
1274 |
long idn2=cid(param[4].argument[0]); |
1275 |
CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1); |
1276 |
CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2); |
1277 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
1278 |
if (idtopo>-1) |
1279 |
{ |
1280 |
topo=mggeo->get_mg_areteid(idtopo); |
1281 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
1282 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
1283 |
} |
1284 |
else topo=NULL; |
1285 |
CAD4FE::MCSegment * seg = new CAD4FE::MCSegment(id,topo,noeud1,noeud2); |
1286 |
mgmai->ajouter_mg_segment(seg); |
1287 |
} |
1288 |
if (entite=="CAD4FE_MCNODE") |
1289 |
{ |
1290 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
1291 |
long idRefTopo=cid(param[2].argument[0]); |
1292 |
long idMCTopo=cid(param[3].argument[0]); |
1293 |
double x=atof(param[4].argument[0].c_str()); |
1294 |
double y=atof(param[5].argument[0].c_str()); |
1295 |
double z=atof(param[6].argument[0].c_str()); |
1296 |
MG_ELEMENT_TOPOLOGIQUE* refTopo=NULL; |
1297 |
if (refTopo==NULL) refTopo=mggeo->get_mg_sommetid(idRefTopo); |
1298 |
if (refTopo==NULL) refTopo=mggeo->get_mg_areteid(idRefTopo); |
1299 |
if (refTopo==NULL) refTopo=mggeo->get_mg_faceid(idRefTopo); |
1300 |
if (refTopo==NULL) refTopo=mggeo->get_mg_volumeid(idRefTopo); |
1301 |
MG_ELEMENT_TOPOLOGIQUE* mcTopo=NULL; |
1302 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_sommetid(idMCTopo); |
1303 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_areteid(idMCTopo); |
1304 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_faceid(idMCTopo); |
1305 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_volumeid(idMCTopo); |
1306 |
|
1307 |
if (mcTopo->get_dimension()==0) |
1308 |
{ |
1309 |
if (updatedMergedRefVertices == false) |
1310 |
{ |
1311 |
for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin(); |
1312 |
itMergedRefVertices != mapMergedRefVertices.end(); |
1313 |
itMergedRefVertices++) |
1314 |
{ |
1315 |
CAD4FE::MCVertex * v = itMergedRefVertices->first; |
1316 |
MG_SOMMET * refV = NULL; |
1317 |
unsigned long id = itMergedRefVertices->second; |
1318 |
refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id); |
1319 |
v->MergeRefVertex(refV); |
1320 |
} |
1321 |
|
1322 |
updatedMergedRefVertices = true; |
1323 |
} |
1324 |
} |
1325 |
|
1326 |
CAD4FE::MCNode* noeud=new CAD4FE::MCNode(id,mcTopo,refTopo,x,y,z); |
1327 |
mgmai->ajouter_mg_noeud(noeud); |
1328 |
} |
1329 |
if (entite=="CAD4FE_MCTRIANGLE") |
1330 |
{ |
1331 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
1332 |
long idtopo=cid(param[2].argument[0]); |
1333 |
long idn1=cid(param[3].argument[0]); |
1334 |
long idn2=cid(param[4].argument[0]); |
1335 |
long idn3=cid(param[5].argument[0]); |
1336 |
CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1); |
1337 |
CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2); |
1338 |
CAD4FE::MCNode* noeud3=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn3); |
1339 |
CAD4FE::MCSegment* mgsegment[3]; |
1340 |
CAD4FE::MCNode *mgnoeud[3]={noeud1,noeud2,noeud3}; |
1341 |
// la topo. d'un MCTriangle est obligatoirement une MCFace |
1342 |
CAD4FE::MCFace* mcFace=(CAD4FE::MCFace*)mggeo->get_mg_faceid(idtopo); |
1343 |
for (int i=0;i<3;i++) |
1344 |
{ |
1345 |
mgsegment[i]=(CAD4FE::MCSegment*)mgmai->get_mg_segment(mgnoeud[i]->get_id(),mgnoeud[(i+1)%3]->get_id()); |
1346 |
if (mgsegment[i]==NULL) |
1347 |
{ |
1348 |
mgsegment[i]=new CAD4FE::MCSegment(mcFace,mgnoeud[i],mgnoeud[(i+1)%3]); |
1349 |
mgmai->ajouter_mg_segment(mgsegment[i]); |
1350 |
} |
1351 |
} |
1352 |
CAD4FE::M3D_MCTriangle *triangle = new CAD4FE::M3D_MCTriangle(id,mcFace,noeud1,noeud2,noeud3,mgsegment[0],mgsegment[1],mgsegment[2]); |
1353 |
mgmai->ajouter_mg_triangle(triangle); |
1354 |
} |
1355 |
#endif |
1356 |
} |
1357 |
} |
1358 |
while (param[0].argument[0]!="FIN"); |
1359 |
#ifdef WINDOWS_VERSION |
1360 |
if (updatedMergedRefVertices == false) |
1361 |
{ |
1362 |
for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin(); |
1363 |
itMergedRefVertices != mapMergedRefVertices.end(); |
1364 |
itMergedRefVertices++) |
1365 |
{ |
1366 |
CAD4FE::MCVertex * v = itMergedRefVertices->first; |
1367 |
MG_SOMMET * refV = NULL; |
1368 |
unsigned long id = itMergedRefVertices->second; |
1369 |
refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id); |
1370 |
v->MergeRefVertex(refV); |
1371 |
} |
1372 |
|
1373 |
updatedMergedRefVertices = true; |
1374 |
} |
1375 |
|
1376 |
#endif |
1377 |
fclose(in); |
1378 |
#ifdef BREP_SLD |
1379 |
fonction->Fermer(); |
1380 |
#endif |
1381 |
return 1; |
1382 |
} |
1383 |
|
1384 |
|
1385 |
|
1386 |
|