MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mailleur_bloc.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 //####// mailleur_bloc.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 #include "gestionversion.h"
24 #include <math.h>
25 #include "mailleur_bloc.h"
26 #include "mg_gestionnaire.h"
27 #include "mailleur3d.h"
28 #include "mailleur0d.h"
29 #include "mailleur1d.h"
30 #include "mailleur2d.h"
31 #include "ot_mathematique.h"
32 #include "mg_geometrie_outils.h"
33 
34 
35 
36 #pragma package(smart_init)
37 
38 
39 
40 
41 
42 MAILLEUR_BLOC::MAILLEUR_BLOC(class MG_GESTIONNAIRE* gentier,MG_GESTIONNAIRE* gbloc,int numgeoentier,int numgeobloc,class FCT_TAILLE* fct_taille,bool save):MAILLEUR(save),gestentier(gentier),gestbloc(gbloc),carte(fct_taille)
43 {
44 if (numgeoentier==0) geoentier=gestentier->get_mg_geometrie(numgeoentier);
45 else geoentier=gestentier->get_mg_geometrieid(numgeoentier);
46 if (numgeobloc==0) geobloc=gestbloc->get_mg_geometrie(numgeobloc);
47 else geobloc=gestbloc->get_mg_geometrieid(numgeobloc);
48 }
49 
51 {
52 delete octreeentier;
53 delete octreebloc;
54 /*int nbface=maientier->get_mg_geometrie()->get_nb_mg_face();
55 for (int i=0;i<nbface;i++) delete quadentier[i];
56 delete [] quadentier;
57 nbface=maibloc->get_mg_geometrie()->get_nb_mg_face();
58 for (int i=0;i<nbface;i++) delete quadbloc[i];
59 delete [] quadbloc;
60 int nbseg=lstsegfrontentier.get_nb();
61 for (int i=0;i<nbseg;i++) delete lstsegfrontentier.get(i);
62 nbseg=lstsegfrontbloc.get_nb();
63 for (int i=0;i<nbseg;i++) delete lstsegfrontbloc.get(i);*/
64 
65 }
66 
67 
69 {
70 if(maille(20)==FAIL) return FAIL;
71 return OK;
72 }
73 
74 int MAILLEUR_BLOC::maille(int etape)
75 {
80 affiche((char*)" MAILLAGE 0D du modele entier");
81 MAILLEUR0D m0d_entier(maientier,geoentier);
82 m0d_entier.maille();
83 if (etape<2) return OK;
84 int nbnoeudentier=maientier->get_nb_mg_noeud();
85 for (int i=0;i<nbnoeudentier;i++)
86  {
87  MG_NOEUD* noeud=maientier->get_mg_noeud(i);
88  double *xyz=noeud->get_coord();
90  if (som!=NULL)
91  {
92  MG_NOEUD *nvnoeud=new MG_NOEUD(som, xyz[0],xyz[1],xyz[2], MAGIC::ORIGINE::IMPOSE);
93  maibloc->ajouter_mg_noeud(nvnoeud);
94  //octreebloc->inserer(nvnoeud);
95  }
96  /* else
97  {
98  int num;
99  double t;
100  MG_ARETE* are=verif_noeud_sur_arete(xyz, geobloc, &num,&t);
101  if (are!=NULL)
102  {
103  MG_NOEUD_ADDITIONNEL_ARETE noeud_add;
104  noeud_add.noeud=noeud;
105  noeud_add.t=t;
106  std::pair<double,MG_NOEUD_ADDITIONNEL_ARETE> tmp(t,noeud_add);
107  lst_noeuds_bloc[num].insert(tmp);
108  }
109  }*/
110 
111 
112  }
113 if (etape<3) return OK;
114 affiche((char*)" MAILLAGE 0D du modele bloc");
115 int nbnoeudblocavantm0d=maibloc->get_nb_mg_noeud();
116 MAILLEUR0D m0d_bloc(maibloc,geobloc);
117 m0d_bloc.adapte();
118 if (etape<4) return OK;
119 int nbnouveaunoeudbloc=maibloc->get_nb_mg_noeud()-nbnoeudblocavantm0d;
120 int nbareteentier=geoentier->get_nb_mg_arete();
121 LISTE_NOEUD_ADD_ARETE *lst_noeuds_entier=new LISTE_NOEUD_ADD_ARETE[nbareteentier];
122 for (int i=0;i<nbnouveaunoeudbloc;i++)
123  {
124  MG_NOEUD *noeud=maibloc->get_mg_noeud(i+nbnoeudblocavantm0d);
125  double *xyz=noeud->get_coord();
126  int num;double t;
127  MG_ARETE* are=verif_noeud_sur_arete(xyz, geoentier, &num,&t);
128  if (are!=NULL)
129  {
130  MG_NOEUD_ADDITIONNEL_ARETE noeud_add;
131  noeud_add.noeud=noeud;
132  noeud_add.t=t;
133  std::pair<double,MG_NOEUD_ADDITIONNEL_ARETE > tmp(t,noeud_add);
134  lst_noeuds_entier[num].insert(tmp);
135  }
136  }
137 if (etape<5) return OK;
138 affiche((char*)" MAILLAGE 1D du modele entier");
139 for (int i=0;i<nbareteentier;i++)
140  {
142  int nbnoeudcontraint=lst_noeuds_entier[i].size();
143  MG_NOEUD* noeuddepart;
144  int numsom=are->get_cosommet1()->get_sommet()->get_lien_maillage()->get_nb();
145  for (int j=0;j<numsom;j++)
146  if (maientier->get_mg_noeudid(are->get_cosommet1()->get_sommet()->get_lien_maillage()->get(j)->get_id())!=NULL) noeuddepart=(MG_NOEUD*)are->get_cosommet1()->get_sommet()->get_lien_maillage()->get(j);
147  MG_NOEUD* noeudarrivee;
148  numsom=are->get_cosommet2()->get_sommet()->get_lien_maillage()->get_nb();
149  for (int j=0;j<numsom;j++)
150  if (maientier->get_mg_noeudid(are->get_cosommet2()->get_sommet()->get_lien_maillage()->get(j)->get_id())!=NULL) noeudarrivee=(MG_NOEUD*)are->get_cosommet2()->get_sommet()->get_lien_maillage()->get(j);
151  MG_NOEUD* navant;
152  double tavant;
153  IT_LISTE_NOEUD_ADD_ARETE it=lst_noeuds_entier[i].begin();
154  for (int j=0;j<nbnoeudcontraint+1;j++)
155  {
156  MG_NOEUD* n1,*n2;
157  double t1,t2;
158  if (j==0) {n1=noeuddepart;t1=are->get_tmin();} else {n1=navant;t1=tavant;}
159  if (j==nbnoeudcontraint) {n2=noeudarrivee;t2=are->get_tmax();}
160  else
161  {
162  double *xyz=(*it).second.noeud->get_coord();
163  n2=new MG_NOEUD(are, xyz[0],xyz[1],xyz[2], MAGIC::ORIGINE::IMPOSE);
165  t2=(*it).second.t;
166  it++;
167  }
168  MAILLEUR1D m1d(maientier, geoentier, carte,are);
170  m1d.maille(are,t1,n1,t2,n2);
171  tavant=t2;
172  navant=n2;
173  }
174  }
175 delete [] lst_noeuds_entier;
178 int nbnoeudtmp=maientier->get_nb_mg_noeud();
179 for (int i=0;i<nbnoeudtmp;i++)
181 nbnoeudtmp=maibloc->get_nb_mg_noeud();
182 for (int i=0;i<nbnoeudtmp;i++)
184 if (etape<6) return OK;
185 int nbsegment=maientier->get_nb_mg_segment();
186 for (int i=0;i<nbsegment;i++)
187  {
189  MG_NOEUD* noeud1=seg->get_noeud1();
190  MG_NOEUD* noeud2=seg->get_noeud2();
191  int dim1;
192  int dim2;
193  MG_NOEUD* n1=chercher(noeud1->get_coord(),*octreebloc);
194  MG_NOEUD* n2=chercher(noeud2->get_coord(),*octreebloc);
195  MG_ARETE* are1ref;
196  MG_FACE* face1ref;
197  MG_ARETE* are2ref;
198  MG_FACE* face2ref;
199  int num1,num2;
200  double t1,t2;
201  if (n1==NULL)
202  {
203  are1ref=verif_noeud_sur_arete(noeud1->get_coord(),geobloc,&num1,&t1);
204  if (are1ref==NULL) dim1=2; else dim1=1;
205  }
206  else
207  {
208  dim1=n1->get_lien_topologie()->get_dimension();
209  if (dim1==1) are1ref=(MG_ARETE*)n1->get_lien_topologie();
210  }
211  if (n2==NULL)
212  {
213  are2ref=verif_noeud_sur_arete(noeud2->get_coord(),geobloc,&num2,&t2);
214  if (are2ref==NULL) dim2=2; else dim2=1;
215  }
216  else
217  {
218  dim2=n2->get_lien_topologie()->get_dimension();
219  if (dim2==1) are2ref=(MG_ARETE*)n2->get_lien_topologie();
220  }
221  if ((dim1==1) || (dim2==1))
222  {
223  if (dim1>1) continue;
224  if (dim2>1) continue;
225  MG_ARETE* ref;
226  if (dim1==1) ref=are1ref; else ref=are2ref;
227  if (n1==NULL)
228  {
229  n1=new MG_NOEUD(ref,noeud1->get_coord()[0],noeud1->get_coord()[1],noeud1->get_coord()[2], MAGIC::ORIGINE::IMPOSE);
231  octreebloc->inserer(n1);
232  }
233  if (n2==NULL)
234  {
235  n2=new MG_NOEUD(ref,noeud2->get_coord()[0],noeud2->get_coord()[1],noeud2->get_coord()[2], MAGIC::ORIGINE::IMPOSE);
237  octreebloc->inserer(n2);
238  }
239  double *xyz1=n1->get_coord();
240  double *xyz2=n2->get_coord();
241  OT_VECTEUR_3D vec1(xyz1,xyz2);
242  double t;
243  ref->inverser(t,xyz1);
244  double dxyz[3];
245  ref->deriver(t,dxyz);
246  OT_VECTEUR_3D vec2(dxyz[0],dxyz[1],dxyz[2]);
247  vec1.norme();
248  vec2.norme();
249  double ps=vec1*vec2;
250  MG_SEGMENT *nvsegment;
251  if (ps>0) nvsegment=new MG_SEGMENT(ref,n1,n2,MAGIC::ORIGINE::IMPOSE);
252  else nvsegment=new MG_SEGMENT(ref,n2,n1,MAGIC::ORIGINE::IMPOSE);
253  maibloc->ajouter_mg_segment(nvsegment);
254  }
255  else if ((dim1==0) && (dim2==0))
256  {
257  MG_ARETE* ref=NULL;
258  MG_SOMMET* som1=(MG_SOMMET*)n1->get_lien_topologie();
259  MG_SOMMET* som2=(MG_SOMMET*)n2->get_lien_topologie();
260  int nb_are=geobloc->get_nb_mg_arete();
261  for ( int i=0 ; i < nb_are ; i++)
262  {
263  MG_ARETE *arete=geobloc->get_mg_arete(i);
264  if ((arete->get_cosommet1()->get_sommet()==som1) && (arete->get_cosommet2()->get_sommet()==som2)) ref=arete;
265  if ((arete->get_cosommet1()->get_sommet()==som2) && (arete->get_cosommet2()->get_sommet()==som1)) ref=arete;
266  }
267  if (ref!=NULL)
268  {
269  double *xyz1=n1->get_coord();
270  double *xyz2=n2->get_coord();
271  OT_VECTEUR_3D vec1(xyz1,xyz2);
272  double t;
273  ref->inverser(t,xyz1);
274  double dxyz[3];
275  ref->deriver(t,dxyz);
276  OT_VECTEUR_3D vec2(dxyz[0],dxyz[1],dxyz[2]);
277  vec1.norme();
278  vec2.norme();
279  double ps=vec1*vec2;
280  MG_SEGMENT *nvsegment;
281  if (ps>0) nvsegment=new MG_SEGMENT(ref,n1,n2,MAGIC::ORIGINE::IMPOSE);
282  else nvsegment=new MG_SEGMENT(ref,n2,n1,MAGIC::ORIGINE::IMPOSE);
283  maibloc->ajouter_mg_segment(nvsegment);
284  }
285  }
286  }
287 if (etape<7) return OK;
288 affiche((char*)" MAILLAGE 1D du modele bloc");
289 int nbaretebloc=geobloc->get_nb_mg_arete();
290 int nbsegmentblocavant=maibloc->get_nb_mg_segment();
291 for (int i=0;i<nbaretebloc;i++)
292  {
294  m1d_bloc.change_pas_integration(pas);
295  m1d_bloc.adapte();
296  }
297 if (etape<8) return OK;
298 int nbfaceentier=geoentier->get_nb_mg_face();
299 TPL_LISTE_ENTITE<MG_SEGMENT*> *lstsegcontraint=new TPL_LISTE_ENTITE<MG_SEGMENT*>[nbfaceentier];
300 int nbsegmentbloc=maibloc->get_nb_mg_segment();
301 for (int i=nbsegmentblocavant;i<nbsegmentbloc;i++)
302  {
304  int num;
305  MG_FACE* face=seg_sur_face(seg,geoentier,&num);
306  if (face!=NULL)
307  lstsegcontraint[num].ajouter(seg);
308  /*MG_NOEUD* noeud1=seg->get_noeud1();
309  MG_NOEUD* noeud2=seg->get_noeud2();
310  int dim1;
311  int dim2;
312  MG_NOEUD* n1=chercher(noeud1->get_coord(),*octreeentier);
313  MG_NOEUD* n2=chercher(noeud2->get_coord(),*octreeentier);
314  MG_FACE* face1ref;
315  MG_FACE* face2ref;
316  int num1,num2;
317  if (n1==NULL)
318  {
319  face1ref=verif_noeud_sur_face(noeud1->get_coord(),geoentier,&num1,octreeentierseg);
320  if (face1ref==NULL) dim1=3; else dim1=2;
321  }
322  else
323  dim1=n1->get_lien_topologie()->get_dimension();
324  if (n2==NULL)
325  {
326  face2ref=verif_noeud_sur_face(noeud2->get_coord(),geoentier,&num2,octreeentierseg);
327  if (face2ref==NULL) dim2=3; else dim2=2;
328  }
329  else
330  dim2=n2->get_lien_topologie()->get_dimension();
331  if ((dim1==3) || (dim2==3)) continue;
332  if ((dim1==2) || (dim2==2))
333  {
334  int num;
335  if (dim1==2) num=num1;
336  else if (dim2==2) num=num2;
337  lstsegcontraint[num].ajouter(seg);
338  } */
339  }
340 if (etape<9) return OK;
341 affiche((char*)" MAILLAGE 2D du modele entier");
342 for (int i=0;i<nbfaceentier;i++)
343  {
344  MG_FACE* face=geoentier->get_mg_face(i);
346  char mess[50];
348  sprintf(mess," Face %i identificateur %lu",i,face->get_id());
349  affiche(mess);
350  m2d.maille(face,&(lstsegcontraint[i]));
351  }
352 delete [] lstsegcontraint;
353 if (etape<10) return OK;
354 int nbfacebloc=geobloc->get_nb_mg_face();
355 TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttricontraint=new TPL_LISTE_ENTITE<MG_TRIANGLE*>[nbfacebloc];
356 int nbtrientier=maientier->get_nb_mg_triangle();
357 for (int i=0;i<nbtrientier;i++)
358  {
360  int num;
361  MG_FACE* face=tri_sur_face(tri,geobloc,&num);
362  if (face!=NULL)
363  lsttricontraint[num].ajouter(tri);
364  }
365 if (etape<11) return OK;
366 affiche((char*)" MAILLAGE 2D du modele bloc");
367 for (int i=0;i<nbfacebloc;i++)
368  {
369  MG_FACE* face=geobloc->get_mg_face(i);
370  MAILLEUR2D m2d(maibloc,geobloc,carte,face);
371  char mess[50];
373  sprintf(mess," Face %i identificateur %lu",i,face->get_id());
374  affiche(mess);
375  m2d.maille(face,NULL,&(lsttricontraint[i]));
376  }
377 delete [] lsttricontraint;
378 if (etape<12) return OK;
379 affiche((char*)" MAILLAGE 3D du modele bloc");
380 int nbvolumebloc=geobloc->get_nb_mg_volume();
381 for (int i=0;i<nbvolumebloc;i++)
382 {
384  MAILLEUR3D m3d(maibloc,geobloc,carte,false,vol);
387  m3d.maille(vol);
388 }
389 if (etape<13) return OK;
391 LISTE_MG_TETRA::iterator it;
392 for (MG_TETRA* tet=maibloc->get_premier_tetra(it);tet!=NULL;tet=maibloc->get_suivant_tetra(it))
393  lsttetra.ajouter(tet);
394 if (etape<14) return OK;
395 affiche((char*)" MAILLAGE 3D du modele entier");
401  m3d.maille(vol,NULL,&lsttetra);
402 return OK;
403 }
404 
406 {
408 octree.rechercher(xyz[0],xyz[1],xyz[2],1e-5,lst);
409 int nb=lst.get_nb();
410 for (int i=0;i<nb;i++)
411  {
412  OT_VECTEUR_3D vec(xyz,lst.get(i)->get_coord());
413  double metrique[9];
414  carte->evaluer(xyz,metrique);
415  double eps=(1./sqrt(metrique[0])*1e-10);
416  if (vec.get_longueur()<eps) return lst.get(i);
417  }
418 return NULL;
419 }
420 
421 
423 {
424  int nbsom=geo->get_nb_mg_sommet();
425  for (int i=0;i<nbsom;i++)
426  {
427  MG_SOMMET *sommet=geo->get_mg_sommet(i);
428  double xyzsom[3];
429  sommet->get_point()->evaluer(xyzsom);
430  double metrique[9];
431  carte->evaluer(xyz,metrique);
432  double eps=(1./sqrt(metrique[0])*1e-6);
433  OT_VECTEUR_3D vec(xyz,xyzsom);
434  if (vec.get_longueur()<eps) return sommet;
435  }
436 return NULL;
437 }
438 
439 
440 MG_ARETE* MAILLEUR_BLOC::verif_noeud_sur_arete(double *xyz, MG_GEOMETRIE *geo,int *num, double *t)
441 {
442  int nb_are=geo->get_nb_mg_arete();
443  for ( int i=0 ; i < nb_are ; i++)
444  {
445  MG_ARETE *arete=geo->get_mg_arete(i);
446  arete->inverser((*t),xyz);
447  if (arete->get_courbe()->est_periodique())
448  if (*t< arete->get_tmin()) *t=*t+arete->get_courbe()->get_periode();
449  double xyztmp[3];
450  arete->evaluer( *t,xyztmp );
451  double metrique[9];
452  carte->evaluer(xyz,metrique);
453  double eps=(1./sqrt(metrique[0])*1e-6);
454  OT_VECTEUR_3D vec(xyz,xyztmp);
455  if (vec.get_longueur()<eps)
456  if ((*t>arete->get_tmin()) && (*t<arete->get_tmax()))
457  {
458  *num=i;
459  return arete;
460  }
461  }
462  return NULL;
463 }
464 
466 {
467 double *xyz1=seg->get_noeud1()->get_coord();
468 double *xyz2=seg->get_noeud2()->get_coord();
469 int nbface=geo->get_nb_mg_face();
470 for (int i=0;i<nbface;i++)
471  {
472  MG_FACE *face=geo->get_mg_face(i);
473  double metrique[9];
474  carte->evaluer(xyz1,metrique);
475  double eps=(1./sqrt(metrique[0])*1e-6);
476  double uv1[2],xyz1bis[3];
477  face->inverser(uv1,xyz1);
478  face->evaluer(uv1,xyz1bis);
479  OT_VECTEUR_3D vec1(xyz1,xyz1bis);
480  if (vec1.get_longueur()<eps)
481  {
482  double uv2[2],xyz2bis[3];
483  face->inverser(uv2,xyz2);
484  face->evaluer(uv2,xyz2bis);
485  OT_VECTEUR_3D vec2(xyz2,xyz2bis);
486  if (vec2.get_longueur()<eps)
487  {
488  double xyz[3];
489  xyz[0]=0.5*(xyz1[0]+xyz2[0]);
490  xyz[1]=0.5*(xyz1[1]+xyz2[1]);
491  xyz[2]=0.5*(xyz1[2]+xyz2[2]);
492  double uv[2];
493  face->inverser(uv,xyz);
494  double dist=otentier.calcule_distance_contour_face_uv(uv,face);
495  if (dist>0.) {*num=i;return face;}
496  }
497  }
498  }
499 return NULL;
500 }
501 
503 {
504 double *xyz1=tri->get_noeud1()->get_coord();
505 double *xyz2=tri->get_noeud2()->get_coord();
506 double *xyz3=tri->get_noeud3()->get_coord();
507 int nbface=geo->get_nb_mg_face();
508 for (int i=0;i<nbface;i++)
509  {
510  MG_FACE *face=geo->get_mg_face(i);
511  double metrique[9];
512  carte->evaluer(xyz1,metrique);
513  double eps=(1./sqrt(metrique[0])*1e-6);
514  double uv1[2],xyz1bis[3];
515  face->inverser(uv1,xyz1);
516  face->evaluer(uv1,xyz1bis);
517  OT_VECTEUR_3D vec1(xyz1,xyz1bis);
518  if (vec1.get_longueur()<eps)
519  {
520  double uv2[2],xyz2bis[3];
521  face->inverser(uv2,xyz2);
522  face->evaluer(uv2,xyz2bis);
523  OT_VECTEUR_3D vec2(xyz2,xyz2bis);
524  if (vec2.get_longueur()<eps)
525  {
526  double uv3[2],xyz3bis[3];
527  face->inverser(uv3,xyz3);
528  face->evaluer(uv3,xyz3bis);
529  OT_VECTEUR_3D vec3(xyz3,xyz3bis);
530  if (vec3.get_longueur()<eps)
531  {
532  double xyz[3];
533  double uv[2];
535  double du=deca.calcul_decalage_parametre_u(uv1[0]);
536  double dv=deca.calcul_decalage_parametre_v(uv1[1]);
537 
538  uv[0]=0.333333333333333333*(deca.decalage_parametre_u(uv1[0],du)+deca.decalage_parametre_u(uv2[0],du)+deca.decalage_parametre_u(uv3[0],du));
539  uv[1]=0.333333333333333333*(deca.decalage_parametre_v(uv1[1],dv)+deca.decalage_parametre_v(uv2[1],dv)+deca.decalage_parametre_v(uv3[1],dv));
540  uv[0]=deca.decalage_parametre_u(uv[0],-du);
541  uv[1]=deca.decalage_parametre_v(uv[1],-dv);
542  double dist=otbloc.calcule_distance_contour_face_uv(uv,face);
543  if (dist>0.) {*num=i;return face;}
544  }
545  }
546  }
547  }
548 return NULL;
549 }
550 
551 
553 {
554 double xmin=1e300,ymin=1e300,zmin=1e300;
555 double xmax=-1e300,ymax=-1e300,zmax=-1e300;
557 int nb_noeud=mai->get_nb_mg_noeud();
558 for (int i=0;i<nb_noeud;i++)
559  {
560  MG_NOEUD* mgnoeud=mai->get_mg_noeud(i);
561  lstnoeud.ajouter(mgnoeud);
562  xmin=std::min(xmin,mgnoeud->get_x());
563  ymin=std::min(ymin,mgnoeud->get_y());
564  zmin=std::min(zmin,mgnoeud->get_z());
565  xmax=std::max(xmax,mgnoeud->get_x());
566  ymax=std::max(ymax,mgnoeud->get_y());
567  zmax=std::max(zmax,mgnoeud->get_z());
568  }
569 double xdiff=xmax-xmin;
570 double ydiff=ymax-ymin;
571 double zdiff=zmax-zmin;
572 xmin=xmin-0.125*xdiff;
573 xmax=xmax+0.125*xdiff;
574 ymin=ymin-0.125*ydiff;
575 ymax=ymax+0.125*ydiff;
576 zmin=zmin-0.125*zdiff;
577 zmax=zmax+0.125*zdiff;
578 (*octree)=new TPL_OCTREE<MG_NOEUD*,MG_NOEUD*>;
579 (*octree)->initialiser(&lstnoeud,1,xmin,ymin,zmin,xmax,ymax,zmax);
580 }
581 
583 {
584 (*octree2)=new TPL_OCTREE<MG_NOEUD*,MG_NOEUD*>;
585 (*octree2)->initialiser(octree1);
586 }
587 
588 
589 
590 
virtual void evaluer(double *param, double *resultat)=0
fonction_affiche * affiche2
Definition: magic_affiche.h:41
virtual void active_affichage(fonction_affiche *fonc)
virtual void affiche(char *mess)
void adapte(void)
Definition: mailleur0d.cpp:85
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur0d.cpp:43
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur1d.cpp:50
void adapte(void)
Definition: mailleur1d.cpp:244
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur2d.cpp:49
virtual int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur3d.cpp:55
class MG_MAILLAGE * maientier
Definition: mailleur_bloc.h:64
class TPL_OCTREE< class MG_NOEUD *, class MG_NOEUD * > * octreeentier
Definition: mailleur_bloc.h:66
MG_GEOMETRIE_OUTILS otbloc
Definition: mailleur_bloc.h:69
int maille(int etape)
class MG_ARETE * verif_noeud_sur_arete(double *xyz, MG_GEOMETRIE *geo, int *num, double *t)
class FCT_TAILLE * carte
Definition: mailleur_bloc.h:63
class MG_NOEUD * chercher(double *xyz, TPL_OCTREE< MG_NOEUD *, MG_NOEUD * > &octree)
class MG_SOMMET * verif_noeud_sur_sommet(double *xyz, class MG_GEOMETRIE *geo)
MG_GEOMETRIE_OUTILS otentier
Definition: mailleur_bloc.h:68
class MG_GESTIONNAIRE * gestbloc
Definition: mailleur_bloc.h:61
void cree_octree(class MG_MAILLAGE *mai, TPL_OCTREE< class MG_NOEUD *, MG_NOEUD * > **octree)
class MG_GESTIONNAIRE * gestentier
Definition: mailleur_bloc.h:61
class TPL_OCTREE< class MG_NOEUD *, class MG_NOEUD * > * octreebloc
Definition: mailleur_bloc.h:65
class MG_GEOMETRIE * geoentier
Definition: mailleur_bloc.h:62
MAILLEUR_BLOC(class MG_GESTIONNAIRE *gentier, MG_GESTIONNAIRE *gbloc, int numgeoentier, int numgeobloc, class FCT_TAILLE *fct_taille, bool save)
class MG_GEOMETRIE * geobloc
Definition: mailleur_bloc.h:62
class MG_FACE * seg_sur_face(class MG_SEGMENT *seg, MG_GEOMETRIE *geo, int *num)
MG_FACE * tri_sur_face(class MG_TRIANGLE *tri, MG_GEOMETRIE *geo, int *num)
class MG_MAILLAGE * maibloc
Definition: mailleur_bloc.h:64
virtual void change_nom_fichierdbg(char *nom)
Definition: mailleur.cpp:66
void change_pas_integration(int val)
Definition: mailleur.cpp:92
char nomfichierdbg[500]
Definition: mailleur.h:54
int pas
Definition: mailleur.h:56
bool savedbg
Definition: mailleur.h:53
virtual double get_tmax(void)
Definition: mg_arete.cpp:184
virtual double get_tmin(void)
Definition: mg_arete.cpp:179
virtual void deriver(double t, double *xyz)
Definition: mg_arete.cpp:149
virtual void evaluer(double t, double *xyz)
Definition: mg_arete.cpp:143
virtual class MG_COURBE * get_courbe(void)
Definition: mg_arete.cpp:89
virtual class MG_COSOMMET * get_cosommet2(void)
Definition: mg_arete.cpp:85
virtual class MG_COSOMMET * get_cosommet1(void)
Definition: mg_arete.cpp:81
virtual void inverser(double &t, double *xyz, double precision=1e-6)
Definition: mg_arete.cpp:173
virtual MG_SOMMET * get_sommet(void)
Definition: mg_cosommet.cpp:83
virtual int est_periodique(void)=0
virtual double get_periode(void)=0
MG_ELEMENT_TOPOLOGIQUE * get_lien_topologie(void)
virtual TPL_SET< MG_ELEMENT_MAILLAGE * > * get_lien_maillage(void)
virtual int get_dimension(void)=0
virtual void inverser(double *uv, double *xyz, double precision=1e-6)
Definition: mg_face.cpp:228
virtual void evaluer(double *uv, double *xyz)
Definition: mg_face.cpp:192
virtual MG_SURFACE * get_surface(void)
Definition: mg_face.cpp:109
double calcule_distance_contour_face_uv(double *uv, class MG_FACE *face)
unsigned int get_nb_mg_arete(void)
unsigned int get_nb_mg_face(void)
MG_SOMMET * get_mg_sommet(unsigned int num)
MG_ARETE * get_mg_arete(unsigned int num)
MG_FACE * get_mg_face(unsigned int num)
MG_VOLUME * get_mg_volume(unsigned int num)
unsigned int get_nb_mg_sommet(void)
unsigned int get_nb_mg_volume(void)
MG_GEOMETRIE * get_mg_geometrieid(unsigned long num)
MG_GEOMETRIE * get_mg_geometrie(unsigned int num)
int ajouter_mg_maillage(MG_MAILLAGE *mgmai)
unsigned long get_id()
MG_TETRA * get_premier_tetra(LISTE_MG_TETRA::iterator &it)
MG_TETRA * get_suivant_tetra(LISTE_MG_TETRA::iterator &it)
unsigned int get_nb_mg_segment(void)
unsigned int get_nb_mg_triangle(void)
MG_NOEUD * get_mg_noeudid(unsigned long num)
unsigned int get_nb_mg_noeud(void)
MG_NOEUD * get_mg_noeud(unsigned int num)
MG_TRIANGLE * get_mg_triangle(unsigned int num)
MG_SEGMENT * get_mg_segment(unsigned int num)
MG_SEGMENT * ajouter_mg_segment(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, int origine, double longue=0.0, unsigned long num=0)
MG_NOEUD * ajouter_mg_noeud(MG_ELEMENT_TOPOLOGIQUE *topo, double xx, double yy, double zz, int origine, unsigned long num=0)
class MG_NOEUD * noeud
Definition: mailleur_bloc.h:77
virtual double * get_coord(void)
Definition: mg_noeud.cpp:92
virtual double get_z(void)
Definition: mg_noeud.cpp:87
virtual double get_y(void)
Definition: mg_noeud.cpp:82
virtual double get_x(void)
Definition: mg_noeud.cpp:77
virtual void evaluer(double *xyz)=0
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_segment.cpp:108
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_segment.cpp:113
virtual MG_POINT * get_point(void)
Definition: mg_sommet.cpp:52
virtual double get_periode_u(void)=0
virtual double get_periode_v(void)=0
virtual MG_NOEUD * get_noeud3(void)
virtual MG_NOEUD * get_noeud1(void)
virtual MG_NOEUD * get_noeud2(void)
double decalage_parametre_v(double par, double dpar)
double calcul_decalage_parametre_v(double par)
double calcul_decalage_parametre_u(double par)
double decalage_parametre_u(double par, double dpar)
virtual double get_longueur(void) const
virtual void norme(void)
virtual void ajouter(X x)
virtual int get_nb(void)
virtual X get(int num)
virtual void ajouter(X x)
virtual void inserer(BOITE_3D &boite, A a, TPL_CELLULE_OCTREE< A, CONDITION > *cellule)
Definition: tpl_octree.h:897
virtual void initialiser(TPL_LISTE_ENTITE< CONDITION > *lst_entite, int nombre, double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Definition: tpl_octree.h:366
virtual void rechercher(BOITE_3D &boite, TPL_MAP_ENTITE< A > &liste_entite_trouve, TPL_CELLULE_OCTREE< A, CONDITION > *cellule)
Definition: tpl_octree.h:606
int get_nb(void)
Definition: tpl_set.h:78
X get(int num)
Definition: tpl_set.h:84
std::map< double, MG_NOEUD_ADDITIONNEL_ARETE, std::less< double > >::iterator IT_LISTE_NOEUD_ADD_ARETE
Definition: mailleur_bloc.h:84
std::map< double, MG_NOEUD_ADDITIONNEL_ARETE, std::less< double > > LISTE_NOEUD_ADD_ARETE
Definition: mailleur_bloc.h:83
const int OK
Definition: mg_definition.h:38
const int FAIL
Definition: mg_definition.h:39
double2 sqrt(double2 &val)