ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mailleur/src/mailleur3d.h
Revision: 421
Committed: Thu Sep 12 22:59:50 2013 UTC (11 years, 11 months ago) by francois
Content type: text/plain
File size: 9452 byte(s)
Log Message:
Suite mise a jour precedente sur le mailleur3d d'enveloppe triangulee

File Contents

# Content
1 //------------------------------------------------------------
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.h
16 //
17 //------------------------------------------------------------
18 //------------------------------------------------------------
19 // COPYRIGHT 2000
20 // Version du 02/03/2006 �11H23
21 //------------------------------------------------------------
22 //------------------------------------------------------------
23
24 #ifndef mailleur3dH
25 #define mailleur3dH
26
27
28
29 #ifdef WINDOWS_VERSION
30 #ifdef BUILT_DLL_MAILLEUR
31 #define DLLPORTMAIL __declspec(dllexport)
32 #else
33 #define DLLPORTMAIL __declspec(dllimport)
34 #endif
35 #else
36 #define DLLPORTMAIL
37 #endif
38
39
40
41 #ifdef BORLANDCPP
42 #include <map.h>
43 #else
44 #include <map>
45 #define CLK_TCK CLOCKS_PER_SEC
46 #endif
47
48 #include <vector>
49 #include "mailleur.h"
50 #include "mg_front_3D.h"
51 #include "mg_maillage.h"
52 #include "mg_geometrie.h"
53 #include "mg_volume.h"
54 #include "fct_taille_volume.h"
55 #include "fct_generateur_3D.h"
56 #include "tpl_octree.h"
57
58
59 const unsigned int NONFORCE=159;
60 const unsigned int ATTENTE=160;
61 const unsigned int PRIORITAIRE=160;
62
63 const unsigned int GENERATION_NOEUD=505;
64 const unsigned int NOEUD_EXISTANT=506;
65 const unsigned int FACE_EXISTANTE=506;
66
67 const unsigned int EXISTE=700;
68 const unsigned int MULTIEXISTE=701;
69 const unsigned int CREATION=702;
70
71 const unsigned int FRONTAL=1000;
72 const unsigned int OCTAL=1001;
73
74 const unsigned int TOUTDETRUIRE=2000;
75 const unsigned int LIMITEDETRUIRE=2001;
76
77
78
79 class DLLPORTMAIL MAILLEUR3D:public MAILLEUR
80 {
81 public:
82
83
84
85
86
87 MAILLEUR3D(MG_MAILLAGE* mgmai,MG_GEOMETRIE *mggeo,MG_VOLUME* mgvol=NULL,FCT_TAILLE* fct_taille=NULL,int destruction=TOUTDETRUIRE);
88 MAILLEUR3D(FCT_GENERATEUR_3D<4> *carte,MG_MAILLAGE* mgmai,class OT_CPU* comp=NULL,int destruction=TOUTDETRUIRE);
89 virtual ~MAILLEUR3D();
90
91 virtual void maille(MG_GROUPE_TOPOLOGIQUE* mggt=NULL);
92 virtual void maille(MG_VOLUME* mgvol,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri=NULL,TPL_LISTE_ENTITE<MG_TETRA*> *lsttet=NULL);
93
94
95 virtual void active_log(char* nomfile);
96 virtual void desactive_log(void);
97 virtual void analyse_maillage_obtenu(double &vol);
98 virtual void change_niveau_optimisation(int num);
99 virtual int get_niveau_optimisation(void);
100 virtual void change_coef(double val);
101 virtual void verifie_conformite_octale(MG_MAILLAGE* mai,MG_MAILLAGE* maisur);
102
103 protected:
104 typedef std::multimap<double,MG_FRONT_3D*,std::less<double> > FRONT;
105 virtual void maille(FCT_GENERATEUR_3D<4> *carte);
106
107 virtual void insere_contrainte_tetra(MG_VOLUME* mgvol,TPL_LISTE_ENTITE<MG_TETRA*> *lsttet);
108 virtual void insere_contrainte_triangle(MG_VOLUME* mgvol,TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttri);
109
110
111
112 virtual void cree_octree(void);
113 virtual void initialise_front(MG_VOLUME* mgvol);
114 virtual void cree_front(MG_VOLUME* mgvol);
115 virtual void recherche_voisin_front(void);
116 virtual void progresse_front(MG_VOLUME* mgvol);
117 virtual int genere_noeud(MG_VOLUME* mgvol,MG_FRONT_3D* ft,TPL_MAP_ENTITE<MG_NOEUD*> &liste_noeud,std::vector<class CAS_FRONT*> &liste_cas);
118 virtual void detruit_element_inactif(void);
119
120 virtual int traite_front(class MG_VOLUME* mgvol,int type,MG_FRONT_3D* ft,std::vector<class CAS_FRONT*>& liste_cas,std::vector<class CAS_FRONT*>& liste_classe_cas,class CAS_FRONT **cas);
121 virtual int traite_front_adjacent3(class MG_VOLUME* mgvol,MG_FRONT_3D* ft,std::vector<CAS_FRONT*> &liste_cas,std::vector<CAS_FRONT*> &liste_classe_cas,CAS_FRONT **cas);
122 virtual int traite_front_adjacent2(class MG_VOLUME* mgvol,MG_FRONT_3D* ft,std::vector<CAS_FRONT*> &liste_cas,std::vector<CAS_FRONT*> &liste_classe_cas,CAS_FRONT **cas);
123 virtual int traite_front_adjacent1(class MG_VOLUME* mgvol,MG_FRONT_3D* ft,std::vector<CAS_FRONT*> &liste_cas,std::vector<CAS_FRONT*> &liste_classe_cas,CAS_FRONT **cas);
124 virtual int traite_front_lie(class MG_VOLUME* mgvol,MG_FRONT_3D* ft,std::vector<CAS_FRONT*> &liste_cas,std::vector<CAS_FRONT*> &liste_classe_cas,CAS_FRONT **cas);
125 virtual int traite_front_general(class MG_VOLUME* mgvol,MG_FRONT_3D* ft,std::vector<CAS_FRONT*> &liste_cas,std::vector<CAS_FRONT*> &liste_classe_cas,CAS_FRONT **cas);
126
127 virtual int traite_destruction(MG_FRONT_3D* ft,TPL_MAP_ENTITE<class MG_TRIANGLE*>& liste_intersection);
128 virtual void detruit_tetra(MG_TRIANGLE* tri);
129
130 virtual class MG_FRONT_3D* mise_a_jour_front(MG_TETRA* tet,int cote,int numfront=ATTENTE);
131 virtual void mise_a_jour_voisin_front(MG_FRONT_3D* ft);
132
133 virtual int test_front(void);
134 virtual void genere_log(int fincouche);
135 virtual void ini_log(void);
136 virtual void fin_log(void);
137
138
139 virtual double angle_front(MG_FRONT_3D* ft1,MG_FRONT_3D* ft2);
140 virtual double angle_front(MG_FRONT_3D* ft1,MG_SEGMENT* seg);
141 virtual double evaluer_distance_noeud_triangle(double x,double y,double z,MG_TRIANGLE* tri);
142 virtual void insere_cas_front(int type,MG_NOEUD* noeud,int numero_cote,double angle,std::vector<CAS_FRONT*>& liste_cas);
143 virtual void efface_cas_front(std::vector<CAS_FRONT*>& liste_cas,std::vector<CAS_FRONT*> liste_classe_cas[8]);
144
145 virtual int inter_tetra_triangle(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4,MG_NOEUD* noeud5,MG_NOEUD* noeud6,MG_NOEUD* noeud7);
146 virtual int inter_triangle_triangle(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4,MG_NOEUD* noeud5,MG_NOEUD* noeud6);
147 virtual int inter_segment_triangle(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4,MG_NOEUD* noeud5);
148 virtual int inter_segment_segment(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4);
149 virtual int examine_solution(double sol1,double sol2,int type);
150 virtual int noeud_est_triangle(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,double x,double y,double z);
151
152
153 virtual double calcule_volume(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4);
154 virtual double calcule_longueur_caracteristique(MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3=NULL,MG_NOEUD* noeud4=NULL);
155
156
157 virtual class MG_TETRA* insere_tetra(class MG_VOLUME* mgvol,class MG_FRONT_3D* ft,MG_NOEUD* noeud4,int type,TPL_MAP_ENTITE<class MG_TRIANGLE*>& liste_intersection);
158 virtual class MG_TRIANGLE* insere_triangle(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,int origine);
159 virtual class MG_SEGMENT* insere_segment(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int origine);
160 virtual class MG_TETRA* cree_tetra(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4,MG_TRIANGLE* triangle1,MG_TRIANGLE* triangle2,MG_TRIANGLE* triangle3,MG_TRIANGLE* triangle4,int origine);
161 virtual class MG_TRIANGLE* cree_triangle(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_SEGMENT* segment1,MG_SEGMENT* segment2,MG_SEGMENT* segment3,int origine);
162 virtual class MG_SEGMENT* cree_segment(class MG_VOLUME* mgvol,MG_NOEUD* noeud1,MG_NOEUD* noeud2,int origine);
163
164 virtual void insere_tetra(MG_MAILLAGE* mai,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_NOEUD* noeud4);
165
166
167
168 virtual MG_FRONT_3D* ajouter_front_courant(int numero_front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_TRIANGLE* triangle);
169 virtual MG_FRONT_3D* ajouter_front(FRONT& front,MG_NOEUD* noeud1,MG_NOEUD* noeud2,MG_NOEUD* noeud3,MG_TRIANGLE* triangle);
170 virtual void ajouter_front(FRONT& front,MG_FRONT_3D *ft);
171 virtual MG_FRONT_3D* get_front(FRONT& front,unsigned int num);
172 virtual unsigned int get_nb_front(FRONT& front);
173 virtual unsigned int get_nb_front_courant(void);
174 virtual void supprimer_front_en_avancant(MG_FRONT_3D* ft);
175 virtual void supprimer_front_en_avancant_sans_delete(MG_FRONT_3D* ft);
176 virtual void supprimer_front_en_reculant(MG_FRONT_3D* ft);
177 virtual void echange_de_front(FRONT& front_original,FRONT& front_destination,MG_FRONT_3D* ft);
178 virtual void echange_de_front(MG_FRONT_3D* ft,int num);
179 virtual void swap_front(FRONT& front_original,FRONT& front_destination);
180 virtual int premier_front_courant(void);
181
182 virtual double calcul_distance_metrique(MG_SEGMENT* seg,int pas=32);
183 virtual double calcul_distance_metrique(double *xyz1,double* xyz2,int pas=32);
184 virtual void ajuste_distance_metrique(double *xyz1,double *xyz2,double longueur_desiree,int pas=32);
185 virtual double calcul_volume_tetra_metrique(MG_TETRA* tet);
186
187
188
189
190
191
192 MG_MAILLAGE* mg_maillage;
193 MG_GEOMETRIE* mg_geometrie;
194 MG_VOLUME* mg_volume;
195 FCT_TAILLE *metrique;
196 int type_mailleur;
197
198 FRONT front_courant[11];
199 FRONT front_attente;
200
201 int activelog;
202 std::string nomlog;
203
204 TPL_OCTREE_FCT<MG_FRONT_3D*,FCT_GENERATEUR_3D<4> > *octree_de_front;
205
206
207 int niveau_optimisation;
208 int typedestruction;
209 FILE* inlog;
210 double coef;
211 };
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227 //---------------------------------------------------------------------------
228 #endif