MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
occ_surface.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 //####// occ_surface.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 #pragma hdrstop
24 #include "gestionversion.h"
25 #ifdef BREP_OCC
26 
27 #include "occ_surface.h"
28 #include <gp_Pnt.hxx>
29 #include <gp_Vec.hxx>
30 #include "GeomAPI_ProjectPointOnSurf.hxx"
31 #include <ShapeAnalysis_Surface.hxx>
32 #include <BRep_Tool.hxx>
33 #include <BRepAdaptor_Surface.hxx>
34 #include <BRep_Tool.hxx>
35 #include <Poly_Triangulation.hxx>
36 #include <Geom_Plane.hxx>
37 #include <gp_Pln.hxx>
38 #include <Geom_CylindricalSurface.hxx>
39 #include <gp_Cylinder.hxx>
40 #include <Geom_ConicalSurface.hxx>
41 #include <gp_Cone.hxx>
42 #include <Geom_SphericalSurface.hxx>
43 #include <IGESSolid_SphericalSurface.hxx>
44 #include <gp_Sphere.hxx>
45 #include "Geom_ToroidalSurface.hxx"
46 #include <gp_Torus.hxx>
47 #include <Geom_BSplineSurface.hxx>
48 #include <Geom_BezierSurface.hxx>
49 #include <GeomConvert.hxx>
50 #include <BRepBuilderAPI_NurbsConvert.hxx>
51 #include <BRepLib_FindSurface.hxx>
52 #include "mg_gestionnaire.h"
53 #include "constantegeo.h"
54 #include "ot_mathematique.h"
55 #include <Geom_RectangularTrimmedSurface.hxx>
56 #include <BRepClass_FaceClassifier.hxx>
57 #include <gp_Pnt2d.hxx>
58 #include <Geom_SurfaceOfRevolution.hxx>
59 
60 #pragma package(smart_init)
61 
62 
63 
65 {
66 public:
69  double t;
70 };
71 
72 
73 
74 OCC_SURFACE::OCC_SURFACE(unsigned long num, TopoDS_Face srf, OCC_FONCTION* fonc):MG_SURFACE(num),face(srf), fonction1(fonc)
75 {
76  surface=BRep_Tool::Surface(face);
77  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
78  Handle(Standard_Type) type=surface->DynamicType();
79  if(type==STANDARD_TYPE(Geom_RectangularTrimmedSurface))
80  {
81  Handle(Geom_RectangularTrimmedSurface) RTSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
82  surface = RTSurface->BasisSurface();
83  }
84  double u1;
85  double u2;
86  double v1;
87  double v2;
88  surface->Bounds(u1,u2,v1, v2);
89  u_min=u1;
90  u_max=u2;
91  v_min=v1;
92  v_max=v2;
93  estperiodeu=surface->IsUClosed();
94  estperiodev=surface->IsVClosed();
95  if (surface->IsUPeriodic()) periode_u=surface->UPeriod();
96  else if (surface->IsUClosed()) periode_u= u_max-u_min;
97  else periode_u=0;
98  if (surface->IsVPeriodic()) periode_v=surface->VPeriod();
99  else if (surface->IsVClosed()) periode_v= v_max-v_min;
100  else periode_v=0;
101  if (type==STANDARD_TYPE(Geom_BSplineSurface))
102  analyse_bspline();
103 
104  //**************************************************************
105  //**************************************************************
106 
107 }
108 
109 OCC_SURFACE::OCC_SURFACE(TopoDS_Face srf, OCC_FONCTION* fonc):MG_SURFACE(),face(srf), fonction1(fonc)
110 {
111  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
112  surface=BRep_Tool::Surface(face);
113  Handle(Standard_Type) type=surface->DynamicType();
114  if(type==STANDARD_TYPE(Geom_RectangularTrimmedSurface))
115  {
116  Handle(Geom_RectangularTrimmedSurface) RTSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
117  surface = RTSurface->BasisSurface();
118  }
119  double u1;
120  double u2;
121  double v1;
122  double v2;
123  surface->Bounds(u1,u2,v1, v2);
124  u_min=u1;
125  u_max=u2;
126  v_min=v1;
127  v_max=v2;
128  estperiodeu=surface->IsUClosed();
129  estperiodev=surface->IsVClosed();
130  if (surface->IsUPeriodic()) periode_u=surface->UPeriod();
131  else if (surface->IsUClosed()) periode_u= u_max-u_min;
132  else periode_u=0;
133  if (surface->IsVPeriodic()) periode_v=surface->VPeriod();
134  else if (surface->IsVClosed()) periode_v= v_max-v_min;
135  else periode_v=0;
136  if (type==STANDARD_TYPE(Geom_BSplineSurface))
137  analyse_bspline();
138  //**************************************************************
139  //**************************************************************
140 
141 
142 }
143 
144 OCC_SURFACE::OCC_SURFACE(OCC_SURFACE& mdd):MG_SURFACE(mdd),face(mdd.face), fonction1(mdd.fonction1)
145 {
146  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
147  surface=BRep_Tool::Surface(face);
148  Handle(Standard_Type) type=surface->DynamicType();
149  if(type==STANDARD_TYPE(Geom_RectangularTrimmedSurface))
150  {
151  Handle(Geom_RectangularTrimmedSurface) RTSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
152  surface = RTSurface->BasisSurface();
153  }
154  u_min=mdd.get_umin();
155  u_max=mdd.get_umax();
156  v_min=mdd.get_vmin();
157  v_max=mdd.get_vmax();
160  periode_u=mdd.periode_u;
161  periode_v=mdd.periode_v;
162 }
164 {
165 }
166 void OCC_SURFACE::evaluer(double *uv,double *xyz)
167 {
168 
169  //const Handle(Geom_Surface) &surface=BRep_Tool::Surface(face);
170  gp_Pnt P;
171  double u=uv[0];
172  double v=uv[1];
173 
174  surface->D0(u,v,P);
175 
176  xyz[0]=P.X();
177  xyz[1]=P.Y();
178  xyz[2]=P.Z();
179 }
180 void OCC_SURFACE::deriver(double *uv,double *xyzdu, double *xyzdv)
181 {
182  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
183  double u=uv[0];
184  double v=uv[1];
185  gp_Vec D1U;
186  gp_Vec D1V;
187  gp_Pnt P;
188 
189  surface->D1(u,v,P,D1U,D1V);
190  xyzdu[0]=D1U.X();
191  xyzdu[1]=D1U.Y();
192  xyzdu[2]=D1U.Z();
193 
194  xyzdv[0]=D1V.X();
195  xyzdv[1]=D1V.Y();
196  xyzdv[2]=D1V.Z();
197 
198 }
199 void OCC_SURFACE::deriver_seconde(double *uv,double* xyzduu,double* xyzduv,double* xyzdvv,double *xyz, double *xyzdu, double *xyzdv)
200 {
201  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
202  double u=uv[0];
203  double v=uv[1];
204  gp_Pnt P;
205  gp_Vec D1U;
206  gp_Vec D1V;
207  gp_Vec D2U;
208  gp_Vec D2V;
209  gp_Vec D2UV;
210 
211  surface->D2(u,v,P,D1U,D1V,D2U,D2V,D2UV);
212 
213  xyz[0]=P.X();
214  xyz[1]=P.Y();
215  xyz[2]=P.Z();
216 
217  xyzdu[0]=D1U.X();
218  xyzdu[1]=D1U.Y();
219  xyzdu[2]=D1U.Z();
220 
221  xyzdv[0]=D1V.X();
222  xyzdv[1]=D1V.Y();
223  xyzdv[2]=D1V.Z();
224 
225  xyzduu[0]=D2U.X();
226  xyzduu[1]=D2U.Y();
227  xyzduu[2]=D2U.Z();
228 
229  xyzdvv[0]=D2V.X();
230  xyzdvv[1]=D2V.Y();
231  xyzdvv[2]=D2V.Z();
232 
233  xyzduv[0]=D2UV.X();
234  xyzduv[1]=D2UV.Y();
235  xyzduv[2]=D2UV.Z();
236 
237 }
238 
239 void OCC_SURFACE::inverser(double *uv,double *xyz,double precision)
240 {
241  // Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
242  double u=xyz[0];
243  double v=xyz[1];
244  double w=xyz[2];
245  gp_Pnt P(u,v,w);
246 
247  //ShapeAnalysis_Surface SAS(surface);
248  //gp_Pnt2d pnt2d=SAS.ValueOfUV(P, precision);
249  GeomAPI_ProjectPointOnSurf PPS(P,surface, precision);
250  double dist=PPS.LowerDistance();
251  if (dist>precision)
252  inverser2(uv,xyz,precision);
253  else
254  {
255  double UU, VV;
256  PPS.LowerDistanceParameters(UU,VV);
257  uv[0]=UU;
258  uv[1]=VV;
259  }
260 }
261 
262 bool OCC_SURFACE::est_sur_surface(double* xyz, double precision)
263 {
264 #ifdef ALL_OCC
265  GeomAPI_ProjectPointOnSurf projecteur;
266  double u0, u1;
267  double v0, v1;
268  ShapeAnalysis::GetFaceUVBounds(face,u0,u1,v0,v1);
269  gp_Pnt point(xyz[0],xyz[1],xyz[2]);
270  projecteur.Init(point,surface,u0,u1,v0,v1);
271  if(projecteur.NbPoints()==0) return false;
272  if(projecteur.LowerDistance()<precision) return true;
273  return false;
274 #else
275  std::cerr << "OCC_SURFACE::est_sur_surface(double* xyz, double precision) --> Non disponible" << std::endl;
276 #endif
277 
278 }
279 
281 {
282  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
283  //return surface->IsUClosed();
284  return estperiodeu;
285 }
286 
288 {
289  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
290  return estperiodev;
291 }
293 {
294  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
295  //if (surface->IsUPeriodic()) return surface->UPeriod();
296  //if (surface->IsUClosed()) return u_max-u_min;
297  //return 1;
298  return periode_u;
299 }
300 
302 {
303  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
304  //if (surface->IsVPeriodic()) return surface->VPeriod();
305  //if (surface->IsVClosed()) return v_max-v_min;
306  //return 0;
307  return periode_v;
308 
309 }
310 
311 void OCC_SURFACE::enregistrer(std::ostream& o,double version)
312 {
313  if(fonction1->get_version()=="OCCV2017")
314  {
315  o <<"%"<<get_id()<< "=SURFACE_OCC("<< get_idoriginal() << ");" << std::endl;
316  }
317  else
318  {
319  o <<"%"<<get_id()<< "=SURFACE_OCC("<< fonction1->GetID(face)<< ");" << std::endl;
320  }
321 }
323 {
324  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
325  Handle(Standard_Type) type=surface->DynamicType();
326  if (type==STANDARD_TYPE(Geom_Plane))
327  {
328  Handle(Geom_Plane) Pln=Handle(Geom_Plane)::DownCast(surface);
329  gp_Pln plan=Pln->Pln();
330 
331  double origine[3];
332  gp_Pnt centre=plan.Location();
333 
334  origine[0]=centre.X();
335  origine[1]=centre.Y();
336  origine[2]=centre.Z();
337 
338  double normal[3];
339  gp_Ax1 axe=plan.Axis();
340  gp_Dir direction=axe.Direction();
341 
342  normal[0]=direction.X();
343  normal[1]=direction.Y();
344  normal[2]=direction.Z();
345 
346  param.ajouter(origine[0]);
347  param.ajouter(origine[1]);
348  param.ajouter(origine[2]);
349  param.ajouter(normal[0]);
350  param.ajouter(normal[1]);
351  param.ajouter(normal[2]);
352 
354  }
355  if (type==STANDARD_TYPE(Geom_CylindricalSurface))
356  {
357  Handle(Geom_CylindricalSurface) cylinder=Handle(Geom_CylindricalSurface)::DownCast(surface);
358  gp_Cylinder cylin=cylinder->Cylinder();
359 
360  double origine[3];
361  gp_Pnt centre=cylin.Location();
362  origine[0]=centre.X();
363  origine[1]=centre.Y();
364  origine[2]=centre.Z();
365  double directionX[3];
366  double direction[3];
367  double rayon;
368  rayon=cylin.Radius();
369 
370  gp_Ax3 repere=cylin.Position();
371  gp_Dir dirX=repere.XDirection();
372  gp_Dir dirZ=repere.Direction();
373  directionX[0]=dirX.X();
374  directionX[1]=dirX.Y();
375  directionX[2]=dirX.Z();
376  direction[0]=dirZ.X();
377  direction[1]=dirZ.Y();
378  direction[2]=dirZ.Z();
379 
380 
381 
382  param.ajouter(origine[0]);
383  param.ajouter(origine[1]);
384  param.ajouter(origine[2]);
385  param.ajouter(directionX[0]);
386  param.ajouter(directionX[1]);
387  param.ajouter(directionX[2]);
388  param.ajouter(direction[0]);
389  param.ajouter(direction[1]);
390  param.ajouter(direction[2]);
391  param.ajouter(rayon);
392  param.ajouter(rayon);
393 
395  }
396  if (type==STANDARD_TYPE(Geom_ConicalSurface))
397  {
398  Handle(Geom_ConicalSurface) cone=Handle(Geom_ConicalSurface)::DownCast(surface);
399  gp_Cone con=cone->Cone();
400 
401  double origine[3];
402  gp_Pnt centre=con.Location();
403  origine[0]=centre.X();
404  origine[1]=centre.Y();
405  origine[2]=centre.Z();
406  double direction[3];
407  double directionX[3];
408  double rayon;
409  rayon=con.RefRadius();
410  double angle;
411  angle=con.SemiAngle();
412 
413  gp_Ax3 repere=con.Position();
414  gp_Dir dirX=repere.XDirection();
415  gp_Dir dirZ=repere.Direction();
416  directionX[0]=dirX.X();
417  directionX[1]=dirX.Y();
418  directionX[2]=dirX.Z();
419  direction[0]=dirZ.X();
420  direction[1]=dirZ.Y();
421  direction[2]=dirZ.Z();
422  param.ajouter(origine[0]);
423  param.ajouter(origine[1]);
424  param.ajouter(origine[2]);
425  param.ajouter(directionX[0]);
426  param.ajouter(directionX[1]);
427  param.ajouter(directionX[2]);
428  param.ajouter(direction[0]);
429  param.ajouter(direction[1]);
430  param.ajouter(direction[2]);
431  param.ajouter(rayon);
432  param.ajouter(rayon);
433  param.ajouter(cos(angle));
434  param.ajouter(sin(angle));
435 
437 
438  }
439  if (type==STANDARD_TYPE(Geom_SphericalSurface))
440  {
441  Handle(Geom_SphericalSurface) sphere=Handle(Geom_SphericalSurface)::DownCast(surface);
442  gp_Sphere sph=sphere->Sphere();
443 
444  double origine[3];
445  gp_Pnt centre=sph.Location();
446  origine[0]=centre.X();
447  origine[1]=centre.Y();
448  origine[2]=centre.Z();
449  double rayon;
450  rayon=sph.Radius();
451  param.ajouter(origine[0]);
452  param.ajouter(origine[1]);
453  param.ajouter(origine[2]);
454  param.ajouter(rayon);
455 
457 
458  }
459  if (type==STANDARD_TYPE(Geom_ToroidalSurface))
460  {
461  Handle(Geom_ToroidalSurface) tore=Handle(Geom_ToroidalSurface)::DownCast(surface);
462  gp_Torus tro=tore->Torus();
463  double origine[3];
464  gp_Pnt centre=tro.Location();
465  origine[0]=centre.X();
466  origine[1]=centre.Y();
467  origine[2]=centre.Z();
468  double direction[3];
469  double directionX[3];
470  double Grayon;
471  Grayon=tro.MajorRadius();
472  double Prayon;
473  Prayon=tro.MinorRadius();
474  gp_Ax3 repere=tro.Position();
475  gp_Dir dirX=repere.XDirection();
476  gp_Dir dirZ=repere.Direction();
477  directionX[0]=dirX.X();
478  directionX[1]=dirX.Y();
479  directionX[2]=dirX.Z();
480  direction[0]=dirZ.X();
481  direction[1]=dirZ.Y();
482  direction[2]=dirZ.Z();
483  param.ajouter(origine[0]);
484  param.ajouter(origine[1]);
485  param.ajouter(origine[2]);
486  param.ajouter(directionX[0]);
487  param.ajouter(directionX[1]);
488  param.ajouter(directionX[2]);
489  param.ajouter(direction[0]);
490  param.ajouter(direction[1]);
491  param.ajouter(direction[2]);
492  param.ajouter(Grayon);
493  param.ajouter(Prayon);
494 
496 
497  }
498  if (type==STANDARD_TYPE(Geom_BSplineSurface))
499  {
500  Handle(Geom_BSplineSurface) bspline=Handle(Geom_BSplineSurface)::DownCast(surface);
501 
502  int nb_Uknot=bspline->NbUKnots();
503  for (int i=1; i<=nb_Uknot; i++)
504  {
505  double Uvaleur=bspline->UKnot(i);
506  param.ajouter(Uvaleur);
507  }
508  int nb_Vknot=bspline->NbVKnots();
509  for (int j=1; j<=nb_Vknot; j++)
510  {
511  double Vvaleur=bspline->VKnot(j);
512  param.ajouter(Vvaleur);
513  }
514  gp_Pnt pctr;
515  double poids;
516  for (int u=1; u<=bspline->NbUPoles(); u++)
517  for (int v=1; v<=bspline->NbVPoles(); v++)
518  {
519  pctr=bspline->Pole(u, v);
520 
521  param.ajouter(pctr.X());
522  param.ajouter(pctr.Y());
523  param.ajouter(pctr.Z());
524 
525  poids=bspline->Weight(u, v);
526  param.ajouter(poids);
527  }
528 
529  double uDegree=bspline->UDegree();
530  param.ajouter(uDegree);
531  double vDegree=bspline->VDegree();
532  param.ajouter(vDegree);
534  }
535 return 0;
536 }
537 void OCC_SURFACE::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
538 {
539  //Conversion of the complete geometry of a shape into
540  //NURBS geometry
541  BRepBuilderAPI_NurbsConvert NURBS(face);
542  Handle(Geom_Surface) surface=BRepLib_FindSurface(NURBS).Surface();
543  Handle(Geom_BSplineSurface) bspline=GeomConvert::SurfaceToBSplineSurface(surface) ;
544 
545  param.ajouter(2);
546  param.ajouter( bspline->UDegree()+1);
547  param.ajouter(bspline->VDegree()+1);
548 
549  param.ajouter(bspline->NbUPoles());
550  param.ajouter(bspline->NbVPoles());
551 
552  for (unsigned int i=1;i<=bspline->NbUKnots();i++)
553  {
554  param.ajouter(bspline->UKnot(i));
555  }
556  //This present the knot vector in the v-direction
557  for (unsigned int j=1;j<=bspline->NbVKnots();j++)
558  {
559  param.ajouter(bspline->VKnot(j));
560  }
561  for (int v=1;v<=bspline->NbVPoles();v++)
562  {
563  for (int u=1;u<=bspline->NbUPoles();u++)
564  {
565  double w=bspline->Weight(u,v);
566  gp_Pnt point=bspline->Pole(u, v);
567  double x=point.X();
568  double y=point.Y();
569  double z=point.Z();
570  param.ajouter(x);
571  param.ajouter(y);
572  param.ajouter(z);
573  param.ajouter(w);
574  }
575 
576  }
577  indx_premier_ptctr=5+bspline->NbUKnots()+bspline->NbVKnots();
578 
579 
580 
581 
582 
583 }
584 
585 void OCC_SURFACE::get_echantillonnage(int numechantillon,std::vector<double> &tab,double eps,double angle_dev)
586 {
587  BRepMesh_IncrementalMesh(face,eps,angle_dev);
588  TopLoc_Location L;
589  Handle (Poly_Triangulation) occtri=BRep_Tool::Triangulation(face,L);
590  if (occtri.IsNull())
591  {
592  BRepMesh_IncrementalMesh(face,eps);
593  occtri=BRep_Tool::Triangulation(face,L);
594  }
595  int nbmaille=occtri->NbTriangles();
596  const Poly_Array1OfTriangle& triangles = occtri->Triangles();
597  const TColgp_Array1OfPnt2d& uvNodes = occtri->UVNodes();
598  int numechantillonpartri=sqrt(numechantillon*1.0/nbmaille)+1;
599  for ( Standard_Integer i = 0; i < nbmaille; i++ )
600  {
601  int n1,n2,n3;
602  Poly_Triangle triangle = triangles( i + 1 );
603  bool face_reversed = (face.Orientation() == TopAbs_REVERSED);
604  if ( face_reversed )
605  triangle.Get( n1, n3, n2 );
606  else
607  triangle.Get( n1, n2, n3 );
608  gp_Pnt2d p1=uvNodes(n1);
609  double u1=p1.X();
610  double v1=p1.Y();
611  gp_Pnt2d p2=uvNodes(n2);
612  double u2=p2.X();
613  double v2=p2.Y();
614  gp_Pnt2d p3=uvNodes(n3);
615  double u3=p3.X();
616  double v3=p3.Y();
617  for (int ii=0;ii<numechantillonpartri;ii++)
618  for (int jj=0;jj<numechantillonpartri;jj++)
619  {
620  double ksi=(ii*1.0+0.5)/(double)numechantillonpartri;
621  double eta=(jj*1.0+0.5)/(double)numechantillonpartri;
622  if (ksi+eta>0.999999999999) jj=numechantillonpartri;
623  else
624  {
625  double u=ksi*u1+eta*u2+(1.-ksi-eta)*u3;
626  double v=ksi*v1+eta*v2+(1.-ksi-eta)*v3;
627  gp_Pnt P;
628  surface->D0(u,v,P);
629  tab.push_back(P.X());
630  tab.push_back(P.Y());
631  tab.push_back(P.Z());
632  tab.push_back(u);
633  tab.push_back(v);
634  }
635  }
636 
637 
638  }
639 
640 }
641 
642 
643 
644 void OCC_SURFACE::get_triangulation(MG_MAILLAGE* mai,MG_FACE* mgface,std::multimap<double,MG_NOEUD*,std::less<double> >& tabnoeudfus,double eps,int mode)
645 {
648  //std::map<unsigned long,bool> aretemaille;
649  std::map<unsigned long,std::map<double,NOEUDARETE,std::less<double> >,std::less<unsigned long> > areteamaille;
650  int nbboucle=mgface->get_nb_mg_boucle();
651  for (int i=0;i<nbboucle;i++)
652  {
653  MG_BOUCLE* bou=mgface->get_mg_boucle(i);
654  int nbarete=bou->get_nb_mg_coarete();
655  for (int j=0;j<nbarete;j++)
656  {
657  MG_ARETE* are=bou->get_mg_coarete(j)->get_arete();
658  listare.ajouter(are);
659  //bool amailler=true;
660  //if (are->get_lien_maillage()->get_nb()>0) amailler=false;
661  //aretemaille[are->get_id()]=amailler;
662  listsom.ajouter(bou->get_mg_coarete(j)->get_arete()->get_cosommet1()->get_sommet());
663  listsom.ajouter(bou->get_mg_coarete(j)->get_arete()->get_cosommet2()->get_sommet());
664  std::map<double,NOEUDARETE,std::less<double> > tmp;
665  std::pair<unsigned long,std::map<double,NOEUDARETE,std::less<double> > > maptmp(are->get_id(),tmp);
666  areteamaille.insert(maptmp);
667  }
668  }
669 
670 
671  TopLoc_Location L;
672  Handle (Poly_Triangulation) pt=BRep_Tool::Triangulation(face,L);
673  int nbnoeud=pt->NbNodes();
674  int nbmaille=pt->NbTriangles();
675  const TColgp_Array1OfPnt& nodes = pt->Nodes();
676  const Poly_Array1OfTriangle& triangles = pt->Triangles();
677  const TColgp_Array1OfPnt2d& uvNodes = pt->UVNodes();
678  std::vector<MG_NOEUD*> tabnoeud;
679  for ( Standard_Integer i = 0; i < nbnoeud; i++ )
680  {
681  gp_Pnt p1=nodes(i+1);
682  double xx=p1.X();
683  double yy=p1.Y();
684  double zz=p1.Z();
685  double key=fabs(xx)+fabs(yy)+fabs(zz);
686  MG_NOEUD* nvnoeud=NULL;
687  if (mode>1)
688  {
689  std::multimap<double,MG_NOEUD*,std::less<double> >::iterator it,itbas,ithaut;
690  itbas=tabnoeudfus.lower_bound(key*0.99);
691  ithaut=tabnoeudfus.upper_bound(key*1.1010101);
692  for ( it=itbas ; it != ithaut; it++ )
693  {
694  MG_NOEUD* ntmp=(*it).second;
695  double xtmp=ntmp->get_x();
696  double ytmp=ntmp->get_y();
697  double ztmp=ntmp->get_z();
698  OT_VECTEUR_3D vec(xtmp-xx,ytmp-yy,ztmp-zz);
699  if (vec.get_longueur()<1e-6*eps) {
700  nvnoeud=ntmp;
701  break;
702  }
703  }
704  }
705  if (nvnoeud==NULL)
706  {
707  MG_ELEMENT_TOPOLOGIQUE *topo=mgface;
709  for (MG_SOMMET* som=listsom.get_premier(it1);som!=NULL;som=listsom.get_suivant(it1))
710  {
711  double xyz[3];
712  som->get_point()->evaluer(xyz);
713  OT_VECTEUR_3D vec(xyz[0]-xx,xyz[1]-yy,xyz[2]-zz);
714  if (vec.get_longueur()<1e-6*eps)
715  {
716  topo=som;
717  break;
718 
719  }
720  }
721  double param_t;
722  if (topo==mgface)
723  {
725  for (MG_ARETE* are=listare.get_premier(it2);are!=NULL;are=listare.get_suivant(it2))
726  {
727  double t;
728  double xyz[3]={xx,yy,zz};
729  are->inverser(t,xyz);
730  if (are->get_courbe()->est_periodique())
731  if (t< are->get_tmin()) t=t+are->get_courbe()->get_periode();
732  double xyztmp[3];
733  are->evaluer(t,xyztmp );
734  OT_VECTEUR_3D vec(xyz,xyztmp);
735  if (vec.get_longueur()<1e-6*eps)
736  if ((t>are->get_tmin()) && (t<are->get_tmax()))
737  {
738  topo=are;
739  param_t=t;
740  break;
741  }
742  }
743  }
744  nvnoeud=new MG_NOEUD(topo,xx,yy,zz,MAGIC::ORIGINE::TRIANGULATION);
745  mai->ajouter_mg_noeud(nvnoeud);
746  std::pair<double,MG_NOEUD*> tmp(key,nvnoeud);
747  tabnoeudfus.insert(tmp);
748  if (topo->get_dimension()==1)
749  {
750  NOEUDARETE na;
751  na.no=nvnoeud;
752  na.are=(MG_ARETE*)topo;
753  na.t=param_t;
754  std::pair<double,NOEUDARETE> tmp(na.t,na);
755  areteamaille[topo->get_id()].insert(tmp);
756  }
757  }
758 
759 
760  tabnoeud.insert(tabnoeud.end(),nvnoeud);
761  }
762  for ( Standard_Integer i = 0; i < nbmaille; i++ )
763  {
764  int n1,n2,n3;
765  Poly_Triangle triangle = triangles( i + 1 );
766  bool face_reversed = (face.Orientation() == TopAbs_REVERSED);
767  if ( face_reversed )
768  triangle.Get( n1, n3, n2 );
769  else
770  triangle.Get( n1, n2, n3 );
771  MG_NOEUD* noeud1=tabnoeud[n1-1];
772  MG_NOEUD* noeud2=tabnoeud[n2-1];
773  MG_NOEUD* noeud3=tabnoeud[n3-1];
774  if (noeud1==noeud2) continue;
775  if (noeud1==noeud3) continue;
776  if (noeud2==noeud3) continue;
777  mai->ajouter_mg_triangle(mgface,noeud1,noeud2,noeud3,MAGIC::ORIGINE::TRIANGULATION);
778  /*if (noeud1->get_lien_topologie()->get_dimension()==0)
779  {
780  MG_SOMMET* som=(MG_SOMMET*)noeud1->get_lien_topologie();
781  som->get_lien_maillage()->ajouter(noeud1);
782  }
783  if (noeud2->get_lien_topologie()->get_dimension()==0)
784  {
785  MG_SOMMET* som=(MG_SOMMET*)noeud2->get_lien_topologie();
786  som->get_lien_maillage()->ajouter(noeud2);
787  }
788  if (noeud3->get_lien_topologie()->get_dimension()==0)
789  {
790  MG_SOMMET* som=(MG_SOMMET*)noeud3->get_lien_topologie();
791  som->get_lien_maillage()->ajouter(noeud3);
792  }*/
793  /*if (noeud1->get_lien_topologie()==noeud2->get_lien_topologie())
794  if (noeud1->get_lien_topologie()->get_dimension()==1)
795  {
796  MG_ARETE* are=(MG_ARETE*)noeud1->get_lien_topologie();
797  if (aretemaille[are->get_id()]==true)
798  {
799  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud1,noeud2,TRIANGULATION);
800  are->get_lien_maillage()->ajouter(seg);
801  }
802  }
803  if (noeud1->get_lien_topologie()==noeud3->get_lien_topologie())
804  if (noeud1->get_lien_topologie()->get_dimension()==1)
805  {
806  MG_ARETE* are=(MG_ARETE*)noeud1->get_lien_topologie();
807  if (aretemaille[are->get_id()]==true)
808  {
809  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud1,noeud3,TRIANGULATION);
810  are->get_lien_maillage()->ajouter(seg);
811  }
812  }#include <../gmsh/tutorial/t8.geo>
813  if (noeud3->get_lien_topologie()==noeud2->get_lien_topologie())
814  if (noeud3->get_lien_topologie()->get_dimension()==1)
815  {
816  MG_ARETE* are=(MG_ARETE*)noeud3->get_lien_topologie();
817  if (aretemaille[are->get_id()]==true)
818  {
819  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud3,noeud2,TRIANGULATION);
820  are->get_lien_maillage()->ajouter(seg);
821  }
822  }
823  if (noeud1->get_lien_topologie()->get_dimension()==1)
824  if (noeud2->get_lien_topologie()->get_dimension()==0)
825  {
826  MG_ARETE* are=(MG_ARETE*)noeud1->get_lien_topologie();
827  MG_SOMMET* som=(MG_SOMMET*)noeud2->get_lien_topologie();
828  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
829  {
830  if (aretemaille[are->get_id()]==true)
831  {
832  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud1,noeud2,TRIANGULATION);
833  are->get_lien_maillage()->ajouter(seg);
834  }
835  }
836  }
837  if (noeud1->get_lien_topologie()->get_dimension()==1)
838  if (noeud3->get_lien_topologie()->get_dimension()==0)
839  {
840  MG_ARETE* are=(MG_ARETE*)noeud1->get_lien_topologie();
841  MG_SOMMET* som=(MG_SOMMET*)noeud3->get_lien_topologie();
842  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
843  {
844  if (aretemaille[are->get_id()]==true)
845  {
846  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud1,noeud3,TRIANGULATION);
847  are->get_lien_maillage()->ajouter(seg);
848  }
849  }
850  }
851  if (noeud2->get_lien_topologie()->get_dimension()==1)
852  if (noeud1->get_lien_topologie()->get_dimension()==0)
853  {
854  MG_ARETE* are=(MG_ARETE*)noeud2->get_lien_topologie();
855  MG_SOMMET* som=(MG_SOMMET*)noeud1->get_lien_topologie();
856  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
857  {
858  if (aretemaille[are->get_id()]==true)
859  {
860  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud2,noeud1,TRIANGULATION);
861  are->get_lien_maillage()->ajouter(seg);
862  }
863  }
864  }
865  if (noeud2->get_lien_topologie()->get_dimension()==1)
866  if (noeud3->get_lien_topologie()->get_dimension()==0)
867  {
868  MG_ARETE* are=(MG_ARETE*)noeud2->get_lien_topologie();
869  MG_SOMMET* som=(MG_SOMMET*)noeud3->get_lien_topologie();
870  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
871  {
872  if (aretemaille[are->get_id()]==true)
873  {
874  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud2,noeud3,TRIANGULATION);
875  are->get_lien_maillage()->ajouter(seg);
876  }
877  }
878  }
879  if (noeud3->get_lien_topologie()->get_dimension()==1)
880  if (noeud1->get_lien_topologie()->get_dimension()==0)
881  {
882  MG_ARETE* are=(MG_ARETE*)noeud3->get_lien_topologie();
883  MG_SOMMET* som=(MG_SOMMET*)noeud1->get_lien_topologie();
884  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
885  {
886  if (aretemaille[are->get_id()]==true)
887  {
888  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud3,noeud1,TRIANGULATION);
889  are->get_lien_maillage()->ajouter(seg);
890  }
891  }
892  }
893  if (noeud3->get_lien_topologie()->get_dimension()==1)
894  if (noeud2->get_lien_topologie()->get_dimension()==0)
895  {
896  MG_ARETE* are=(MG_ARETE*)noeud3->get_lien_topologie();
897  MG_SOMMET* som=(MG_SOMMET*)noeud2->get_lien_topologie();
898  if ((are->get_cosommet1()->get_sommet()==som)||(are->get_cosommet2()->get_sommet()==som))
899  {
900  if (aretemaille[are->get_id()]==true)
901  {
902  MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeud3,noeud2,TRIANGULATION);
903  are->get_lien_maillage()->ajouter(seg);
904  }
905  }
906  }*/
907  }
908  if (mode>1)
909  {
911  for (MG_ARETE* are=listare.get_premier(it2);are!=NULL;are=listare.get_suivant(it2))
912  {
913  if (are->get_lien_maillage()->get_nb()==0)
914  {
915  unsigned long id=are->get_id();
916  MG_NOEUD* nodep=(MG_NOEUD*)are->get_cosommet1()->get_sommet()->get_lien_maillage()->get(0);
917  MG_NOEUD* noarr=(MG_NOEUD*)are->get_cosommet2()->get_sommet()->get_lien_maillage()->get(0);
918  std::map<double,NOEUDARETE,std::less<double> >::iterator it=areteamaille[id].begin();
919  MG_NOEUD* noeudcourant=nodep;
920  while (it!=areteamaille[id].end())
921  {
922  MG_NOEUD* noeud=(*it).second.no;
923  //MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeudcourant,noeud,TRIANGULATION);
924  MG_SEGMENT* seg=mai->get_mg_segment(noeudcourant->get_id(),noeud->get_id());
925  seg->change_lien_topologie(are);
926  noeudcourant=noeud;
927  it++;
928  }
929  //MG_SEGMENT* seg=mai->ajouter_mg_segment(are,noeudcourant,noarr,TRIANGULATION);
930  MG_SEGMENT* seg=mai->get_mg_segment(noeudcourant->get_id(),noarr->get_id());
931  seg->change_lien_topologie(are);
932  }
933  }
934 
935  }
936 }
937 
938 void OCC_SURFACE::get_liste_pole(std::vector< double> *liste_pole,double eps)
939 {
940  //Handle(Geom_Surface) surface=BRep_Tool::Surface(face);
941  Handle(Standard_Type) type=surface->DynamicType();
942  //std::cout << surface->DynamicType()->Name() <<std::endl;
943  if(type==STANDARD_TYPE(Geom_RectangularTrimmedSurface))
944  {
945  Handle(Geom_RectangularTrimmedSurface) RTSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
946  Handle(Geom_Surface) basissurface = RTSurface->BasisSurface();
947  Handle(Standard_Type) type_basissurface=basissurface->DynamicType();
948  if(type_basissurface==STANDARD_TYPE(Geom_SphericalSurface))
949  {
950  type=STANDARD_TYPE(Geom_SphericalSurface);
951  }
952  }
953  if(type==STANDARD_TYPE(Geom_SphericalSurface))
954  {
955  BRepClass_FaceClassifier faceclassifier;
956  gp_Pnt2d pnt2d_pole_sud(0.0,-M_PI/2.);
957  faceclassifier.Perform(face,pnt2d_pole_sud,eps);
958  if(faceclassifier.State()==TopAbs_IN || faceclassifier.State()==TopAbs_ON)
959  {
960  liste_pole->push_back(0.0);
961  liste_pole->push_back(-M_PI/2.);
962  }
963  gp_Pnt2d pnt2d_pole_nord(0.0,M_PI/2.);
964  faceclassifier.Perform(face,pnt2d_pole_nord,eps);
965  if(faceclassifier.State()==TopAbs_IN || faceclassifier.State()==TopAbs_ON)
966  {
967  liste_pole->push_back(0.0);
968  liste_pole->push_back(M_PI/2.);
969  }
970  }
971  if(type==STANDARD_TYPE(Geom_SurfaceOfRevolution))
972  {
973  BRepClass_FaceClassifier faceclassifier;
974  gp_Pnt2d pnt2d_pole_sud(0.0,v_min);
975  faceclassifier.Perform(face,pnt2d_pole_sud,eps);
976  if(faceclassifier.State()==TopAbs_IN || faceclassifier.State()==TopAbs_ON)
977  {
978  liste_pole->push_back(0.0);
979  liste_pole->push_back(v_min);
980  }
981  gp_Pnt2d pnt2d_pole_nord(0.0,v_max);
982  faceclassifier.Perform(face,pnt2d_pole_nord,eps);
983  if(faceclassifier.State()==TopAbs_IN || faceclassifier.State()==TopAbs_ON)
984  {
985  liste_pole->push_back(0.0);
986  liste_pole->push_back(v_max);
987  }
988  }
989 }
990 
991 
993 {
994  Handle(Geom_BSplineSurface) bspline=Handle(Geom_BSplineSurface)::DownCast(surface);
995  bool ferme=true;
996  for (int v=1; v<=bspline->NbVPoles(); v++)
997  {
998  gp_Pnt pctr1=bspline->Pole(1, v);
999  gp_Pnt pctr2=bspline->Pole(bspline->NbUPoles(), v);
1000  double poids1=bspline->Weight(1, v);
1001  double poids2=bspline->Weight(bspline->NbUPoles(), v);
1002  double xyz1[4];
1003  double xyz2[4];
1004  xyz1[0]=pctr1.X();
1005  xyz1[1]=pctr1.Y();
1006  xyz1[2]=pctr1.Z();
1007  xyz1[3]=poids1;
1008  xyz2[0]=pctr2.X();
1009  xyz2[1]=pctr2.Y();
1010  xyz2[2]=pctr2.Z();
1011  xyz2[3]=poids2;
1012  OT_VECTEUR_4D vec(xyz1,xyz2);
1013  if (vec.get_longueur()>fonction1->get_precision())
1014  ferme=false;
1015 
1016  }
1017  if (ferme)
1018  {
1019  estperiodeu=1;
1021  }
1022  ferme=true;
1023  for (int u=1; u<=bspline->NbUPoles(); u++)
1024  {
1025  gp_Pnt pctr1=bspline->Pole(u,1);
1026  gp_Pnt pctr2=bspline->Pole(u,bspline->NbVPoles());
1027  double poids1=bspline->Weight(u,1);
1028  double poids2=bspline->Weight(u,bspline->NbVPoles());
1029  double xyz1[4];
1030  double xyz2[4];
1031  xyz1[0]=pctr1.X();
1032  xyz1[1]=pctr1.Y();
1033  xyz1[2]=pctr1.Z();
1034  xyz1[3]=poids1;
1035  xyz2[0]=pctr2.X();
1036  xyz2[1]=pctr2.Y();
1037  xyz2[2]=pctr2.Z();
1038  xyz2[3]=poids2;
1039  OT_VECTEUR_4D vec(xyz1,xyz2);
1040  if (vec.get_longueur()>fonction1->get_precision())
1041  ferme=false;
1042 
1043  }
1044  if (ferme)
1045  {
1046  estperiodev=1;
1048  }
1049 }
1050 
1051 void OCC_SURFACE::inverser2(double *uv,double *xyz,double precision)
1052 {
1053 int NUMDECOUP=20;
1054 double u1;
1055 double u2;
1056 double v1;
1057 double v2;
1058 double u,v,distmin=1e300;
1059 surface->Bounds(u1,u2,v1, v2);
1060 for (int i=0;i<NUMDECOUP+1;i++)
1061  for (int j=0;j<NUMDECOUP+1;j++)
1062  {
1063  double ut=u1+i*1.0/NUMDECOUP*(u2-u1);
1064  double vt=v1+j*1.0/NUMDECOUP*(v2-v1);
1065  gp_Pnt P;
1066  surface->D0(ut,vt,P);
1067  double xyz2[3]={P.X(),P.Y(),P.Z()};
1068  OT_VECTEUR_3D vec(xyz,xyz2);
1069  double dist=vec.get_longueur();
1070  if (dist<distmin)
1071  {
1072  distmin=dist;
1073  u=ut;
1074  v=vt;
1075  }
1076  }
1077 bool sortie=false;
1078 int nbiteration=0;
1079 while (sortie==false)
1080 {
1081 double uv2[3]={u,v,0.};
1082 double xyzuv[3],xyzuvdu[3],xyzuvdv[3],xyzuvduu[3],xyzuvduv[3],xyzuvdvv[3];
1083 deriver_seconde(uv2,xyzuvduu,xyzuvduv,xyzuvdvv,xyzuv,xyzuvdu,xyzuvdv);
1084 OT_VECTEUR_3D vxyz(xyz);
1085 OT_VECTEUR_3D vxyzuv(xyzuv);
1086 OT_VECTEUR_3D P=vxyzuv-vxyz;
1087 OT_VECTEUR_3D vxyzuvdu(xyzuvdu);
1088 OT_VECTEUR_3D vxyzuvdv(xyzuvdv);
1089 OT_VECTEUR_3D vxyzuvduu(xyzuvduu);
1090 OT_VECTEUR_3D vxyzuvdvv(xyzuvdvv);
1091 OT_VECTEUR_3D vxyzuvduv(xyzuvduv);
1092 double Fdu=P*vxyzuvduu+vxyzuvdu*vxyzuvdu;
1093 double Fdv=P*vxyzuvduv+vxyzuvdv*vxyzuvdu;
1094 double Gdu=P*vxyzuvduv+vxyzuvdu*vxyzuvdv;
1095 double Gdv=P*vxyzuvdvv+vxyzuvdv*vxyzuvdv;
1096 double F=P*xyzuvdu;
1097 double G=P*xyzuvdv;
1098 double det=Fdu*Gdv-Gdu*Fdv;
1099 double deltau=(-F*Gdv+Gdu*G)/det;
1100 double deltav=(-Fdu*G+F*Fdv)/det;
1101 double new_u=u+deltau;
1102 double new_v=v+deltav;
1103 if (new_u<u1) new_u=u1;
1104 if (new_u>u2) new_u=u2;
1105 if (new_v<v1) new_v=v1;
1106 if (new_v>v2) new_v=v2;
1107 if (fabs(new_u-u)<precision)
1108  if (fabs(new_v-v)<precision)
1109  sortie=true;
1110 u=new_u;
1111 v=new_v;
1112 nbiteration++;
1113 if (nbiteration>1000) sortie=true;
1114 }
1115 uv[0]=u;
1116 uv[1]=v;
1117 }
1118 
1119 #endif
OCC_SURFACE::get_periode_u
virtual double get_periode_u(void)
Definition: occ_surface.cpp:292
MG_ARETE::get_cosommet2
virtual class MG_COSOMMET * get_cosommet2(void)
Definition: mg_arete.cpp:85
OCC_SURFACE::periode_u
double periode_u
Definition: occ_surface.h:74
TPL_MAP_ENTITE::get_premier
virtual X get_premier(ITERATEUR &it)
Definition: tpl_map_entite.h:112
MG_SEGMENT
Definition: mg_segment.h:38
MG_BOUCLE
Definition: mg_boucle.h:35
gestionversion.h
MG_BOUCLE::get_nb_mg_coarete
virtual int get_nb_mg_coarete(void)
Definition: mg_boucle.cpp:78
MG_SURFACE
Definition: mg_surface.h:31
TPL_MAP_ENTITE
Definition: tpl_map_entite.h:35
mg_gestionnaire.h
GEOMETRIE::CONST::Co_CONE
@ Co_CONE
Definition: constantegeo.h:32
MG_NOEUD::get_z
virtual double get_z(void)
Definition: mg_noeud.cpp:87
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
OCC_SURFACE::inverser
virtual void inverser(double *uv, double *xyz, double precision=1e-6)
Definition: occ_surface.cpp:239
OCC_SURFACE::deriver_seconde
virtual void deriver_seconde(double *uv, double *xyzduu, double *xyzduv, double *xyzdvv, double *xyz, double *xyzdu, double *xyzdv)
Definition: occ_surface.cpp:199
NOEUDARETE
Definition: occ_surface.cpp:64
OCC_SURFACE::enregistrer
virtual void enregistrer(std::ostream &o, double version)
Definition: occ_surface.cpp:311
OCC_SURFACE::get_type_geometrique
virtual int get_type_geometrique(TPL_LISTE_ENTITE< double > &param)
Definition: occ_surface.cpp:322
OCC_SURFACE::periode_v
double periode_v
Definition: occ_surface.h:75
NOEUDARETE::t
double t
Definition: occ_surface.cpp:69
MG_ELEMENT_TOPOLOGIQUE::get_dimension
virtual int get_dimension(void)=0
MG_ELEMENT_MAILLAGE::change_lien_topologie
void change_lien_topologie(MG_ELEMENT_TOPOLOGIQUE *topo)
Definition: mg_element_maillage.cpp:56
OCC_SURFACE
Definition: occ_surface.h:38
OCC_SURFACE::evaluer
virtual void evaluer(double *uv, double *xyz)
Definition: occ_surface.cpp:166
MG_FACE::get_nb_mg_boucle
virtual int get_nb_mg_boucle(void)
Definition: mg_face.cpp:67
OCC_SURFACE::est_periodique_v
virtual int est_periodique_v(void)
Definition: occ_surface.cpp:287
NOEUDARETE::no
MG_NOEUD * no
Definition: occ_surface.cpp:67
MG_SURFACE::get_vmax
virtual double get_vmax()
Definition: mg_surface.cpp:71
MG_SURFACE::u_max
double u_max
Definition: mg_surface.h:64
MG_ELEMENT_TOPOLOGIQUE
Definition: mg_element_topologique.h:51
OCC_SURFACE::get_periode_v
virtual double get_periode_v(void)
Definition: occ_surface.cpp:301
MG_SURFACE::v_min
double v_min
Definition: mg_surface.h:65
OCC_SURFACE::fonction1
OCC_FONCTION * fonction1
Definition: occ_surface.h:70
MG_SURFACE::u_min
double u_min
Definition: mg_surface.h:63
OT_VECTEUR_4D::get_longueur
virtual double get_longueur(void) const
Definition: ot_mathematique.cpp:1612
MG_FACE::evaluer
virtual void evaluer(double *uv, double *xyz)
Definition: mg_face.cpp:192
OCC_SURFACE::get_param_NURBS
virtual void get_param_NURBS(int &indx_premier_ptctr, TPL_LISTE_ENTITE< double > &param)
Definition: occ_surface.cpp:537
OCC_SURFACE::est_sur_surface
virtual bool est_sur_surface(double *xyz, double precision=1e-6)
Definition: occ_surface.cpp:262
OCC_SURFACE::~OCC_SURFACE
virtual ~OCC_SURFACE()
Definition: occ_surface.cpp:163
MG_MAILLAGE::ajouter_mg_triangle
MG_TRIANGLE * ajouter_mg_triangle(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, class MG_NOEUD *mgnoeud3, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:731
MG_NOEUD
Definition: mg_noeud.h:41
constantegeo.h
OCC_SURFACE::get_liste_pole
virtual void get_liste_pole(std::vector< double > *liste_pole, double eps)
Definition: occ_surface.cpp:938
TPL_LISTE_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_liste_entite.h:38
TPL_MAP_ENTITE::ITERATEUR
std::map< unsigned long, X, std::less< unsigned long > >::iterator ITERATEUR
Definition: tpl_map_entite.h:38
OCC_SURFACE::estperiodeu
int estperiodeu
Definition: occ_surface.h:72
MG_IDENTIFICATEUR::id
unsigned long id
Definition: mg_identificateur.h:49
GEOMETRIE::CONST::Co_PLAN
@ Co_PLAN
Definition: constantegeo.h:32
MG_COSOMMET::get_sommet
virtual MG_SOMMET * get_sommet(void)
Definition: mg_cosommet.cpp:83
ot_mathematique.h
OCC_SURFACE::deriver
virtual void deriver(double *uv, double *xyzdu, double *xyzdv)
Definition: occ_surface.cpp:180
MG_NOEUD::get_x
virtual double get_x(void)
Definition: mg_noeud.cpp:77
MG_MAILLAGE::get_mg_segment
MG_SEGMENT * get_mg_segment(unsigned int num)
Definition: mg_maillage.cpp:619
OT_VECTEUR_3D
Definition: ot_mathematique.h:94
occ_surface.h
TPL_MAP_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_map_entite.h:55
OT_VECTEUR_4D
Definition: ot_mathematique.h:215
MG_SURFACE::v_max
double v_max
Definition: mg_surface.h:66
MG_BOUCLE::get_mg_coarete
virtual MG_COARETE * get_mg_coarete(int num)
Definition: mg_boucle.cpp:84
MG_ELEMENT_GEOMETRIQUE::get_idoriginal
virtual std::string get_idoriginal(void)
Definition: mg_element_geometrique.cpp:52
MG_SURFACE::get_umax
virtual double get_umax()
Definition: mg_surface.cpp:61
sqrt
double2 sqrt(double2 &val)
Definition: ot_doubleprecision.cpp:345
OCC_SURFACE::inverser2
virtual void inverser2(double *uv, double *xyz, double precision=1e-6)
Definition: occ_surface.cpp:1051
MG_SURFACE::get_vmin
virtual double get_vmin()
Definition: mg_surface.cpp:66
GEOMETRIE::CONST::Co_TORE
@ Co_TORE
Definition: constantegeo.h:32
GEOMETRIE::CONST::Co_SPHERE
@ Co_SPHERE
Definition: constantegeo.h:32
OCC_FONCTION::get_precision
virtual double get_precision(void)
Definition: occ_fonction.cpp:99
OCC_SURFACE::est_periodique_u
virtual int est_periodique_u(void)
Definition: occ_surface.cpp:280
OT_VECTEUR_3D::get_longueur
virtual double get_longueur(void) const
Definition: ot_mathematique.cpp:483
GEOMETRIE::CONST::Co_BSPLINES
@ Co_BSPLINES
Definition: constantegeo.h:32
MG_MAILLAGE
Definition: mg_maillage.h:62
TPL_LISTE_ENTITE< double >
OCC_SURFACE::Handle
Handle(Geom_Surface) surface
OCC_SURFACE::estperiodev
int estperiodev
Definition: occ_surface.h:73
OCC_SURFACE::get_echantillonnage
virtual void get_echantillonnage(int numechantillon, std::vector< double > &tab, double eps, double angle_dev)
Definition: occ_surface.cpp:585
MG_ARETE
Definition: mg_arete.h:36
MG_FACE
Definition: mg_face.h:34
MG_FACE::get_mg_boucle
virtual MG_BOUCLE * get_mg_boucle(int num)
Definition: mg_face.cpp:72
MG_ARETE::get_cosommet1
virtual class MG_COSOMMET * get_cosommet1(void)
Definition: mg_arete.cpp:81
TPL_MAP_ENTITE::get_suivant
virtual X get_suivant(ITERATEUR &it)
Definition: tpl_map_entite.h:120
MG_SOMMET
Definition: mg_sommet.h:35
OCC_SURFACE::analyse_bspline
virtual void analyse_bspline(void)
Definition: occ_surface.cpp:992
MAGIC::ORIGINE::TRIANGULATION
@ TRIANGULATION
Definition: mg_definition.h:79
cos
double2 cos(double2 &val)
Definition: ot_doubleprecision.cpp:206
OCC_SURFACE::OCC_SURFACE
OCC_SURFACE(unsigned long num, TopoDS_Face srf, OCC_FONCTION *fonc)
Definition: occ_surface.cpp:74
OCC_FONCTION::GetID
virtual int GetID(const TopoDS_Shape &shape)
Definition: occ_fonction.cpp:59
MG_COARETE::get_arete
virtual MG_ARETE * get_arete(void)
Definition: mg_coarete.cpp:58
OCC_FONCTION
Definition: occ_fonction.h:40
NOEUDARETE::are
MG_ARETE * are
Definition: occ_surface.cpp:68
P
#define P(i, j)
MG_SURFACE::get_umin
virtual double get_umin()
Definition: mg_surface.cpp:56
OCC_FONCTION::get_version
virtual std::string get_version(void)
Definition: occ_fonction.cpp:88
GEOMETRIE::CONST::Co_CYLINDRE
@ Co_CYLINDRE
Definition: constantegeo.h:32
OCC_SURFACE::get_triangulation
virtual void get_triangulation(class MG_MAILLAGE *mai, class MG_FACE *face, std::multimap< double, class MG_NOEUD *, std::less< double > > &tabnoeudfusm, double eps, int mode)
Definition: occ_surface.cpp:644
OCC_SURFACE::face
TopoDS_Face face
Definition: occ_surface.h:69
MG_NOEUD::get_y
virtual double get_y(void)
Definition: mg_noeud.cpp:82
MG_MAILLAGE::ajouter_mg_noeud
MG_NOEUD * ajouter_mg_noeud(MG_ELEMENT_TOPOLOGIQUE *topo, double xx, double yy, double zz, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:421
sin
double2 sin(double2 &val)
Definition: ot_doubleprecision.cpp:250