1 |
francois |
283 |
//------------------------------------------------------------ |
2 |
|
|
//------------------------------------------------------------ |
3 |
|
|
// MAGiC |
4 |
|
|
// Jean Christophe Cuilli�re et Vincent FRANCOIS |
5 |
|
|
// D�partement de G�nie M�canique - UQTR |
6 |
|
|
//------------------------------------------------------------ |
7 |
|
|
// Le projet MAGIC est un projet de recherche du d�partement |
8 |
|
|
// de g�nie m�canique de l'Universit� du Qu�bec � |
9 |
|
|
// Trois Rivi�res |
10 |
|
|
// Les librairies ne peuvent �tre utilis�es sans l'accord |
11 |
|
|
// des auteurs (contact : francois@uqtr.ca) |
12 |
|
|
//------------------------------------------------------------ |
13 |
|
|
//------------------------------------------------------------ |
14 |
|
|
// |
15 |
|
|
// mailleur2d.h |
16 |
|
|
// |
17 |
|
|
//------------------------------------------------------------ |
18 |
|
|
//------------------------------------------------------------ |
19 |
|
|
// COPYRIGHT 2000 |
20 |
|
|
// Version du 02/03/2006 � 11H23 |
21 |
|
|
//------------------------------------------------------------ |
22 |
|
|
//------------------------------------------------------------ |
23 |
|
|
#ifndef _MAILLEUR2D_ |
24 |
|
|
#define _MAILLEUR2D_ |
25 |
|
|
|
26 |
|
|
#ifdef WINDOWS_VERSION |
27 |
|
|
#ifdef BUILT_DLL_MAILLEUR |
28 |
|
|
#define DLLPORTMAIL __declspec(dllexport) |
29 |
|
|
#else |
30 |
|
|
#define DLLPORTMAIL __declspec(dllimport) |
31 |
|
|
#endif |
32 |
|
|
#else |
33 |
|
|
#define DLLPORTMAIL |
34 |
|
|
#endif |
35 |
|
|
|
36 |
|
|
|
37 |
|
|
#ifdef BORLANDCPP |
38 |
|
|
#include <map.h> |
39 |
|
|
#else |
40 |
|
|
#include <map> |
41 |
|
|
#endif |
42 |
|
|
|
43 |
|
|
#include "mg_front_2D.h" |
44 |
|
|
#include "ot_decalage_parametre.h" |
45 |
|
|
#include "mg_noeud.h" |
46 |
|
|
#include "mg_segment.h" |
47 |
|
|
#include "mg_maillage.h" |
48 |
|
|
#include "mg_geometrie.h" |
49 |
|
|
#include "mg_face.h" |
50 |
|
|
#include "mailleur.h" |
51 |
|
|
#include "fct_taille_face.h" |
52 |
|
|
#include "tpl_quadtree.h" |
53 |
|
|
#include "tpl_liste_entite.h" |
54 |
|
|
|
55 |
|
|
|
56 |
|
|
#define CAS_FRONT_3 1 |
57 |
|
|
#define CAS_FRONT_4 2 |
58 |
|
|
#define CAS_FERME_CAVITE_P 3 |
59 |
|
|
#define CAS_FERME_CAVITE_S 4 |
60 |
|
|
#define CAS_FERME_CAVITE 5 |
61 |
|
|
#define CAS_GENERAL 6 |
62 |
|
|
|
63 |
|
|
#define PASTROUVE 10 |
64 |
|
|
#define TROUVE 11 |
65 |
|
|
|
66 |
|
|
#define TOUS_SEGMENT 20 |
67 |
|
|
#define TOUS_FRONT 21 |
68 |
|
|
#define RIEN 22 |
69 |
|
|
|
70 |
|
|
#define NOEUD_CREE 30 |
71 |
|
|
#define FRONT_RENCONTRE 31 |
72 |
|
|
#define ERREUR 32 |
73 |
|
|
|
74 |
|
|
class DLLPORTMAIL MAILLEUR2D:public MAILLEUR |
75 |
|
|
{ |
76 |
|
|
public : |
77 |
|
|
typedef std::multimap<double,MG_FRONT_2D*,std::less<double> > FRONT; |
78 |
|
|
|
79 |
francois |
447 |
|
80 |
francois |
446 |
MAILLEUR2D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,FCT_TAILLE* fct_taille,MG_FACE* mgface=NULL); |
81 |
francois |
283 |
~MAILLEUR2D(); |
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
void maille(MG_GROUPE_TOPOLOGIQUE* mggt=NULL); |
86 |
|
|
void maille(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg=NULL,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri=NULL); |
87 |
francois |
447 |
void change_niveau_optimisation(int num); |
88 |
|
|
int get_niveau_optimisation(void); |
89 |
francois |
283 |
|
90 |
|
|
|
91 |
|
|
private : |
92 |
francois |
446 |
|
93 |
francois |
283 |
|
94 |
|
|
void initialise_frontiere(MG_FACE* mgface); |
95 |
|
|
void cree_quadtree(MG_FACE* mgface); |
96 |
|
|
void initialise_front(MG_FACE* mgface); |
97 |
|
|
void progresse_front(MG_FACE* mgface); |
98 |
|
|
|
99 |
francois |
447 |
|
100 |
francois |
283 |
void insere_contrainte_segment(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg); |
101 |
|
|
void insere_contrainte_triangle(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri); |
102 |
|
|
|
103 |
|
|
int traite_front(int type_front,MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
104 |
|
|
int traite_front_cas_front_3(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
105 |
|
|
int traite_front_cas_front_4(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
106 |
|
|
int traite_front_cas_ferme_cavite(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
107 |
|
|
int traite_front_cas_ferme_cavite_p(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
108 |
|
|
int traite_front_cas_ferme_cavite_s(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
109 |
|
|
int traite_front_cas_general(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
110 |
|
|
|
111 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_TRIANGLE *triangle); |
112 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_NOEUD *noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
113 |
|
|
int triangle_est_dans_bon_sens(MG_FACE* face,MG_NOEUD* noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
114 |
|
|
int genere_noeud(MG_FACE* mgface,MG_FRONT_2D* front,MG_FRONT_2D **front_rencontre,MG_NOEUD **noeud); |
115 |
|
|
int insere_segment(MG_FACE *mgface,MG_SEGMENT **nv_segment,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int type_verication); |
116 |
|
|
void supprime_segment(MG_SEGMENT* mgsegment); |
117 |
|
|
MG_TRIANGLE* insere_triangle(MG_ELEMENT_TOPOLOGIQUE* topo,class MG_NOEUD *mgnoeud1,class MG_NOEUD *mgnoeud2,class MG_NOEUD *mgnoeud3); |
118 |
|
|
|
119 |
francois |
447 |
|
120 |
francois |
283 |
int intersection_segment_segment(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4); |
121 |
|
|
int examine_solution(double sol1,double sol2,int type); |
122 |
|
|
|
123 |
francois |
532 |
|
124 |
|
|
|
125 |
francois |
283 |
MG_FRONT_2D* ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_SEGMENT* segment); |
126 |
|
|
void ajouter_front(FRONT& front,MG_FRONT_2D *ft); |
127 |
|
|
MG_FRONT_2D* get_front(FRONT& front,unsigned int num); |
128 |
|
|
unsigned int get_nb_front(FRONT& front); |
129 |
|
|
void supprimer_front(MG_FRONT_2D* ft); |
130 |
|
|
void supprimer_front(MG_SEGMENT* segment); |
131 |
|
|
void echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_2D* ft); |
132 |
|
|
|
133 |
|
|
|
134 |
|
|
MG_MAILLAGE* mg_maillage; |
135 |
|
|
MG_GEOMETRIE* mg_geometrie; |
136 |
|
|
MG_FACE* mg_face; |
137 |
|
|
FCT_TAILLE *metrique; |
138 |
|
|
double periode_u; |
139 |
|
|
double periode_v; |
140 |
francois |
447 |
int niveau_optimisation; |
141 |
francois |
283 |
OT_DECALAGE_PARAMETRE *decalage; |
142 |
|
|
|
143 |
|
|
TPL_LISTE_ENTITE<MG_SEGMENT*> segment_frontiere; |
144 |
|
|
TPL_LISTE_ENTITE<MG_NOEUD*> noeud_frontiere; |
145 |
|
|
TPL_QUADTREE<MG_SEGMENT*,MG_NOEUD*> *quadtree_de_segment; |
146 |
|
|
TPL_QUADTREE<MG_SEGMENT*,MG_NOEUD*> *quadtree_de_frontiere; |
147 |
|
|
TPL_QUADTREE<MG_FRONT_2D*,MG_NOEUD*> *quadtree_de_front; |
148 |
|
|
FRONT front_courant; |
149 |
|
|
FRONT front_attente; |
150 |
francois |
447 |
|
151 |
|
|
|
152 |
francois |
283 |
}; |
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
#endif |