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 "mg_sommet_noeud.h" |
32 |
#include "mg_arete_element.h" |
33 |
#include "mg_face_element.h" |
34 |
#include "mg_volume_element.h" |
35 |
#include "mg_coque_element.h" |
36 |
#include "mg_poutre_element.h" |
37 |
#include "pars_argument.h" |
38 |
#include "parse.h" |
39 |
#include "ot_chaine.h" |
40 |
#ifdef BREP_STEP |
41 |
#include "step_surface.h" |
42 |
#include "step_courbe.h" |
43 |
#include "step_point.h" |
44 |
#endif |
45 |
#ifdef BREP_SAT |
46 |
#include "acis_surface.h" |
47 |
#include "acis_courbe.h" |
48 |
#include "acis_point.h" |
49 |
#endif |
50 |
#include "lc_point.h" |
51 |
#include "fem_segment2.h" |
52 |
#include "fem_mini_segment2.h" |
53 |
#include "fem_segment3.h" |
54 |
#include "fem_triangle3.h" |
55 |
#include "fem_triangle6.h" |
56 |
#include "fem_quadrangle4.h" |
57 |
#include "fem_quadrangle8.h" |
58 |
#include "fem_tetra4.h" |
59 |
#include "xfem_segment2.h" |
60 |
#include "xfem_triangle3.h" |
61 |
#include "xfem_tetra4.h" |
62 |
#include "fem_tetra10.h" |
63 |
#include "fem_hexa8.h" |
64 |
#include "fem_hexa20.h" |
65 |
#include "fem_penta6.h" |
66 |
#include "fem_penta15.h" |
67 |
//OCC |
68 |
#ifdef BREP_OCC |
69 |
#include "occ_surface.h" |
70 |
#include "occ_point.h" |
71 |
#include "occ_courbe.h" |
72 |
#include "occ_fonction.h" |
73 |
#include "TopoDS_Shape.hxx" |
74 |
#include "TopoDS.hxx" |
75 |
#endif |
76 |
#ifdef CSG_OCC |
77 |
#include "mg_assemblage.h" |
78 |
#include "mg_primitive_boite.h" |
79 |
#include "mg_primitive_sphere.h" |
80 |
#include "mg_primitive_ellipsoide_revolution.h" |
81 |
#include "mg_primitive_cylindre.h" |
82 |
#include "mg_primitive_cone.h" |
83 |
#include "mg_primitive_tore.h" |
84 |
#include "mg_primitive_complexe.h" |
85 |
#include "mg_operateur_boolean_union.h" |
86 |
#include "mg_operateur_boolean_difference.h" |
87 |
#include "mg_operateur_boolean_intersection.h" |
88 |
#endif |
89 |
//--------------------------------------------------------------------------- |
90 |
// CAD4FE Headers |
91 |
#ifdef WINDOWS_VERSION |
92 |
#include "CAD4FE_MCEdge.h" |
93 |
#include "CAD4FE_MCFace.h" |
94 |
#include "CAD4FE_MCVertex.h" |
95 |
#include "CAD4FE_PolySurface.h" |
96 |
#include "CAD4FE_PolyCurve.h" |
97 |
#include "CAD4FE_MCNode.h" |
98 |
#include "CAD4FE_MCSegment.h" |
99 |
#include "CAD4FE_MCTriangle.h" |
100 |
#include "CAD4FE_m3d_MCTriangle.h" |
101 |
#endif |
102 |
//--------------------------------------------------------------------------- |
103 |
|
104 |
|
105 |
//--------------------------------------------------------------------------- |
106 |
#pragma package(smart_init) |
107 |
|
108 |
|
109 |
MG_FILE::MG_FILE(char* chemin):MG_GESTIONNAIRE() |
110 |
{ |
111 |
code_de_lecture=lire(chemin); |
112 |
} |
113 |
|
114 |
MG_FILE::MG_FILE():MG_GESTIONNAIRE() |
115 |
{ |
116 |
} |
117 |
|
118 |
MG_FILE::~MG_FILE() |
119 |
{ |
120 |
} |
121 |
|
122 |
int MG_FILE::get_code_de_lecture(void) |
123 |
{ |
124 |
return code_de_lecture; |
125 |
} |
126 |
|
127 |
long MG_FILE::cid(std::string str) |
128 |
{ |
129 |
const char *p=str.c_str(); |
130 |
if (*p=='$') return atol(p+1); |
131 |
return -1; |
132 |
} |
133 |
|
134 |
|
135 |
void MG_FILE::lire_ccf(double version,int nb,int numparam,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],MG_ELEMENT_TOPOLOGIQUE *ele) |
136 |
{ |
137 |
if (version<2.0) |
138 |
{ |
139 |
for (int i=0;i<nb;i++) |
140 |
{ |
141 |
parse.decode(param[numparam].argument[i].c_str(),"(@,@)",param+numparam+1); |
142 |
char nom[3]; |
143 |
strcpy(nom,param[numparam+1].argument[0].c_str()); |
144 |
if (strcmp(nom,"CM")==0) |
145 |
{ |
146 |
unsigned long val; |
147 |
val=atol(param[numparam+2].argument[0].c_str()); |
148 |
ele->ajouter_ccf(nom,val); |
149 |
} |
150 |
else |
151 |
{ |
152 |
double val; |
153 |
val=atof(param[numparam+2].argument[0].c_str()); |
154 |
ele->ajouter_ccf(nom,val); |
155 |
} |
156 |
} |
157 |
} |
158 |
else if (version<2.1) |
159 |
{ |
160 |
for (int i=0;i<nb;i++) |
161 |
{ |
162 |
char test[500]; |
163 |
strcpy(test,param[numparam].argument[i].c_str()); |
164 |
parse.decode(param[numparam].argument[i].c_str(),"(@,@,@)",param+numparam+1); |
165 |
char formulation[10]; |
166 |
strcpy(formulation,param[numparam+1].argument[0].c_str()); |
167 |
char nom[3]; |
168 |
strcpy(nom,param[numparam+2].argument[0].c_str()); |
169 |
if (formulation[0]=='N') |
170 |
{ |
171 |
double val; |
172 |
val=atof(param[numparam+3].argument[0].c_str()); |
173 |
ele->ajouter_ccf(nom,val); |
174 |
} |
175 |
if (formulation[0]=='I') |
176 |
{ |
177 |
unsigned long val; |
178 |
val=atol(param[numparam+3].argument[0].c_str()); |
179 |
ele->ajouter_ccf(nom,val); |
180 |
} |
181 |
if (formulation[0]=='F') |
182 |
{ |
183 |
parse.decode(param[numparam].argument[i].c_str(),"(@,@,@,@,(@))",param+numparam+1); |
184 |
char formule[500]; |
185 |
strcpy(formule,param[numparam+3].argument[0].c_str()); |
186 |
char variable[500]; |
187 |
strcpy(variable,param[numparam+5].argument[0].c_str()); |
188 |
OT_CHAINE ot; |
189 |
std::vector<std::string> listvariable=ot.split(variable,','); |
190 |
ele->ajouter_ccf(nom,formule,listvariable); |
191 |
} |
192 |
} |
193 |
} |
194 |
else |
195 |
{ |
196 |
for (int i=0;i<nb;i++) |
197 |
{ |
198 |
char test[500]; |
199 |
strcpy(test,param[numparam].argument[i].c_str()); |
200 |
parse.decode(param[numparam].argument[i].c_str(),"(@,@,@,@)",param+numparam+1); |
201 |
char formulation[10]; |
202 |
strcpy(formulation,param[numparam+1].argument[0].c_str()); |
203 |
char nom[3]; |
204 |
strcpy(nom,param[numparam+2].argument[0].c_str()); |
205 |
char suiv[10]; |
206 |
strcpy(suiv,param[numparam+3].argument[0].c_str()); |
207 |
if (formulation[0]=='N') |
208 |
{ |
209 |
double val; |
210 |
val=atof(param[numparam+4].argument[0].c_str()); |
211 |
ele->ajouter_ccf(nom,val,suiv); |
212 |
} |
213 |
if (formulation[0]=='I') |
214 |
{ |
215 |
unsigned long val; |
216 |
val=atol(param[numparam+4].argument[0].c_str()); |
217 |
ele->ajouter_ccf(nom,val,suiv); |
218 |
} |
219 |
if (formulation[0]=='F') |
220 |
{ |
221 |
parse.decode(param[numparam].argument[i].c_str(),"(@,@,@,,@@,(@))",param+numparam+1); |
222 |
char formule[500]; |
223 |
strcpy(formule,param[numparam+4].argument[0].c_str()); |
224 |
char variable[500]; |
225 |
strcpy(variable,param[numparam+6].argument[0].c_str()); |
226 |
OT_CHAINE ot; |
227 |
std::vector<std::string> listvariable=ot.split(variable,','); |
228 |
ele->ajouter_ccf(nom,formule,listvariable,suiv); |
229 |
} |
230 |
} |
231 |
} |
232 |
} |
233 |
|
234 |
void MG_FILE::lire_NOEUD(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
235 |
{ |
236 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
237 |
long idtopo=cid(param[2].argument[0]); |
238 |
double x=atof(param[3].argument[0].c_str()); |
239 |
double y=atof(param[4].argument[0].c_str()); |
240 |
double z=atof(param[5].argument[0].c_str()); |
241 |
int ori=atoi(param[6].argument[0].c_str()); |
242 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
243 |
if (idtopo>-1) |
244 |
{ |
245 |
topo=mggeo->get_mg_sommetid(idtopo); |
246 |
if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo); |
247 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
248 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
249 |
} |
250 |
else topo=NULL; |
251 |
MG_NOEUD* noeud=new MG_NOEUD(id,topo,x,y,z,ori); |
252 |
mgmai->ajouter_mg_noeud(noeud); |
253 |
} |
254 |
|
255 |
void MG_FILE::lire_SEGMENT(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
256 |
{ |
257 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
258 |
long idtopo=cid(param[2].argument[0]); |
259 |
long idn1=cid(param[3].argument[0]); |
260 |
long idn2=cid(param[4].argument[0]); |
261 |
int ori=atoi(param[5].argument[0].c_str()); |
262 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
263 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
264 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
265 |
if (idtopo>-1) |
266 |
{ |
267 |
topo=mggeo->get_mg_areteid(idtopo); |
268 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
269 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
270 |
if (topo==NULL) topo=mggeo->get_mg_poutreid(idtopo); |
271 |
} |
272 |
else topo=NULL; |
273 |
MG_SEGMENT* seg=new MG_SEGMENT(id,topo,noeud1,noeud2,ori); |
274 |
mgmai->ajouter_mg_segment(seg); |
275 |
} |
276 |
|
277 |
|
278 |
void MG_FILE::lire_TRIANGLE(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
279 |
{ |
280 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
281 |
long idtopo=cid(param[2].argument[0]); |
282 |
long idn1=cid(param[3].argument[0]); |
283 |
long idn2=cid(param[4].argument[0]); |
284 |
long idn3=cid(param[5].argument[0]); |
285 |
int ori=atoi(param[6].argument[0].c_str()); |
286 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
287 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
288 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
289 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
290 |
if (idtopo>-1) |
291 |
{ |
292 |
topo=mggeo->get_mg_faceid(idtopo); |
293 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
294 |
} |
295 |
mgmai->ajouter_mg_triangle(topo,noeud1,noeud2,noeud3,ori,id); |
296 |
} |
297 |
|
298 |
void MG_FILE::lire_QUADRANGLE(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
299 |
{ |
300 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
301 |
long idtopo=cid(param[2].argument[0]); |
302 |
long idn1=cid(param[3].argument[0]); |
303 |
long idn2=cid(param[4].argument[0]); |
304 |
long idn3=cid(param[5].argument[0]); |
305 |
long idn4=cid(param[6].argument[0]); |
306 |
int ori=atoi(param[7].argument[0].c_str()); |
307 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
308 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
309 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
310 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
311 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
312 |
if (idtopo>-1) |
313 |
{ |
314 |
topo=mggeo->get_mg_faceid(idtopo); |
315 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
316 |
} |
317 |
else topo=NULL; |
318 |
mgmai->ajouter_mg_quadrangle(topo,noeud1,noeud2,noeud3,noeud4,ori,id); |
319 |
} |
320 |
|
321 |
|
322 |
void MG_FILE::lire_TETRA(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
323 |
{ |
324 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
325 |
long idtopo=cid(param[2].argument[0]); |
326 |
long idn1=cid(param[3].argument[0]); |
327 |
long idn2=cid(param[4].argument[0]); |
328 |
long idn3=cid(param[5].argument[0]); |
329 |
long idn4=cid(param[6].argument[0]); |
330 |
int ori=atoi(param[7].argument[0].c_str()); |
331 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
332 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
333 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
334 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
335 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
336 |
if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo); |
337 |
else topo=NULL; |
338 |
if (noeud1&&noeud2&&noeud3&&noeud4) mgmai->ajouter_mg_tetra(topo,noeud1,noeud2,noeud3,noeud4,ori,id); |
339 |
} |
340 |
|
341 |
void MG_FILE::lire_HEXA(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
342 |
{ |
343 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
344 |
long idtopo=cid(param[2].argument[0]); |
345 |
long idn1=cid(param[3].argument[0]); |
346 |
long idn2=cid(param[4].argument[0]); |
347 |
long idn3=cid(param[5].argument[0]); |
348 |
long idn4=cid(param[6].argument[0]); |
349 |
long idn5=cid(param[7].argument[0]); |
350 |
long idn6=cid(param[8].argument[0]); |
351 |
long idn7=cid(param[9].argument[0]); |
352 |
long idn8=cid(param[10].argument[0]); |
353 |
int ori=atoi(param[11].argument[0].c_str()); |
354 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
355 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
356 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
357 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
358 |
MG_NOEUD* noeud5=mgmai->get_mg_noeudid(idn5); |
359 |
MG_NOEUD* noeud6=mgmai->get_mg_noeudid(idn6); |
360 |
MG_NOEUD* noeud7=mgmai->get_mg_noeudid(idn7); |
361 |
MG_NOEUD* noeud8=mgmai->get_mg_noeudid(idn8); |
362 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
363 |
if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo); |
364 |
else topo=NULL; |
365 |
mgmai->ajouter_mg_hexa(topo,noeud1,noeud2,noeud3,noeud4,noeud5,noeud6,noeud7,noeud8,ori,id); |
366 |
} |
367 |
|
368 |
|
369 |
void MG_FILE::lire_PENTA(long id,class PARSE& parse,class PARS_ARGUMENT (¶m)[100],std::string& data,MG_MAILLAGE *mgmai,MG_GEOMETRIE *mggeo) |
370 |
{ |
371 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2); |
372 |
long idtopo=cid(param[2].argument[0]); |
373 |
long idn1=cid(param[3].argument[0]); |
374 |
long idn2=cid(param[4].argument[0]); |
375 |
long idn3=cid(param[5].argument[0]); |
376 |
long idn4=cid(param[6].argument[0]); |
377 |
long idn5=cid(param[7].argument[0]); |
378 |
long idn6=cid(param[8].argument[0]); |
379 |
int ori=atoi(param[9].argument[0].c_str()); |
380 |
MG_NOEUD* noeud1=mgmai->get_mg_noeudid(idn1); |
381 |
MG_NOEUD* noeud2=mgmai->get_mg_noeudid(idn2); |
382 |
MG_NOEUD* noeud3=mgmai->get_mg_noeudid(idn3); |
383 |
MG_NOEUD* noeud4=mgmai->get_mg_noeudid(idn4); |
384 |
MG_NOEUD* noeud5=mgmai->get_mg_noeudid(idn5); |
385 |
MG_NOEUD* noeud6=mgmai->get_mg_noeudid(idn6); |
386 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
387 |
if (idtopo>-1) topo=mggeo->get_mg_volumeid(idtopo); |
388 |
else topo=NULL; |
389 |
mgmai->ajouter_mg_penta(topo,noeud1,noeud2,noeud3,noeud4,noeud5,noeud6,ori,id); |
390 |
} |
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
int MG_FILE::lire(char* chemin) |
397 |
{ |
398 |
FILE *in; |
399 |
//char ligne[3000]; |
400 |
in=fopen(chemin,"rt"); |
401 |
if (in==NULL) return 0; |
402 |
PARS_ARGUMENT param[100]; |
403 |
PARSE parse; |
404 |
|
405 |
MG_GEOMETRIE *mggeo; |
406 |
MG_ARBRE* arbre; |
407 |
#ifdef WINDOWS_VERSION |
408 |
std::multimap<CAD4FE::MCVertex*, unsigned long> mapMergedRefVertices; |
409 |
#endif |
410 |
bool updatedMergedRefVertices = false; |
411 |
version_fichier=1.0; |
412 |
std::vector<unsigned long> volumemince; |
413 |
do |
414 |
{ |
415 |
int ierr; |
416 |
std::string ligne=parse.lire(in,';',&ierr); |
417 |
parse.decode(ligne.c_str(),"@;",param); |
418 |
const char *chaine=param[0].argument[0].c_str(); |
419 |
if ((chaine[0]=='/') && (chaine[1]=='/')) |
420 |
{ |
421 |
if ((chaine[2]=='*')&&(chaine[3]=='i')) |
422 |
{ |
423 |
unsigned long id; |
424 |
sscanf(chaine,"//*i:%lu;",&id); |
425 |
entiteidmax=id; |
426 |
} |
427 |
if ((chaine[2]=='*')&&(chaine[3]=='v')) |
428 |
sscanf(chaine,"//*v:%lf;",&version_fichier); |
429 |
} |
430 |
else if (param[0].argument[0]!="FIN") |
431 |
{ |
432 |
parse.decode(ligne.c_str(),"%@=@(@);",param); |
433 |
std::string entite=param[1].argument[0]; |
434 |
long id=atol(param[0].argument[0].c_str()); |
435 |
std::string data=param[2].argument[0] ; |
436 |
MG_MAILLAGE *mgmai; |
437 |
FEM_MAILLAGE *femmai; |
438 |
if (entite=="GEOMETRIE") |
439 |
{ |
440 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
441 |
double unite=atof(param[2].argument[0].c_str()); |
442 |
std::string typegeo=param[3].argument[0]; |
443 |
std::string chemin=param[4].argument[0]; |
444 |
if (typegeo=="VIRTUEL") |
445 |
{ |
446 |
mggeo=new MG_GEOMETRIE((char*)typegeo.c_str(),id,(char*)chemin.c_str(),unite); |
447 |
ajouter_mg_geometrie(mggeo); |
448 |
} |
449 |
#ifdef BREP_STEP |
450 |
if (typegeo=="STEP") |
451 |
{ |
452 |
mggeo=new MG_GEOMETRIE((char*)"STEP",id,(char *)chemin.c_str(),unite); |
453 |
ajouter_mg_geometrie(mggeo); |
454 |
} |
455 |
#endif |
456 |
#ifdef BREP_SAT |
457 |
if (typegeo=="ACIS") |
458 |
{ |
459 |
mggeo=new MG_GEOMETRIE((char*)"ACIS",id,(char *)chemin.c_str(),unite); |
460 |
ajouter_mg_geometrie(mggeo); |
461 |
} |
462 |
#endif |
463 |
|
464 |
#ifdef BREP_OCC |
465 |
if (typegeo=="OCC") |
466 |
{ |
467 |
mggeo=new MG_GEOMETRIE((char*)"OCC",id,chemin.c_str(),unite); |
468 |
ajouter_mg_geometrie(mggeo); |
469 |
} |
470 |
if (typegeo=="OCCV2015") |
471 |
{ |
472 |
mggeo=new MG_GEOMETRIE((char*)"OCCV2015",id,chemin.c_str(),unite); |
473 |
ajouter_mg_geometrie(mggeo); |
474 |
} |
475 |
#endif |
476 |
|
477 |
std::string nommat=""; |
478 |
if (param[5].argument[0]!="") |
479 |
nommat=param[5].argument[0]; |
480 |
mggeo->change_gest_materiau((char*)nommat.c_str()); |
481 |
} |
482 |
#ifdef CSG_OCC |
483 |
if (entite=="ARBRE") |
484 |
{ |
485 |
parse.decode(data.c_str(),"@",param+2); |
486 |
std::string nom=param[2].argument[0]; |
487 |
arbre=new MG_ARBRE(id,nom.c_str()); |
488 |
ajouter_mg_arbre(arbre); |
489 |
} |
490 |
if (entite == "ASSEMBLAGE") |
491 |
{ |
492 |
parse.decode(data.c_str(),"@,@,(&)",param+2); |
493 |
std::string nom=param[2].argument[0]; |
494 |
int nb_primitive = atoi((char*)param[3].argument[0].c_str()); |
495 |
MG_ASSEMBLAGE *mgassembl=new MG_ASSEMBLAGE(id,nom.c_str()); |
496 |
for(int i=0;i<nb_primitive;i++) |
497 |
{ |
498 |
unsigned long id2 = cid(param[4].argument[i]); |
499 |
mgassembl->ajouter_mg_primitive(id2); |
500 |
} |
501 |
arbre->ajouter_mg_assemblage(mgassembl); |
502 |
} |
503 |
if (entite=="BOITE") |
504 |
{ |
505 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
506 |
double x1=atof((char*)param[2].argument[0].c_str()); |
507 |
double y1=atof((char*)param[3].argument[0].c_str()); |
508 |
double z1=atof((char*)param[4].argument[0].c_str()); |
509 |
double x2=atof((char*)param[5].argument[0].c_str()); |
510 |
double y2=atof((char*)param[6].argument[0].c_str()); |
511 |
double z2=atof((char*)param[7].argument[0].c_str()); |
512 |
MG_PRIMITIVE_BOITE *b=new MG_PRIMITIVE_BOITE(id,x1,y1,z1,x2,y2,z2); |
513 |
b->construit(); |
514 |
arbre->ajouter_mg_primitive(b); |
515 |
} |
516 |
if (entite=="SPHERE") |
517 |
{ |
518 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
519 |
double centre_x=atof((char*)param[2].argument[0].c_str()); |
520 |
double centre_y=atof((char*)param[3].argument[0].c_str()); |
521 |
double centre_z=atof((char*)param[4].argument[0].c_str()); |
522 |
double rayon=atof((char*)param[5].argument[0].c_str()); |
523 |
MG_PRIMITIVE_SPHERE *b=new MG_PRIMITIVE_SPHERE(id,centre_x,centre_y,centre_z,rayon); |
524 |
b->construit(); |
525 |
arbre->ajouter_mg_primitive(b); |
526 |
} |
527 |
if (entite=="ELLIPSOIDE_REVOLUTION") |
528 |
{ |
529 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2); |
530 |
double centre_x=atof((char*)param[2].argument[0].c_str()); |
531 |
double centre_y=atof((char*)param[3].argument[0].c_str()); |
532 |
double centre_z=atof((char*)param[4].argument[0].c_str()); |
533 |
double axe_x=atof((char*)param[5].argument[0].c_str()); |
534 |
double axe_y=atof((char*)param[6].argument[0].c_str()); |
535 |
double axe_z=atof((char*)param[7].argument[0].c_str()); |
536 |
double rayon_majeur=atof((char*)param[8].argument[0].c_str()); |
537 |
double rayon_mineur=atof((char*)param[9].argument[0].c_str()); |
538 |
MG_PRIMITIVE_ELLIPSOIDE_REVOLUTION *b=new MG_PRIMITIVE_ELLIPSOIDE_REVOLUTION(id,centre_x,centre_y,centre_z,axe_x,axe_y,axe_z,rayon_majeur,rayon_mineur); |
539 |
b->construit(); |
540 |
arbre->ajouter_mg_primitive(b); |
541 |
} |
542 |
if (entite=="CYLINDRE") |
543 |
{ |
544 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
545 |
double extremite_x=atof((char*)param[2].argument[0].c_str()); |
546 |
double extremite_y=atof((char*)param[3].argument[0].c_str()); |
547 |
double extremite_z=atof((char*)param[4].argument[0].c_str()); |
548 |
double longitude=atof((char*)param[5].argument[0].c_str()); |
549 |
double latitude=atof((char*)param[6].argument[0].c_str()); |
550 |
double rayon=atof((char*)param[7].argument[0].c_str()); |
551 |
double longueur=atof((char*)param[8].argument[0].c_str()); |
552 |
MG_PRIMITIVE_CYLINDRE *b=new MG_PRIMITIVE_CYLINDRE(id,extremite_x,extremite_y,extremite_z,longitude,latitude,rayon,longueur); |
553 |
b->construit(); |
554 |
arbre->ajouter_mg_primitive(b); |
555 |
} |
556 |
if (entite=="TORE") |
557 |
{ |
558 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
559 |
double centre_x=atof((char*)param[2].argument[0].c_str()); |
560 |
double centre_y=atof((char*)param[3].argument[0].c_str()); |
561 |
double centre_z=atof((char*)param[4].argument[0].c_str()); |
562 |
double longitude=atof((char*)param[5].argument[0].c_str()); |
563 |
double latitude=atof((char*)param[6].argument[0].c_str()); |
564 |
double rayon_cercle=atof((char*)param[7].argument[0].c_str()); |
565 |
double rayon_tore=atof((char*)param[8].argument[0].c_str()); |
566 |
MG_PRIMITIVE_TORE *b=new MG_PRIMITIVE_TORE(id,centre_x,centre_y,centre_z,longitude,latitude,rayon_cercle,rayon_tore); |
567 |
b->construit(); |
568 |
arbre->ajouter_mg_primitive(b); |
569 |
} |
570 |
if (entite=="CONE") |
571 |
{ |
572 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
573 |
double base_x=atof((char*)param[2].argument[0].c_str()); |
574 |
double base_y=atof((char*)param[3].argument[0].c_str()); |
575 |
double base_z=atof((char*)param[4].argument[0].c_str()); |
576 |
double longitude=atof((char*)param[5].argument[0].c_str()); |
577 |
double latitude=atof((char*)param[6].argument[0].c_str()); |
578 |
double rayon=atof((char*)param[7].argument[0].c_str()); |
579 |
double hauteur=atof((char*)param[8].argument[0].c_str()); |
580 |
MG_PRIMITIVE_CONE *b=new MG_PRIMITIVE_CONE(id,base_x,base_y,base_z,longitude,latitude,rayon,hauteur); |
581 |
b->construit(); |
582 |
arbre->ajouter_mg_primitive(b); |
583 |
} |
584 |
if (entite=="UNION") |
585 |
{ |
586 |
parse.decode(data.c_str(),"@,@,@",param+2); |
587 |
int sem=atoi((char*)param[2].argument[0].c_str()); |
588 |
long id1=cid((char*)param[3].argument[0].c_str()); |
589 |
long id2=cid((char*)param[4].argument[0].c_str()); |
590 |
MG_PRIMITIVE *p1=arbre->get_mg_primitiveid(id1); |
591 |
MG_PRIMITIVE *p2=arbre->get_mg_primitiveid(id2); |
592 |
MG_OPERATEUR_BOOLEAN_UNION *op=new MG_OPERATEUR_BOOLEAN_UNION(id,sem,p1,p2); |
593 |
arbre->ajouter_mg_operateur_boolean(op); |
594 |
} |
595 |
if (entite=="DIFFERENCE") |
596 |
{ |
597 |
parse.decode(data.c_str(),"@,@,@",param+2); |
598 |
int sem=atoi((char*)param[2].argument[0].c_str()); |
599 |
long id1=cid((char*)param[3].argument[0].c_str()); |
600 |
long id2=cid((char*)param[4].argument[0].c_str()); |
601 |
MG_PRIMITIVE *p1=arbre->get_mg_primitiveid(id1); |
602 |
MG_PRIMITIVE *p2=arbre->get_mg_primitiveid(id2); |
603 |
MG_OPERATEUR_BOOLEAN_DIFFERENCE *op=new MG_OPERATEUR_BOOLEAN_DIFFERENCE(id,sem,p1,p2); |
604 |
arbre->ajouter_mg_operateur_boolean(op); |
605 |
} |
606 |
if (entite=="INTERSECTION") |
607 |
{ |
608 |
parse.decode(data.c_str(),"@,@,@",param+2); |
609 |
int sem=atoi((char*)param[2].argument[0].c_str()); |
610 |
long id1=cid((char*)param[3].argument[0].c_str()); |
611 |
long id2=cid((char*)param[4].argument[0].c_str()); |
612 |
MG_PRIMITIVE *p1=arbre->get_mg_primitiveid(id1); |
613 |
MG_PRIMITIVE *p2=arbre->get_mg_primitiveid(id2); |
614 |
MG_OPERATEUR_BOOLEAN_INTERSECTION *op=new MG_OPERATEUR_BOOLEAN_INTERSECTION(id,sem,p1,p2); |
615 |
arbre->ajouter_mg_operateur_boolean(op); |
616 |
} |
617 |
if (entite=="PRIM_COMPLEXE") |
618 |
{ |
619 |
parse.decode(data.c_str(),"@",param+2); |
620 |
long id1=cid((char*)param[2].argument[0].c_str()); |
621 |
MG_OPERATEUR_BOOLEAN *op=arbre->get_mg_operateur_booleanid(id1); |
622 |
MG_PRIMITIVE* p=op->construit(id); |
623 |
arbre->ajouter_mg_primitive(p); |
624 |
} |
625 |
|
626 |
|
627 |
|
628 |
|
629 |
#endif |
630 |
if (entite=="GEOMETRIE_EPS") |
631 |
{ |
632 |
parse.decode(data.c_str(),"@",param+2); |
633 |
double val=atof((char*)param[2].argument[0].c_str()); |
634 |
mggeo->change_valeur_precision(val); |
635 |
} |
636 |
if (entite=="GROUPE_TOPOLOGIQUE") |
637 |
{ |
638 |
parse.decode(data.c_str(),"@,(&)",param+2); |
639 |
MG_GROUPE_TOPOLOGIQUE* mggt=new MG_GROUPE_TOPOLOGIQUE(id); |
640 |
mggeo->ajouter_mg_groupe_topologique(mggt); |
641 |
int nb=atoi(param[2].argument[0].c_str()); |
642 |
for (int i=0;i<nb;i++) |
643 |
{ |
644 |
unsigned long id2=cid(param[3].argument[i].c_str()); |
645 |
MG_ELEMENT_TOPOLOGIQUE* ele; |
646 |
ele=mggeo->get_mg_sommetid(id2); |
647 |
if (ele==NULL) ele=mggeo->get_mg_areteid(id2); |
648 |
if (ele==NULL) ele=mggeo->get_mg_faceid(id2); |
649 |
if (ele==NULL) ele=mggeo->get_mg_volumeid(id2); |
650 |
if (ele!=NULL) mggt->ajouter(ele); |
651 |
} |
652 |
|
653 |
} |
654 |
if (entite=="GEOM_FONCTION") |
655 |
{ |
656 |
parse.decode(data.c_str(),"@,@,(&)",param+2); |
657 |
int dim=atoi((char*)param[2].argument[0].c_str()); |
658 |
MG_GEOM_FONCTION *gf=new MG_GEOM_FONCTION(id,dim); |
659 |
mggeo->ajouter_mg_geom_fonction(gf); |
660 |
int nb=atoi(param[3].argument[0].c_str()); |
661 |
for (int i=0;i<nb;i++) |
662 |
{ |
663 |
parse.decode(param[4].argument[i].c_str(),"(&)",param+5); |
664 |
double *coo=new double[dim]; |
665 |
for (int j=0;j<dim;j++) |
666 |
coo[j]=atof(param[5].argument[j].c_str()); |
667 |
gf->ajouter_point(coo); |
668 |
delete [] coo; |
669 |
} |
670 |
|
671 |
} |
672 |
|
673 |
if (entite=="VOLUME") |
674 |
{ |
675 |
if (version_fichier<2) |
676 |
{ |
677 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
678 |
MG_VOLUME* mgvol=new MG_VOLUME(param[2].argument[0],id); |
679 |
mggeo->ajouter_mg_volume(mgvol); |
680 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
681 |
mgvol->change_num_materiau(nummat); |
682 |
int nb=atoi(param[5].argument[0].c_str()); |
683 |
if (nb!=0) lire_ccf(version_fichier,nb,6,parse,param,mgvol); |
684 |
} |
685 |
else if (version_fichier<2.3) |
686 |
{ |
687 |
parse.decode(data.c_str(),"@,@,@,(&)",param+2); |
688 |
MG_VOLUME* mgvol=new MG_VOLUME(param[2].argument[0],id); |
689 |
mggeo->ajouter_mg_volume(mgvol); |
690 |
int nb=atoi(param[4].argument[0].c_str()); |
691 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,mgvol); |
692 |
} |
693 |
else |
694 |
{ |
695 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
696 |
MG_VOLUME* mgvol=new MG_VOLUME(param[2].argument[0],id); |
697 |
mggeo->ajouter_mg_volume(mgvol); |
698 |
int mince=atoi(param[4].argument[0].c_str()); |
699 |
if (mince==0) |
700 |
{ |
701 |
std::string data2=param[5].argument[0]; |
702 |
parse.decode(data2.c_str(),"@,(&)",param+5); |
703 |
int nb=atoi(param[5].argument[0].c_str()); |
704 |
if (nb!=0) lire_ccf(version_fichier,nb,6,parse,param,mgvol); |
705 |
} |
706 |
else |
707 |
{ |
708 |
std::string data2=param[5].argument[0]; |
709 |
parse.decode(data2.c_str(),"(&),@,(&)",param+5); |
710 |
int nb_face=param[5].argument.size(); |
711 |
for (int i=0;i<nb_face;i=i+2) |
712 |
{ |
713 |
unsigned long idn1=cid(param[5].argument[i]); |
714 |
unsigned long idn2=cid(param[5].argument[i+1]); |
715 |
volumemince.push_back(id); |
716 |
volumemince.push_back(idn1); |
717 |
volumemince.push_back(idn2); |
718 |
} |
719 |
int nb=atoi(param[6].argument[0].c_str()); |
720 |
if (nb!=0) lire_ccf(version_fichier,nb,7,parse,param,mgvol); |
721 |
} |
722 |
} |
723 |
/*{ |
724 |
for (int i=0;i<nb;i++) |
725 |
{ |
726 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
727 |
char nom[3]; |
728 |
double val; |
729 |
strcpy(nom,param[7].argument[0].c_str()); |
730 |
val=atof(param[8].argument[0].c_str()); |
731 |
mgvol->ajouter_ccf(nom,val); |
732 |
} |
733 |
}*/ |
734 |
} |
735 |
if (entite=="COQUE") |
736 |
{ |
737 |
if (version_fichier<2) |
738 |
{ |
739 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
740 |
MG_COQUE* mgcoq=new MG_COQUE(param[2].argument[0],id); |
741 |
mggeo->ajouter_mg_coque(mgcoq); |
742 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
743 |
mgcoq->change_num_materiau(nummat); |
744 |
int nb=atoi(param[5].argument[0].c_str()); |
745 |
if (nb!=0) lire_ccf(version_fichier,nb,6,parse,param,mgcoq); |
746 |
} |
747 |
else |
748 |
{ |
749 |
parse.decode(data.c_str(),"@,@,@,(&)",param+2); |
750 |
MG_COQUE* mgcoq=new MG_COQUE(param[2].argument[0],id); |
751 |
mggeo->ajouter_mg_coque(mgcoq); |
752 |
int nb=atoi(param[4].argument[0].c_str()); |
753 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,mgcoq); |
754 |
} |
755 |
/*if (nb!=0) |
756 |
{ |
757 |
for (int i=0;i<nb;i++) |
758 |
{ |
759 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
760 |
char nom[3]; |
761 |
double val; |
762 |
strcpy(nom,param[7].argument[0].c_str()); |
763 |
val=atof(param[8].argument[0].c_str()); |
764 |
mgcoq->ajouter_ccf(nom,val); |
765 |
} |
766 |
}*/ |
767 |
} |
768 |
if (entite=="POUTRE") |
769 |
{ |
770 |
if (version_fichier<2) |
771 |
{ |
772 |
parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
773 |
MG_POUTRE* mgpoutre=new MG_POUTRE(param[2].argument[0],id); |
774 |
mggeo->ajouter_mg_poutre(mgpoutre); |
775 |
int nummat=atoi((char*)param[4].argument[0].c_str()); |
776 |
mgpoutre->change_num_materiau(nummat); |
777 |
int nb=atoi(param[5].argument[0].c_str()); |
778 |
if (nb!=0) lire_ccf(version_fichier,nb,6,parse,param,mgpoutre); |
779 |
} |
780 |
else |
781 |
{ |
782 |
parse.decode(data.c_str(),"@,@,@,(&)",param+2); |
783 |
MG_POUTRE* mgpou=new MG_POUTRE(param[2].argument[0],id); |
784 |
mggeo->ajouter_mg_poutre(mgpou); |
785 |
int nb=atoi(param[4].argument[0].c_str()); |
786 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,mgpou); |
787 |
} |
788 |
|
789 |
/*if (nb!=0) |
790 |
{ |
791 |
for (int i=0;i<nb;i++) |
792 |
{ |
793 |
parse.decode(param[6].argument[i].c_str(),"(@,@)",param+7); |
794 |
char nom[3]; |
795 |
double val; |
796 |
strcpy(nom,param[7].argument[0].c_str()); |
797 |
val=atof(param[8].argument[0].c_str()); |
798 |
mgpoutre->ajouter_ccf(nom,val); |
799 |
} |
800 |
}*/ |
801 |
} |
802 |
if (entite=="COQUILLE") |
803 |
{ |
804 |
parse.decode(data.c_str(),"@,@",param+2); |
805 |
long ident=cid(param[2].argument[0]); |
806 |
MG_VOLUME* mgvol=mggeo->get_mg_volumeid(ident); |
807 |
MG_COQUE* mgcoq=mggeo->get_mg_coqueid(ident); |
808 |
if (mgvol!=NULL) |
809 |
{ |
810 |
MG_COQUILLE* mgcoq=new MG_COQUILLE(id,mgvol); |
811 |
mggeo->ajouter_mg_coquille(mgcoq,mgvol); |
812 |
} |
813 |
if (mgcoq!=NULL) |
814 |
{ |
815 |
MG_COQUILLE* mgcoquille=new MG_COQUILLE(id,mgcoq); |
816 |
mggeo->ajouter_mg_coquille(mgcoquille,mgcoq); |
817 |
} |
818 |
|
819 |
} |
820 |
|
821 |
#ifdef BREP_STEP |
822 |
if (entite=="SURFACE_STEP") |
823 |
{ |
824 |
parse.decode(data.c_str(),"@",param+2); |
825 |
long idstepsuf=atol(param[2].argument[0].c_str()); |
826 |
ST_SURFACE *stsurf=mggeo->get_gest_step().lst_surface.getid(idstepsuf); |
827 |
STEP_SURFACE* stepsurf=new STEP_SURFACE(id,stsurf); |
828 |
mggeo->ajouter_mg_surface(stepsurf); |
829 |
} |
830 |
if (entite=="COURBE_STEP") |
831 |
{ |
832 |
parse.decode(data.c_str(),"@",param+2); |
833 |
long idstepcur=atol(param[2].argument[0].c_str()); |
834 |
ST_COURBE *stcur=mggeo->get_gest_step().lst_courbe.getid(idstepcur); |
835 |
STEP_COURBE* stepcur=new STEP_COURBE(id,stcur); |
836 |
mggeo->ajouter_mg_courbe(stepcur); |
837 |
} |
838 |
|
839 |
if (entite=="POINT_STEP") |
840 |
{ |
841 |
parse.decode(data.c_str(),"@",param+2); |
842 |
long idsteppt=atol(param[2].argument[0].c_str()); |
843 |
ST_POINT *stpt=mggeo->get_gest_step().lst_point.getid(idsteppt); |
844 |
STEP_POINT* steppt=new STEP_POINT(id,stpt); |
845 |
mggeo->ajouter_mg_point(steppt); |
846 |
} |
847 |
|
848 |
#endif |
849 |
#ifdef BREP_SAT |
850 |
if (entite=="SURFACE_SAT") |
851 |
{ |
852 |
parse.decode(data.c_str(),"@",param+2); |
853 |
long idsatsuf=atol(param[2].argument[0].c_str()); |
854 |
SAT_SURFACE *satsurf=mggeo->get_gest_sat().lst_surface.getid(idsatsuf); |
855 |
ACIS_SURFACE* acissurf=new ACIS_SURFACE(id,satsurf); |
856 |
mggeo->ajouter_mg_surface(acissurf); |
857 |
} |
858 |
if (entite=="COURBE_SAT") |
859 |
{ |
860 |
parse.decode(data.c_str(),"@",param+2); |
861 |
long idsatcur=atol(param[2].argument[0].c_str()); |
862 |
SAT_COURBE *satcur=mggeo->get_gest_sat().lst_courbe.getid(idsatcur); |
863 |
ACIS_COURBE* aciscur=new ACIS_COURBE(id,satcur); |
864 |
mggeo->ajouter_mg_courbe(aciscur); |
865 |
} |
866 |
|
867 |
if (entite=="POINT_SAT") |
868 |
{ |
869 |
parse.decode(data.c_str(),"@",param+2); |
870 |
long idsatpt=atol(param[2].argument[0].c_str()); |
871 |
SAT_POINT *satpt=mggeo->get_gest_sat().lst_point.getid(idsatpt); |
872 |
ACIS_POINT* acispt=new ACIS_POINT(id,satpt); |
873 |
mggeo->ajouter_mg_point(acispt); |
874 |
} |
875 |
|
876 |
#endif |
877 |
|
878 |
#ifdef BREP_OCC |
879 |
|
880 |
if (entite=="SURFACE_OCC") |
881 |
{ |
882 |
parse.decode(data.c_str(),"@",param+2); |
883 |
long idocc=atol(param[2].argument[0].c_str()); |
884 |
const TopoDS_Shape& occshape=mggeo->get_occ_fonction().GetShape(idocc); |
885 |
TopoDS_Face occface=TopoDS::Face(occshape); |
886 |
OCC_SURFACE* occsurf=new OCC_SURFACE(id,occface,mggeo->get_occ_fonction()); |
887 |
mggeo->ajouter_mg_surface(occsurf); |
888 |
} |
889 |
if (entite=="COURBE_OCC") |
890 |
{ |
891 |
parse.decode(data.c_str(),"@",param+2); |
892 |
long idocc=atol(param[2].argument[0].c_str()); |
893 |
const TopoDS_Shape& occshape=mggeo->get_occ_fonction().GetShape(idocc); |
894 |
TopoDS_Edge occedge=TopoDS::Edge(occshape); |
895 |
OCC_COURBE* occcrb=new OCC_COURBE(id,occedge, mggeo->get_occ_fonction()); |
896 |
mggeo->ajouter_mg_courbe(occcrb); |
897 |
} |
898 |
if (entite=="POINT_OCC") |
899 |
{ |
900 |
parse.decode(data.c_str(),"@",param+2); |
901 |
long idocc=atol(param[2].argument[0].c_str()); |
902 |
const TopoDS_Shape& occshape=mggeo->get_occ_fonction().GetShape(idocc); |
903 |
TopoDS_Vertex occvertex=TopoDS::Vertex(occshape); |
904 |
OCC_POINT* occpoint=new OCC_POINT(id,occvertex, mggeo->get_occ_fonction()); |
905 |
mggeo->ajouter_mg_point(occpoint); |
906 |
} |
907 |
#endif |
908 |
#ifdef WINDOWS_VERSION |
909 |
if (entite=="CAD4FE_POLYCURVE") |
910 |
{ |
911 |
CAD4FE::PolyCurve * polycurve = NULL; |
912 |
parse.decode(data.c_str(),"@,(&)",param+2); |
913 |
int nb = atoi(param[2].argument[0].c_str()); |
914 |
|
915 |
if (nb == 0) |
916 |
{ |
917 |
printf("PolyCurve %d is formed with reference vertex : ", id); |
918 |
parse.decode(param[3].argument[0].c_str(),"@",param+4); |
919 |
int idRefVertex; |
920 |
idRefVertex=cid(param[4].argument[0].c_str()); |
921 |
printf("%d ;\n ", idRefVertex); |
922 |
MG_SOMMET * refVertex = mggeo->get_mg_sommetid(idRefVertex); |
923 |
polycurve = new CAD4FE::PolyCurve(refVertex); |
924 |
} |
925 |
else |
926 |
{ |
927 |
printf("PolyCurve %d is formed with reference edges : ", id); |
928 |
polycurve = new CAD4FE::PolyCurve; |
929 |
for (int i=0;i<nb;i++) |
930 |
{ |
931 |
parse.decode(param[3].argument[i].c_str(),"@",param+4); |
932 |
int idRefEdge; |
933 |
idRefEdge=cid(param[4].argument[0].c_str()); |
934 |
printf("%d ; ", idRefEdge); |
935 |
MG_ARETE * refEdge = mggeo->get_mg_areteid(idRefEdge); |
936 |
CAD4FE::PolyCurve tmpPC(refEdge); |
937 |
polycurve->Merge(tmpPC); |
938 |
} |
939 |
printf("\n"); |
940 |
} |
941 |
|
942 |
polycurve->change_id(id); |
943 |
mggeo->ajouter_mg_courbe(polycurve); |
944 |
} |
945 |
|
946 |
|
947 |
if (entite=="CAD4FE_POLYSURFACE") |
948 |
{ |
949 |
CAD4FE::PolySurface * polysurface = new CAD4FE::PolySurface; |
950 |
polysurface->change_id(id); |
951 |
mggeo->ajouter_mg_surface(polysurface); |
952 |
|
953 |
parse.decode(data.c_str(),"@,(&)",param+2); |
954 |
|
955 |
int nb = atoi(param[2].argument[0].c_str()); |
956 |
printf("PolySurface %d is formed with reference faces : ", id); |
957 |
for (int i=0;i<nb;i++) |
958 |
{ |
959 |
parse.decode(param[3].argument[i].c_str(),"@",param+4); |
960 |
int idRefFace; |
961 |
idRefFace=cid(param[4].argument[0].c_str()); |
962 |
printf("%d ; ", idRefFace); |
963 |
|
964 |
MG_FACE * refFace = mggeo->get_mg_faceid(idRefFace); |
965 |
CAD4FE::PolySurface tmpSF(refFace); |
966 |
polysurface->Merge(tmpSF); |
967 |
} |
968 |
|
969 |
printf("\n"); |
970 |
} |
971 |
if (entite=="CAD4FE_MCEDGE") |
972 |
{ |
973 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
974 |
|
975 |
std::string idOriginal = param[2].argument[0]; |
976 |
long idPolyCurve=cid(param[3].argument[0]); |
977 |
CAD4FE::PolyCurve * polycurve = (CAD4FE::PolyCurve *) mggeo->get_mg_courbeid(idPolyCurve); |
978 |
|
979 |
// sense is not used because a MCEdge always has |
980 |
// a sense = 1 ! |
981 |
// (because polycurve domain is equal to mcEdge domain) |
982 |
CAD4FE::MCEdge * mcEdge = new CAD4FE::MCEdge(idOriginal, polycurve); |
983 |
mcEdge->change_id(id); |
984 |
mggeo->ajouter_mg_arete(mcEdge); |
985 |
|
986 |
int nb=atoi(param[7].argument[0].c_str()); |
987 |
if (nb!=0) |
988 |
{ |
989 |
for (int i=0;i<nb;i++) |
990 |
{ |
991 |
parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9); |
992 |
char nom[3]; |
993 |
double val; |
994 |
strcpy(nom,param[9].argument[0].c_str()); |
995 |
val=atof(param[10].argument[0].c_str()); |
996 |
mcEdge->ajouter_ccf(nom,val); |
997 |
} |
998 |
} |
999 |
} |
1000 |
if (entite=="CAD4FE_MCFACE") |
1001 |
{ |
1002 |
parse.decode(data.c_str(),"@,@,@,@,@,(&)",param+2); |
1003 |
|
1004 |
std::string idOriginal = param[2].argument[0]; |
1005 |
long idPolySurface=cid(param[3].argument[0]); |
1006 |
CAD4FE::PolySurface * polysurface = (CAD4FE::PolySurface *) mggeo->get_mg_surfaceid(idPolySurface); |
1007 |
|
1008 |
CAD4FE::MCFace * mcFace = new CAD4FE::MCFace(idOriginal, polysurface); |
1009 |
mcFace->change_id(id); |
1010 |
mggeo->ajouter_mg_face(mcFace); |
1011 |
|
1012 |
int nb=atoi(param[6].argument[0].c_str()); |
1013 |
if (nb!=0) |
1014 |
{ |
1015 |
for (int i=0;i<nb;i++) |
1016 |
{ |
1017 |
parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8); |
1018 |
char nom[3]; |
1019 |
double val; |
1020 |
strcpy(nom,param[8].argument[0].c_str()); |
1021 |
val=atof(param[9].argument[0].c_str()); |
1022 |
mcFace->ajouter_ccf(nom,val); |
1023 |
} |
1024 |
} |
1025 |
} |
1026 |
if (entite=="CAD4FE_MCVERTEX") |
1027 |
{ |
1028 |
parse.decode(data.c_str(),"@,@,@,(&),@,(&)",param+2); |
1029 |
std::string idOriginal = param[2].argument[0]; |
1030 |
long idsom=cid(param[3].argument[0]); |
1031 |
MG_SOMMET * mgsom = mggeo->get_mg_sommetid(idsom); |
1032 |
CAD4FE::MCVertex * mcVertex = new CAD4FE::MCVertex(mgsom); |
1033 |
mcVertex->change_id(id); |
1034 |
mggeo->ajouter_mg_sommet(mcVertex); |
1035 |
int nb_ref_vertex=atoi(param[4].argument[0].c_str()); |
1036 |
if (nb_ref_vertex!=0) |
1037 |
{ |
1038 |
for (int i=0;i<nb_ref_vertex;i++) |
1039 |
{ |
1040 |
unsigned long idRefVertex=cid(param[5].argument[i]); |
1041 |
mcVertex->GetMergedRefVertices()[idRefVertex] = NULL; |
1042 |
mapMergedRefVertices.insert(std::make_pair(mcVertex,idRefVertex)); |
1043 |
} |
1044 |
} |
1045 |
int nb_ccf=atoi(param[4+2].argument[0].c_str()); |
1046 |
if (nb_ccf!=0) |
1047 |
{ |
1048 |
for (int i=0;i<nb_ccf;i++) |
1049 |
{ |
1050 |
parse.decode(param[5+2].argument[i].c_str(),"(@,@)",param+6+2); |
1051 |
char nom_ccf[3]; |
1052 |
double val_ccf; |
1053 |
strcpy(nom_ccf,param[6+2].argument[0].c_str()); |
1054 |
val_ccf=atof(param[7+2].argument[0].c_str()); |
1055 |
mgsom->ajouter_ccf(nom_ccf,val_ccf); |
1056 |
} |
1057 |
} |
1058 |
} |
1059 |
#endif |
1060 |
if (entite=="FACE") |
1061 |
{ |
1062 |
if (version_fichier<2.2) parse.decode(data.c_str(),"@,@,(@),@,@,(&)",param+2); |
1063 |
else parse.decode(data.c_str(),"@,@,(@),@,@,@,(&)",param+2); |
1064 |
long idsurf=cid(param[3].argument[0]); |
1065 |
int sens=atoi(param[5].argument[0].c_str()); |
1066 |
MG_SURFACE* mgsurf=mggeo->get_mg_surfaceid(idsurf); |
1067 |
MG_FACE* mgface=new MG_FACE(param[2].argument[0],id,mgsurf,sens); |
1068 |
mggeo->ajouter_mg_face(mgface); |
1069 |
int argccf=7; |
1070 |
if (version_fichier>2.1) |
1071 |
{ |
1072 |
argccf=8; |
1073 |
int nbpole=atoi(param[6].argument[0].c_str()); |
1074 |
mgface->change_nb_pole(nbpole); |
1075 |
} |
1076 |
int nb=atoi(param[argccf-1].argument[0].c_str()); |
1077 |
if (nb!=0) lire_ccf(version_fichier,nb,argccf,parse,param,mgface); |
1078 |
/*if (nb!=0) |
1079 |
{ |
1080 |
for (int i=0;i<nb;i++) |
1081 |
{ |
1082 |
parse.decode(param[7].argument[i].c_str(),"(@,@)",param+8); |
1083 |
char nom[3]; |
1084 |
double val; |
1085 |
strcpy(nom,param[8].argument[0].c_str()); |
1086 |
val=atof(param[9].argument[0].c_str()); |
1087 |
mgface->ajouter_ccf(nom,val); |
1088 |
} |
1089 |
}*/ |
1090 |
} |
1091 |
if (entite=="COFACE") |
1092 |
{ |
1093 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1094 |
long idface=cid(param[2].argument[0]); |
1095 |
long idcoq=cid(param[3].argument[0]); |
1096 |
int sens=atoi(param[4].argument[0].c_str()); |
1097 |
MG_FACE* mgface=mggeo->get_mg_faceid(idface); |
1098 |
MG_COQUILLE* mgcoq=mggeo->get_mg_coquilleid(idcoq); |
1099 |
MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(id,mgface,mgcoq,sens); |
1100 |
mgcoq->ajouter_mg_coface(mgcoface); |
1101 |
} |
1102 |
if (entite=="BOUCLE") |
1103 |
{ |
1104 |
parse.decode(data.c_str(),"@,(@)",param+2); |
1105 |
long ident=cid(param[2].argument[0]); |
1106 |
MG_FACE* mgface=mggeo->get_mg_faceid(ident); |
1107 |
MG_POUTRE* mgpoutre=mggeo->get_mg_poutreid(ident); |
1108 |
if (mgface!=NULL) |
1109 |
{ |
1110 |
MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgface); |
1111 |
mggeo->ajouter_mg_boucle(mgbou,mgface); |
1112 |
} |
1113 |
if (mgpoutre!=NULL) |
1114 |
{ |
1115 |
MG_BOUCLE* mgbou=new MG_BOUCLE(id,mgpoutre); |
1116 |
mggeo->ajouter_mg_boucle(mgbou,mgpoutre); |
1117 |
} |
1118 |
} |
1119 |
if (entite=="POINT") |
1120 |
{ |
1121 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1122 |
double xyz[3]; |
1123 |
xyz[0]=atof(param[2].argument[0].c_str()); |
1124 |
xyz[1]=atof(param[3].argument[0].c_str()); |
1125 |
xyz[2]=atof(param[4].argument[0].c_str()); |
1126 |
LC_POINT* point=new LC_POINT(id,xyz); |
1127 |
mggeo->ajouter_mg_point(point); |
1128 |
} |
1129 |
if (entite=="SOMMET") |
1130 |
{ |
1131 |
if (version_fichier<2.2) parse.decode(data.c_str(),"@,@,@,(&)",param+2); |
1132 |
else parse.decode(data.c_str(),"@,@,@,@,(&)",param+2); |
1133 |
long idpoint=cid(param[3].argument[0]); |
1134 |
MG_POINT* mgpt=mggeo->get_mg_pointid(idpoint); |
1135 |
MG_SOMMET* mgsom=new MG_SOMMET(param[2].argument[0],id,mgpt); |
1136 |
mggeo->ajouter_mg_sommet(mgsom); |
1137 |
int argccf=5; |
1138 |
if (version_fichier>2.1) |
1139 |
{ |
1140 |
argccf=6; |
1141 |
int ipole=atoi(param[4].argument[0].c_str()); |
1142 |
if (ipole==1) mgsom->change_pole(true); |
1143 |
} |
1144 |
int nb=atoi(param[argccf-1].argument[0].c_str()); |
1145 |
if (nb!=0) lire_ccf(version_fichier,nb,argccf,parse,param,mgsom); |
1146 |
/*if (nb!=0) |
1147 |
{ |
1148 |
for (int i=0;i<nb;i++) |
1149 |
{ |
1150 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1151 |
char nom[3]; |
1152 |
double val; |
1153 |
strcpy(nom,param[6].argument[0].c_str()); |
1154 |
val=atof(param[7].argument[0].c_str()); |
1155 |
mgsom->ajouter_ccf(nom,val); |
1156 |
} |
1157 |
}*/ |
1158 |
} |
1159 |
if (entite=="ARETE_ELEMENT") |
1160 |
{ |
1161 |
parse.decode(data.c_str(),"@,(&),@,(&)",param+2); |
1162 |
MG_ARETE_ELEMENT* are=new MG_ARETE_ELEMENT(id); |
1163 |
mggeo->ajouter_mg_arete(are); |
1164 |
int nb=atoi(param[4].argument[0].c_str()); |
1165 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,are); |
1166 |
/* if (nb!=0) |
1167 |
{ |
1168 |
for (int i=0;i<nb;i++) |
1169 |
{ |
1170 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1171 |
char nom[3]; |
1172 |
double val; |
1173 |
strcpy(nom,param[6].argument[0].c_str()); |
1174 |
val=atof(param[7].argument[0].c_str()); |
1175 |
are->ajouter_ccf(nom,val); |
1176 |
} |
1177 |
}*/ |
1178 |
} |
1179 |
if (entite=="FACE_ELEMENT") |
1180 |
{ |
1181 |
parse.decode(data.c_str(),"@,(&),@,(&)",param+2); |
1182 |
MG_FACE_ELEMENT* face=new MG_FACE_ELEMENT(id); |
1183 |
mggeo->ajouter_mg_face(face); |
1184 |
int nb=atoi(param[4].argument[0].c_str()); |
1185 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,face); |
1186 |
/*if (nb!=0) |
1187 |
{ |
1188 |
for (int i=0;i<nb;i++) |
1189 |
{ |
1190 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1191 |
char nom[3]; |
1192 |
double val; |
1193 |
strcpy(nom,param[6].argument[0].c_str()); |
1194 |
val=atof(param[7].argument[0].c_str()); |
1195 |
face->ajouter_ccf(nom,val); |
1196 |
} |
1197 |
}*/ |
1198 |
} |
1199 |
if (entite=="COQUE_ELEMENT") |
1200 |
{ |
1201 |
parse.decode(data.c_str(),"@,(&),@,(&)",param+2); |
1202 |
MG_COQUE_ELEMENT* coq=new MG_COQUE_ELEMENT(id); |
1203 |
mggeo->ajouter_mg_coque(coq); |
1204 |
int nbele=atoi(param[2].argument[0].c_str()); |
1205 |
for (int i=0;i<nbele;i++) |
1206 |
{ |
1207 |
unsigned long idele=cid(param[3].argument[i].c_str()); |
1208 |
coq->ajouter_element(idele); |
1209 |
} |
1210 |
int nb=atoi(param[4].argument[0].c_str()); |
1211 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,coq); |
1212 |
/* if (nb!=0) |
1213 |
{ |
1214 |
for (int i=0;i<nb;i++) |
1215 |
{ |
1216 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1217 |
char nom[3]; |
1218 |
double val; |
1219 |
strcpy(nom,param[6].argument[0].c_str()); |
1220 |
val=atof(param[7].argument[0].c_str()); |
1221 |
coq->ajouter_ccf(nom,val); |
1222 |
} |
1223 |
}*/ |
1224 |
} |
1225 |
if (entite=="POUTRE_ELEMENT") |
1226 |
{ |
1227 |
parse.decode(data.c_str(),"@,(&),@,(&)",param+2); |
1228 |
MG_POUTRE_ELEMENT* pou=new MG_POUTRE_ELEMENT(id); |
1229 |
mggeo->ajouter_mg_poutre(pou); |
1230 |
int nbele=atoi(param[2].argument[0].c_str()); |
1231 |
for (int i=0;i<nbele;i++) |
1232 |
{ |
1233 |
unsigned long idele=cid(param[3].argument[i].c_str()); |
1234 |
pou->ajouter_element(idele); |
1235 |
} |
1236 |
int nb=atoi(param[4].argument[0].c_str()); |
1237 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,pou); |
1238 |
/*if (nb!=0) |
1239 |
{ |
1240 |
for (int i=0;i<nb;i++) |
1241 |
{ |
1242 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1243 |
char nom[3]; |
1244 |
double val; |
1245 |
strcpy(nom,param[6].argument[0].c_str()); |
1246 |
val=atof(param[7].argument[0].c_str()); |
1247 |
pou->ajouter_ccf(nom,val); |
1248 |
} |
1249 |
}*/ |
1250 |
} |
1251 |
if (entite=="VOLUME_ELEMENT") |
1252 |
{ |
1253 |
parse.decode(data.c_str(),"@,(&),@,(&)",param+2); |
1254 |
MG_VOLUME_ELEMENT* vol=new MG_VOLUME_ELEMENT(id); |
1255 |
mggeo->ajouter_mg_volume(vol); |
1256 |
int nb=atoi(param[4].argument[0].c_str()); |
1257 |
if (nb!=0) lire_ccf(version_fichier,nb,5,parse,param,vol); |
1258 |
/* if (nb!=0) |
1259 |
{ |
1260 |
for (int i=0;i<nb;i++) |
1261 |
{ |
1262 |
parse.decode(param[5].argument[i].c_str(),"(@,@)",param+6); |
1263 |
char nom[3]; |
1264 |
double val; |
1265 |
strcpy(nom,param[6].argument[0].c_str()); |
1266 |
val=atof(param[7].argument[0].c_str()); |
1267 |
vol->ajouter_ccf(nom,val); |
1268 |
} |
1269 |
}*/ |
1270 |
} |
1271 |
if (entite=="SOMMET_NOEUD") |
1272 |
{ |
1273 |
parse.decode(data.c_str(),"@,@,(&)",param+2); |
1274 |
long idnoeud=cid(param[2].argument[0]); |
1275 |
MG_SOMMET_NOEUD* mgsom=new MG_SOMMET_NOEUD(id,idnoeud); |
1276 |
mggeo->ajouter_mg_sommet(mgsom); |
1277 |
int nb=atoi(param[3].argument[0].c_str()); |
1278 |
if (nb!=0) lire_ccf(version_fichier,nb,4,parse,param,mgsom); |
1279 |
/*if (nb!=0) |
1280 |
{ |
1281 |
for (int i=0;i<nb;i++) |
1282 |
{ |
1283 |
parse.decode(param[4].argument[i].c_str(),"(@,@)",param+5); |
1284 |
char nom[3]; |
1285 |
double val; |
1286 |
strcpy(nom,param[5].argument[0].c_str()); |
1287 |
val=atof(param[6].argument[0].c_str()); |
1288 |
mgsom->ajouter_ccf(nom,val); |
1289 |
} |
1290 |
}*/ |
1291 |
} |
1292 |
if (entite=="ARETE") |
1293 |
{ |
1294 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
1295 |
long idcur=cid(param[3].argument[0]); |
1296 |
int sens=atoi(param[6].argument[0].c_str()); |
1297 |
MG_COURBE* mgcur=mggeo->get_mg_courbeid(idcur); |
1298 |
MG_ARETE* mgarete=new MG_ARETE(param[2].argument[0],id,mgcur,sens); |
1299 |
mggeo->ajouter_mg_arete(mgarete); |
1300 |
int nb=atoi(param[7].argument[0].c_str()); |
1301 |
if (nb!=0) lire_ccf(version_fichier,nb,8,parse,param,mgarete); |
1302 |
/*if (nb!=0) |
1303 |
{ |
1304 |
for (int i=0;i<nb;i++) |
1305 |
{ |
1306 |
parse.decode(param[8].argument[i].c_str(),"(@,@)",param+9); |
1307 |
char nom[3]; |
1308 |
double val; |
1309 |
strcpy(nom,param[9].argument[0].c_str()); |
1310 |
val=atof(param[10].argument[0].c_str()); |
1311 |
mgarete->ajouter_ccf(nom,val); |
1312 |
} |
1313 |
}*/ |
1314 |
} |
1315 |
if (entite=="COSOMMET") |
1316 |
{ |
1317 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1318 |
long idsom=cid(param[2].argument[0]); |
1319 |
long idarete=cid(param[3].argument[0]); |
1320 |
int num=atoi(param[4].argument[0].c_str()); |
1321 |
MG_SOMMET* mgsom=mggeo->get_mg_sommetid(idsom); |
1322 |
MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete); |
1323 |
MG_COSOMMET* mgcosom=mggeo->ajouter_mg_cosommet(id,mgarete,mgsom); |
1324 |
if (num==1) mgarete->changer_cosommet1(mgcosom); |
1325 |
if (num==2) mgarete->changer_cosommet2(mgcosom); |
1326 |
} |
1327 |
if (entite=="COARETE") |
1328 |
{ |
1329 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1330 |
long idarete=cid(param[2].argument[0]); |
1331 |
long idboucle=cid(param[3].argument[0]); |
1332 |
int sens=atoi(param[4].argument[0].c_str()); |
1333 |
MG_ARETE* mgarete=mggeo->get_mg_areteid(idarete); |
1334 |
MG_BOUCLE* mgboucle=mggeo->get_mg_boucleid(idboucle); |
1335 |
MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(id,mgarete,mgboucle,sens); |
1336 |
mgboucle->ajouter_mg_coarete(mgcoarete); |
1337 |
} |
1338 |
if (entite=="VISU_COURBE") |
1339 |
{ |
1340 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
1341 |
double xyz1[3]; |
1342 |
double xyz2[3]; |
1343 |
xyz1[0]=atof(param[2].argument[0].c_str()); |
1344 |
xyz1[1]=atof(param[3].argument[0].c_str()); |
1345 |
xyz1[2]=atof(param[4].argument[0].c_str()); |
1346 |
xyz2[0]=atof(param[5].argument[0].c_str()); |
1347 |
xyz2[1]=atof(param[6].argument[0].c_str()); |
1348 |
xyz2[2]=atof(param[7].argument[0].c_str()); |
1349 |
MG_VISU_COURBE* mgcrb=new MG_VISU_COURBE(id,xyz1,xyz2); |
1350 |
mggeo->ajouter_mg_visu_courbe(mgcrb); |
1351 |
} |
1352 |
if (entite=="MAILLAGE") |
1353 |
{ |
1354 |
parse.decode(data.c_str(),"@",param+2); |
1355 |
long idgeo=cid(param[2].argument[0]); |
1356 |
mggeo=get_mg_geometrieid(idgeo); |
1357 |
mgmai=new MG_MAILLAGE(id,mggeo); |
1358 |
ajouter_mg_maillage(mgmai); |
1359 |
} |
1360 |
if (entite=="MAILLAGE_STRUCTURE") |
1361 |
{ |
1362 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
1363 |
long idgeo=cid(param[2].argument[0]); |
1364 |
mggeo=get_mg_geometrieid(idgeo); |
1365 |
mgmai=new MG_MAILLAGE(id,mggeo); |
1366 |
ajouter_mg_maillage(mgmai); |
1367 |
double xmin=atof(param[3].argument[0].c_str()); |
1368 |
double ymin=atof(param[4].argument[0].c_str()); |
1369 |
double zmin=atof(param[5].argument[0].c_str()); |
1370 |
double xmax=atof(param[6].argument[0].c_str()); |
1371 |
double ymax=atof(param[7].argument[0].c_str()); |
1372 |
double zmax=atof(param[8].argument[0].c_str()); |
1373 |
int nx=atoi(param[9].argument[0].c_str()); |
1374 |
int ny=atoi(param[10].argument[0].c_str()); |
1375 |
int nz=atoi(param[11].argument[0].c_str()); |
1376 |
BOITE_3D b(xmin,ymin,zmin,xmax,ymax,zmax); |
1377 |
mgmai->change_param_structure(b,nx,ny,nz); |
1378 |
} |
1379 |
if (entite=="FEM_MAILLAGE") |
1380 |
{ |
1381 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1382 |
int degre=atoi(param[2].argument[0].c_str()); |
1383 |
long idmai=cid(param[3].argument[0]); |
1384 |
long idgeo=cid(param[4].argument[0]); |
1385 |
mggeo=get_mg_geometrieid(idgeo); |
1386 |
mgmai=get_mg_maillageid(idmai); |
1387 |
femmai=new FEM_MAILLAGE(id,mggeo,mgmai,degre); |
1388 |
ajouter_fem_maillage(femmai); |
1389 |
} |
1390 |
if (entite=="FEM_MAILLAGE_STRUCTURE") |
1391 |
{ |
1392 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1393 |
int degre=atoi(param[2].argument[0].c_str()); |
1394 |
long idmai=cid(param[3].argument[0]); |
1395 |
long idgeo=cid(param[4].argument[0]); |
1396 |
mggeo=get_mg_geometrieid(idgeo); |
1397 |
mgmai=get_mg_maillageid(idmai); |
1398 |
femmai=new FEM_MAILLAGE(id,mggeo,mgmai,degre); |
1399 |
ajouter_fem_maillage(femmai); |
1400 |
double xmin=atof(param[5].argument[0].c_str()); |
1401 |
double ymin=atof(param[6].argument[0].c_str()); |
1402 |
double zmin=atof(param[7].argument[0].c_str()); |
1403 |
double xmax=atof(param[8].argument[0].c_str()); |
1404 |
double ymax=atof(param[9].argument[0].c_str()); |
1405 |
double zmax=atof(param[10].argument[0].c_str()); |
1406 |
int nx=atoi(param[11].argument[0].c_str()); |
1407 |
int ny=atoi(param[12].argument[0].c_str()); |
1408 |
int nz=atoi(param[13].argument[0].c_str()); |
1409 |
BOITE_3D b(xmin,ymin,zmin,xmax,ymax,zmax); |
1410 |
femmai->change_param_structure(b,nx,ny,nz); |
1411 |
} |
1412 |
if (entite=="NOEUD") lire_NOEUD(id,parse,param,data,mgmai,mggeo); |
1413 |
if (entite=="FEM_NOEUD") |
1414 |
{ |
1415 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
1416 |
long idtopo=cid(param[2].argument[0]); |
1417 |
long idmai=cid(param[3].argument[0]); |
1418 |
double x=atof(param[4].argument[0].c_str()); |
1419 |
double y=atof(param[5].argument[0].c_str()); |
1420 |
double z=atof(param[6].argument[0].c_str()); |
1421 |
int num=atoi(param[7].argument[0].c_str()); |
1422 |
int numopt=atoi(param[8].argument[0].c_str()); |
1423 |
MG_ELEMENT_MAILLAGE* elmai; |
1424 |
if (idmai>-1) |
1425 |
{ |
1426 |
elmai=mgmai->get_mg_noeudid(idmai); |
1427 |
if (elmai==NULL) elmai=mgmai->get_mg_segmentid(idmai); |
1428 |
if (elmai==NULL) elmai=mgmai->get_mg_triangleid(idmai); |
1429 |
if (elmai==NULL) elmai=mgmai->get_mg_tetraid(idmai); |
1430 |
} |
1431 |
else elmai=NULL; |
1432 |
FEM_NOEUD* noeud; |
1433 |
if (elmai!=NULL) noeud=new FEM_NOEUD(id,elmai,x,y,z); |
1434 |
else |
1435 |
{ |
1436 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
1437 |
if (idtopo>-1) |
1438 |
{ |
1439 |
topo=mggeo->get_mg_sommetid(idtopo); |
1440 |
if (topo==NULL) topo=mggeo->get_mg_areteid(idtopo); |
1441 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
1442 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
1443 |
} |
1444 |
else topo=NULL; |
1445 |
noeud=new FEM_NOEUD(id,topo,x,y,z); |
1446 |
} |
1447 |
noeud->change_numero(num); |
1448 |
noeud->change_numero_opt(numopt); |
1449 |
femmai->ajouter_fem_noeud(noeud); |
1450 |
} |
1451 |
if (entite=="FEM_NOEUD_DEF") |
1452 |
{ |
1453 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1454 |
double x=atof(param[2].argument[0].c_str()); |
1455 |
double y=atof(param[3].argument[0].c_str()); |
1456 |
double z=atof(param[4].argument[0].c_str()); |
1457 |
FEM_NOEUD* noeud=femmai->get_fem_noeudid(id); |
1458 |
noeud->change_dx(x); |
1459 |
noeud->change_dy(y); |
1460 |
noeud->change_dz(z); |
1461 |
femmai->active_deforme(); |
1462 |
} |
1463 |
if (entite=="FEM_NOEUD_REAC") |
1464 |
{ |
1465 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1466 |
double x=atof(param[2].argument[0].c_str()); |
1467 |
double y=atof(param[3].argument[0].c_str()); |
1468 |
double z=atof(param[4].argument[0].c_str()); |
1469 |
FEM_NOEUD* noeud=femmai->get_fem_noeudid(id); |
1470 |
noeud->change_rx(x); |
1471 |
noeud->change_ry(y); |
1472 |
noeud->change_rz(z); |
1473 |
femmai->active_reaction();; |
1474 |
} |
1475 |
if (entite=="SEGMENT") lire_SEGMENT(id,parse,param,data,mgmai,mggeo); |
1476 |
if (entite=="FEM_ELEMENT_NOEUD") |
1477 |
{ |
1478 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1479 |
long idtopo=cid(param[2].argument[0]); |
1480 |
long idmai=cid(param[3].argument[0]); |
1481 |
long idn1=cid(param[4].argument[0]); |
1482 |
FEM_NOEUD* tab[1]; |
1483 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1484 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1485 |
if (idtopo>-1) |
1486 |
topo=mggeo->get_mg_sommetid(idtopo); |
1487 |
MG_ELEMENT_MAILLAGE* elmai; |
1488 |
if (idmai>-1) |
1489 |
elmai=mgmai->get_mg_noeudid(idmai); |
1490 |
else elmai=NULL; |
1491 |
FEM_ELEMENT0* fem=new FEM_ELEMENT0(id,topo,elmai,tab); |
1492 |
femmai->ajouter_fem_element0(fem); |
1493 |
} |
1494 |
if (entite=="FEM_SEGMENT2") |
1495 |
{ |
1496 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
1497 |
long idtopo=cid(param[2].argument[0]); |
1498 |
long idmai=cid(param[3].argument[0]); |
1499 |
long idn1=cid(param[4].argument[0]); |
1500 |
long idn2=cid(param[5].argument[0]); |
1501 |
FEM_NOEUD* tab[2]; |
1502 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1503 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1504 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1505 |
if (idtopo>-1) |
1506 |
topo=mggeo->get_mg_areteid(idtopo); |
1507 |
if (topo==NULL) topo=mggeo->get_mg_poutreid(idtopo); |
1508 |
MG_ELEMENT_MAILLAGE* elmai; |
1509 |
if (idmai>-1) |
1510 |
elmai=mgmai->get_mg_segmentid(idmai); |
1511 |
else elmai=NULL; |
1512 |
FEM_SEGMENT2* seg=new FEM_SEGMENT2(id,topo,elmai,tab); |
1513 |
femmai->ajouter_fem_element1(seg); |
1514 |
} |
1515 |
if (entite=="FEM_MINI_SEGMENT2") |
1516 |
{ |
1517 |
parse.decode(data.c_str(),"@,@",param+2); |
1518 |
long idn1=cid(param[2].argument[0]); |
1519 |
long idn2=cid(param[3].argument[0]); |
1520 |
FEM_NOEUD* tab[2]; |
1521 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1522 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1523 |
MG_SEGMENT* mseg=femmai->get_mg_maillage()->get_mg_segment(tab[0]->get_mg_element_maillage()->get_id(),tab[1]->get_mg_element_maillage()->get_id()); |
1524 |
FEM_MINI_SEGMENT2* seg=new FEM_MINI_SEGMENT2(id,mseg,tab); |
1525 |
femmai->ajouter_fem_element1(seg); |
1526 |
} |
1527 |
if (entite=="FEM_SEGMENT3") |
1528 |
{ |
1529 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
1530 |
long idtopo=cid(param[2].argument[0]); |
1531 |
long idmai=cid(param[3].argument[0]); |
1532 |
long idn1=cid(param[4].argument[0]); |
1533 |
long idn2=cid(param[5].argument[0]); |
1534 |
long idn3=cid(param[6].argument[0]); |
1535 |
FEM_NOEUD* tab[3]; |
1536 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1537 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1538 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1539 |
MG_ELEMENT_MAILLAGE* elmai; |
1540 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1541 |
if (idtopo>-1) |
1542 |
topo=mggeo->get_mg_areteid(idtopo); |
1543 |
if (idmai>-1) |
1544 |
elmai=mgmai->get_mg_segmentid(idmai); |
1545 |
else elmai=NULL; |
1546 |
FEM_SEGMENT3* seg=new FEM_SEGMENT3(id,topo,elmai,tab); |
1547 |
femmai->ajouter_fem_element1(seg); |
1548 |
} |
1549 |
if (entite=="TRIANGLE") lire_TRIANGLE(id,parse,param,data,mgmai,mggeo); |
1550 |
if (entite=="QUADRANGLE") lire_QUADRANGLE(id,parse,param,data,mgmai,mggeo); |
1551 |
if (entite=="FEM_TRIANGLE3") |
1552 |
{ |
1553 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
1554 |
long idtopo=cid(param[2].argument[0]); |
1555 |
long idmai=cid(param[3].argument[0]); |
1556 |
long idn1=cid(param[4].argument[0]); |
1557 |
long idn2=cid(param[5].argument[0]); |
1558 |
long idn3=cid(param[6].argument[0]); |
1559 |
FEM_NOEUD* tab[3]; |
1560 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1561 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1562 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1563 |
MG_ELEMENT_MAILLAGE* elmai; |
1564 |
if (idmai>-1) |
1565 |
elmai=mgmai->get_mg_triangleid(idmai); |
1566 |
else elmai=NULL; |
1567 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1568 |
if (idtopo>-1) |
1569 |
topo=mggeo->get_mg_faceid(idtopo); |
1570 |
FEM_TRIANGLE3* tri=new FEM_TRIANGLE3(id,topo,elmai,tab); |
1571 |
femmai->ajouter_fem_element2(tri); |
1572 |
} |
1573 |
if (entite=="FEM_TRIANGLE6") |
1574 |
{ |
1575 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2); |
1576 |
long idtopo=cid(param[2].argument[0]); |
1577 |
long idmai=cid(param[3].argument[0]); |
1578 |
long idn1=cid(param[4].argument[0]); |
1579 |
long idn2=cid(param[5].argument[0]); |
1580 |
long idn3=cid(param[6].argument[0]); |
1581 |
long idn4=cid(param[7].argument[0]); |
1582 |
long idn5=cid(param[8].argument[0]); |
1583 |
long idn6=cid(param[9].argument[0]); |
1584 |
FEM_NOEUD* tab[6]; |
1585 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1586 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1587 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1588 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1589 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1590 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1591 |
MG_ELEMENT_MAILLAGE* elmai; |
1592 |
if (idmai>-1) |
1593 |
elmai=mgmai->get_mg_triangleid(idmai); |
1594 |
else elmai=NULL; |
1595 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1596 |
if (idtopo>-1) |
1597 |
topo=mggeo->get_mg_faceid(idtopo); |
1598 |
FEM_TRIANGLE6* tri=new FEM_TRIANGLE6(id,topo,elmai,tab); |
1599 |
femmai->ajouter_fem_element2(tri); |
1600 |
} |
1601 |
if (entite=="FEM_QUADRANGLE4") |
1602 |
{ |
1603 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
1604 |
long idtopo=cid(param[2].argument[0]); |
1605 |
long idmai=cid(param[3].argument[0]); |
1606 |
long idn1=cid(param[4].argument[0]); |
1607 |
long idn2=cid(param[5].argument[0]); |
1608 |
long idn3=cid(param[6].argument[0]); |
1609 |
long idn4=cid(param[7].argument[0]); |
1610 |
FEM_NOEUD* tab[4]; |
1611 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1612 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1613 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1614 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1615 |
MG_ELEMENT_MAILLAGE* elmai; |
1616 |
if (idmai>-1) |
1617 |
elmai=mgmai->get_mg_quadrangleid(idmai); |
1618 |
else elmai=NULL; |
1619 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1620 |
if (idtopo>-1) |
1621 |
topo=mggeo->get_mg_faceid(idtopo); |
1622 |
FEM_QUADRANGLE4* quad=new FEM_QUADRANGLE4(id,topo,elmai,tab); |
1623 |
femmai->ajouter_fem_element2(quad); |
1624 |
} |
1625 |
if (entite=="FEM_QUADRANGLE8") |
1626 |
{ |
1627 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
1628 |
long idtopo=cid(param[2].argument[0]); |
1629 |
long idmai=cid(param[3].argument[0]); |
1630 |
long idn1=cid(param[4].argument[0]); |
1631 |
long idn2=cid(param[5].argument[0]); |
1632 |
long idn3=cid(param[6].argument[0]); |
1633 |
long idn4=cid(param[7].argument[0]); |
1634 |
long idn5=cid(param[8].argument[0]); |
1635 |
long idn6=cid(param[9].argument[0]); |
1636 |
long idn7=cid(param[10].argument[0]); |
1637 |
long idn8=cid(param[11].argument[0]); |
1638 |
FEM_NOEUD* tab[8]; |
1639 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1640 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1641 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1642 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1643 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1644 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1645 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1646 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1647 |
MG_ELEMENT_MAILLAGE* elmai; |
1648 |
if (idmai>-1) |
1649 |
elmai=mgmai->get_mg_quadrangleid(idmai); |
1650 |
else elmai=NULL; |
1651 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1652 |
if (idtopo>-1) |
1653 |
topo=mggeo->get_mg_faceid(idtopo); |
1654 |
FEM_QUADRANGLE8* quad=new FEM_QUADRANGLE8(id,topo,elmai,tab); |
1655 |
femmai->ajouter_fem_element2(quad); |
1656 |
} |
1657 |
if (entite=="TETRAEDRE") lire_TETRA(id,parse,param,data,mgmai,mggeo); |
1658 |
|
1659 |
if (entite=="HEXAEDRE") lire_HEXA(id,parse,param,data,mgmai,mggeo); |
1660 |
if (entite=="PENTAEDRE") lire_PENTA(id,parse,param,data,mgmai,mggeo); |
1661 |
if (entite=="FEM_TETRA4") |
1662 |
{ |
1663 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
1664 |
long idtopo=cid(param[2].argument[0]); |
1665 |
long idmai=cid(param[3].argument[0]); |
1666 |
long idn1=cid(param[4].argument[0]); |
1667 |
long idn2=cid(param[5].argument[0]); |
1668 |
long idn3=cid(param[6].argument[0]); |
1669 |
long idn4=cid(param[7].argument[0]); |
1670 |
long etat=atoi(param[8].argument[0].c_str()); |
1671 |
FEM_NOEUD* tab[4]; |
1672 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1673 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1674 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1675 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1676 |
MG_ELEMENT_MAILLAGE* elmai; |
1677 |
if (idmai>-1) |
1678 |
elmai=mgmai->get_mg_tetraid(idmai); |
1679 |
else elmai=NULL; |
1680 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1681 |
if (idtopo>-1) |
1682 |
topo=mggeo->get_mg_volumeid(idtopo); |
1683 |
FEM_TETRA4* tet=new FEM_TETRA4(id,topo,elmai,tab); |
1684 |
tet->change_etat(0,etat); |
1685 |
femmai->ajouter_fem_element3(tet); |
1686 |
} |
1687 |
if (entite=="XFEM_ELEMENT_NOEUD") |
1688 |
{ |
1689 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
1690 |
unsigned long idele=cid(param[2].argument[0]); |
1691 |
unsigned long idtopo=cid(param[3].argument[0]); |
1692 |
unsigned long idn1=cid(param[4].argument[0]); |
1693 |
int etat=atoi(param[5].argument[0].c_str()); |
1694 |
MG_ELEMENT_TOPOLOGIQUE* topo=mggeo->get_mg_sommetid(idtopo); |
1695 |
FEM_ELEMENT_MAILLAGE* mai=femmai->get_fem_element0id(idele); |
1696 |
if (mai==NULL) mai=femmai->get_fem_element1id(idele); |
1697 |
if (mai==NULL) mai=femmai->get_fem_element2id(idele); |
1698 |
if (mai==NULL) mai=femmai->get_fem_element3id(idele); |
1699 |
FEM_NOEUD* tab[4]; |
1700 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1701 |
XFEM_ELEMENT0* xele=new XFEM_ELEMENT0(id,mai,topo,tab); |
1702 |
femmai->ajouter_xfem_element0(xele); |
1703 |
xele->change_etat(etat); |
1704 |
} |
1705 |
if (entite=="XFEM_SEGMENT2") |
1706 |
{ |
1707 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
1708 |
unsigned long idele=cid(param[2].argument[0]); |
1709 |
unsigned long idtopo=cid(param[3].argument[0]); |
1710 |
unsigned long idn1=cid(param[4].argument[0]); |
1711 |
unsigned long idn2=cid(param[5].argument[0]); |
1712 |
int etat=atoi(param[6].argument[0].c_str()); |
1713 |
FEM_ELEMENT_MAILLAGE* mai=femmai->get_fem_element1id(idele); |
1714 |
if (mai==NULL) mai=femmai->get_fem_element2id(idele); |
1715 |
if (mai==NULL) mai=femmai->get_fem_element3id(idele); |
1716 |
MG_ELEMENT_TOPOLOGIQUE* topo=mggeo->get_mg_areteid(idtopo); |
1717 |
FEM_NOEUD* tab[4]; |
1718 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1719 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1720 |
XFEM_SEGMENT2* xseg=new XFEM_SEGMENT2(id,mai,topo,tab); |
1721 |
femmai->ajouter_xfem_element1(xseg); |
1722 |
xseg->change_etat(etat); |
1723 |
} |
1724 |
if (entite=="XFEM_TRIANGLE3") |
1725 |
{ |
1726 |
parse.decode(data.c_str(),"@,@,@,@,@,@",param+2); |
1727 |
unsigned long idtet=cid(param[2].argument[0]); |
1728 |
unsigned long idtopo=cid(param[3].argument[0]); |
1729 |
unsigned long idn1=cid(param[4].argument[0]); |
1730 |
unsigned long idn2=cid(param[5].argument[0]); |
1731 |
unsigned long idn3=cid(param[6].argument[0]); |
1732 |
int etat=atoi(param[7].argument[0].c_str()); |
1733 |
FEM_ELEMENT_MAILLAGE* mai=femmai->get_fem_element3id(idtet); |
1734 |
MG_ELEMENT_TOPOLOGIQUE* topo=mggeo->get_mg_volumeid(idtopo); |
1735 |
FEM_NOEUD* tab[3]; |
1736 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1737 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1738 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1739 |
XFEM_TRIANGLE3* xtri=new XFEM_TRIANGLE3(id,mai,topo,tab); |
1740 |
femmai->ajouter_xfem_element2(xtri); |
1741 |
xtri->change_etat(etat); |
1742 |
} |
1743 |
if (entite=="XFEM_TETRA4") |
1744 |
{ |
1745 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@",param+2); |
1746 |
unsigned long idtet=cid(param[2].argument[0]); |
1747 |
unsigned long idtopo=cid(param[3].argument[0]); |
1748 |
unsigned long idn1=cid(param[4].argument[0]); |
1749 |
unsigned long idn2=cid(param[5].argument[0]); |
1750 |
unsigned long idn3=cid(param[6].argument[0]); |
1751 |
unsigned long idn4=cid(param[7].argument[0]); |
1752 |
int etat=atoi(param[8].argument[0].c_str()); |
1753 |
FEM_ELEMENT_MAILLAGE* mai=femmai->get_fem_element3id(idtet); |
1754 |
MG_ELEMENT_TOPOLOGIQUE* topo=mggeo->get_mg_volumeid(idtopo); |
1755 |
FEM_NOEUD* tab[4]; |
1756 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1757 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1758 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1759 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1760 |
XFEM_TETRA4* xtet=new XFEM_TETRA4(id,mai,topo,tab); |
1761 |
femmai->ajouter_xfem_element3(xtet); |
1762 |
xtet->change_etat(etat); |
1763 |
} |
1764 |
if (entite=="FEM_TETRA10") |
1765 |
{ |
1766 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1767 |
long idtopo=cid(param[2].argument[0]); |
1768 |
long idmai=cid(param[3].argument[0]); |
1769 |
long idn1=cid(param[4].argument[0]); |
1770 |
long idn2=cid(param[5].argument[0]); |
1771 |
long idn3=cid(param[6].argument[0]); |
1772 |
long idn4=cid(param[7].argument[0]); |
1773 |
long idn5=cid(param[8].argument[0]); |
1774 |
long idn6=cid(param[9].argument[0]); |
1775 |
long idn7=cid(param[10].argument[0]); |
1776 |
long idn8=cid(param[11].argument[0]); |
1777 |
long idn9=cid(param[12].argument[0]); |
1778 |
long idn10=cid(param[13].argument[0]); |
1779 |
FEM_NOEUD* tab[10]; |
1780 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1781 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1782 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1783 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1784 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1785 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1786 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1787 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1788 |
tab[8]=femmai->get_fem_noeudid(idn9); |
1789 |
tab[9]=femmai->get_fem_noeudid(idn10); |
1790 |
MG_ELEMENT_MAILLAGE* elmai; |
1791 |
if (idmai>-1) |
1792 |
elmai=mgmai->get_mg_tetraid(idmai); |
1793 |
else elmai=NULL; |
1794 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1795 |
if (idtopo>-1) |
1796 |
topo=mggeo->get_mg_volumeid(idtopo); |
1797 |
FEM_TETRA10* tet=new FEM_TETRA10(id,topo,elmai,tab); |
1798 |
femmai->ajouter_fem_element3(tet); |
1799 |
} |
1800 |
if (entite=="FEM_HEXA8") |
1801 |
{ |
1802 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@",param+2); |
1803 |
long idtopo=cid(param[2].argument[0]); |
1804 |
long idmai=cid(param[3].argument[0]); |
1805 |
long idn1=cid(param[4].argument[0]); |
1806 |
long idn2=cid(param[5].argument[0]); |
1807 |
long idn3=cid(param[6].argument[0]); |
1808 |
long idn4=cid(param[7].argument[0]); |
1809 |
long idn5=cid(param[8].argument[0]); |
1810 |
long idn6=cid(param[9].argument[0]); |
1811 |
long idn7=cid(param[10].argument[0]); |
1812 |
long idn8=cid(param[11].argument[0]); |
1813 |
FEM_NOEUD* tab[8]; |
1814 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1815 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1816 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1817 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1818 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1819 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1820 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1821 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1822 |
MG_ELEMENT_MAILLAGE* elmai; |
1823 |
if (idmai>-1) |
1824 |
elmai=mgmai->get_mg_hexaid(idmai); |
1825 |
else elmai=NULL; |
1826 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1827 |
if (idtopo>-1) |
1828 |
topo=mggeo->get_mg_volumeid(idtopo); |
1829 |
FEM_HEXA8* hex=new FEM_HEXA8(id,topo,elmai,tab); |
1830 |
femmai->ajouter_fem_element3(hex); |
1831 |
} |
1832 |
if (entite=="FEM_HEXA20") |
1833 |
{ |
1834 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1835 |
long idtopo=cid(param[2].argument[0]); |
1836 |
long idmai=cid(param[3].argument[0]); |
1837 |
long idn1=cid(param[4].argument[0]); |
1838 |
long idn2=cid(param[5].argument[0]); |
1839 |
long idn3=cid(param[6].argument[0]); |
1840 |
long idn4=cid(param[7].argument[0]); |
1841 |
long idn5=cid(param[8].argument[0]); |
1842 |
long idn6=cid(param[9].argument[0]); |
1843 |
long idn7=cid(param[10].argument[0]); |
1844 |
long idn8=cid(param[11].argument[0]); |
1845 |
long idn9=cid(param[12].argument[0]); |
1846 |
long idn10=cid(param[13].argument[0]); |
1847 |
long idn11=cid(param[14].argument[0]); |
1848 |
long idn12=cid(param[15].argument[0]); |
1849 |
long idn13=cid(param[16].argument[0]); |
1850 |
long idn14=cid(param[17].argument[0]); |
1851 |
long idn15=cid(param[18].argument[0]); |
1852 |
long idn16=cid(param[19].argument[0]); |
1853 |
long idn17=cid(param[20].argument[0]); |
1854 |
long idn18=cid(param[21].argument[0]); |
1855 |
long idn19=cid(param[22].argument[0]); |
1856 |
long idn20=cid(param[23].argument[0]); |
1857 |
FEM_NOEUD* tab[20]; |
1858 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1859 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1860 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1861 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1862 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1863 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1864 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1865 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1866 |
tab[8]=femmai->get_fem_noeudid(idn9); |
1867 |
tab[9]=femmai->get_fem_noeudid(idn10); |
1868 |
tab[10]=femmai->get_fem_noeudid(idn11); |
1869 |
tab[11]=femmai->get_fem_noeudid(idn12); |
1870 |
tab[12]=femmai->get_fem_noeudid(idn13); |
1871 |
tab[13]=femmai->get_fem_noeudid(idn14); |
1872 |
tab[14]=femmai->get_fem_noeudid(idn15); |
1873 |
tab[15]=femmai->get_fem_noeudid(idn16); |
1874 |
tab[16]=femmai->get_fem_noeudid(idn17); |
1875 |
tab[17]=femmai->get_fem_noeudid(idn18); |
1876 |
tab[18]=femmai->get_fem_noeudid(idn19); |
1877 |
tab[19]=femmai->get_fem_noeudid(idn20); |
1878 |
MG_ELEMENT_MAILLAGE* elmai; |
1879 |
if (idmai>-1) |
1880 |
elmai=mgmai->get_mg_hexaid(idmai); |
1881 |
else elmai=NULL; |
1882 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1883 |
if (idtopo>-1) |
1884 |
topo=mggeo->get_mg_volumeid(idtopo); |
1885 |
FEM_HEXA20* hex=new FEM_HEXA20(id,topo,elmai,tab); |
1886 |
femmai->ajouter_fem_element3(hex); |
1887 |
} |
1888 |
if (entite=="FEM_PENTA6") |
1889 |
{ |
1890 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@",param+2); |
1891 |
long idtopo=cid(param[2].argument[0]); |
1892 |
long idmai=cid(param[3].argument[0]); |
1893 |
long idn1=cid(param[4].argument[0]); |
1894 |
long idn2=cid(param[5].argument[0]); |
1895 |
long idn3=cid(param[6].argument[0]); |
1896 |
long idn4=cid(param[7].argument[0]); |
1897 |
long idn5=cid(param[8].argument[0]); |
1898 |
long idn6=cid(param[9].argument[0]); |
1899 |
FEM_NOEUD* tab[6]; |
1900 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1901 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1902 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1903 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1904 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1905 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1906 |
MG_ELEMENT_MAILLAGE* elmai; |
1907 |
if (idmai>-1) |
1908 |
elmai=mgmai->get_mg_pentaid(idmai); |
1909 |
else elmai=NULL; |
1910 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1911 |
if (idtopo>-1) |
1912 |
topo=mggeo->get_mg_volumeid(idtopo); |
1913 |
FEM_PENTA6* pen=new FEM_PENTA6(id,topo,elmai,tab); |
1914 |
femmai->ajouter_fem_element3(pen); |
1915 |
} |
1916 |
if (entite=="FEM_PENTA15") |
1917 |
{ |
1918 |
parse.decode(data.c_str(),"@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@,@",param+2); |
1919 |
long idtopo=cid(param[2].argument[0]); |
1920 |
long idmai=cid(param[3].argument[0]); |
1921 |
long idn1=cid(param[4].argument[0]); |
1922 |
long idn2=cid(param[5].argument[0]); |
1923 |
long idn3=cid(param[6].argument[0]); |
1924 |
long idn4=cid(param[7].argument[0]); |
1925 |
long idn5=cid(param[8].argument[0]); |
1926 |
long idn6=cid(param[9].argument[0]); |
1927 |
long idn7=cid(param[10].argument[0]); |
1928 |
long idn8=cid(param[11].argument[0]); |
1929 |
long idn9=cid(param[12].argument[0]); |
1930 |
long idn10=cid(param[13].argument[0]); |
1931 |
long idn11=cid(param[14].argument[0]); |
1932 |
long idn12=cid(param[15].argument[0]); |
1933 |
long idn13=cid(param[16].argument[0]); |
1934 |
long idn14=cid(param[17].argument[0]); |
1935 |
long idn15=cid(param[18].argument[0]); |
1936 |
FEM_NOEUD* tab[15]; |
1937 |
tab[0]=femmai->get_fem_noeudid(idn1); |
1938 |
tab[1]=femmai->get_fem_noeudid(idn2); |
1939 |
tab[2]=femmai->get_fem_noeudid(idn3); |
1940 |
tab[3]=femmai->get_fem_noeudid(idn4); |
1941 |
tab[4]=femmai->get_fem_noeudid(idn5); |
1942 |
tab[5]=femmai->get_fem_noeudid(idn6); |
1943 |
tab[6]=femmai->get_fem_noeudid(idn7); |
1944 |
tab[7]=femmai->get_fem_noeudid(idn8); |
1945 |
tab[8]=femmai->get_fem_noeudid(idn9); |
1946 |
tab[9]=femmai->get_fem_noeudid(idn10); |
1947 |
tab[10]=femmai->get_fem_noeudid(idn11); |
1948 |
tab[11]=femmai->get_fem_noeudid(idn12); |
1949 |
tab[12]=femmai->get_fem_noeudid(idn13); |
1950 |
tab[13]=femmai->get_fem_noeudid(idn14); |
1951 |
tab[14]=femmai->get_fem_noeudid(idn15); |
1952 |
MG_ELEMENT_MAILLAGE* elmai; |
1953 |
if (idmai>-1) |
1954 |
elmai=mgmai->get_mg_pentaid(idmai); |
1955 |
else elmai=NULL; |
1956 |
MG_ELEMENT_TOPOLOGIQUE* topo=NULL; |
1957 |
if (idtopo>-1) |
1958 |
topo=mggeo->get_mg_volumeid(idtopo); |
1959 |
FEM_PENTA15* pen=new FEM_PENTA15(id,topo,elmai,tab); |
1960 |
femmai->ajouter_fem_element3(pen); |
1961 |
} |
1962 |
if (entite=="SOLUTION") |
1963 |
{ |
1964 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
1965 |
int typeentite=atoi(param[2].argument[0].c_str()); |
1966 |
int typesolution=atoi(param[3].argument[0].c_str()); |
1967 |
std::string nomsol=param[4].argument[0]; |
1968 |
long idmai=cid(param[5].argument[0]); |
1969 |
int nb=atoi(param[6].argument[0].c_str()); |
1970 |
std::string chemin=param[7].argument[0]; |
1971 |
MG_MAILLAGE* mai=get_mg_maillageid(idmai); |
1972 |
MG_SOLUTION* sol=new MG_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol,typeentite,typesolution); |
1973 |
ajouter_mg_solution(sol); |
1974 |
for (int i=0;i<nb;i++) |
1975 |
sol->change_legende(i,param[8].argument[i]); |
1976 |
} |
1977 |
if (entite=="FEM_SOLUTION") |
1978 |
{ |
1979 |
parse.decode(data.c_str(),"@,@,@,@,@,@,(&)",param+2); |
1980 |
int typeentite=atoi(param[2].argument[0].c_str()); |
1981 |
int typesolution=atoi(param[3].argument[0].c_str()); |
1982 |
std::string nomsol=param[4].argument[0]; |
1983 |
long idmai=cid(param[5].argument[0]); |
1984 |
int nb=atoi(param[6].argument[0].c_str()); |
1985 |
std::string chemin=param[7].argument[0]; |
1986 |
FEM_MAILLAGE* mai=get_fem_maillageid(idmai); |
1987 |
FEM_SOLUTION* sol=new FEM_SOLUTION(id,mai,nb,(char*)chemin.c_str(),SOL_EXISTANTE,nomsol,typeentite,typesolution); |
1988 |
ajouter_fem_solution(sol); |
1989 |
for (int i=0;i<nb;i++) |
1990 |
sol->change_legende(i,param[8].argument[i]); |
1991 |
} |
1992 |
#ifdef WINDOWS_VERSION |
1993 |
if (entite=="CAD4FE_MCSEGMENT") |
1994 |
{ |
1995 |
parse.decode(data.c_str(),"@,@,@",param+2); |
1996 |
long idtopo=cid(param[2].argument[0]); |
1997 |
long idn1=cid(param[3].argument[0]); |
1998 |
long idn2=cid(param[4].argument[0]); |
1999 |
CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1); |
2000 |
CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2); |
2001 |
MG_ELEMENT_TOPOLOGIQUE* topo; |
2002 |
if (idtopo>-1) |
2003 |
{ |
2004 |
topo=mggeo->get_mg_areteid(idtopo); |
2005 |
if (topo==NULL) topo=mggeo->get_mg_faceid(idtopo); |
2006 |
if (topo==NULL) topo=mggeo->get_mg_volumeid(idtopo); |
2007 |
} |
2008 |
else topo=NULL; |
2009 |
CAD4FE::MCSegment * seg = new CAD4FE::MCSegment(id,topo,noeud1,noeud2); |
2010 |
mgmai->ajouter_mg_segment(seg); |
2011 |
} |
2012 |
if (entite=="CAD4FE_MCNODE") |
2013 |
{ |
2014 |
parse.decode(data.c_str(),"@,@,@,@,@",param+2); |
2015 |
long idRefTopo=cid(param[2].argument[0]); |
2016 |
long idMCTopo=cid(param[3].argument[0]); |
2017 |
double x=atof(param[4].argument[0].c_str()); |
2018 |
double y=atof(param[5].argument[0].c_str()); |
2019 |
double z=atof(param[6].argument[0].c_str()); |
2020 |
MG_ELEMENT_TOPOLOGIQUE* refTopo=NULL; |
2021 |
if (refTopo==NULL) refTopo=mggeo->get_mg_sommetid(idRefTopo); |
2022 |
if (refTopo==NULL) refTopo=mggeo->get_mg_areteid(idRefTopo); |
2023 |
if (refTopo==NULL) refTopo=mggeo->get_mg_faceid(idRefTopo); |
2024 |
if (refTopo==NULL) refTopo=mggeo->get_mg_volumeid(idRefTopo); |
2025 |
MG_ELEMENT_TOPOLOGIQUE* mcTopo=NULL; |
2026 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_sommetid(idMCTopo); |
2027 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_areteid(idMCTopo); |
2028 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_faceid(idMCTopo); |
2029 |
if (mcTopo==NULL) mcTopo=mggeo->get_mg_volumeid(idMCTopo); |
2030 |
|
2031 |
if (mcTopo->get_dimension()==0) |
2032 |
{ |
2033 |
if (updatedMergedRefVertices == false) |
2034 |
{ |
2035 |
for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin(); |
2036 |
itMergedRefVertices != mapMergedRefVertices.end(); |
2037 |
itMergedRefVertices++) |
2038 |
{ |
2039 |
CAD4FE::MCVertex * v = itMergedRefVertices->first; |
2040 |
MG_SOMMET * refV = NULL; |
2041 |
unsigned long id = itMergedRefVertices->second; |
2042 |
refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id); |
2043 |
v->MergeRefVertex(refV); |
2044 |
} |
2045 |
|
2046 |
updatedMergedRefVertices = true; |
2047 |
} |
2048 |
} |
2049 |
|
2050 |
CAD4FE::MCNode* noeud=new CAD4FE::MCNode(id,mcTopo,refTopo,x,y,z); |
2051 |
mgmai->ajouter_mg_noeud(noeud); |
2052 |
} |
2053 |
if (entite=="CAD4FE_MCTRIANGLE") |
2054 |
{ |
2055 |
parse.decode(data.c_str(),"@,@,@,@",param+2); |
2056 |
long idtopo=cid(param[2].argument[0]); |
2057 |
long idn1=cid(param[3].argument[0]); |
2058 |
long idn2=cid(param[4].argument[0]); |
2059 |
long idn3=cid(param[5].argument[0]); |
2060 |
CAD4FE::MCNode* noeud1=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn1); |
2061 |
CAD4FE::MCNode* noeud2=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn2); |
2062 |
CAD4FE::MCNode* noeud3=(CAD4FE::MCNode*)mgmai->get_mg_noeudid(idn3); |
2063 |
CAD4FE::MCSegment* mgsegment[3]; |
2064 |
CAD4FE::MCNode *mgnoeud[3]={noeud1,noeud2,noeud3}; |
2065 |
// la topo. d'un MCTriangle est obligatoirement une MCFace |
2066 |
CAD4FE::MCFace* mcFace=(CAD4FE::MCFace*)mggeo->get_mg_faceid(idtopo); |
2067 |
for (int i=0;i<3;i++) |
2068 |
{ |
2069 |
mgsegment[i]=(CAD4FE::MCSegment*)mgmai->get_mg_segment(mgnoeud[i]->get_id(),mgnoeud[(i+1)%3]->get_id()); |
2070 |
if (mgsegment[i]==NULL) |
2071 |
{ |
2072 |
mgsegment[i]=new CAD4FE::MCSegment(mcFace,mgnoeud[i],mgnoeud[(i+1)%3]); |
2073 |
mgmai->ajouter_mg_segment(mgsegment[i]); |
2074 |
} |
2075 |
} |
2076 |
CAD4FE::M3D_MCTriangle *triangle = new CAD4FE::M3D_MCTriangle(id,mcFace,noeud1,noeud2,noeud3,mgsegment[0],mgsegment[1],mgsegment[2]); |
2077 |
mgmai->ajouter_mg_triangle(triangle); |
2078 |
} |
2079 |
#endif |
2080 |
} |
2081 |
} |
2082 |
while (param[0].argument[0]!="FIN"); |
2083 |
|
2084 |
for (int i=0;i<volumemince.size();i=i+3) |
2085 |
{ |
2086 |
MG_VOLUME *vol=mggeo->get_mg_volumeid(volumemince[i]); |
2087 |
MG_FACE* face1=mggeo->get_mg_faceid(volumemince[i+1]); |
2088 |
MG_FACE* face2=mggeo->get_mg_faceid(volumemince[i+2]); |
2089 |
vol->ajouter_face_correspondante(face1,face2); |
2090 |
} |
2091 |
|
2092 |
|
2093 |
LISTE_MG_ARBRE::iterator itarbre; |
2094 |
for (MG_ARBRE* arb=get_premier_arbre(itarbre);arb!=NULL;arb=get_suivant_arbre(itarbre)) |
2095 |
{ |
2096 |
LISTE_MG_ASSEMBLAGE::iterator itass; |
2097 |
for (MG_ASSEMBLAGE *ass=arb->get_premier_assemblage(itass);ass!=NULL;ass=arb->get_suivant_assemblage(itass)) |
2098 |
ass->ini_donne(arb); |
2099 |
} |
2100 |
LISTE_MG_GEOMETRIE::iterator itgeo; |
2101 |
for (MG_GEOMETRIE* geo=get_premier_geometrie(itgeo);geo;geo=get_suivant_geometrie(itgeo)) |
2102 |
{ |
2103 |
LISTE_MG_SOMMET::iterator itsom; |
2104 |
for (MG_SOMMET* som=geo->get_premier_sommet(itsom);som;som=geo->get_suivant_sommet(itsom)) |
2105 |
if (som->est_un_sommet_noeud()) |
2106 |
{ |
2107 |
MG_SOMMET_NOEUD* somno=(MG_SOMMET_NOEUD*)som; |
2108 |
unsigned long idnoeud=somno->get_id_mg_noeud(); |
2109 |
MG_NOEUD* noeud; |
2110 |
LISTE_MG_MAILLAGE::iterator itmai; |
2111 |
for (MG_MAILLAGE* mai=get_premier_mg_maillage(itmai);mai;mai=get_suivant_mg_maillage(itmai)) |
2112 |
if (mai->get_mg_noeudid(idnoeud)!=NULL) noeud=mai->get_mg_noeudid(idnoeud); |
2113 |
somno->change_mg_noeud(noeud); |
2114 |
} |
2115 |
LISTE_MG_COQUE::iterator itcoq; |
2116 |
for (MG_COQUE* coq=geo->get_premier_coque(itcoq);coq;coq=geo->get_suivant_coque(itcoq)) |
2117 |
if (coq->est_une_coque_element()) |
2118 |
{ |
2119 |
MG_COQUE_ELEMENT* coque=(MG_COQUE_ELEMENT*)coq; |
2120 |
int nbele=coque->get_nb_liste_id(); |
2121 |
MG_MAILLAGE* mgmai=NULL; |
2122 |
for (int i=0;i<nbele;i++) |
2123 |
{ |
2124 |
unsigned long eleid=coque->get_liste_id(i); |
2125 |
if (i==0) |
2126 |
{ |
2127 |
LISTE_MG_MAILLAGE::iterator itmai; |
2128 |
for (MG_MAILLAGE* mai=get_premier_mg_maillage(itmai);mai;mai=get_suivant_mg_maillage(itmai)) |
2129 |
{ |
2130 |
if (mai->get_mg_triangleid(eleid)!=NULL) mgmai=mai; |
2131 |
if (mai->get_mg_quadrangleid(eleid)!=NULL) mgmai=mai; |
2132 |
} |
2133 |
} |
2134 |
MG_ELEMENT_MAILLAGE* ele=NULL; |
2135 |
if (ele==NULL) ele=mgmai->get_mg_triangleid(eleid); |
2136 |
if (ele==NULL) ele=mgmai->get_mg_quadrangleid(eleid); |
2137 |
coque->ajouter_element(ele); |
2138 |
} |
2139 |
|
2140 |
} |
2141 |
LISTE_MG_POUTRE::iterator itpou; |
2142 |
for (MG_POUTRE* pou=geo->get_premier_poutre(itpou);pou;pou=geo->get_suivant_poutre(itpou)) |
2143 |
if (pou->est_une_poutre_element()) |
2144 |
{ |
2145 |
MG_POUTRE_ELEMENT* poutre=(MG_POUTRE_ELEMENT*)pou; |
2146 |
int nbele=poutre->get_nb_liste_id(); |
2147 |
MG_MAILLAGE* mgmai=NULL; |
2148 |
for (int i=0;i<nbele;i++) |
2149 |
{ |
2150 |
unsigned long eleid=poutre->get_liste_id(i); |
2151 |
if (i==0) |
2152 |
{ |
2153 |
LISTE_MG_MAILLAGE::iterator itmai; |
2154 |
for (MG_MAILLAGE* mai=get_premier_mg_maillage(itmai);mai;mai=get_suivant_mg_maillage(itmai)) |
2155 |
{ |
2156 |
if (mai->get_mg_segmentid(eleid)!=NULL) mgmai=mai; |
2157 |
} |
2158 |
} |
2159 |
MG_ELEMENT_MAILLAGE* ele=NULL; |
2160 |
if (ele==NULL) ele=mgmai->get_mg_segmentid(eleid); |
2161 |
poutre->ajouter_element(ele); |
2162 |
} |
2163 |
|
2164 |
} |
2165 |
} |
2166 |
#ifdef WINDOWS_VERSION |
2167 |
if (updatedMergedRefVertices == false) |
2168 |
{ |
2169 |
for (std::multimap<CAD4FE::MCVertex * , unsigned long>::iterator itMergedRefVertices = mapMergedRefVertices.begin(); |
2170 |
itMergedRefVertices != mapMergedRefVertices.end(); |
2171 |
itMergedRefVertices++) |
2172 |
{ |
2173 |
CAD4FE::MCVertex * v = itMergedRefVertices->first; |
2174 |
MG_SOMMET * refV = NULL; |
2175 |
unsigned long id = itMergedRefVertices->second; |
2176 |
refV = (MG_SOMMET *) mggeo->get_mg_sommetid(id); |
2177 |
v->MergeRefVertex(refV); |
2178 |
} |
2179 |
|
2180 |
updatedMergedRefVertices = true; |
2181 |
} |
2182 |
|
2183 |
#endif |
2184 |
fclose(in); |
2185 |
return 1; |
2186 |
} |
2187 |
|
2188 |
|
2189 |
|
2190 |
|