MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
sld_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 //####// sld_import.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #ifdef BREP_SLD
26 
27 #include "sld_import.h"
28 #include "mg_geometrie.h"
29 #include "mg_gestionnaire.h"
30 #include "sld_surface.h"
31 #include "sld_point.h"
32 #include "sld_courbe.h"
33 #include "lc_point.h"
34 #include "sld_fonction.h"
35 
36 #include <strutils.hpp> // pour le ansistringcompare
37 
38 
39 #include <atl\atlmod.h>
40 #include "smartvars.h"
41 #include "sldworks_tlb.h"
42 #include "swconst_tlb.h"
43 
44 #include <string.h> // pour l'analyse des string des Conditions aux limites
45 #include <stdio.h>
46 
47 
49 {
50 }
51 
52 
54 {
55 
56 }
57 
58 
59 
60 void SLD_IMPORT::relation(IFace2 *ent1,class MG_FACE* ent2)
61 {
63  r.a=ent1;
64  r.b=ent2;
65  lst_face.insert(lst_face.end(),r);
66 }
67 
68 
69 void SLD_IMPORT::relation(class ISurface *ent1,class MG_SURFACE* ent2)
70 {
72  r.a=ent1;
73  r.b=ent2;
74  lst_surface.insert(lst_surface.end(),r);
75 }
76 
77 
78 void SLD_IMPORT::relation(IEdge *ent1,class MG_ARETE* ent2)
79 {
81  r.a=ent1;
82  r.b=ent2;
83  lst_arete.insert(lst_arete.end(),r);
84 }
85 
86 void SLD_IMPORT::relation(ICurve *ent1,class MG_COURBE* ent2)
87 {
89  r.a=ent1;
90  r.b=ent2;
91  lst_courbe.insert(lst_courbe.end(),r);
92 }
93 
94 void SLD_IMPORT::relation(IVertex *ent1,class MG_SOMMET* ent2)
95 {
97  r.a=ent1;
98  r.b=ent2;
99  lst_sommet.insert(lst_sommet.end(),r);
100 }
101 
102 
104 {
105  vector<TPL_RELATION_ENTITE<IFace2,MG_FACE> >::iterator i;
106  for (i=lst_face.begin();i!=lst_face.end();i++)
107  if ((*i).a==face) return (*i).b;
108  return NULL;
109 }
110 
111 MG_SURFACE* SLD_IMPORT::trouver(ISurface *surface)
112 {
113  vector<TPL_RELATION_ENTITE<ISurface,MG_SURFACE> >::iterator i;
114  for (i=lst_surface.begin();i!=lst_surface.end();i++)
115  if ((*i).a==surface) return (*i).b;
116  return NULL;
117 }
118 
120 {
121  vector<TPL_RELATION_ENTITE<IEdge,MG_ARETE> >::iterator i;
122  for (i=lst_arete.begin();i!=lst_arete.end();i++)
123  if ((*i).a==arete) return (*i).b;
124  return NULL;
125 }
126 
128 {
129  vector<TPL_RELATION_ENTITE<ICurve,MG_COURBE> >::iterator i;
130  for (i=lst_courbe.begin();i!=lst_courbe.end();i++)
131  if ((*i).a==courbe) return (*i).b;
132 
133  return NULL;
134 }
135 
136 MG_SOMMET* SLD_IMPORT::trouver(IVertex *sommet) // le trouver original
137 {
138 
139  vector<TPL_RELATION_ENTITE<IVertex,MG_SOMMET> >::iterator i;
140  for (i=lst_sommet.begin();i!=lst_sommet.end();i++)
141  if ((*i).a==sommet) return (*i).b;
142  return NULL;
143 }
144 
146 {
147  SLD_FONCTION& fonction=gest.get_sld_fonction();
148  fonction.Connection();
149  fonction.OuvrirFichier( path );
150 
151  MG_GEOMETRIE *mggeo=new MG_GEOMETRIE("SLD",path);
152  gest.ajouter_mg_geometrie(mggeo);
153 
154  swApp = fonction.swApp;
155  swModel=fonction.swModel;
156  CComQIPtr<IPartDoc> swPart;
157  swPart = swModel;
158  VARIANT_BOOL retour;
159  swModel->EditRebuild3(&retour); // n�cessaire pour r�-attacher les attributs sur les poutres (?!?)
160 
161  RegisterAttributs(); // register des attributs pour les conditions aux limites et autres
162  fonction.DefAttrDoublon = DefAttrDoublon;
163 
164  CComPtr <IModeler> swModeler ;
165  double OldToleranceValue;
166  double Tolerance = fonction.GetValeurTolerance() ;
167  swApp->IGetModeler(&swModeler); // obtenir le modeler
168  swModeler->SetToleranceValue ( 0, Tolerance, &OldToleranceValue); //swBSCurveOutputTol -3 D bspline curve output tolerance (meters)
169  swModeler->SetToleranceValue ( 1, Tolerance, &OldToleranceValue); //swBSCurveNonRationalOutputTol - 3D nonrational b-spline curve output tolerance (meters)
170  swModeler->SetToleranceValue ( 2, Tolerance, &OldToleranceValue); //swUVCurveOutputTol - 2D trim curve output tolerance (fraction of characteristic minimum face dimension)
171 
172 
173  bool NouvelleCourbe = false; // indice pour �viter d'avoir 2 LC-point quand la m�me ar�te est �valu�e 2 fois
174 
175  CComVariant vBodyArr; // si plus d'un corps dans le fichier part
176  swPart->GetBodies2(swSolidBody, VARIANT_TRUE, &vBodyArr);
177  SAFEARRAY* psaBody = V_ARRAY(&vBodyArr);
178  LPDISPATCH* pBodyDispArray = NULL;
179  long nBodyHighIndex = -1;
180  SafeArrayAccessData(psaBody, (void **) &pBodyDispArray);
181  SafeArrayGetUBound(psaBody, 1, &nBodyHighIndex);
182  swModel->EditRebuild3();
183  long nb_sld_corps = nBodyHighIndex + 1;
184 
185 
186  // certains pointeurs de sommet et d'ar�te sont dupliqu�s: il y a 2 pointeurs pour
187  // un seul sommet appel� "Sommet651"
188  // Donc la methode "trouver" bas�e sur les pointeurs peut se planter... donc je v�rifie si
189  // un sommet du m�me nom existe d�j�
190  std::map < std::string , MG_SOMMET* > lst_vertices;
191  std::map < std::string , MG_SOMMET* >::iterator it_lst_vertices;
192  std::map < std::string , MG_ARETE* > lst_edges;
193  std::map < std::string , MG_ARETE* >::iterator it_lst_edges;
195 
196 
197  for (long i=0;i<nb_sld_corps;i++) // boucle sur les corps
198  {
199  CComQIPtr <IBody2> swBody;
200  swBody = pBodyDispArray[i];
201  long tipe;
202  swBody->GetType(&tipe);
203  short visible;
204  swBody->get_Visible(&visible) ;
205  if (tipe ==0 && visible != 0 )
206  {
207  MG_VOLUME* mgvol=new MG_VOLUME("nil");
208  mggeo->ajouter_mg_volume(mgvol);
209 
210  MG_COQUILLE* mgcoq=new MG_COQUILLE(mgvol);
211  mggeo->ajouter_mg_coquille(mgcoq,mgvol);
212 
213  // note de Gilles: pour moi les faces sont int�gralement r�cup�r�es
214  // seulement si on ne fait rien � l'int�rieur de la boucle get first face... get next face
215  std::multimap < std::string , CComPtr <IFace2> > lst_faces;
216  std::multimap < std::string , CComPtr <IFace2> >::iterator it_face;
217 
218 
219  CComPtr <IFace2> swFace;
220  swBody->IGetFirstFace(&swFace);
221  while (swFace)
222  {
223  CComPtr<IFace2> swFace_Next;
224  std::string idoriginal = fonction.GetID(swFace.p).c_str();
225  if ( lst_faces.find(idoriginal) == lst_faces.end() )
226  lst_faces.insert(std::make_pair( idoriginal , swFace) );
227  swFace->IGetNextFace(&swFace_Next);
228  swFace.Release();
229  swFace = swFace_Next;
230  }
231 
232 
233  for (it_face = lst_faces.begin(); it_face != lst_faces.end(); it_face++)
234  {
235  swFace = it_face->second;
236  // la premi�re face est d�j� active....
237 
238  CComPtr <ISurface> swSurf ;
239  swFace->IGetSurface(&swSurf);
240  MG_SURFACE* mgsurface=0;//trouver(swSurf.p);
241  if (mgsurface==NULL)
242  {
243  char id[1000];
244  sprintf(id,"%s",fonction.GetID(swFace.p).c_str());
245 
246  CComPtr <IEntity> ent;
247  {
248  WideString acstostr(id);
249  BSTR nom=BSTR(acstostr);
250  CComQIPtr <IPartDoc> swPart;
251  swPart = swModel;
252  swPart->IGetEntityByName ( nom, swSelFACES , &ent ) ;
253  }
254 
255  SLD_SURFACE* sldSurface=0;
256  if (ent == 0)
257  sldSurface=new SLD_SURFACE(id,fonction,swFace);
258  else
259  sldSurface=new SLD_SURFACE(id,fonction);
260  mgsurface=sldSurface;
261  mggeo->ajouter_mg_surface(mgsurface);
262  relation(swSurf,mgsurface);
263  }
264  MG_FACE* mgface=trouver(swFace.p);
265  if (mgface==NULL)
266  {
267  VARIANT_BOOL retval;
268  swFace->FaceInSurfaceSense( &retval ) ;
269  int sens;
270  if (retval ==1)
271  sens = -1;
272  else
273  sens = 1;
274 
275  mgface=new MG_FACE(fonction.GetID(swFace).c_str(),mgsurface,sens); // orientation=1 si face et surface meme sens -1 sinon
276  mggeo->ajouter_mg_face(mgface);
277  relation(swFace,mgface);
278  VerifierCL(swFace);
279 
280  long nb_loop=-1;
281  swFace->GetLoopCount(&nb_loop);
282  CComPtr <ILoop2> swLoop; // boucler sur les loop
283  CComPtr <ILoop2> swNextLoop;
284  swFace->IGetFirstLoop(&swLoop);
285 
286  for (long k=0;k<nb_loop;k++)
287  {
288  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgface);
289  mggeo->ajouter_mg_boucle(mgboucle,mgface);
290 
291  {
292  CComPtr <ICoEdge> swCoArete;
293  CComPtr <ICoEdge> nextCoArete;
294 
295  swLoop->IGetFirstCoEdge(&swCoArete);
296 
297  long nbedge;
298  swLoop->GetEdgeCount(&nbedge);
299  for (long l=0;l<nbedge;l++)
300  {
301  CComPtr<IEdge> swArete;
302  CComPtr<ICurve> swCourbe;
303  swCoArete->IGetEdge (&swArete);
304  swArete->IGetCurve (&swCourbe);
305  MG_COURBE* mgcourbe=trouver(swCourbe.p);
306  NouvelleCourbe = false;
307  if (mgcourbe==NULL)
308  {
309  char id[1000];
310  sprintf(id,"%s",fonction.GetID(swArete.p).c_str());
311 
312  CComPtr<IEdge> swEdgeTemp;
313  fonction.GetParID(id, swEdgeTemp);
314 
315  SLD_COURBE* sldcourbe=0;
316  if ( swEdgeTemp != 0)
317  sldcourbe=new SLD_COURBE(id,fonction);
318  else
319  sldcourbe=new SLD_COURBE(id, fonction, swArete);
320 
321  mgcourbe=sldcourbe;
322  mggeo->ajouter_mg_courbe(mgcourbe);
323  relation(swCourbe,mgcourbe);
324  NouvelleCourbe = true;
325  } // ici ? si on a d�j� la courbe, pourquoi refaire les sommets....
326  CComPtr<IVertex> swSommet1;
327  CComPtr<IVertex> swSommet2;
328  swArete->IGetStartVertex( &swSommet1 );
329  MG_ARETE* mgarete;
330  MG_SOMMET *mgsom1,*mgsom2;
331  if (swSommet1!=NULL) // si on a une arr�te avec deux points limites
332  { // sinon on va dans le else
333  swArete->IGetEndVertex ( &swSommet2 ) ;
334  mgsom1=trouver(swSommet1.p); // j'ai besoin du trouver!!! sinon le doublon reste .
335  if (mgsom1==NULL)
336  {
337  char id[1000];
338  strcpy(id,fonction.GetID(swSommet1.p).c_str());
339  it_lst_vertices = lst_vertices.find(id);
340  if ( it_lst_vertices != lst_vertices.end())
341  mgsom1 = it_lst_vertices->second;
342  else
343  {
344  MG_POINT* mgpoint=0;
345  CComPtr<IVertex> swVertexTemp;
346  fonction.GetParID(id,swVertexTemp);
347  if (swVertexTemp == 0)
348  {
349  CComVariant vretval;
350  swSommet1->GetPoint(&vretval) ;
351  SafeDoubleArray retval(vretval);
352  double xyz[3]={retval[0],retval[1],retval[2]};
353  LC_POINT * lcpoint=new LC_POINT(xyz);
354  mgpoint = lcpoint;
355  }
356  else
357  {
358  SLD_POINT* sldpoint=new SLD_POINT(id,fonction);
359  mgpoint = sldpoint;
360  }
361 
362  mggeo->ajouter_mg_point(mgpoint);
363  mgsom1=new MG_SOMMET(id,mgpoint);
364  mggeo->ajouter_mg_sommet(mgsom1);
365  lst_vertices[id]=mgsom1;
366  relation(swSommet1,mgsom1);
367  VerifierCL(swSommet1);
368  }
369  }
370 
371  mgsom2=trouver(swSommet2.p);
372  if (mgsom2==NULL)
373  {
374  char id[1000];
375  strcpy(id,fonction.GetID(swSommet2.p).c_str());
376  it_lst_vertices = lst_vertices.find(id);
377  if ( it_lst_vertices != lst_vertices.end())
378  mgsom2 = it_lst_vertices->second;
379  else
380  {
381  MG_POINT* mgpoint=0;
382  CComPtr<IVertex> swVertexTemp;
383  fonction.GetParID(id,swVertexTemp);
384  if (swVertexTemp == 0)
385  {
386  CComVariant vretval;
387  swSommet2->GetPoint(&vretval) ;
388  SafeDoubleArray retval(vretval);
389  double xyz[3]={retval[0],retval[1],retval[2]};
390  LC_POINT * lcpoint=new LC_POINT(xyz);
391  mgpoint = lcpoint;
392  }
393  else
394  {
395  SLD_POINT* sldpoint=new SLD_POINT(id,fonction);
396  mgpoint = sldpoint;
397  }
398  mggeo->ajouter_mg_point(mgpoint);
399  mgsom2=new MG_SOMMET(id,mgpoint);
400  mggeo->ajouter_mg_sommet(mgsom2);
401  lst_vertices[id]=mgsom2;
402  relation(swSommet2,mgsom2);
403  VerifierCL(swSommet2);
404  }
405  }
406  }
407  else
408  {
409  // mettre le code si on a une courbe seule
410  // i.e. si l'on a pas de point de d�but ou de fin.
411  // j'ai une swCourbe, mais surtout une sldcourbe.
412  if (NouvelleCourbe) // si c'est une nouvelle courbe on doit ajouter un point, sinon il est d�j� cr��.
413  {
414  double xyz[3];
415  mgcourbe->evaluer(mgcourbe->get_tmin(),xyz);
416 
417  // on envoie dans le cr�ateur du lc_point un tableau des coordonn�es
418  LC_POINT *lcpoint1= new LC_POINT(xyz);
419  MG_POINT* mgpoint=lcpoint1;
420  mggeo->ajouter_mg_point(mgpoint);
421 
422  mgsom1=new MG_SOMMET("nil",mgpoint);
423  mggeo->ajouter_mg_sommet(mgsom1);
424  mgsom2=mgsom1;
425  }
426  } // end if (swSommet1!=NULL)
427 
428  char id[50]="";
429  strcpy(id,fonction.GetID(swArete.p).c_str());
430  it_lst_edges = lst_edges.find(id);
431  if (it_lst_edges != lst_edges.end())
432  mgarete = it_lst_edges->second;
433  else
434  //arete=trouver(swArete.p);
435  // (mgarete==NULL)
436  {
437  int sens;
438  short isRev;
439  swArete->IsParamReversed ( &isRev );
440  if (isRev==1)
441  sens = -1;
442  else
443  sens = 1 ;
444 
445  mgarete=new MG_ARETE(id,mgcourbe,sens);
446  lst_edges[id]=mgarete;
447  mggeo->ajouter_mg_arete(mgarete);
448  relation(swArete,mgarete);
449  VerifierCL(swArete,fonction);
450  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
451  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
452  mgarete->changer_cosommet1(mgcosom1);
453  mgarete->changer_cosommet2(mgcosom2);
454  }
455 
456  int sens;
457  short ret;
458  swCoArete->GetSense(&ret) ;
459  if (ret==1) sens=1;
460  else sens=-1;
461 
462  // d�terminer si le sens de l'ar�te originelle est dans le m�me sens que l'ar�te Maitre
463  sens *= fonction.sensMaitre;
464  // fin de la d�termination
465 
466  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens);
467  mgboucle->ajouter_mg_coarete(mgcoarete);
468  swCoArete->IGetNext(&nextCoArete);
469  swCoArete = nextCoArete;
470  nextCoArete.Release();
471  }
472 
473  } // next CoArrete
474 
475  swLoop->IGetNext(&swNextLoop);
476  swLoop = swNextLoop;
477  swNextLoop.Release();
478  } // next Loop
479  }
480  MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(mgface,mgcoq,1);
481  mgcoq->ajouter_mg_coface(mgcoface);
482  } // next face
483 
484 
485  swFace.Release();
486 
487  } // on ignore les SheetBody
488  swBody.Release();
489 
490  } // next body
491 
492 
493  CComPtr <IFeature> swFeat;
494  CComPtr <IFeature> swNextFeat;
495  VARIANT_BOOL bSupprime;
496  CComVariant vArete;
497  CComVariant vEdge;
498  CComPtr <IEntity> ent;
499 
500  swPart->IFirstFeature(&swFeat);
501 
502  while (swFeat)
503  {
504  swFeat->IsSuppressed(&bSupprime);
505 
506 
507 
508  if (!bSupprime)
509  {
510  CComBSTR NomFeat;
511  swFeat->GetTypeName(&NomFeat);
512 
513  CComBSTR Compo1 ("CompositeCurve."); // le dernier point est mang� par le BSTR
514  CComBSTR Compo2 ("3DSplineCurve.");
515 
516 
517  if ((Compo1==NomFeat) || (Compo2==NomFeat)) // code de traitement des poutres
518  {
519  CComPtr <IReferenceCurve> refCourbe;
520  CComPtr <IUnknown> Unk;
521 
522  swFeat->IGetSpecificFeature(&Unk);
523  Unk->QueryInterface( IID_IReferenceCurve, (LPVOID*)&refCourbe);
524 
525  CComPtr<IEdge> swArete;
526  refCourbe->IGetFirstSegment(&swArete);
527 
528 
529  while (swArete)
530  {
531  bool ig =Ignorer(swArete);
532 
533  if (!ig)
534  {
535  char id3[1000]; // �tait dans la boucle while avant
536  sprintf(id3,"%s",fonction.GetID(swArete.p).c_str());
537  MG_POUTRE* mgpoutre = new MG_POUTRE(id3);
538  mggeo->ajouter_mg_poutre(mgpoutre); //
539 
540  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgpoutre);
541  mggeo->ajouter_mg_boucle(mgboucle,mgpoutre);
542 
543  CComPtr <ICoEdge> swCoArete;
544  CComPtr<ICurve> swCourbe;
545 
546  swArete->IGetCurve (&swCourbe);
547  MG_COURBE* mgcourbe=trouver(swCourbe.p);
548  NouvelleCourbe = false;
549  if (mgcourbe==NULL)
550  {
551  char id4[1000];
552  sprintf(id4,"%s",fonction.GetID(swArete.p).c_str());
553  SLD_COURBE* sldcourbe=new SLD_COURBE(id4,fonction);
554  mgcourbe=sldcourbe;
555  mggeo->ajouter_mg_courbe(mgcourbe);
556  relation(swCourbe,mgcourbe);
557  NouvelleCourbe = true;
558  delete []id4;
559  }
560  CComPtr<IVertex> swSommet1;
561  CComPtr<IVertex> swSommet2;
562  swArete->IGetStartVertex( &swSommet1 );
563 
564  MG_ARETE* mgarete;
565  MG_SOMMET *mgsom1,*mgsom2;
566  if (swSommet1!=NULL) // si on a une arr�te avec deux points limites
567  { // sinon on va dans le else
568 
569  mgsom1=trouver(swSommet1.p);
570  if (mgsom1==NULL)
571  {
572  char id[1000];
573  strcpy(id,fonction.GetID(swSommet1.p).c_str());
574  it_lst_vertices = lst_vertices.find(id);
575  if ( it_lst_vertices != lst_vertices.end())
576  mgsom1 = it_lst_vertices->second;
577  else
578  {
579  char id[1000];
580  sprintf(id,"%s",fonction.GetID(swSommet1.p).c_str());
581  SLD_POINT* sldpoint=new SLD_POINT(id,fonction);
582  MG_POINT* mgpoint=sldpoint;
583  mggeo->ajouter_mg_point(mgpoint);
584  mgsom1=new MG_SOMMET(id,mgpoint);
585  mggeo->ajouter_mg_sommet(mgsom1);
586  relation(swSommet1,mgsom1);
587  VerifierCL(swSommet1);
588  }
589  }
590  swArete->IGetEndVertex ( &swSommet2 );
591  mgsom2=trouver(swSommet2.p);
592  if (mgsom2==NULL)
593  {
594  char id22[1000];
595  strcpy(id22,fonction.GetID(swSommet2.p).c_str());
596  it_lst_vertices = lst_vertices.find(id22);
597  if ( it_lst_vertices != lst_vertices.end())
598  mgsom2 = it_lst_vertices->second;
599  else
600  {
601  SLD_POINT* sldpoint=new SLD_POINT(id22,fonction);
602  MG_POINT* mgpoint=sldpoint;
603  mggeo->ajouter_mg_point(mgpoint);
604  mgsom2=new MG_SOMMET(id22,mgpoint);
605  mggeo->ajouter_mg_sommet(mgsom2);
606  relation(swSommet2,mgsom2);
607  VerifierCL(swSommet2);
608  }
609  }
610  }
611  else
612  {
613  // mettre le code si on a une courbe seule
614  // i.e. si l'on a pas de point de d�but ou de fin.
615  // j'ai une swCourbe, mais surtout une sldcourbe.
616  if (NouvelleCourbe) // si c'est une nouvelle courbe on doit ajouter un point, sinon il est d�j� cr��.
617  {
618  double xyz[3];
619  mgcourbe->evaluer(mgcourbe->get_tmin(),xyz);
620 
621  // on envoie dans le cr�ateur du lc_point un tableau des coordonn�es
622  LC_POINT *lcpoint1= new LC_POINT(xyz);
623  MG_POINT* mgpoint=lcpoint1;
624  mggeo->ajouter_mg_point(mgpoint);
625 
626  mgsom1=new MG_SOMMET("nil",mgpoint);
627  mggeo->ajouter_mg_sommet(mgsom1);
628  mgsom2=mgsom1;
629  }
630  } // end if (swSommet1!=NULL)
631 
632  char id2[50]="";
633  strcpy(id2,fonction.GetID(swArete.p).c_str());
634  it_lst_edges = lst_edges.find(id2);
635  if (it_lst_edges != lst_edges.end())
636  mgarete = it_lst_edges->second;
637  else
638  {
639  int sens;
640  short isRev;
641  swArete->IsParamReversed ( &isRev );
642  if (isRev==1)
643  sens = -1;
644  else
645  sens = 1 ;
646 
647  mgarete=new MG_ARETE(id2,mgcourbe,sens);
648  mggeo->ajouter_mg_arete(mgarete);
649  relation(swArete,mgarete);
650  VerifierCL(swArete,fonction);
651  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
652  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
653  mgarete->changer_cosommet1(mgcosom1);
654  mgarete->changer_cosommet2(mgcosom2);
655  }
656 
657  int sens=1; // attention, �a �a peut faire ch... un max.
658  short ret;
659  //swCoArete->GetSense(&ret) ;
660  //if (ret==1) sens=1; else sens=-1;
661  // d�terminer si le sens de l'ar�te originelle est dans le m�me sens que l'ar�te Maitre
662  sens *= fonction.sensMaitre;
663  // fin de la d�termination
664  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens);
665  mgboucle->ajouter_mg_coarete(mgcoarete);
666 
667  //*****************************
668  // fin code si on avait une poutre
669  //*******************************
670  } // end if on ignore pas la poutre
671  swArete.Release();
672  refCourbe->IGetNextSegment(&swArete);
673  } // end while (swarete)
674 
675  } // end if feature est une poutre
676  } // end if feat supprim�
677  swFeat->IGetNextFeature(&swNextFeat);
678  swFeat = swNextFeat;
679  swNextFeat.Release();
680  } // Next sur les features
681 
682 
683 
684  /*CComBSTR Compa1 ("ExtruRefSurface.");
685  CComBSTR Compa2 ("RevolvRefSurf.");
686  CComBSTR Compa3 ("SweepRefSurface.");
687  CComBSTR Compa4 ("BlendRefSurface.");
688  CComBSTR Compa5 ("OffsetRefSurface.");
689  CComBSTR Compa6 ("ExtendRefSurface.");
690  CComBSTR Compa7 ("PlanarSurface.");
691  CComBSTR Compa8 ("RadiateRefSurface.");
692  CComBSTR Compa9 ("MidRefSurface.");
693  CComBSTR Compa10 ("FillRefSurface.");
694  //CComBSTR Compa11 ("PLine."); //*/
695 
696  // traitement des coques
697 
698  swPart->GetBodies2(swSheetBody,true,&vBodyArr) ;
699  psaBody = V_ARRAY(&vBodyArr);
700  pBodyDispArray = NULL;
701  nBodyHighIndex = -1;
702  SafeArrayAccessData(psaBody, (void **) &pBodyDispArray);
703  SafeArrayGetUBound(psaBody, 1, &nBodyHighIndex);
704  long nb_sld_coque = nBodyHighIndex + 1;
705 
706  for (long i=0;i<nb_sld_coque;i++) // boucle sur les coques
707  {
708 
709  CComQIPtr <IBody2> swBody;
710  swBody = pBodyDispArray[i];
711 
712  // cr�ation de la coque et de la coquille
713  char id[1000];
714  //sprintf(id,"%s",fonction.GetID(swFace.p).c_str());
715  MG_COQUE* mgcoque = new MG_COQUE("Allo");//(id);
716  mggeo->ajouter_mg_coque(mgcoque);
717  MG_COQUILLE* mgcoquille=new MG_COQUILLE(mgcoque);
718  mggeo->ajouter_mg_coquille(mgcoquille,mgcoque);
719 
720  std::multimap < std::string , CComPtr <IFace2> > lst_facesCoque;
721  std::multimap < std::string , CComPtr <IFace2> >::iterator it_faceCoque;
722 
723  CComPtr <IFace2> swFace;
724  swBody->IGetFirstFace(&swFace);
725  while (swFace)
726  {
727 
728  CComPtr<IFace2> swFace_Next;
729  std::string idoriginal = fonction.GetID(swFace.p).c_str();
730  if ( lst_facesCoque.find(idoriginal) == lst_facesCoque.end() )
731  lst_facesCoque.insert(std::make_pair( idoriginal , swFace) );
732  swFace->IGetNextFace(&swFace_Next);
733  swFace.Release();
734  swFace = swFace_Next;
735  }
736 
737  for (it_faceCoque = lst_facesCoque.begin(); it_faceCoque != lst_facesCoque.end(); it_faceCoque++)
738  {
739  CComPtr <ISurface> swSurf ;
740  swFace = it_faceCoque->second;
741  swFace->IGetSurface(&swSurf);
742  MG_SURFACE* mgsurface=trouver(swSurf.p);
743 
744  if (mgsurface==NULL)
745  {
746  char id77[1000]; // le id existe d�j�, pas optimis�...
747  sprintf(id77,"%s",fonction.GetID(swFace.p).c_str());
748  SLD_SURFACE* sldSurface=new SLD_SURFACE(id77,fonction);
749  mgsurface=sldSurface;
750  mggeo->ajouter_mg_surface(mgsurface);
751  relation(swSurf,mgsurface);
752  }
753  MG_FACE* mgface=trouver(swFace.p);
754  if (mgface==NULL)
755  {
756 
757  VARIANT_BOOL retval;
758  swFace->FaceInSurfaceSense( &retval ) ;
759  int sens;
760  if (retval ==1)
761  sens = -1;
762  else
763  sens = 1;
764 
765  mgface=new MG_FACE(fonction.GetID(swFace).c_str(),mgsurface,sens); // orientation=1 si face et surface meme sens -1 sinon
766  mggeo->ajouter_mg_face(mgface);
767  relation(swFace,mgface);
768  VerifierCL(swFace);
769 
770  long nb_loop=-1;
771  swFace->GetLoopCount(&nb_loop);
772  CComPtr <ILoop2> swLoop; // boucler sur les loop
773  CComPtr <ILoop2> swNextLoop;
774  swFace->IGetFirstLoop(&swLoop);
775 
776  for (long k=0;k<nb_loop;k++)
777  {
778 
779  MG_BOUCLE* mgboucle=new MG_BOUCLE(mgface);
780  mggeo->ajouter_mg_boucle(mgboucle,mgface);
781 
782  CComPtr <ICoEdge> swCoArete;
783  CComPtr <ICoEdge> nextCoArete;
784 
785  swLoop->IGetFirstCoEdge(&swCoArete);
786 
787  long nbedge;
788  swLoop->GetEdgeCount(&nbedge);
789  for (long l=0;l<nbedge;l++)
790  {
791 
792  CComPtr<IEdge> swArete;
793  CComPtr<ICurve> swCourbe;
794  swCoArete->IGetEdge (&swArete);
795  swArete->IGetCurve (&swCourbe);
796  MG_COURBE* mgcourbe=trouver(swCourbe.p);
797  NouvelleCourbe = false;
798  if (mgcourbe==NULL)
799  {
800  char id[1000];
801  sprintf(id,"%s",fonction.GetID(swArete.p).c_str());
802  SLD_COURBE* sldcourbe=new SLD_COURBE(id,fonction);
803  mgcourbe=sldcourbe;
804  mggeo->ajouter_mg_courbe(mgcourbe);
805  relation(swCourbe,mgcourbe);
806  NouvelleCourbe = true;
807  } // ici ? si on a d�j� la courbe, pourquoi refaire les sommets....
808  CComPtr<IVertex> swSommet1;
809  CComPtr<IVertex> swSommet2;
810  swArete->IGetStartVertex( &swSommet1 );
811  MG_ARETE* mgarete;
812  MG_SOMMET *mgsom1,*mgsom2;
813  if (swSommet1!=NULL) // si on a une arr�te avec deux points limites
814  {
815  // sinon on va dans le else
816  swArete->IGetEndVertex ( &swSommet2 ) ;
817  mgsom1=trouver(swSommet1.p);
818  if (mgsom1==NULL)
819  {
820  char id[1000];
821  strcpy(id,fonction.GetID(swSommet1.p).c_str());
822  it_lst_vertices = lst_vertices.find(id);
823  if ( it_lst_vertices != lst_vertices.end())
824  mgsom1 = it_lst_vertices->second;
825  else
826  {
827  char id[1000];
828  sprintf(id,"%s",fonction.GetID(swSommet1.p).c_str());
829  SLD_POINT* sldpoint=new SLD_POINT(id,fonction);
830  MG_POINT* mgpoint=sldpoint;
831  mggeo->ajouter_mg_point(mgpoint);
832  mgsom1=new MG_SOMMET(id,mgpoint);
833  mggeo->ajouter_mg_sommet(mgsom1);
834  relation(swSommet1,mgsom1);
835  VerifierCL(swSommet1);
836  }
837  } // end if mgsom1 = null
838  mgsom2=trouver(swSommet2.p);
839  if (mgsom2==NULL)
840  {
841  char id22[1000];
842  strcpy(id22,fonction.GetID(swSommet2.p).c_str());
843  it_lst_vertices = lst_vertices.find(id22);
844  if ( it_lst_vertices != lst_vertices.end())
845  mgsom2 = it_lst_vertices->second;
846  else
847  {
848  //char id[1000];
849  //sprintf(id,"%s",fonction.GetID(swSommet2.p).c_str());
850  SLD_POINT* sldpoint=new SLD_POINT(id22,fonction);
851  MG_POINT* mgpoint=sldpoint;
852  mggeo->ajouter_mg_point(mgpoint);
853  mgsom2=new MG_SOMMET(id22,mgpoint);
854  mggeo->ajouter_mg_sommet(mgsom2);
855  relation(swSommet2,mgsom2);
856  VerifierCL(swSommet2);
857  } // end if sur le it_lst_vertices
858  } // end if si le mgsommet2 est null
859  } // end if mgsommet1 est null
860  else // swsom1 est null, on a une courbe sans sommets
861  {
862  if (NouvelleCourbe) // si c'est une nouvelle courbe on doit ajouter un point, sinon il est d�j� cr��.
863  {
864  double xyz[3];
865  mgcourbe->evaluer(mgcourbe->get_tmin(),xyz);
866 
867  // on envoie dans le cr�ateur du lc_point un tableau des coordonn�es
868  LC_POINT *lcpoint1= new LC_POINT(xyz);
869  MG_POINT* mgpoint=lcpoint1;
870  mggeo->ajouter_mg_point(mgpoint);
871 
872  mgsom1=new MG_SOMMET("nil",mgpoint);
873  mggeo->ajouter_mg_sommet(mgsom1);
874  mgsom2=mgsom1;
875  }
876  } // end if (swSommet1!=NULL)
877 
878  // mgarete=trouver(swArete.p);
879  //if (mgarete==NULL)
880  char id3[50]="";
881  strcpy(id3,fonction.GetID(swArete.p).c_str());
882  it_lst_edges = lst_edges.find(id3);
883  if (it_lst_edges != lst_edges.end())
884  mgarete = it_lst_edges->second;
885  else
886  {
887  int sens;
888  short isRev;
889  swArete->IsParamReversed ( &isRev );
890  if (isRev==1)
891  sens = -1;
892  else
893  sens = 1 ;
894 
895  mgarete=new MG_ARETE(fonction.GetID(swArete.p).c_str(),mgcourbe,sens);
896  mggeo->ajouter_mg_arete(mgarete);
897  relation(swArete,mgarete);
898  VerifierCL(swArete,fonction);
899  MG_COSOMMET* mgcosom1=mggeo->ajouter_mg_cosommet(mgarete,mgsom1);
900  MG_COSOMMET* mgcosom2=mggeo->ajouter_mg_cosommet(mgarete,mgsom2);
901  mgarete->changer_cosommet1(mgcosom1);
902  mgarete->changer_cosommet2(mgcosom2);
903  }
904 
905  int sens;
906  short ret;
907  swCoArete->GetSense(&ret) ;
908  if (ret==1) sens=1;
909  else sens=-1;
910  // d�terminer si le sens de l'ar�te originelle est dans le m�me sens que l'ar�te Maitre
911  sens *= fonction.sensMaitre;
912  // fin de la d�termination
913  MG_COARETE* mgcoarete=mggeo->ajouter_mg_coarete(mgarete,mgboucle,sens);
914  mgboucle->ajouter_mg_coarete(mgcoarete);
915  swCoArete->IGetNext(&nextCoArete);
916  swCoArete = nextCoArete;
917  nextCoArete.Release();
918 
919  } // end for sur les edges de la loop
920  swLoop->IGetNext(&swNextLoop);
921  swLoop = swNextLoop;
922  swNextLoop.Release();
923 
924  } // end for sur les loop
925 
926  MG_COFACE* mgcoface=mggeo->ajouter_mg_coface(mgface,mgcoquille,1);
927  mgcoquille->ajouter_mg_coface(mgcoface);
928  } // end if si la face n'est pas nulle
929  } // end for sur les faces de la coque
930  } // end for sur les nb_Coques
931  return mggeo;
932 }
933 
934 void SLD_IMPORT::VerifierCL(CComPtr<IVertex> swSommet)
935 {
936 
937  CComQIPtr <IEntity> swEnt;
938  CComPtr <IAttribute> Attribut;
939  swEnt = swSommet;
940 
941  swEnt->IFindAttribute ( DefAttrConditionLimite, 0, &Attribut ) ;
942 
943  if (Attribut!=NULL)
944  {
945  IParameter* ParamCL;
946  CComBSTR nomParam("CL.") ;
947  Attribut->IGetParameter ( nomParam, &ParamCL );
948  CComBSTR bchaineCL;
949  ParamCL->GetStringValue(&bchaineCL);
950 
951  MG_SOMMET* mgsommet = trouver(swSommet);
952 
953  AnsiString rep(bchaineCL);
954  char* ptr;
955  ptr = rep.c_str();
956 
957  char cnombre[3];
958  cnombre[0] = *ptr++;
959  cnombre[1] = *ptr++;
960  cnombre[2]='\0';
961  long inombre;
962  sscanf(cnombre,"%ld",&inombre);
963  for (int CL = 0;CL<inombre;CL++)
964  {
965  char TypeCL[3];
966  char ValeurCL[14];
967  TypeCL[0] = *ptr++;
968  TypeCL[1] = *ptr++;
969  TypeCL[2] = '\0';
970 
971  for (int j = 0; j<13;j++)
972  {
973  ValeurCL[j] = *ptr++;
974  }
975  *ptr--;
976  //ValeurCL[2] = '.'; // changer une virgule en un point
977  ValeurCL[13] = '\0';
978  double valeur; // = fonction.CharDouble(ValeurCL);
979  sscanf(ValeurCL,"%le",&valeur);
980 
981  mgsommet->ajouter_ccf(TypeCL,valeur);
982 
983  }
984  Attribut = NULL;
985  } // end if attribut pas null
986 
987 }
988 
989 
990 void SLD_IMPORT::VerifierCL(CComPtr<IEdge> swArete, SLD_FONCTION& fonction)
991 {
992  // on regarde s'il n'y aurait pas une condition aux limites sur ce sommet.
993 
994  CComQIPtr <IEntity> swEnt;
995  CComPtr <IAttribute> Attribut;
996  swEnt = swArete;
997 
998 
999  swEnt->IFindAttribute ( DefAttrConditionLimite, 0, &Attribut ) ;
1000 
1001  if (Attribut!=NULL)
1002  {
1003  IParameter* ParamCL;
1004  CComBSTR nomParam("CL.") ;
1005  Attribut->IGetParameter ( nomParam, &ParamCL );
1006  CComBSTR bchaineCL;
1007  ParamCL->GetStringValue(&bchaineCL);
1008 
1009  MG_ARETE* mgarete = trouver(swArete);
1010 
1011  AnsiString rep(bchaineCL);
1012  char* ptr;
1013  ptr = rep.c_str();
1014 
1015  char cnombre[3];
1016  cnombre[0] = *ptr++;
1017  cnombre[1] = *ptr++;
1018  cnombre[2]='\0';
1019  long inombre;
1020  sscanf(cnombre,"%ld",&inombre);
1021  for (int CL = 0;CL<inombre;CL++)
1022  {
1023  char TypeCL[3];
1024  char ValeurCL[14];
1025  TypeCL[0] = *ptr++;
1026  TypeCL[1] = *ptr++;
1027  TypeCL[2] = '\0';
1028 
1029  for (int j = 0; j<13;j++)
1030  {
1031  ValeurCL[j] = *ptr++;
1032  }
1033  *ptr--;
1034  //ValeurCL[2] = '.'; // changer une virgule en un point
1035  ValeurCL[13] = '\0';
1036  double valeur; // = fonction.CharDouble(ValeurCL);
1037  sscanf(ValeurCL,"%le",&valeur);
1038  mgarete->ajouter_ccf(TypeCL,valeur);
1039 
1040  }
1041  Attribut = NULL;
1042  } // end if attribut pas null sur condition aux limites
1043 
1044  swEnt->IFindAttribute ( DefAttrRCP1, 0, &Attribut ) ;
1045 
1046  if (Attribut !=NULL)
1047  {
1048  IParameter* ParamAs;
1049  CComBSTR nomParamAs("As.") ;
1050  Attribut->IGetParameter ( nomParamAs, &ParamAs );
1051  double valAs;
1052  ParamAs->GetDoubleValue(&valAs);
1053 
1054  IParameter* ParamI1;
1055  CComBSTR nomParamI1("I1.") ;
1056  Attribut->IGetParameter ( nomParamI1, &ParamI1 );
1057  double valI1;
1058  ParamI1->GetDoubleValue(&valI1);
1059 
1060  IParameter* ParamI2;
1061  CComBSTR nomParamI2("I2.") ;
1062  Attribut->IGetParameter ( nomParamI2, &ParamI2 );
1063  double valI2;
1064  ParamI2->GetDoubleValue(&valI2);
1065 
1066  double x;
1067  double y;
1068  double z;
1069 
1070  IParameter* ParamNX;
1071  CComBSTR nomParamNX("X3.") ;
1072  Attribut->IGetParameter ( nomParamNX, &ParamNX );
1073  ParamNX->GetDoubleValue(&x);
1074 
1075  IParameter* ParamNY;
1076  CComBSTR nomParamNY("Y3.") ;
1077  Attribut->IGetParameter ( nomParamNY, &ParamNY );
1078  ParamNY->GetDoubleValue(&y);
1079 
1080  IParameter* ParamNZ;
1081  CComBSTR nomParamNZ("Z3.") ;
1082  Attribut->IGetParameter ( nomParamNZ, &ParamNZ );
1083  ParamNZ->GetDoubleValue(&z);
1084 
1085  MG_ARETE* mgarete;
1086  mgarete = trouver(swArete);
1087  if (mgarete==NULL) // ???
1088  mgarete = trouver(swArete);
1089  mgarete->ajouter_ccf("As",valAs); // aire section
1090  if (mgarete==NULL)
1091  mgarete = trouver(swArete);
1092  mgarete->ajouter_ccf("IX",valI1); // Inertie en X
1093  if (mgarete==NULL)
1094  mgarete = trouver(swArete);
1095  mgarete->ajouter_ccf("IY",valI2); // Inertie en Y
1096  if (mgarete==NULL)
1097  mgarete = trouver(swArete);
1098  mgarete->ajouter_ccf("NX",x); // Location du troisi�me point en X
1099  if (mgarete==NULL)
1100  mgarete = trouver(swArete);
1101  mgarete->ajouter_ccf("NY",y);
1102  if (mgarete==NULL)
1103  mgarete = trouver(swArete);
1104  mgarete->ajouter_ccf("NZ",z);
1105 
1106  Attribut = NULL;
1107  } // end if poutre
1108 
1109 
1110 }
1111 
1112 void SLD_IMPORT::VerifierCL(CComPtr<IFace2> swFace)
1113 {
1114 
1115 
1116  CComQIPtr <IEntity> swEnt;
1117  CComPtr <IAttribute> Attribut;
1118  swEnt = swFace;
1119 
1120 
1121  swEnt->IFindAttribute ( DefAttrConditionLimite, 0, &Attribut ) ;
1122 
1123  if (Attribut!=NULL)
1124  {
1125  IParameter* ParamCL;
1126  CComBSTR nomParam("CL.") ;
1127  Attribut->IGetParameter ( nomParam, &ParamCL );
1128  CComBSTR bchaineCL;
1129  ParamCL->GetStringValue(&bchaineCL);
1130 
1131  MG_FACE* mgface = trouver(swFace);
1132 
1133  AnsiString rep(bchaineCL);
1134  char* ptr;
1135  ptr = rep.c_str();
1136 
1137  char cnombre[3];
1138  cnombre[0] = *ptr++;
1139  cnombre[1] = *ptr++;
1140  cnombre[2]='\0';
1141  long inombre;
1142  sscanf(cnombre,"%ld",&inombre);
1143  for (int CL = 0;CL<inombre;CL++)
1144  {
1145  char TypeCL[3];
1146  char ValeurCL[14];
1147  TypeCL[0] = *ptr++;
1148  TypeCL[1] = *ptr++;
1149  TypeCL[2] = '\0';
1150 
1151  for (int j = 0; j<13;j++)
1152  {
1153  ValeurCL[j] = *ptr++;
1154  }
1155  *ptr--;
1156  //ValeurCL[2] = '.'; // changer une virgule en un point
1157  ValeurCL[13] = '\0';
1158  double valeur; // = fonction.CharDouble(ValeurCL);
1159  sscanf(ValeurCL,"%le",&valeur);
1160  mgface->ajouter_ccf(TypeCL,valeur);
1161 
1162  }
1163  Attribut = NULL;
1164  } // end if attribut pas null sur condition aux limites
1165 
1166 
1167  swEnt->IFindAttribute ( DefAttrRCCoque, 0, &Attribut ) ;
1168  if (Attribut!=NULL)
1169  {
1170  //ATTENTION, rien encore n'est fait pour le mat�riau!!!
1171  IParameter* ParamEP;
1172  CComBSTR nomParam("Ep.") ;
1173  Attribut->IGetParameter ( nomParam, &ParamEP );
1174  double valEP;
1175  ParamEP->GetDoubleValue(&valEP);
1176 
1177  MG_FACE* mgface = trouver(swFace);
1178  mgface->ajouter_ccf("EP",valEP);
1179  Attribut = NULL;
1180  }
1181 
1182 
1183  // on v�rifie si c'est une face Interne
1184  swEnt->IFindAttribute ( DefAttrFaceInterne, 0, &Attribut ) ;
1185  if (Attribut!=NULL)
1186  {
1187  double valFI = 1;
1188 
1189  MG_FACE* mgface = trouver(swFace);
1190  mgface->ajouter_ccf("FI",valFI);
1191 
1192  IParameter* ParamPo;
1193  CComBSTR nomParam("Po.") ;
1194  Attribut->IGetParameter ( nomParam, &ParamPo );
1195  double valPo=-1;
1196  ParamPo->GetDoubleValue(&valPo);
1197  MG_FACE* mgface2 = trouver(swFace);
1198  mgface2->ajouter_ccf("Po",valPo);
1199 
1200  Attribut = NULL;
1201  }
1202 
1203 }
1204 
1205 
1206 
1207 
1208 bool SLD_IMPORT::Ignorer(CComPtr<IEdge> swArete)
1209 {
1210  CComQIPtr <IEntity> swEnt;
1211  CComPtr <IAttribute> Attribut;
1212 
1213  swEnt = swArete;
1214  swEnt->IFindAttribute ( DefAttrRCP1, 0, &Attribut ) ;
1215 
1216  double D1;
1217  if (Attribut!=NULL)
1218  {
1219  IParameter* ParamD1;
1220  CComBSTR nomParam("D1.") ;
1221  Attribut->IGetParameter ( nomParam, &ParamD1 );
1222  ParamD1->GetDoubleValue(&D1);
1223  }
1224 
1225  if (D1==-9)
1226  {
1227  return true;
1228  }
1229  return false;
1230 }
1231 
1232 
1233 
1234 
1235 
1236 
1237 
1239 {
1240  VARIANT_BOOL retval;
1241 
1242  CComBSTR nom2 ("ConditionLimite.");
1243  swApp->IDefineAttribute ( nom2, &DefAttrConditionLimite );
1244  CComBSTR bCL ("CL.");
1245  DefAttrConditionLimite->AddParameter(bCL, swParamTypeString, 0, 0,&retval);
1246  DefAttrConditionLimite->Register(&retval) ;
1247 
1248 
1249  CComBSTR nom3 ( "Poutre1.");
1250  swApp->IDefineAttribute ( nom3, &DefAttrRCP1);
1251  CComBSTR bM ("M.");
1252  CComBSTR bS ("S.");
1253  CComBSTR bAs ("As.");
1254  CComBSTR bI1 ("I1.");
1255  CComBSTR bI2 ("I2.");
1256  CComBSTR bD1 ("D1.");
1257  CComBSTR bD2 ("D2.");
1258  CComBSTR bD3 ("D3.");
1259  CComBSTR bD4 ("D4.");
1260  CComBSTR bD5 ("D5.");
1261  CComBSTR bD6 ("D6.");
1262  CComBSTR bN3 ("N3.");
1263  CComBSTR bX3 ("X3.");
1264  CComBSTR bY3 ("Y3.");
1265  CComBSTR bZ3 ("Z3.");
1266  CComBSTR bFG ("Flag.");
1267  DefAttrRCP1->AddParameter(bM, 1, 0, 0); // 0 = double, 1 = string, 2 = integer
1268  DefAttrRCP1->AddParameter(bS, 1, 0, 0);
1269  DefAttrRCP1->AddParameter(bAs, 0, 0, 0);
1270  DefAttrRCP1->AddParameter(bI1, 0, 0, 0);
1271  DefAttrRCP1->AddParameter(bI2, 0, 0, 0);
1272  DefAttrRCP1->AddParameter(bN3, 1, 0, 0); // le nom du troisi�me point
1273  DefAttrRCP1->AddParameter(bX3, 0, 0, 0); // le x du troisi�me point
1274  DefAttrRCP1->AddParameter(bY3, 0, 0, 0); // le y du troisi�me point
1275  DefAttrRCP1->AddParameter(bZ3, 0, 0, 0); // le z du troisi�me point
1276  DefAttrRCP1->AddParameter(bD1, 0, 0, 0);
1277  DefAttrRCP1->AddParameter(bD2, 0, 0, 0);
1278  DefAttrRCP1->AddParameter(bD3, 0, 0, 0);
1279  DefAttrRCP1->AddParameter(bD4, 0, 0, 0);
1280  DefAttrRCP1->AddParameter(bD5, 0, 0, 0);
1281  DefAttrRCP1->AddParameter(bD6, 0, 0, 0);
1282  DefAttrRCP1->AddParameter(bFG, 0, 0, 0); // le flag, pas utile dans magic, mais la structure doit �tre la m�me
1283 
1284  DefAttrRCP1->Register();
1285 
1286  CComBSTR nom4 ("Coque.");
1287  swApp->IDefineAttribute ( nom4, &DefAttrRCCoque);
1288  CComBSTR bM2 ("M.");
1289  CComBSTR bep ("Ep.");
1290  CComBSTR bFl ("Flag.");
1291  DefAttrRCCoque->AddParameter(bM2, 1, 0, 0);// 'le mat�riau' 0 = double, 1 = string, 2 = integer
1292  DefAttrRCCoque->AddParameter(bep, 0, 0, 0);// ' �paisseur
1293  DefAttrRCCoque->AddParameter(bFl, 0, 0, 0);//
1294  DefAttrRCCoque->Register();
1295 
1296  CComBSTR nom5 ("FaceInterne.");
1297  swApp->IDefineAttribute ( nom5, &DefAttrFaceInterne);
1298  CComBSTR bFI ("FI.");
1299  CComBSTR bPo ("Po.");
1300  DefAttrFaceInterne->AddParameter(bFI, 0, 0, 0); // la valeur de la taille sugg�r�e
1301  DefAttrFaceInterne->AddParameter(bPo, 0, 0, 0); // poutre ou coque
1302 
1303  DefAttrFaceInterne->Register();
1304 
1305  CComBSTR nom6 ("Doublon.");
1306  swApp->IDefineAttribute ( nom6, &DefAttrDoublon);
1307  CComBSTR bMa ("Maitre.");
1308  DefAttrDoublon->AddParameter(bMa, 1, 0, 0);
1309  CComBSTR bSe ("Sens.");
1310  DefAttrDoublon->AddParameter(bSe, 0, 0, 0);
1311  DefAttrDoublon->Register();
1312 
1313 }
1314 
1315 
1316 
1317 
1318 #endif
1319 
1320 
1321 
1322 
1323 
1324 
1325 
1326 
1327 
1328 
1329 
1330 
1331 
1332 
1333 
1334 
sld_surface.h
MG_ARETE::changer_cosommet2
virtual void changer_cosommet2(class MG_COSOMMET *cosom)
Definition: mg_arete.cpp:77
MG_GEOMETRIE::ajouter_mg_poutre
virtual int ajouter_mg_poutre(MG_POUTRE *mgpoutre)
Definition: mg_geometrie.cpp:1904
SLD_IMPORT::DefAttrDoublon
CComPtr< IAttributeDef > DefAttrDoublon
Definition: sld_import.h:76
mg_geometrie.h
SLD_IMPORT::RegisterAttributs
void RegisterAttributs(void)
Definition: sld_import.cpp:1238
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
SLD_IMPORT::importer
class MG_GEOMETRIE * importer(class MG_GESTIONNAIRE &gest, char *path)
Definition: sld_import.cpp:145
mg_gestionnaire.h
MG_GEOMETRIE::ajouter_mg_boucle
virtual int ajouter_mg_boucle(MG_BOUCLE *mgboucle)
Definition: mg_geometrie.cpp:1041
sld_point.h
SLD_FONCTION::GetValeurTolerance
double GetValeurTolerance()
Definition: sld_fonction.cpp:812
SLD_IMPORT::lst_face
vector< TPL_RELATION_ENTITE< IFace2, MG_FACE > > lst_face
Definition: sld_import.h:79
SLD_FONCTION
Definition: sld_fonction.h:37
TPL_RELATION_ENTITE
Definition: tpl_relation_entite.h:31
MG_COSOMMET
Definition: mg_cosommet.h:31
SLD_IMPORT::DefAttrConditionLimite
CComPtr< IAttributeDef > DefAttrConditionLimite
Definition: sld_import.h:72
SLD_IMPORT::lst_arete
vector< TPL_RELATION_ENTITE< IEdge, MG_ARETE > > lst_arete
Definition: sld_import.h:81
MG_COARETE
Definition: mg_coarete.h:31
MG_GEOMETRIE::ajouter_mg_volume
virtual int ajouter_mg_volume(MG_VOLUME *mgvol)
Definition: mg_geometrie.cpp:1642
TPL_RELATION_ENTITE::b
B * b
Definition: tpl_relation_entite.h:35
SLD_FONCTION::swApp
CComPtr< ISldWorks > swApp
Definition: sld_fonction.h:45
MG_BOUCLE::ajouter_mg_coarete
virtual void ajouter_mg_coarete(class MG_COARETE *mgcoarete)
Definition: mg_boucle.cpp:73
sld_import.h
MG_VOLUME
Definition: mg_volume.h:33
MG_COQUILLE
Definition: mg_coquille.h:34
MG_GESTIONNAIRE
Definition: mg_gestionnaire.h:57
MG_COFACE
Definition: mg_coface.h:33
MG_GEOMETRIE::ajouter_mg_sommet
virtual int ajouter_mg_sommet(MG_SOMMET *mgsom)
Definition: mg_geometrie.cpp:497
sld_fonction.h
MG_COURBE
Definition: mg_courbe.h:30
SLD_IMPORT::trouver
MG_FACE * trouver(IFace2 *face)
Definition: sld_import.cpp:103
MG_POUTRE
Definition: mg_poutre.h:33
SLD_IMPORT::~SLD_IMPORT
virtual ~SLD_IMPORT()
Definition: sld_import.cpp:53
SLD_IMPORT::lst_surface
vector< TPL_RELATION_ENTITE< ISurface, MG_SURFACE > > lst_surface
Definition: sld_import.h:80
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
SLD_FONCTION::OuvrirFichier
void OuvrirFichier(char *)
Definition: sld_fonction.cpp:52
SLD_IMPORT::DefAttrFaceInterne
CComPtr< IAttributeDef > DefAttrFaceInterne
Definition: sld_import.h:75
SLD_IMPORT::VerifierCL
void VerifierCL(CComPtr< IVertex >)
Definition: sld_import.cpp:934
SLD_IMPORT::DefAttrRCP1
CComPtr< IAttributeDef > DefAttrRCP1
Definition: sld_import.h:73
MG_GEOMETRIE::ajouter_mg_cosommet
virtual int ajouter_mg_cosommet(MG_COSOMMET *mgcosom)
Definition: mg_geometrie.cpp:643
SLD_IMPORT::relation
void relation(IFace2 *ent1, class MG_FACE *ent2)
Definition: sld_import.cpp:60
lc_point.h
MG_GESTIONNAIRE::ajouter_mg_geometrie
int ajouter_mg_geometrie(MG_GEOMETRIE *mggeo)
Definition: mg_gestionnaire.cpp:306
SLD_COURBE
Definition: sld_courbe.h:35
SLD_IMPORT::Ignorer
bool Ignorer(CComPtr< IEdge >)
Definition: sld_import.cpp:1208
SLD_SURFACE
Definition: sld_surface.h:36
SLD_FONCTION::DefAttrDoublon
CComPtr< IAttributeDef > DefAttrDoublon
Definition: sld_fonction.h:81
MG_POINT
Definition: mg_point.h:33
SLD_IMPORT::swApp
CComPtr< ISldWorks > swApp
Definition: sld_import.h:54
MG_GEOMETRIE::ajouter_mg_courbe
virtual int ajouter_mg_courbe(MG_COURBE *mgcrb)
Definition: mg_geometrie.cpp:251
TPL_RELATION_ENTITE::a
A * a
Definition: tpl_relation_entite.h:34
MG_COURBE::evaluer
virtual void evaluer(double t, double *xyz)=0
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
SLD_FONCTION::Connection
void Connection(void)
Definition: sld_fonction.cpp:158
SLD_FONCTION::sensMaitre
double sensMaitre
Definition: sld_fonction.h:84
SLD_POINT
Definition: sld_point.h:36
MG_GEOMETRIE::ajouter_mg_arete
virtual int ajouter_mg_arete(MG_ARETE *mgarete)
Definition: mg_geometrie.cpp:759
SLD_IMPORT::DefAttrRCCoque
CComPtr< IAttributeDef > DefAttrRCCoque
Definition: sld_import.h:74
MG_GEOMETRIE::ajouter_mg_point
virtual int ajouter_mg_point(MG_POINT *mgpt)
Definition: mg_geometrie.cpp:137
LC_POINT
Definition: lc_point.h:30
SLD_IMPORT::swModel
CComPtr< IModelDoc2 > swModel
Definition: sld_import.h:55
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
SLD_FONCTION::swModel
CComPtr< IModelDoc2 > swModel
Definition: sld_fonction.h:46
MG_GEOMETRIE
Definition: mg_geometrie.h:84
MG_GEOMETRIE::ajouter_mg_coque
virtual int ajouter_mg_coque(MG_COQUE *mgcoque)
Definition: mg_geometrie.cpp:1777
MG_ARETE
Definition: mg_arete.h:36
MG_FACE
Definition: mg_face.h:34
MG_COQUE
Definition: mg_coque.h:33
SLD_FONCTION::GetParID
BOOL GetParID(char *ID, CComPtr< IFace2 > &)
Definition: sld_fonction.cpp:381
MG_SOMMET
Definition: mg_sommet.h:35
SLD_IMPORT::lst_sommet
vector< TPL_RELATION_ENTITE< IVertex, MG_SOMMET > > lst_sommet
Definition: sld_import.h:83
SLD_FONCTION::GetID
class AnsiString GetID(IEdge *)
Definition: sld_fonction.cpp:728
sld_courbe.h
SLD_IMPORT::SLD_IMPORT
SLD_IMPORT()
Definition: sld_import.cpp:48
SLD_IMPORT::lst_courbe
vector< TPL_RELATION_ENTITE< ICurve, MG_COURBE > > lst_courbe
Definition: sld_import.h:82
MG_GEOMETRIE::ajouter_mg_surface
virtual int ajouter_mg_surface(MG_SURFACE *mgsrf)
Definition: mg_geometrie.cpp:366
MG_COURBE::get_tmin
virtual double get_tmin()
Definition: mg_courbe.cpp:58