ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mailleur_auto/src/mailleur3d.cpp
Revision: 253
Committed: Tue Jul 13 19:40:46 2010 UTC (14 years, 10 months ago) by francois
Original Path: magic/lib/mailleur/src/mailleur3d.cpp
File size: 23752 byte(s)
Log Message:
changement de hiearchie et utilisation de ccmake + mise a jour

File Contents

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