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 |
//####// mailleur2d.h |
15 |
//####// |
16 |
//####//------------------------------------------------------------ |
17 |
//####//------------------------------------------------------------ |
18 |
//####// COPYRIGHT 2000-2024 |
19 |
//####// jeu 13 jun 2024 11:58:56 EDT |
20 |
//####//------------------------------------------------------------ |
21 |
//####//------------------------------------------------------------ |
22 |
#ifndef _MAILLEUR2D_ |
23 |
#define _MAILLEUR2D_ |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
#include <map> |
30 |
|
31 |
|
32 |
#include "mg_front_2D.h" |
33 |
#include "ot_decalage_parametre.h" |
34 |
#include "mg_geometrie.h" |
35 |
#include "mg_maillage.h" |
36 |
#include "mg_face.h" |
37 |
#include "mailleur.h" |
38 |
#include "tpl_octree.h" |
39 |
#include "tpl_liste_entite.h" |
40 |
#include "fct_taille.h" |
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
class MAILLEUR2D:public MAILLEUR |
50 |
{ |
51 |
public : |
52 |
typedef std::multimap<double,MG_FRONT_2D*,std::less<double> > FRONT; |
53 |
|
54 |
|
55 |
MAILLEUR2D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,FCT_TAILLE* fct_taille,MG_FACE* mgface=NULL); |
56 |
~MAILLEUR2D(); |
57 |
|
58 |
|
59 |
|
60 |
int maille(MG_GROUPE_TOPOLOGIQUE* mggt=NULL); |
61 |
int maille(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg=NULL,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri=NULL); |
62 |
void change_niveau_optimisation(int num); |
63 |
int get_niveau_optimisation(void); |
64 |
|
65 |
|
66 |
private : |
67 |
|
68 |
|
69 |
void initialise_frontiere(MG_FACE* mgface); |
70 |
void cree_ntree(MG_FACE* mgface); |
71 |
void initialise_front(MG_FACE* mgface,TPL_MAP_ENTITE<MG_SOMMET*> &liste_pole); |
72 |
int progresse_front(MG_FACE* mgface); |
73 |
void traite_pole(MG_FACE* mgface,TPL_MAP_ENTITE<MG_SOMMET*> &liste_pole); |
74 |
|
75 |
void verifie_coin_sommet(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lstaffectecoin); |
76 |
|
77 |
void insere_contrainte_segment(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg); |
78 |
void insere_contrainte_triangle(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri); |
79 |
|
80 |
int traite_front(int type_front,MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
81 |
int traite_front_cas_front_3(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
82 |
int traite_front_cas_front_4(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
83 |
int traite_front_cas_ferme_cavite(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
84 |
int traite_front_cas_ferme_cavite_p(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
85 |
int traite_front_cas_ferme_cavite_s(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
86 |
int traite_front_cas_general(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
87 |
|
88 |
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_TRIANGLE *triangle); |
89 |
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_NOEUD *noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
90 |
int triangle_est_dans_bon_sens(MG_FACE* face,MG_NOEUD* noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
91 |
int genere_noeud(MG_FACE* mgface,MG_FRONT_2D* front,MG_FRONT_2D **front_rencontre,MG_NOEUD **noeud); |
92 |
int insere_segment(MG_FACE *mgface,MG_SEGMENT **nv_segment,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int type_verication); |
93 |
void supprime_segment(MG_SEGMENT* mgsegment); |
94 |
MG_TRIANGLE* insere_triangle(MG_ELEMENT_TOPOLOGIQUE* topo,class MG_NOEUD *mgnoeud1,class MG_NOEUD *mgnoeud2,class MG_NOEUD *mgnoeud3); |
95 |
|
96 |
|
97 |
int intersection_segment_segment(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4); |
98 |
int examine_solution(double sol1,double sol2,int type); |
99 |
|
100 |
|
101 |
|
102 |
MG_FRONT_2D* ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_SEGMENT* segment); |
103 |
void ajouter_front(FRONT& front,MG_FRONT_2D *ft); |
104 |
MG_FRONT_2D* get_front(FRONT& front,unsigned int num); |
105 |
unsigned int get_nb_front(FRONT& front); |
106 |
void supprimer_front(MG_FRONT_2D* ft); |
107 |
void echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_2D* ft); |
108 |
void enregistre_front(char *nom,int dimension=3); |
109 |
|
110 |
MG_MAILLAGE* mg_maillage; |
111 |
MG_GEOMETRIE* mg_geometrie; |
112 |
MG_FACE* mg_face; |
113 |
FCT_TAILLE *metrique; |
114 |
double periode_u; |
115 |
double periode_v; |
116 |
int niveau_optimisation; |
117 |
OT_DECALAGE_PARAMETRE *decalage; |
118 |
|
119 |
TPL_LISTE_ENTITE<MG_SEGMENT*> segment_frontiere; |
120 |
TPL_LISTE_ENTITE<MG_NOEUD*> noeud_frontiere; |
121 |
TPL_NTREE_FCT<MG_SEGMENT*,FCT_TAILLE> *ntree_de_segment; |
122 |
TPL_OCTREE<MG_FRONT_2D*,MG_NOEUD*> *ntree_de_front; |
123 |
FRONT front_courant; |
124 |
FRONT front_attente; |
125 |
double umin,vmin,umax,vmax; |
126 |
|
127 |
|
128 |
}; |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
#endif |