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