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 |
|
|
typedef std::multimap<double,class M3D_TRIANGLE*,std::less<double> > ORDRE_TRIANGLE; |
79 |
|
|
|
80 |
|
|
MAILLEUR2D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,MG_FACE* mgface=NULL,FCT_TAILLE* fct_taille=NULL); |
81 |
|
|
~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 |
|
|
|
88 |
|
|
|
89 |
|
|
private : |
90 |
|
|
int creation_metrique; |
91 |
|
|
|
92 |
|
|
void initialise_frontiere(MG_FACE* mgface); |
93 |
|
|
void cree_quadtree(MG_FACE* mgface); |
94 |
|
|
void initialise_front(MG_FACE* mgface); |
95 |
|
|
void progresse_front(MG_FACE* mgface); |
96 |
|
|
void optimise(MG_FACE* mgface); |
97 |
|
|
|
98 |
|
|
void insere_contrainte_segment(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_SEGMENT*> *lstseg); |
99 |
|
|
void insere_contrainte_triangle(MG_FACE* mgface,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri); |
100 |
|
|
|
101 |
|
|
int traite_front(int type_front,MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
102 |
|
|
int traite_front_cas_front_3(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
103 |
|
|
int traite_front_cas_front_4(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
104 |
|
|
int traite_front_cas_ferme_cavite(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
105 |
|
|
int traite_front_cas_ferme_cavite_p(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
106 |
|
|
int traite_front_cas_ferme_cavite_s(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
107 |
|
|
int traite_front_cas_general(MG_FACE *mgface,MG_FRONT_2D* ftp,MG_FRONT_2D* ft,MG_FRONT_2D* fts); |
108 |
|
|
|
109 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_TRIANGLE *triangle); |
110 |
|
|
int noeud_est_dans_triangle(MG_NOEUD* noeud,MG_NOEUD *noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
111 |
|
|
int triangle_est_dans_bon_sens(MG_FACE* face,MG_NOEUD* noeud1,MG_NOEUD *noeud2,MG_NOEUD *noeud3); |
112 |
|
|
int genere_noeud(MG_FACE* mgface,MG_FRONT_2D* front,MG_FRONT_2D **front_rencontre,MG_NOEUD **noeud); |
113 |
|
|
int insere_segment(MG_FACE *mgface,MG_SEGMENT **nv_segment,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int type_verication); |
114 |
|
|
void supprime_segment(MG_SEGMENT* mgsegment); |
115 |
|
|
MG_TRIANGLE* insere_triangle(MG_ELEMENT_TOPOLOGIQUE* topo,class MG_NOEUD *mgnoeud1,class MG_NOEUD *mgnoeud2,class MG_NOEUD *mgnoeud3); |
116 |
|
|
int bouge_point(MG_FACE* mgface,MG_NOEUD* mg_noeud,double& crit,double &u,double& v,double& x,double& y, double& z); |
117 |
|
|
|
118 |
|
|
int intersection_segment_segment(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4); |
119 |
|
|
int examine_solution(double sol1,double sol2,int type); |
120 |
|
|
|
121 |
|
|
double calcule_longueur_segment_metrique(MG_FACE* mgface,MG_SEGMENT* mgsegment); |
122 |
|
|
double calcule_distance_metrique(MG_FACE* mgface,double u1,double v1,double u2,double v2,double du,double dv); |
123 |
|
|
|
124 |
|
|
MG_FRONT_2D* ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_SEGMENT* segment); |
125 |
|
|
void ajouter_front(FRONT& front,MG_FRONT_2D *ft); |
126 |
|
|
MG_FRONT_2D* get_front(FRONT& front,unsigned int num); |
127 |
|
|
unsigned int get_nb_front(FRONT& front); |
128 |
|
|
void supprimer_front(MG_FRONT_2D* ft); |
129 |
|
|
void supprimer_front(MG_SEGMENT* segment); |
130 |
|
|
void echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_2D* ft); |
131 |
|
|
|
132 |
|
|
|
133 |
|
|
MG_MAILLAGE* mg_maillage; |
134 |
|
|
MG_GEOMETRIE* mg_geometrie; |
135 |
|
|
MG_FACE* mg_face; |
136 |
|
|
FCT_TAILLE *metrique; |
137 |
|
|
double periode_u; |
138 |
|
|
double periode_v; |
139 |
|
|
|
140 |
|
|
OT_DECALAGE_PARAMETRE *decalage; |
141 |
|
|
|
142 |
|
|
TPL_LISTE_ENTITE<MG_SEGMENT*> segment_frontiere; |
143 |
|
|
TPL_LISTE_ENTITE<MG_NOEUD*> noeud_frontiere; |
144 |
|
|
TPL_QUADTREE<MG_SEGMENT*,MG_NOEUD*> *quadtree_de_segment; |
145 |
|
|
TPL_QUADTREE<MG_SEGMENT*,MG_NOEUD*> *quadtree_de_frontiere; |
146 |
|
|
TPL_QUADTREE<MG_FRONT_2D*,MG_NOEUD*> *quadtree_de_front; |
147 |
|
|
FRONT front_courant; |
148 |
|
|
FRONT front_attente; |
149 |
|
|
ORDRE_TRIANGLE lst_tri_qual; |
150 |
|
|
ORDRE_TRIANGLE lst_tri_qual2; |
151 |
|
|
unsigned long idavantprogresse; |
152 |
|
|
}; |
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
#endif |