ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mailleur/src/mailleur3d.cpp
Revision: 287
Committed: Wed Oct 19 20:55:30 2011 UTC (13 years, 6 months ago) by francois
File size: 21775 byte(s)
Log Message:
Dissociation du mailleur 3D et de l'optimisateur 3D

File Contents

# User Rev Content
1 francois 283 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4     // Jean Christophe Cuilli�e et Vincent FRANCOIS
5     // D�artement de G�ie M�anique - UQTR
6     //------------------------------------------------------------
7     // Le projet MAGIC est un projet de recherche du d�artement
8     // de g�ie m�anique de l'Universit�du Qu�ec �
9     // Trois Rivi�es
10     // Les librairies ne peuvent �re utilis�s sans l'accord
11     // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // mailleur3d.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 �11H23
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26    
27    
28     //#pragma hdrstop
29     #include <time.h>
30     #include "tpl_set.h"
31     #include "mailleur3d.h"
32     #include "m3d_triangle.h"
33     #include "mg_gestionnaire.h"
34 francois 287 #include "mailleur3d_optimisation.h"
35 francois 283 //---------------------------------------------------------------------------
36    
37     //#pragma package(smart_init)
38    
39    
40    
41     MAILLEUR3D::MAILLEUR3D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,MG_VOLUME* mgvol,FCT_TAILLE* fct_taille,int destruction):MAILLEUR(),mg_maillage(mgmai),mg_geometrie(mggeo),mg_volume(mgvol),metrique(fct_taille),activelog(0),niveau_optimisation(2),type_mailleur(FRONTAL),typedestruction(destruction)
42     {
43    
44     for (int i=0;i<100;i++)
45     {
46     cpu[i]=0.;
47     nbfois[i]=0;
48     }
49     }
50    
51    
52     MAILLEUR3D::MAILLEUR3D(FCT_GENERATEUR_3D<4> *carte,MG_MAILLAGE* mgmai,OT_CPU* comp,int destruction):MAILLEUR(comp),metrique(carte),type_mailleur(OCTAL),mg_maillage(mgmai),coef(2.),typedestruction(destruction)
53     {
54     }
55    
56    
57     MAILLEUR3D::~MAILLEUR3D()
58     {
59     }
60    
61    
62    
63    
64     void MAILLEUR3D::maille(MG_GROUPE_TOPOLOGIQUE* mggt)
65     {
66     if (type_mailleur==FRONTAL)
67     {
68     if (mg_volume!=NULL) maille(mg_volume);
69     else
70     {
71     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> lst;
72     if (mggt!=NULL)
73     {
74     int nb=mggt->get_nb();
75     for (int i=0;i<nb;i++)
76     {
77     lst.ajouter(mggt->get(i));
78     mggt->get(i)->get_topologie_sousjacente(&lst);
79     }
80     }
81     int nb_vol=mg_geometrie->get_nb_mg_volume();
82     for (int i=0;i<nb_vol;i++)
83     {
84     MG_VOLUME* mgvol=mg_geometrie->get_mg_volume(i);
85     if (mggt!=NULL)
86     if (lst.existe(mgvol)==0) continue;
87     maille(mgvol);
88     }
89     }
90 francois 287 }
91 francois 283 if (type_mailleur==OCTAL)
92     {
93     FCT_GENERATEUR_3D<4> *carte=(FCT_GENERATEUR_3D<4> *)metrique;
94     maille(carte);
95     }
96    
97     }
98    
99    
100    
101     void MAILLEUR3D::maille(MG_VOLUME* mgvol,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri,TPL_LISTE_ENTITE<MG_TETRA*> *lsttet)
102     {
103     initialise_frontiere(mgvol);
104     cree_octree();
105     int creation_metrique=0;
106     if (metrique==NULL)
107     {
108     metrique=new FCT_TAILLE_VOLUME(distance_maximale,octree_de_frontiere);
109     creation_metrique=1;
110     }
111     else distance_maximale=metrique->get_valeur_maximale(0);
112     if (affichageactif==1) (*affiche)((char*)" Construction du front");
113     initialise_front(mgvol);
114     if (lsttri!=NULL) insere_contrainte_triangle(mgvol,lsttri);
115     if (lsttet!=NULL) insere_contrainte_tetra(mgvol,lsttet);
116     if (affichageactif==1) (*affiche)((char*)" Progression du front");
117     //mg_maillage->get_gestionnaire()->enregistrer("c:\\void.magic");
118     progresse_front(mgvol);
119     if (affichageactif==1) (*affiche)((char*)" Construction du maillage final");
120     detruit_element_inactif();
121     if (affichageactif==1) (*affiche)((char*)" Optimisation du maillage final");
122 francois 287 MAILLEUR3D_OPTIMISATION opt(mg_maillage,niveau_optimisation);
123     opt.active_affichage(affiche);
124 francois 283 int nbaoptimiser;
125     int nbaoptimiserapres=mg_maillage->get_nb_mg_tetra();
126     do
127     {
128     nbaoptimiser=nbaoptimiserapres;
129 francois 287 opt.optimise(mgvol,nbaoptimiserapres);
130 francois 283 }
131     while (nbaoptimiserapres!=nbaoptimiser);
132     if (creation_metrique==1) delete metrique;
133    
134     delete octree_de_triangle;
135     delete octree_de_frontiere;
136     delete octree_de_front;
137    
138     triangle_frontiere.vide();
139     noeud_frontiere.vide();
140     noeud_arete_frontiere.vide();
141     }
142    
143     void MAILLEUR3D::initialise_frontiere(MG_VOLUME* mgvol)
144     {
145     clock_t cpu1=clock(); //debug
146     int nbcoq=mgvol->get_nb_mg_coquille();
147     for (int i=0;i<nbcoq;i++)
148     {
149     MG_COQUILLE* mgcoq=mgvol->get_mg_coquille(i);
150     int nbcoface=mgcoq->get_nb_mg_coface();
151     for (int j=0;j<nbcoface;j++)
152     {
153     MG_COFACE* coface=mgcoq->get_mg_coface(j);
154     MG_FACE* mgface=coface->get_face();
155     TPL_SET<MG_ELEMENT_MAILLAGE*> * lien_maillage = mgface->get_lien_maillage();
156     TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it;
157     MG_ELEMENT_MAILLAGE* element;
158     for (element = lien_maillage->get_premier(it); element; element = lien_maillage->get_suivant(it) )
159     {
160     MG_TRIANGLE* mgtri=(MG_TRIANGLE*)element;
161     MG_TRIANGLE* tritemp=mg_maillage->get_mg_triangleid(mgtri->get_id());
162     if (tritemp==NULL) continue;
163     triangle_frontiere.ajouter(mgtri);
164     noeud_frontiere.ajouter(mgtri->get_noeud1());
165     noeud_frontiere.ajouter(mgtri->get_noeud2());
166     noeud_frontiere.ajouter(mgtri->get_noeud3());
167     }
168     int nbbou=mgface->get_nb_mg_boucle();
169     for (int l=0;l<nbbou;l++)
170     {
171     MG_BOUCLE* mgbou=mgface->get_mg_boucle(l);
172     int nbcoarete=mgbou->get_nb_mg_coarete();
173     for (int m=0;m<nbcoarete;m++)
174     {
175     MG_COARETE* mgcoarete=mgbou->get_mg_coarete(m);
176     MG_ARETE* mgarete=mgcoarete->get_arete();
177     TPL_SET<MG_ELEMENT_MAILLAGE*> * lien_maillage = mgarete->get_lien_maillage();
178     TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it;
179     MG_ELEMENT_MAILLAGE* element;
180     for (element = lien_maillage->get_premier(it); element; element = lien_maillage->get_suivant(it) )
181     {
182     MG_SEGMENT* mgseg=(MG_SEGMENT*)element;
183     MG_SEGMENT* segtemp=mg_maillage->get_mg_segmentid(mgseg->get_id());
184     if (segtemp==NULL) continue;
185     noeud_arete_frontiere.ajouter(mgseg->get_noeud1());
186     noeud_arete_frontiere.ajouter(mgseg->get_noeud2());
187     }
188     }
189     }
190     }
191     }
192    
193     clock_t cpu2=clock(); //debug
194     cpu[0]=cpu[0]+(cpu2-cpu1)/CLK_TCK; //debug
195     nbfois[0]++; //debug
196     }
197    
198     void MAILLEUR3D::cree_octree(void)
199     {
200     /*double xmin,ymin,zmin;
201     double xmax,ymax,zmax;
202    
203     clock_t cpu1=clock(); // debug
204     int nb_noeud=noeud_arete_frontiere.get_nb();
205     for (int i=0;i<nb_noeud;i++)
206     {
207     MG_NOEUD* mgnoeud=noeud_arete_frontiere.get(i);
208     if (i==0)
209     {
210     xmin=mgnoeud->get_x();
211     xmax=mgnoeud->get_x();
212     ymin=mgnoeud->get_y();
213     ymax=mgnoeud->get_y();
214     zmin=mgnoeud->get_z();
215     zmax=mgnoeud->get_z();
216     }
217     else
218     {
219     xmin=std::min(xmin,mgnoeud->get_x());
220     ymin=std::min(ymin,mgnoeud->get_y());
221     zmin=std::min(zmin,mgnoeud->get_z());
222     xmax=std::max(xmax,mgnoeud->get_x());
223     ymax=std::max(ymax,mgnoeud->get_y());
224     zmax=std::max(zmax,mgnoeud->get_z());
225     }
226     }
227     double xdiff=xmax-xmin;
228     double ydiff=ymax-ymin;
229     double zdiff=zmax-zmin;
230     double xcentre=0.5*(xmax+xmin);
231     double ycentre=0.5*(ymax+ymin);
232     double zcentre=0.5*(zmax+zmin);
233     xmin=xcentre-10.25*xdiff;
234     xmax=xcentre+10.25*xdiff;
235     ymin=ycentre-10.25*ydiff;
236     ymax=ycentre+10.25*ydiff;
237     zmin=zcentre-10.25*zdiff;
238     zmax=zcentre+10.25*zdiff; */
239     FCT_GENERATEUR_3D<4> *carte=(FCT_GENERATEUR_3D<4> *)metrique;
240     int nb_cellule=carte->get_nb_cellule();
241     double param[32];
242     carte->get_information(0,0,param);
243     double xmin=param[0]+0.005*(param[1]-param[0]);
244     double ymin=param[8]+0.005*(param[10]-param[8]);
245     double zmin=param[16]+0.005*(param[20]-param[16]);
246     carte->get_information(nb_cellule-1,0,param);
247     double xmax=param[1]-0.005*(param[1]-param[0]);
248     double ymax=param[10]-0.005*(param[10]-param[8]);
249     double zmax=param[20]-0.005*(param[20]-param[16]);
250     octree_de_triangle=new TPL_OCTREE_FCT<MG_TRIANGLE*,FCT_GENERATEUR_3D<4> >;
251     octree_de_frontiere=new TPL_OCTREE<MG_TRIANGLE*,MG_NOEUD*>;
252     octree_de_front=new TPL_OCTREE<MG_FRONT_3D*,MG_NOEUD*>;
253     octree_de_triangle->initialiser(*carte,xmin,ymin,zmin,xmax,ymax,zmax);
254     octree_de_frontiere->initialiser(octree_de_triangle);
255     octree_de_front->initialiser(octree_de_triangle);
256    
257     int nb_triangle=triangle_frontiere.get_nb();
258     for (int j=0;j<nb_triangle;j++)
259     {
260     octree_de_frontiere->inserer(triangle_frontiere.get(j));
261     octree_de_triangle->inserer(triangle_frontiere.get(j));
262     }
263     /*clock_t cpu2=clock(); //debug
264     cpu[1]=cpu[1]+(cpu2-cpu1)/CLK_TCK; //debug
265     nbfois[1]++; //debug*/
266     }
267    
268     void MAILLEUR3D::initialise_front(MG_VOLUME* mgvol)
269     {
270     clock_t cpu1=clock(); //debug
271     // constitution du front
272     int nbcoq=mgvol->get_nb_mg_coquille();
273     for (int i=0;i<nbcoq;i++)
274     {
275     MG_COQUILLE* mgcoq=mgvol->get_mg_coquille(i);
276     int nbcoface=mgcoq->get_nb_mg_coface();
277     for (int j=0;j<nbcoface;j++)
278     {
279     MG_COFACE* coface=mgcoq->get_mg_coface(j);
280     MG_FACE* mgface=coface->get_face();
281    
282     TPL_SET<MG_ELEMENT_MAILLAGE*> * lien_maillage = mgface->get_lien_maillage();
283     TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it;
284     MG_ELEMENT_MAILLAGE* element;
285     for (element = lien_maillage->get_premier(it); element; element = lien_maillage->get_suivant(it) )
286     {
287     MG_TRIANGLE* mgtri=(MG_TRIANGLE*)element;
288     MG_TRIANGLE* tritemp=mg_maillage->get_mg_triangleid(mgtri->get_id());
289     if (tritemp==NULL) continue;
290     if (coface->get_orientation()==1) ajouter_front_courant(NONFORCE,mgtri->get_noeud1(),mgtri->get_noeud2(),mgtri->get_noeud3(),mgtri);
291     else ajouter_front_courant(NONFORCE,mgtri->get_noeud1(),mgtri->get_noeud3(),mgtri->get_noeud2(),mgtri);
292     }
293     }
294     }
295    
296     // recherche des voisins
297     for (int l=0;l<11;l++)
298     {
299     int nb_front=get_nb_front(front_courant[l]);
300     for (int i=0;i<nb_front;i++)
301     {
302     MG_FRONT_3D* ft=get_front(front_courant[l],i);
303     MG_NOEUD* mgnoeud1=ft->get_noeud1();
304     MG_NOEUD* mgnoeud2=ft->get_noeud2();
305     MG_NOEUD* mgnoeud3=ft->get_noeud3();
306     ft->changer_front_voisin(NULL,0);
307     ft->changer_front_voisin(NULL,1);
308     ft->changer_front_voisin(NULL,2);
309     for (int j=0;j<mgnoeud1->get_lien_triangle()->get_nb();j++)
310     for (int k=0;k<mgnoeud2->get_lien_triangle()->get_nb();k++)
311     {
312     M3D_TRIANGLE* tri1=(M3D_TRIANGLE*)mgnoeud1->get_lien_triangle()->get(j);
313     M3D_TRIANGLE* tri2=(M3D_TRIANGLE*)mgnoeud2->get_lien_triangle()->get(k);
314     if (tri1==tri2)
315     if (tri1->get_etat_front()==FRONT_ACTIF)
316     if (tri1->get_mgfront()!=ft)
317     {
318     MG_FRONT_3D* ft2=tri1->get_mgfront();
319     if (ft->get_front_voisin(0)==NULL)
320     {
321     ft->changer_front_voisin(ft2,0);
322     ft->changer_angle_voisin(angle_front(ft,ft2),0);
323     }
324     else
325     {
326     double angle=angle_front(ft,ft2);
327     if (angle<ft->get_angle_voisin(0))
328     {
329     ft->changer_front_voisin(ft2,0);
330     ft->changer_angle_voisin(angle,0);
331     }
332     }
333     }
334     }
335     for (int j=0;j<mgnoeud1->get_lien_triangle()->get_nb();j++)
336     for (int k=0;k<mgnoeud3->get_lien_triangle()->get_nb();k++)
337     {
338     M3D_TRIANGLE* tri1=(M3D_TRIANGLE*)mgnoeud1->get_lien_triangle()->get(j);
339     M3D_TRIANGLE* tri2=(M3D_TRIANGLE*)mgnoeud3->get_lien_triangle()->get(k);
340     if (tri1==tri2)
341     if (tri1->get_etat_front()==FRONT_ACTIF)
342     if (tri1->get_mgfront()!=ft)
343     {
344     MG_FRONT_3D* ft2=tri1->get_mgfront();
345     if (ft->get_front_voisin(1)==NULL)
346     {
347     ft->changer_front_voisin(ft2,1);
348     ft->changer_angle_voisin(angle_front(ft,ft2),1);
349     }
350     else
351     {
352     double angle=angle_front(ft,ft2);
353     if (angle<ft->get_angle_voisin(1))
354     {
355     ft->changer_front_voisin(ft2,1);
356     ft->changer_angle_voisin(angle,1);
357     }
358     }
359     }
360     }
361     for (int j=0;j<mgnoeud2->get_lien_triangle()->get_nb();j++)
362     for (int k=0;k<mgnoeud3->get_lien_triangle()->get_nb();k++)
363     {
364     M3D_TRIANGLE* tri1=(M3D_TRIANGLE*)mgnoeud2->get_lien_triangle()->get(j);
365     M3D_TRIANGLE* tri2=(M3D_TRIANGLE*)mgnoeud3->get_lien_triangle()->get(k);
366     if (tri1==tri2)
367     if (tri1->get_etat_front()==FRONT_ACTIF)
368     if (tri1->get_mgfront()!=ft)
369     {
370     MG_FRONT_3D* ft2=tri1->get_mgfront();
371     if (ft->get_front_voisin(2)==NULL)
372     {
373     ft->changer_front_voisin(ft2,2);
374     ft->changer_angle_voisin(angle_front(ft,ft2),2);
375     }
376     else
377     {
378     double angle=angle_front(ft,ft2);
379     if (angle<ft->get_angle_voisin(2))
380     {
381     ft->changer_front_voisin(ft2,2);
382     ft->changer_angle_voisin(angle,2);
383     }
384     }
385     }
386     }
387     if ( (ft->get_front_voisin(0)==NULL) || (ft->get_front_voisin(1)==NULL)|| (ft->get_front_voisin(2)==NULL))
388     refresh();
389     }
390    
391     }
392     clock_t cpu2=clock(); //debug
393     cpu[2]=cpu[2]+(cpu2-cpu1)/CLK_TCK; //debug
394     nbfois[2]++; //debug
395     }
396    
397    
398    
399     // FONCTIONS GERANT L ENTITE FRONT (ajout suppression et tout le bordel)
400     MG_FRONT_3D* MAILLEUR3D::ajouter_front_courant(int numero_front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_TRIANGLE* triangle)
401     {
402     int numfront;
403     if (numero_front==NONFORCE)
404     {
405     numfront=(int)(triangle->get_longueur()/distance_maximale*10.);
406     if (numfront>10) numfront=10;
407     }
408     else numfront=numero_front;
409     MG_FRONT_3D* mgfront;
410     if (numfront>11) mgfront=ajouter_front(front_attente,noeud1,noeud2,noeud3,triangle);
411     else mgfront=ajouter_front(front_courant[numfront],noeud1,noeud2,noeud3,triangle);
412     mgfront->changer_numero_front(numfront);
413     if (triangle->get_type_entite()==IDM3D_TRIANGLE)
414     {
415     M3D_TRIANGLE* mtri=(M3D_TRIANGLE*)triangle;
416     mtri->change_etat_front(FRONT_ACTIF);
417     mtri->change_mgfront(mgfront);
418     }
419     return mgfront;
420     }
421    
422     MG_FRONT_3D* MAILLEUR3D::ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_TRIANGLE* triangle)
423     {
424     MG_FRONT_3D* ft=new MG_FRONT_3D(noeud1,noeud2,noeud3,triangle);
425     ajouter_front(front,ft);
426     octree_de_front->inserer(ft);
427     return ft;
428     }
429    
430     void MAILLEUR3D::ajouter_front(FRONT& front,MG_FRONT_3D *ft)
431     {
432     std::pair<const double,MG_FRONT_3D*> tmp(ft->get_triangle()->get_longueur(),ft);
433     front.insert(tmp);
434     }
435    
436     MG_FRONT_3D* MAILLEUR3D::get_front(FRONT& front,unsigned int num)
437     {
438     FRONT::iterator i=front.begin();
439     for (unsigned long j=0;j<num;j++) i++;
440     return ((*i).second);
441     }
442    
443    
444     unsigned int MAILLEUR3D::get_nb_front(FRONT& front)
445     {
446     return front.size();
447     }
448    
449     unsigned int MAILLEUR3D::get_nb_front_courant(void)
450     {
451    
452     return front_courant[0].size()+front_courant[1].size()+front_courant[2].size()+front_courant[3].size()+front_courant[4].size()+front_courant[5].size()+front_courant[6].size()+front_courant[7].size()+front_courant[8].size()+front_courant[9].size()+front_courant[10].size();
453     }
454    
455     void MAILLEUR3D::supprimer_front_en_avancant(MG_FRONT_3D* ft)
456     {
457     supprimer_front_en_avancant_sans_delete(ft);
458     delete ft;
459     }
460    
461     void MAILLEUR3D::supprimer_front_en_avancant_sans_delete(MG_FRONT_3D* ft)
462     {
463     octree_de_front->supprimer(ft);
464     int numfront=ft->get_numero_front();
465     FRONT* front_original;
466     if (numfront==ATTENTE)
467     front_original=&front_attente;
468     else
469     front_original=front_courant+numfront;
470     FRONT::iterator j=front_original->lower_bound(ft->get_triangle()->get_longueur());
471     while (ft!=(*j).second) j++;
472     front_original->erase(j);
473     MG_TRIANGLE* mgtri=ft->get_triangle();
474     if (mgtri->get_type_entite()==IDM3D_TRIANGLE)
475     {
476     M3D_TRIANGLE* m3dtri=(M3D_TRIANGLE*)mgtri;
477     m3dtri->change_etat_front(FRONT_PASSE);
478     m3dtri->change_mgfront(NULL);
479     }
480     }
481    
482     void MAILLEUR3D::supprimer_front_en_reculant(MG_FRONT_3D* ft)
483     {
484     octree_de_front->supprimer(ft);
485     int numfront=ft->get_numero_front();
486     FRONT* front_original;
487     if (numfront==ATTENTE)
488     front_original=&front_attente;
489     else
490     front_original=front_courant+numfront;
491     FRONT::iterator j=front_original->lower_bound(ft->get_triangle()->get_longueur());
492     while (ft!=(*j).second) j++;
493     front_original->erase(j);
494     MG_TRIANGLE* mgtri=ft->get_triangle();
495     if (mgtri->get_type_entite()==IDM3D_TRIANGLE)
496     {
497     M3D_TRIANGLE* m3dtri=(M3D_TRIANGLE*)mgtri;
498     m3dtri->change_etat_front(FRONT_NONACTIF);
499     m3dtri->change_mgfront(NULL);
500     }
501     delete ft;
502     }
503    
504     void MAILLEUR3D::echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_3D* ft)
505     {
506     FRONT::iterator j=front_original.lower_bound(ft->get_triangle()->get_longueur());
507     while (ft!=(*j).second) j++;
508     front_original.erase(j);
509     ajouter_front(front_destination,ft);
510     }
511    
512     void MAILLEUR3D::echange_de_front(MG_FRONT_3D* ft,int num)
513     {
514     int numfront;
515     if (num==NONFORCE)
516     {
517     numfront=(int)(ft->get_triangle()->get_longueur()/distance_maximale*10.);
518     if (numfront>10) numfront=10;
519     }
520     else if (num==ATTENTE) numfront=ATTENTE;
521     else numfront=num;
522     if (numfront>10) numfront=ATTENTE;
523     FRONT* front_original;
524     int num_front_original=ft->get_numero_front();
525     if (num_front_original==ATTENTE)
526     front_original=&front_attente;
527     else
528     front_original=front_courant+num_front_original;
529     FRONT* front_destination;
530     if (numfront==ATTENTE)
531     front_destination=&front_attente;
532     else
533     front_destination=front_courant+numfront;
534    
535    
536    
537     FRONT::iterator j=front_original->lower_bound(ft->get_triangle()->get_longueur());
538     while (ft!=(*j).second) j++;
539     front_original->erase(j);
540     ft->changer_numero_front(numfront);
541     ajouter_front(*front_destination,ft);
542    
543     }
544    
545    
546     void MAILLEUR3D::swap_front(FRONT& front_original,FRONT& front_destination)
547     {
548     front_original.swap(front_destination);
549     }
550    
551    
552    
553     int MAILLEUR3D::premier_front_courant(void)
554     {
555     int num=-1;
556     if (front_courant[0].size()>0) num=0;
557     else if (front_courant[1].size()>0) num=1;
558     else if (front_courant[2].size()>0) num=2;
559     else if (front_courant[3].size()>0) num=3;
560     else if (front_courant[4].size()>0) num=4;
561     else if (front_courant[5].size()>0) num=5;
562     else if (front_courant[6].size()>0) num=6;
563     else if (front_courant[7].size()>0) num=7;
564     else if (front_courant[8].size()>0) num=8;
565     else if (front_courant[9].size()>0) num=9;
566     else if (front_courant[10].size()>0) num=10;
567     return num;
568     }
569    
570    
571    
572     void MAILLEUR3D::active_log(char* nomfile)
573     {
574     activelog=1;
575     nomlog=nomfile;
576     }
577    
578     void MAILLEUR3D::desactive_log(void)
579     {
580     activelog=0;
581     }
582    
583 francois 287 void MAILLEUR3D::change_niveau_optimisation(int num)
584     {
585     niveau_optimisation=num;
586     }
587 francois 283
588 francois 287 int MAILLEUR3D::get_niveau_optimisation(void)
589     {
590     return niveau_optimisation;
591     }
592 francois 283