MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
step_import.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// step_import.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:53 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #ifdef BREP_STEP
26 #include <string.h>
27 #include "step_import.h"
28 #include "step_surface.h"
29 #include "step_point.h"
30 #include "step_courbe.h"
31 
32 #include "stadface.h"
33 #include "staxis1place.h"
34 #include "staxis2place3d.h"
35 #include "stbrep.h"
36 #include "stbrepwithvoids.h"
37 #include "stbspline.h"
38 #include "stbsplines.h"
39 #include "stcircle.h"
40 #include "stclosedshell.h"
41 #include "storientedclosedshell.h"
42 #include "stconical.h"
43 #include "stcylindrical.h"
44 #include "stdirection.h"
45 #include "stedgecurve.h"
46 #include "stedgeloop.h"
47 #include "stellipse.h"
48 #include "stfacebound.h"
49 #include "stfaceobound.h"
50 #include "stline.h"
51 #include "storiedge.h"
52 #include "stplane.h"
53 #include "stspherical.h"
54 #include "stsurfextrusion.h"
55 #include "stsurfrevolution.h"
56 #include "sttoroidal.h"
57 #include "stvector.h"
58 #include "stvertex.h"
59 #include "mg_geometrie.h"
60 #include "mg_gestionnaire.h"
61 
63 {
64 }
65 
66 
68 {
69 }
70 
71 
73 {
74  MG_GEOMETRIE *mggeo=new MG_GEOMETRIE((char*)"STEP",path);
75  gest.ajouter_mg_geometrie(mggeo);
76  long nb_manifold_solid_brep=mggeo->get_gest_step().lst_manifold_brep.get_nb();
77  for (long i=0;i<nb_manifold_solid_brep;i++)
78  {
79  ST_MANIFOLD_BREP* manifold_brep=mggeo->get_gest_step().lst_manifold_brep.get(i);
80  manifold_brep->est_util(&mggeo->get_gest_step());
81  char idori[10];
82  sprintf(idori,"%lu",manifold_brep->get_id());
83  MG_VOLUME* mgvol=new MG_VOLUME(idori);
84  mggeo->ajouter_mg_volume(mgvol);
85  ST_CLOSED_SHELL* closed_shell=mggeo->get_gest_step().lst_closed_shell.getid(manifold_brep->get_id_closed_shell());
86  long nb_advanced_face=closed_shell->get_nb_advanced_face();
87  MG_COQUILLE* mgcoq=new MG_COQUILLE(mgvol);
88  mggeo->ajouter_mg_coquille(mgcoq,mgvol);
89  for (long j=0;j<nb_advanced_face;j++)
90  {
91  ST_ADVANCED_FACE* advanced_face=mggeo->get_gest_step().lst_advanced_face.getid(closed_shell->get_id_advanced_face(j));
92  ST_SURFACE* surface=mggeo->get_gest_step().lst_surface.getid(advanced_face->get_id_surface());
93  MG_SURFACE* mgsurface=trouver(surface);
94  if (mgsurface==NULL)
95  {
96  STEP_SURFACE* stepsurface=new STEP_SURFACE(surface);
97  mgsurface=stepsurface;
98  mggeo->ajouter_mg_surface(mgsurface);
99  relation(surface,mgsurface);
100  }
101  MG_FACE* mgface=trouver(advanced_face);
102  if (mgface==NULL)
103  {
104  char idori[10];
105  sprintf(idori,"%lu",advanced_face->get_id());
106  mgface=new MG_FACE(idori,mgsurface,advanced_face->get_orientation());
107  mggeo->ajouter_mg_face(mgface);
108  relation(advanced_face,mgface);
109  }
110  MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(mgface,mgcoq,1);
111  mgcoq->ajouter_mg_coface(mgcoface);
112  long nb_face_bound=advanced_face->get_nb_face_bound();
113  for (long k=0;k<nb_face_bound;k++)
114  {
115  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgface);
116  mggeo->ajouter_mg_boucle(mgboucle,mgface);
117  ST_FACE_BOUND *fb=mggeo->get_gest_step().lst_facebound.getid(advanced_face->get_id_face_bound(k));
118  {
120  long nb_oriented_edge=edge_loop->get_nb_oriented_edge();
121  for (long l=0;l<nb_oriented_edge;l++)
122  {
123  ST_ORIENTED_EDGE* oriented_edge=mggeo->get_gest_step().lst_oriedge.getid(edge_loop->get_id_oriented_edge(l));
124  ST_EDGE_CURVE* edge_curve=mggeo->get_gest_step().lst_edgecurve.getid(oriented_edge->get_id_edge_curve());
125  ST_COURBE* courbe=mggeo->get_gest_step().lst_courbe.getid(edge_curve->get_id_curve());
126  ST_VERTEX* sommet1=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet1());
127  ST_VERTEX* sommet2=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet2());
128  MG_COURBE* mgcourbe=trouver(courbe);
129  if (mgcourbe==NULL)
130  {
131  STEP_COURBE* stepcourbe=new STEP_COURBE(courbe);
132  mgcourbe=stepcourbe;
133  mggeo->ajouter_mg_courbe(mgcourbe);
134  relation(courbe,mgcourbe);
135  }
136  MG_SOMMET* mgsom1=trouver(sommet1);
137  if (mgsom1==NULL)
138  {
139  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet1->get_id_point());
140  STEP_POINT* steppoint=new STEP_POINT(point);
141  MG_POINT* mgpoint=steppoint;
142  mggeo->ajouter_mg_point(mgpoint);
143  char idori[10];
144  sprintf(idori,"%lu",sommet1->get_id());
145  mgsom1=new MG_SOMMET(idori,mgpoint);
146  mggeo->ajouter_mg_sommet(mgsom1);
147  relation(sommet1,mgsom1);
148  }
149  MG_SOMMET* mgsom2=trouver(sommet2);
150  if (mgsom2==NULL)
151  {
152  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet2->get_id_point());
153  STEP_POINT* steppoint=new STEP_POINT(point);
154  MG_POINT* mgpoint=steppoint;
155  mggeo->ajouter_mg_point(mgpoint);
156  char idori[10];
157  sprintf(idori,"%lu",sommet2->get_id());
158  mgsom2=new MG_SOMMET(idori,mgpoint);
159  mggeo->ajouter_mg_sommet(mgsom2);
160  relation(sommet2,mgsom2);
161  }
162  MG_ARETE* mgarete=trouver((ST_EDGE_CURVE*)edge_curve);
163  if (mgarete==NULL)
164  {
165  int sens;
166  if (edge_curve->get_orientation()==1) sens=1;
167  else sens=-1;
168  char idori[10];
169  sprintf(idori,"%lu",edge_curve->get_id());
170  mgarete=new MG_ARETE(idori,mgcourbe,sens);
171  mggeo->ajouter_mg_arete(mgarete);
172  relation((ST_EDGE_CURVE*)edge_curve,mgarete);
173  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
174  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
175  mgarete->changer_cosommet1(mgcosom1);
176  mgarete->changer_cosommet2(mgcosom2);
177  }
178  int sens;
179  if (oriented_edge->get_orientation()==1) sens=1;
180  else sens=-1;
181  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens);
182  mgboucle->ajouter_mg_coarete(mgcoarete);
183  }
184  }
185  }
186  }
187  }
188  long nb_brep_with_voids=mggeo->get_gest_step().lst_brep_with_voids.get_nb();
189  for (long m=0;m<nb_brep_with_voids;m++)
190  {
191  ST_BREP_WITH_VOIDS* brep_with_voids=mggeo->get_gest_step().lst_brep_with_voids.get(m);
192  brep_with_voids->est_util(&mggeo->get_gest_step());
193  char idori[10];
194  sprintf(idori,"%lu",brep_with_voids->get_id());
195  MG_VOLUME* mgvol=new MG_VOLUME(idori);
196  mggeo->ajouter_mg_volume(mgvol);
197  ST_CLOSED_SHELL* closed_shell=mggeo->get_gest_step().lst_closed_shell.getid(brep_with_voids->get_id_closed_shell());
198  long nb_advanced_face=closed_shell->get_nb_advanced_face();
199  MG_COQUILLE* mgcoq=new MG_COQUILLE(mgvol);
200  mggeo->ajouter_mg_coquille(mgcoq,mgvol);
201  for (long s=0;s<nb_advanced_face;s++)
202  {
203  ST_ADVANCED_FACE* advanced_face=mggeo->get_gest_step().lst_advanced_face.getid(closed_shell->get_id_advanced_face(s));
204  ST_SURFACE* surface=mggeo->get_gest_step().lst_surface.getid(advanced_face->get_id_surface());
205  MG_SURFACE* mgsurface=trouver(surface);
206  if (mgsurface==NULL)
207  {
208  STEP_SURFACE* stepsurface=new STEP_SURFACE(surface);
209  mgsurface=stepsurface;
210  mggeo->ajouter_mg_surface(mgsurface);
211  relation(surface,mgsurface);
212  }
213  MG_FACE* mgface=trouver(advanced_face);
214  if (mgface==NULL)
215  {
216  char idori[10];
217  sprintf(idori,"%lu",advanced_face->get_id());
218  mgface=new MG_FACE(idori,mgsurface,advanced_face->get_orientation());
219  mggeo->ajouter_mg_face(mgface);
220  relation(advanced_face,mgface);
221  }
222  MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(mgface,mgcoq,1);
223  mgcoq->ajouter_mg_coface(mgcoface);
224  long nb_face_bound=advanced_face->get_nb_face_bound();
225  for (long t=0;t<nb_face_bound;t++)
226  {
227  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgface);
228  mggeo->ajouter_mg_boucle(mgboucle,mgface);
229  ST_FACE_BOUND *fb=mggeo->get_gest_step().lst_facebound.getid(advanced_face->get_id_face_bound(t));
230  {
232  long nb_oriented_edge=edge_loop->get_nb_oriented_edge();
233  for (long u=0;u<nb_oriented_edge;u++)
234  {
235  ST_ORIENTED_EDGE* oriented_edge=mggeo->get_gest_step().lst_oriedge.getid(edge_loop->get_id_oriented_edge(u));
236  ST_EDGE_CURVE* edge_curve=mggeo->get_gest_step().lst_edgecurve.getid(oriented_edge->get_id_edge_curve());
237  ST_COURBE* courbe=mggeo->get_gest_step().lst_courbe.getid(edge_curve->get_id_curve());
238  ST_VERTEX* sommet1=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet1());
239  ST_VERTEX* sommet2=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet2());
240  MG_COURBE* mgcourbe=trouver(courbe);
241  if (mgcourbe==NULL)
242  {
243  STEP_COURBE* stepcourbe=new STEP_COURBE(courbe);
244  mgcourbe=stepcourbe;
245  mggeo->ajouter_mg_courbe(mgcourbe);
246  relation(courbe,mgcourbe);
247  }
248  MG_SOMMET* mgsom1=trouver(sommet1);
249  if (mgsom1==NULL)
250  {
251  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet1->get_id_point());
252  STEP_POINT* steppoint=new STEP_POINT(point);
253  MG_POINT* mgpoint=steppoint;
254  mggeo->ajouter_mg_point(mgpoint);
255  char idori[10];
256  sprintf(idori,"%lu",sommet1->get_id());
257  mgsom1=new MG_SOMMET(idori,mgpoint);
258  mggeo->ajouter_mg_sommet(mgsom1);
259  relation(sommet1,mgsom1);
260  }
261  MG_SOMMET* mgsom2=trouver(sommet2);
262  if (mgsom2==NULL)
263  {
264  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet2->get_id_point());
265  STEP_POINT* steppoint=new STEP_POINT(point);
266  MG_POINT* mgpoint=steppoint;
267  mggeo->ajouter_mg_point(mgpoint);
268  char idori[10];
269  sprintf(idori,"%lu",sommet2->get_id());
270  mgsom2=new MG_SOMMET(idori,mgpoint);
271  mggeo->ajouter_mg_sommet(mgsom2);
272  relation(sommet2,mgsom2);
273  }
274  MG_ARETE* mgarete=trouver((ST_EDGE_CURVE*)edge_curve);
275  if (mgarete==NULL)
276  {
277  int sens;
278  if (edge_curve->get_orientation()==1) sens=1;
279  else sens=-1;
280  char idori[10];
281  sprintf(idori,"%lu",edge_curve->get_id());
282  mgarete=new MG_ARETE(idori,mgcourbe,sens);
283  mggeo->ajouter_mg_arete(mgarete);
284  relation((ST_EDGE_CURVE*)edge_curve,mgarete);
285  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
286  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
287  mgarete->changer_cosommet1(mgcosom1);
288  mgarete->changer_cosommet2(mgcosom2);
289  }
290  int sens;
291  if (oriented_edge->get_orientation()==1) sens=1;
292  else sens=-1;
293  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens);
294  mgboucle->ajouter_mg_coarete(mgcoarete);
295  }
296  }
297  }
298  }
299  long nb_oriented_closed_shell=mggeo->get_gest_step().lst_oriented_closed_shell.get_nb();
300  for (long n=0;n<nb_oriented_closed_shell;n++)
301  {
302  ST_ORIENTED_CLOSED_SHELL* oriented_closed_shell=mggeo->get_gest_step().lst_oriented_closed_shell.getid(brep_with_voids->get_id_oriented_closed_shell(n));
303  ST_CLOSED_SHELL* closed_shell=mggeo->get_gest_step().lst_closed_shell.getid(oriented_closed_shell->get_id_closed_shell());
304  MG_COQUILLE* mgcoq=new MG_COQUILLE(mgvol);
305  mggeo->ajouter_mg_coquille(mgcoq,mgvol);
306  long nb_advanced_face_inv=closed_shell->get_nb_advanced_face();
307  for (long z=0;z<nb_advanced_face_inv;z++)
308  {
309  ST_ADVANCED_FACE* advanced_face=mggeo->get_gest_step().lst_advanced_face.getid(closed_shell->get_id_advanced_face(z));
310  ST_SURFACE* surface=mggeo->get_gest_step().lst_surface.getid(advanced_face->get_id_surface());
311  MG_SURFACE* mgsurface=trouver(surface);
312  if (mgsurface==NULL)
313  {
314  STEP_SURFACE* stepsurface=new STEP_SURFACE(surface);
315  mgsurface=stepsurface;
316  mggeo->ajouter_mg_surface(mgsurface);
317  relation(surface,mgsurface);
318  }
319  MG_FACE* mgface=trouver(advanced_face);
320  if (mgface==NULL)
321  {
322  char idori[10];
323  sprintf(idori,"%lu",advanced_face->get_id());
324  mgface=new MG_FACE(idori,mgsurface,advanced_face->get_orientation());
325  mggeo->ajouter_mg_face(mgface);
326  relation(advanced_face,mgface);
327  }
328  MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(mgface,mgcoq,oriented_closed_shell->get_orientation());
329  mgcoq->ajouter_mg_coface(mgcoface); /* */
330  long nb_face_bound=advanced_face->get_nb_face_bound();
331  for (long p=0;p<nb_face_bound;p++)
332  {
333  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgface);
334  mggeo->ajouter_mg_boucle(mgboucle,mgface);
335  ST_FACE_BOUND *fb=mggeo->get_gest_step().lst_facebound.getid(advanced_face->get_id_face_bound(p));
336  {
338  long nb_oriented_edge=edge_loop->get_nb_oriented_edge();
339  for (long q=0;q<nb_oriented_edge;q++)
340  {
341  ST_ORIENTED_EDGE* oriented_edge=mggeo->get_gest_step().lst_oriedge.getid(edge_loop->get_id_oriented_edge(q));
342  ST_EDGE_CURVE* edge_curve=mggeo->get_gest_step().lst_edgecurve.getid(oriented_edge->get_id_edge_curve());
343  ST_COURBE* courbe=mggeo->get_gest_step().lst_courbe.getid(edge_curve->get_id_curve());
344  ST_VERTEX* sommet1=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet1());
345  ST_VERTEX* sommet2=mggeo->get_gest_step().lst_vertex.getid(edge_curve->get_id_sommet2());
346  MG_COURBE* mgcourbe=trouver(courbe);
347  if (mgcourbe==NULL)
348  {
349  STEP_COURBE* stepcourbe=new STEP_COURBE(courbe);
350  mgcourbe=stepcourbe;
351  mggeo->ajouter_mg_courbe(mgcourbe);
352  relation(courbe,mgcourbe);
353  }
354  MG_SOMMET* mgsom1=trouver(sommet1);
355  if (mgsom1==NULL)
356  {
357  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet1->get_id_point());
358  STEP_POINT* steppoint=new STEP_POINT(point);
359  MG_POINT* mgpoint=steppoint;
360  mggeo->ajouter_mg_point(mgpoint);
361  char idori[10];
362  sprintf(idori,"%lu",sommet1->get_id());
363  mgsom1=new MG_SOMMET(idori,mgpoint);
364  mggeo->ajouter_mg_sommet(mgsom1);
365  relation(sommet1,mgsom1);
366  }
367  MG_SOMMET* mgsom2=trouver(sommet2);
368  if (mgsom2==NULL)
369  {
370  ST_POINT* point=mggeo->get_gest_step().lst_point.getid(sommet2->get_id_point());
371  STEP_POINT* steppoint=new STEP_POINT(point);
372  MG_POINT* mgpoint=steppoint;
373  mggeo->ajouter_mg_point(mgpoint);
374  char idori[10];
375  sprintf(idori,"%lu",sommet2->get_id());
376  mgsom2=new MG_SOMMET(idori,mgpoint);
377  mggeo->ajouter_mg_sommet(mgsom2);
378  relation(sommet2,mgsom2);
379  }
380  MG_ARETE* mgarete=trouver((ST_EDGE_CURVE*)edge_curve);
381  if (mgarete==NULL)
382  {
383  int sens;
384  if (edge_curve->get_orientation()==1) sens=1;
385  else sens=-1;
386  char idori[10];
387  sprintf(idori,"%lu",edge_curve->get_id());
388  mgarete=new MG_ARETE(idori,mgcourbe,sens);
389  mggeo->ajouter_mg_arete(mgarete);
390  relation((ST_EDGE_CURVE*)edge_curve,mgarete);
391  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
392  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
393  mgarete->changer_cosommet1(mgcosom1);
394  mgarete->changer_cosommet2(mgcosom2);
395  }
396  int sens;
397  if (oriented_edge->get_orientation()==1) sens=1;
398  else sens=-1;
399  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens*oriented_closed_shell->get_orientation());
400  mgboucle->ajouter_mg_coarete(mgcoarete);
401  }
402  }
403  }
404  }
405  }
406  }
407  int nbFace=mggeo->get_nb_mg_face();
408  for (int i =0;i<nbFace;i++)
409  {
410  MG_FACE* face = mggeo->get_mg_face(i);
411  std::string nom = face->get_idoriginal();
412  long idstep=atol(nom.c_str());
413  ST_ADVANCED_FACE* stface=mggeo->get_gest_step().lst_advanced_face.getid(idstep);
414  nom=stface->get_idoriginal();
415  int taille=nom.size();
416  char *cnom=new char[taille+1];
417  strcpy(cnom,nom.c_str());
418  char* ptr=strchr(cnom,'@');
419  if (ptr!=NULL)
420  {
421  char cnombre[3];
422  *ptr++;
423  cnombre[0] = *ptr++;
424  cnombre[1] = *ptr++;
425  cnombre[2]='\0';
426  long inombre;
427  sscanf(cnombre,"%ld",&inombre);
428  for (int CL = 0;CL<inombre;CL++)
429  {
430  char TypeCL[3];
431  char ValeurCL[14];
432  TypeCL[0] = *ptr++;
433  TypeCL[1] = *ptr++;
434  TypeCL[2] = '\0';
435  for (int j = 0; j<13;j++)
436  {
437  ValeurCL[j] = *ptr++;
438  }
439  ValeurCL[2] = '.'; // changer une virgule en un point
440  ValeurCL[13] = '\0';
441  double valeur; // = fonction.CharDouble(ValeurCL);
442  sscanf(ValeurCL,"%le",&valeur);
443  face->ajouter_ccf(TypeCL,valeur);
444  }
445  }
446  delete [] cnom;
447  }
448  int nbarete=mggeo->get_nb_mg_arete();
449  for (int i =0;i<nbarete;i++)
450  {
451  MG_ARETE* arete = mggeo->get_mg_arete(i);
452  std::string nom = arete->get_idoriginal();
453  long idstep=atol(nom.c_str());
454  ST_EDGE_CURVE* starete=mggeo->get_gest_step().lst_edgecurve.getid(idstep);
455  nom=starete->get_idoriginal();
456  int taille=nom.size();
457  char *cnom=new char[taille+1];
458  strcpy(cnom,nom.c_str());
459  char* ptr= strchr(cnom,'@') ;
460  if (ptr!=NULL)
461  {
462  char cnombre[3];
463  *ptr++;
464  cnombre[0] = *ptr++;
465  cnombre[1] = *ptr++;
466  cnombre[2]='\0';
467  long inombre; // = fonction.CharToLong(cnombre);
468  sscanf(cnombre,"%ld",&inombre);
469  for (int CL = 0;CL<inombre;CL++)
470  {
471  char TypeCL[3];
472  char ValeurCL[14];
473  TypeCL[0] = *ptr++;
474  TypeCL[1] = *ptr++;
475  TypeCL[2] = '\0';
476 
477  for (int j = 0; j<13;j++)
478  {
479  ValeurCL[j] = *ptr++;
480  }
481  ValeurCL[2] = '.'; // changer une virgule en un point
482  ValeurCL[13] = '\0';
483  double valeur; // = fonction.CharDouble(ValeurCL);
484  sscanf(ValeurCL,"%le",&valeur);
485  //cout << " Type = " << TypeCL << " Et de valeur = " << valeur << endl;
486  arete->ajouter_ccf(TypeCL,valeur);
487  }
488  }
489  delete [] cnom;
490  }
491  int nbSommet=mggeo->get_nb_mg_sommet();
492  for (int i =0;i<nbSommet;i++)
493  {
494  MG_SOMMET* sommet = mggeo->get_mg_sommet(i);
495  std::string nom = sommet->get_idoriginal();
496  long idstep=atol(nom.c_str());
497  ST_VERTEX* stvertex=mggeo->get_gest_step().lst_vertex.getid(idstep);
498  nom=stvertex->get_idoriginal();
499  int taille=nom.size();
500  char *cnom=new char[taille+1];
501  strcpy(cnom,nom.c_str());
502  char* ptr;
503  ptr = strchr(cnom,'@') ;
504  if (ptr!=NULL)
505  {
506 
507  char cnombre[3];
508  *ptr++;
509  cnombre[0] = *ptr++;
510  cnombre[1] = *ptr++;
511  cnombre[2]='\0';
512  long inombre; // = fonction.CharToLong(cnombre);
513  sscanf(cnombre,"%ld",&inombre);
514 
515  for (int CL = 0;CL<inombre;CL++)
516  {
517  char TypeCL[3];
518  char ValeurCL[14];
519  TypeCL[0] = *ptr++;
520  TypeCL[1] = *ptr++;
521  TypeCL[2] = '\0';
522 
523  for (int j = 0; j<13;j++)
524  {
525  ValeurCL[j] = *ptr++;
526  }
527  ValeurCL[2] = '.'; // changer une virgule en un point
528  ValeurCL[13] = '\0';
529  double valeur; // = fonction.CharDouble(ValeurCL);
530  sscanf(ValeurCL,"%le",&valeur);
531  //cout << "Type = " << TypeCL << " Et de valeur = " << valeur << endl;
532  sommet->ajouter_ccf(TypeCL,valeur);
533  }
534  }
535  delete [] cnom;
536  }
537 
538 
539  return mggeo;
540 }
541 #endif
542 
ST_GESTIONNAIRE::lst_edgecurve
TPL_MAP_ENTITE< class ST_EDGE_CURVE * > lst_edgecurve
Definition: st_gestionnaire.h:71
MG_ARETE::changer_cosommet2
virtual void changer_cosommet2(class MG_COSOMMET *cosom)
Definition: mg_arete.cpp:77
ST_ORIENTED_EDGE::get_orientation
virtual int get_orientation(void)
Definition: storiedge.cpp:41
MG_GEOMETRIE::get_gest_step
class ST_GESTIONNAIRE & get_gest_step(void)
Definition: mg_geometrie.cpp:2694
stvector.h
mg_geometrie.h
ST_ORIENTED_EDGE
Definition: storiedge.h:33
stspherical.h
MG_ELEMENT_TOPOLOGIQUE::ajouter_ccf
virtual void ajouter_ccf(char *nom, double val, std::string suiv="NS")
Definition: mg_element_topologique.cpp:159
MG_BOUCLE
Definition: mg_boucle.h:35
gestionversion.h
MG_SURFACE
Definition: mg_surface.h:31
stsurfrevolution.h
ST_ADVANCED_FACE::get_orientation
virtual int get_orientation(void)
Definition: stadface.cpp:68
stconical.h
ST_ORIENTED_CLOSED_SHELL::get_orientation
virtual int get_orientation(void)
Definition: storientedclosedshell.cpp:47
ST_GESTIONNAIRE::lst_oriented_closed_shell
TPL_MAP_ENTITE< class ST_ORIENTED_CLOSED_SHELL * > lst_oriented_closed_shell
Definition: st_gestionnaire.h:83
stfacebound.h
ST_VERTEX
Definition: stvertex.h:33
ST_CLOSED_SHELL
Definition: stclosedshell.h:34
mg_gestionnaire.h
MG_GEOMETRIE::ajouter_mg_boucle
virtual int ajouter_mg_boucle(MG_BOUCLE *mgboucle)
Definition: mg_geometrie.cpp:1041
STEP_IMPORT::importer
class MG_GEOMETRIE * importer(class MG_GESTIONNAIRE &gest, char *path)
Definition: step_import.cpp:72
STEP_IMPORT::trouver
MG_FACE * trouver(ST_ADVANCED_FACE *face)
Definition: step_import.h:78
stsurfextrusion.h
stadface.h
ST_BREP_WITH_VOIDS
Definition: stbrepwithvoids.h:33
MG_COSOMMET
Definition: mg_cosommet.h:31
MG_GEOMETRIE::get_nb_mg_arete
unsigned int get_nb_mg_arete(void)
Definition: mg_geometrie.cpp:813
ST_ORIENTED_EDGE::get_id_edge_curve
virtual long get_id_edge_curve(void)
Definition: storiedge.cpp:37
stedgeloop.h
ST_ADVANCED_FACE
Definition: stadface.h:34
MG_COARETE
Definition: mg_coarete.h:31
ST_GESTIONNAIRE::lst_facebound
TPL_MAP_ENTITE< class ST_FACE_BOUND * > lst_facebound
Definition: st_gestionnaire.h:74
stbrepwithvoids.h
storientedclosedshell.h
MG_GEOMETRIE::ajouter_mg_volume
virtual int ajouter_mg_volume(MG_VOLUME *mgvol)
Definition: mg_geometrie.cpp:1642
ST_CLOSED_SHELL::get_id_advanced_face
virtual long get_id_advanced_face(long num)
Definition: stclosedshell.cpp:53
storiedge.h
ST_VERTEX::get_id_point
virtual long get_id_point(void)
Definition: stvertex.cpp:41
ST_ORIENTED_CLOSED_SHELL
Definition: storientedclosedshell.h:33
MG_GEOMETRIE::get_mg_sommet
MG_SOMMET * get_mg_sommet(unsigned int num)
Definition: mg_geometrie.cpp:539
ST_BREP_WITH_VOIDS::est_util
virtual void est_util(class ST_GESTIONNAIRE *gest)
Definition: stbrepwithvoids.cpp:60
MG_BOUCLE::ajouter_mg_coarete
virtual void ajouter_mg_coarete(class MG_COARETE *mgcoarete)
Definition: mg_boucle.cpp:73
MG_VOLUME
Definition: mg_volume.h:33
MG_COQUILLE
Definition: mg_coquille.h:34
ST_EDGE_LOOP
Definition: stedgeloop.h:34
MG_GESTIONNAIRE
Definition: mg_gestionnaire.h:57
MG_COFACE
Definition: mg_coface.h:33
ST_FACE_BOUND
Definition: stfacebound.h:34
MG_GEOMETRIE::ajouter_mg_sommet
virtual int ajouter_mg_sommet(MG_SOMMET *mgsom)
Definition: mg_geometrie.cpp:497
ST_GESTIONNAIRE::lst_point
TPL_MAP_ENTITE< class ST_POINT * > lst_point
Definition: st_gestionnaire.h:91
MG_COURBE
Definition: mg_courbe.h:30
ST_EDGE_CURVE::get_id_sommet2
virtual long get_id_sommet2(void)
Definition: stedgecurve.cpp:46
stvertex.h
ST_EDGE_CURVE::get_orientation
virtual int get_orientation(void)
Definition: stedgecurve.cpp:50
ST_POINT
Definition: st_point.h:30
ST_MANIFOLD_BREP::est_util
virtual void est_util(class ST_GESTIONNAIRE *gest)
Definition: stbrep.cpp:43
ST_MANIFOLD_BREP
Definition: stbrep.h:32
stellipse.h
ST_EDGE_CURVE::get_id_sommet1
virtual long get_id_sommet1(void)
Definition: stedgecurve.cpp:42
MG_GEOMETRIE::ajouter_mg_coquille
virtual int ajouter_mg_coquille(MG_COQUILLE *mgcoq)
Definition: mg_geometrie.cpp:1473
MG_GEOMETRIE::ajouter_mg_coface
virtual int ajouter_mg_coface(MG_COFACE *mgcoface)
Definition: mg_geometrie.cpp:1356
ST_EDGE_CURVE
Definition: stedgecurve.h:34
ST_GESTIONNAIRE::lst_advanced_face
TPL_MAP_ENTITE< class ST_ADVANCED_FACE * > lst_advanced_face
Definition: st_gestionnaire.h:84
stbrep.h
MG_GEOMETRIE::ajouter_mg_cosommet
virtual int ajouter_mg_cosommet(MG_COSOMMET *mgcosom)
Definition: mg_geometrie.cpp:643
ST_BREP_WITH_VOIDS::get_id_oriented_closed_shell
virtual long get_id_oriented_closed_shell(long numero)
Definition: stbrepwithvoids.cpp:48
ST_CLOSED_SHELL::get_nb_advanced_face
virtual long get_nb_advanced_face(void)
Definition: stclosedshell.cpp:48
stdirection.h
staxis1place.h
MG_GESTIONNAIRE::ajouter_mg_geometrie
int ajouter_mg_geometrie(MG_GEOMETRIE *mggeo)
Definition: mg_gestionnaire.cpp:306
TPL_MAP_ENTITE::get_nb
virtual int get_nb(void)
Definition: tpl_map_entite.h:83
ST_EDGE_CURVE::get_id_curve
virtual long get_id_curve(void)
Definition: stedgecurve.cpp:38
ST_GESTIONNAIRE::lst_edge_loop
TPL_MAP_ENTITE< class ST_EDGE_LOOP * > lst_edge_loop
Definition: st_gestionnaire.h:85
stcylindrical.h
MG_GEOMETRIE::get_mg_arete
MG_ARETE * get_mg_arete(unsigned int num)
Definition: mg_geometrie.cpp:800
step_point.h
STEP_POINT
Definition: step_point.h:33
ST_GESTIONNAIRE::lst_brep_with_voids
TPL_MAP_ENTITE< class ST_BREP_WITH_VOIDS * > lst_brep_with_voids
Definition: st_gestionnaire.h:87
stfaceobound.h
ST_BREP_WITH_VOIDS::get_id_closed_shell
virtual long get_id_closed_shell(void)
Definition: stbrepwithvoids.cpp:52
ST_GESTIONNAIRE::lst_vertex
TPL_MAP_ENTITE< class ST_VERTEX * > lst_vertex
Definition: st_gestionnaire.h:75
ST_GESTIONNAIRE::lst_courbe
TPL_MAP_ENTITE< class ST_COURBE * > lst_courbe
Definition: st_gestionnaire.h:95
ST_MANIFOLD_BREP::get_id_closed_shell
virtual long get_id_closed_shell(void)
Definition: stbrep.cpp:36
MG_POINT
Definition: mg_point.h:33
MG_GEOMETRIE::get_mg_face
MG_FACE * get_mg_face(unsigned int num)
Definition: mg_geometrie.cpp:1251
step_surface.h
ST_ADVANCED_FACE::get_id_face_bound
virtual long get_id_face_bound(long numero)
Definition: stadface.cpp:62
ST_SURFACE
Definition: st_surface.h:29
ST_ADVANCED_FACE::get_nb_face_bound
virtual long get_nb_face_bound(void)
Definition: stadface.cpp:57
MG_GEOMETRIE::ajouter_mg_courbe
virtual int ajouter_mg_courbe(MG_COURBE *mgcrb)
Definition: mg_geometrie.cpp:251
stclosedshell.h
MG_GEOMETRIE::ajouter_mg_face
virtual int ajouter_mg_face(MG_FACE *mgface)
Definition: mg_geometrie.cpp:1210
MG_GEOMETRIE::ajouter_mg_coarete
virtual int ajouter_mg_coarete(MG_COARETE *mgcoarete)
Definition: mg_geometrie.cpp:925
MG_GEOMETRIE::get_nb_mg_face
unsigned int get_nb_mg_face(void)
Definition: mg_geometrie.cpp:1264
step_import.h
ST_GESTIONNAIRE::lst_oriedge
TPL_MAP_ENTITE< class ST_ORIENTED_EDGE * > lst_oriedge
Definition: st_gestionnaire.h:72
TPL_MAP_ENTITE::getid
virtual X getid(unsigned long num)
Definition: tpl_map_entite.h:96
STEP_IMPORT::STEP_IMPORT
STEP_IMPORT()
Definition: step_import.cpp:62
STEP_SURFACE
Definition: step_surface.h:33
MG_GEOMETRIE::ajouter_mg_arete
virtual int ajouter_mg_arete(MG_ARETE *mgarete)
Definition: mg_geometrie.cpp:759
MG_GEOMETRIE::ajouter_mg_point
virtual int ajouter_mg_point(MG_POINT *mgpt)
Definition: mg_geometrie.cpp:137
ST_IDENTIFICATEUR::get_idoriginal
virtual std::string get_idoriginal(void)
Definition: st_ident.cpp:66
STEP_COURBE
Definition: step_courbe.h:32
staxis2place3d.h
MG_COQUILLE::ajouter_mg_coface
virtual void ajouter_mg_coface(class MG_COFACE *mgcoface)
Definition: mg_coquille.cpp:71
MG_ARETE::changer_cosommet1
virtual void changer_cosommet1(class MG_COSOMMET *cosom)
Definition: mg_arete.cpp:73
TPL_MAP_ENTITE::get
virtual X get(int num)
Definition: tpl_map_entite.h:89
ST_FACE_BOUND::get_id_edge_loop
virtual long get_id_edge_loop(void)
Definition: stfacebound.cpp:35
MG_GEOMETRIE
Definition: mg_geometrie.h:84
sttoroidal.h
ST_EDGE_LOOP::get_id_oriented_edge
virtual long get_id_oriented_edge(long numero)
Definition: stedgeloop.cpp:51
ST_ADVANCED_FACE::get_id_surface
virtual long get_id_surface(void)
Definition: stadface.cpp:47
ST_GESTIONNAIRE::lst_surface
TPL_MAP_ENTITE< class ST_SURFACE * > lst_surface
Definition: st_gestionnaire.h:96
STEP_IMPORT::~STEP_IMPORT
virtual ~STEP_IMPORT()
Definition: step_import.cpp:67
step_courbe.h
stcircle.h
stline.h
stedgecurve.h
MG_ARETE
Definition: mg_arete.h:36
MG_FACE
Definition: mg_face.h:34
stplane.h
MG_ELEMENT_TOPOLOGIQUE::get_idoriginal
virtual std::string get_idoriginal(void)
Definition: mg_element_topologique.cpp:299
MG_SOMMET
Definition: mg_sommet.h:35
ST_ORIENTED_CLOSED_SHELL::get_id_closed_shell
virtual long get_id_closed_shell(void)
Definition: storientedclosedshell.cpp:42
ST_IDENTIFICATEUR::get_id
virtual unsigned long get_id()
Definition: st_ident.cpp:42
STEP_IMPORT::relation
void relation(class ST_ADVANCED_FACE *ent1, class MG_FACE *ent2)
Definition: step_import.h:47
MG_GEOMETRIE::ajouter_mg_surface
virtual int ajouter_mg_surface(MG_SURFACE *mgsrf)
Definition: mg_geometrie.cpp:366
stbspline.h
ST_GESTIONNAIRE::lst_manifold_brep
TPL_MAP_ENTITE< class ST_MANIFOLD_BREP * > lst_manifold_brep
Definition: st_gestionnaire.h:86
MG_GEOMETRIE::get_nb_mg_sommet
unsigned int get_nb_mg_sommet(void)
Definition: mg_geometrie.cpp:552
ST_COURBE
Definition: st_courbe.h:33
stbsplines.h
ST_GESTIONNAIRE::lst_closed_shell
TPL_MAP_ENTITE< class ST_CLOSED_SHELL * > lst_closed_shell
Definition: st_gestionnaire.h:82
ST_EDGE_LOOP::get_nb_oriented_edge
virtual long get_nb_oriented_edge(void)
Definition: stedgeloop.cpp:47
m
#define m(i, j)