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 |
francois |
632 |
#include "mg_geometrie.h" |
46 |
francois |
283 |
#include "mg_maillage.h" |
47 |
|
|
#include "mg_face.h" |
48 |
|
|
#include "mailleur.h" |
49 |
francois |
632 |
#include "tpl_octree.h" |
50 |
francois |
283 |
#include "tpl_liste_entite.h" |
51 |
francois |
632 |
#include "fct_taille.h" |
52 |
francois |
283 |
|
53 |
|
|
|
54 |
|
|
#define CAS_FRONT_3 1 |
55 |
|
|
#define CAS_FRONT_4 2 |
56 |
|
|
#define CAS_FERME_CAVITE_P 3 |
57 |
|
|
#define CAS_FERME_CAVITE_S 4 |
58 |
|
|
#define CAS_FERME_CAVITE 5 |
59 |
|
|
#define CAS_GENERAL 6 |
60 |
|
|
|
61 |
|
|
#define PASTROUVE 10 |
62 |
|
|
#define TROUVE 11 |
63 |
|
|
|
64 |
|
|
#define TOUS_SEGMENT 20 |
65 |
|
|
#define TOUS_FRONT 21 |
66 |
|
|
#define RIEN 22 |
67 |
|
|
|
68 |
|
|
#define NOEUD_CREE 30 |
69 |
|
|
#define FRONT_RENCONTRE 31 |
70 |
|
|
#define ERREUR 32 |
71 |
|
|
|
72 |
francois |
632 |
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
francois |
283 |
class DLLPORTMAIL MAILLEUR2D:public MAILLEUR |
77 |
|
|
{ |
78 |
|
|
public : |
79 |
|
|
typedef std::multimap<double,MG_FRONT_2D*,std::less<double> > FRONT; |
80 |
|
|
|
81 |
francois |
447 |
|
82 |
francois |
446 |
MAILLEUR2D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,FCT_TAILLE* fct_taille,MG_FACE* mgface=NULL); |
83 |
francois |
283 |
~MAILLEUR2D(); |
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
void maille(MG_GROUPE_TOPOLOGIQUE* mggt=NULL); |
88 |
|
|
void maille(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg=NULL,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri=NULL); |
89 |
francois |
447 |
void change_niveau_optimisation(int num); |
90 |
|
|
int get_niveau_optimisation(void); |
91 |
francois |
283 |
|
92 |
|
|
|
93 |
|
|
private : |
94 |
francois |
446 |
|
95 |
francois |
283 |
|
96 |
|
|
void initialise_frontiere(MG_FACE* mgface); |
97 |
francois |
632 |
void cree_ntree(MG_FACE* mgface); |
98 |
francois |
283 |
void initialise_front(MG_FACE* mgface); |
99 |
|
|
void progresse_front(MG_FACE* mgface); |
100 |
|
|
|
101 |
francois |
447 |
|
102 |
francois |
283 |
void insere_contrainte_segment(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg); |
103 |
|
|
void insere_contrainte_triangle(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri); |
104 |
|
|
|
105 |
|
|
int traite_front(int type_front,MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
106 |
|
|
int traite_front_cas_front_3(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
107 |
|
|
int traite_front_cas_front_4(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
108 |
|
|
int traite_front_cas_ferme_cavite(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
109 |
|
|
int traite_front_cas_ferme_cavite_p(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
110 |
|
|
int traite_front_cas_ferme_cavite_s(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
111 |
|
|
int traite_front_cas_general(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
112 |
|
|
|
113 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_TRIANGLE *triangle); |
114 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_NOEUD *noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
115 |
|
|
int triangle_est_dans_bon_sens(MG_FACE* face,MG_NOEUD* noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
116 |
|
|
int genere_noeud(MG_FACE* mgface,MG_FRONT_2D* front,MG_FRONT_2D **front_rencontre,MG_NOEUD **noeud); |
117 |
|
|
int insere_segment(MG_FACE *mgface,MG_SEGMENT **nv_segment,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int type_verication); |
118 |
|
|
void supprime_segment(MG_SEGMENT* mgsegment); |
119 |
|
|
MG_TRIANGLE* insere_triangle(MG_ELEMENT_TOPOLOGIQUE* topo,class MG_NOEUD *mgnoeud1,class MG_NOEUD *mgnoeud2,class MG_NOEUD *mgnoeud3); |
120 |
|
|
|
121 |
francois |
447 |
|
122 |
francois |
283 |
int intersection_segment_segment(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4); |
123 |
|
|
int examine_solution(double sol1,double sol2,int type); |
124 |
|
|
|
125 |
francois |
532 |
|
126 |
|
|
|
127 |
francois |
283 |
MG_FRONT_2D* ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_SEGMENT* segment); |
128 |
|
|
void ajouter_front(FRONT& front,MG_FRONT_2D *ft); |
129 |
|
|
MG_FRONT_2D* get_front(FRONT& front,unsigned int num); |
130 |
|
|
unsigned int get_nb_front(FRONT& front); |
131 |
|
|
void supprimer_front(MG_FRONT_2D* ft); |
132 |
|
|
void echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_2D* ft); |
133 |
|
|
|
134 |
|
|
|
135 |
|
|
MG_MAILLAGE* mg_maillage; |
136 |
|
|
MG_GEOMETRIE* mg_geometrie; |
137 |
|
|
MG_FACE* mg_face; |
138 |
|
|
FCT_TAILLE *metrique; |
139 |
|
|
double periode_u; |
140 |
|
|
double periode_v; |
141 |
francois |
447 |
int niveau_optimisation; |
142 |
francois |
283 |
OT_DECALAGE_PARAMETRE *decalage; |
143 |
|
|
|
144 |
|
|
TPL_LISTE_ENTITE<MG_SEGMENT*> segment_frontiere; |
145 |
|
|
TPL_LISTE_ENTITE<MG_NOEUD*> noeud_frontiere; |
146 |
francois |
632 |
TPL_NTREE_FCT<MG_SEGMENT*,FCT_TAILLE> *ntree_de_segment; |
147 |
|
|
TPL_OCTREE<MG_FRONT_2D*,MG_NOEUD*> *ntree_de_front; |
148 |
francois |
283 |
FRONT front_courant; |
149 |
|
|
FRONT front_attente; |
150 |
francois |
632 |
double umin,vmin,umax,vmax; |
151 |
francois |
447 |
|
152 |
francois |
632 |
|
153 |
francois |
283 |
}; |
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
#endif |