1 |
souaissa |
66 |
//---------------------------------------------------------------------------
|
2 |
|
|
#include"gestionversion.h"
|
3 |
|
|
|
4 |
|
|
#pragma hdrstop
|
5 |
|
|
|
6 |
|
|
#include "vct_comparaison.h"
|
7 |
souaissa |
153 |
#include "vct_volume.h"
|
8 |
souaissa |
87 |
#include "vct_face.h"
|
9 |
|
|
#include "vct_surface.h"
|
10 |
francois |
169 |
#include <iomanip>
|
11 |
souaissa |
153 |
#include "vct_outils.h"
|
12 |
souaissa |
158 |
#include "constantegeo.h"
|
13 |
|
|
|
14 |
souaissa |
66 |
//---------------------------------------------------------------------------
|
15 |
|
|
|
16 |
|
|
#pragma package(smart_init)
|
17 |
|
|
|
18 |
|
|
|
19 |
francois |
102 |
VCT_COMPARAISON::VCT_COMPARAISON(MG_GESTIONNAIRE *gst1,MG_GEOMETRIE *mgeo1,MG_GESTIONNAIRE *gst2,MG_GEOMETRIE *mgeo2):mggeo1(mgeo1),mggeo2(mgeo2),gest1(gst1),gest2(gst2)
|
20 |
souaissa |
66 |
{
|
21 |
souaissa |
153 |
MG_VOLUME*vol1=mggeo1->get_mg_volume(0);
|
22 |
|
|
MG_VOLUME*vol2=mggeo2->get_mg_volume(0);
|
23 |
|
|
T1=vol1->get_vectorisation().get_matrice_transformation(2);
|
24 |
|
|
T2=vol2->get_vectorisation().get_matrice_transformation(1);
|
25 |
|
|
|
26 |
francois |
89 |
}
|
27 |
souaissa |
66 |
|
28 |
souaissa |
99 |
VCT_COMPARAISON::~VCT_COMPARAISON()
|
29 |
|
|
{
|
30 |
|
|
}
|
31 |
souaissa |
66 |
|
32 |
francois |
89 |
|
33 |
souaissa |
143 |
void VCT_COMPARAISON::compare_les_deux_geometries(int affiche_couleur)
|
34 |
souaissa |
153 |
{
|
35 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
36 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
37 |
souaissa |
66 |
|
38 |
souaissa |
87 |
for(int i=0;i<nb_face1; i++)
|
39 |
|
|
{
|
40 |
souaissa |
153 |
OT_VECTEUR_4DD Dv1,Dv2,G1,G2;
|
41 |
|
|
OT_TENSEUR V1(4),V2(4);
|
42 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
43 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
44 |
|
|
G1=surf1->get_vectorisation().calcule_barycentre(T1);
|
45 |
|
|
G1=surf1->get_vectorisation().get_nouveau_pt(T1,G1);
|
46 |
|
|
int id1=face1->get_id();
|
47 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
48 |
|
|
OT_TENSEUR ttns1_face(4),ttns1_surf(4);
|
49 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
50 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
51 |
souaissa |
87 |
|
52 |
souaissa |
153 |
face1->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
53 |
|
|
tns1_face=face1->get_vectorisation().calcule_tenseur_metrique();
|
54 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_metrique();
|
55 |
souaissa |
87 |
|
56 |
souaissa |
153 |
ttns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
57 |
|
|
ttns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
58 |
|
|
vector<double2> ifac1; vector<double2>isurf1;
|
59 |
|
|
for(int r=0;r<4;r++)
|
60 |
|
|
{
|
61 |
|
|
ifac1.insert( ifac1.end(), ttns1_face(r,r));
|
62 |
|
|
isurf1.insert( isurf1.end(), ttns1_surf(r,r));
|
63 |
|
|
}
|
64 |
|
|
int cmpt=0;
|
65 |
|
|
for(int j=0;j<nb_face2;j++)
|
66 |
|
|
{
|
67 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
68 |
|
|
MG_SURFACE*surf2=face2->get_surface();
|
69 |
|
|
G2=surf2->get_vectorisation().calcule_barycentre(T2);
|
70 |
|
|
int id2=face2->get_id();
|
71 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
72 |
|
|
OT_TENSEUR ttns2_face(4),ttns2_surf(4);
|
73 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
74 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
75 |
souaissa |
87 |
|
76 |
souaissa |
153 |
face2->get_vectorisation().calcule_axes_dinertie(T2,Dv1,V1);
|
77 |
|
|
tns2_face=face2->get_vectorisation().calcule_tenseur_metrique();
|
78 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_metrique();
|
79 |
souaissa |
87 |
|
80 |
souaissa |
153 |
ttns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
81 |
|
|
ttns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
82 |
|
|
vector<double2> ifac2; vector<double2> isurf2;
|
83 |
|
|
for(int r=0;r<4;r++)
|
84 |
|
|
{
|
85 |
|
|
ifac2.insert( ifac2.end(), ttns2_face(r,r));
|
86 |
|
|
isurf2.insert( isurf2.end(), ttns2_surf(r,r));
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
90 |
|
|
{
|
91 |
|
|
if(tns1_face.est_til_equivalent(tns2_face))
|
92 |
|
|
{
|
93 |
|
|
verifier_le_repere(V1,V2,ifac1,ifac2);
|
94 |
|
|
if(tns1_surf.est_til_equivalent(tns2_surf))
|
95 |
|
|
{
|
96 |
|
|
similarite.ajouter(id1);
|
97 |
|
|
similarite.ajouter(id2);
|
98 |
|
|
vector<unsigned int> indx1,indx2;
|
99 |
|
|
if(ttns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
100 |
|
|
{
|
101 |
|
|
if(G1==G2)
|
102 |
|
|
{
|
103 |
|
|
surf_ident.ajouter(id1);
|
104 |
|
|
surf_ident.ajouter(id2);
|
105 |
|
|
}
|
106 |
|
|
|
107 |
|
|
if(ttns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
108 |
|
|
{
|
109 |
|
|
sim_double.ajouter(id1) ;
|
110 |
|
|
sim_double.ajouter(id2) ;
|
111 |
|
|
cmpt++;
|
112 |
|
|
}
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
}
|
116 |
|
|
}
|
117 |
|
|
}
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
nb_sim.ajouter(cmpt);
|
121 |
souaissa |
87 |
}
|
122 |
souaissa |
153 |
|
123 |
|
|
if(sim_double.get_nb()==0)
|
124 |
|
|
{
|
125 |
|
|
sim_double=surf_ident;
|
126 |
|
|
}
|
127 |
|
|
if (affiche_couleur) this->affecter_les_couleurs(23);
|
128 |
|
|
}
|
129 |
souaissa |
66 |
|
130 |
|
|
|
131 |
|
|
|
132 |
souaissa |
143 |
void VCT_COMPARAISON::trouver_les_identites(int affiche_couleur)
|
133 |
souaissa |
87 |
{
|
134 |
souaissa |
142 |
|
135 |
|
|
TPL_LISTE_ENTITE<int> lst_fin;
|
136 |
souaissa |
87 |
TPL_LISTE_ENTITE<int> lst;
|
137 |
souaissa |
143 |
this->compare_les_deux_geometries(0);
|
138 |
souaissa |
99 |
int nb_face1=mggeo1->get_nb_mg_face();
|
139 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
140 |
souaissa |
90 |
|
141 |
souaissa |
87 |
|
142 |
|
|
|
143 |
|
|
|
144 |
souaissa |
99 |
this->trouve_face_de_reference(face_ref1,face_ref2);//,ls,lst_fin
|
145 |
souaissa |
87 |
|
146 |
souaissa |
153 |
OT_VECTEUR_4DD Dv,Dv1,Dv2,G1ref,G2ref,g1g2;
|
147 |
souaissa |
99 |
OT_TENSEUR V(4),V1(4),V2(4);
|
148 |
|
|
OT_VECTEUR_4DD g1_ref,g2_ref;
|
149 |
|
|
MG_FACE* face1_ref=mggeo1->get_mg_faceid(face_ref1);
|
150 |
souaissa |
153 |
//MG_SURFACE* surf1_ref=face1_ref->get_surface();
|
151 |
|
|
//G1ref= surf1_ref->get_vectorisation().calcule_barycentre(T1);
|
152 |
|
|
G1ref= face1_ref->get_vectorisation().calcule_barycentre(T1);
|
153 |
|
|
G1ref= face1_ref->get_vectorisation().get_nouveau_pt(T1,G1ref);
|
154 |
|
|
//face1_ref->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
155 |
|
|
/*
|
156 |
souaissa |
99 |
for(int r=0;r<4;r++) {
|
157 |
|
|
for(int s=0;s<4;s++) {
|
158 |
|
|
g1_ref[r]= g1_ref[r]+V1(s,r)*G1[s];
|
159 |
|
|
}
|
160 |
|
|
}
|
161 |
souaissa |
153 |
*/
|
162 |
souaissa |
99 |
|
163 |
|
|
MG_FACE* face2_ref=mggeo2->get_mg_faceid(face_ref2);
|
164 |
souaissa |
153 |
//face2_ref->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
165 |
|
|
//MG_SURFACE* surf2_ref=face2_ref->get_surface();
|
166 |
|
|
//G2ref= surf2_ref->get_vectorisation().calcule_barycentre(T2);
|
167 |
|
|
G2ref= face2_ref->get_vectorisation().calcule_barycentre(T2);
|
168 |
|
|
/*
|
169 |
souaissa |
99 |
for(int r=0;r<4;r++) {
|
170 |
|
|
for(int s=0;s<4;s++) {
|
171 |
|
|
g2_ref[r]= g2_ref[r]+V2(s,r)*G2[s];
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
souaissa |
153 |
*/
|
175 |
souaissa |
99 |
|
176 |
|
|
OT_VECTEUR_4DD g1refg1,g2refg2;
|
177 |
|
|
|
178 |
|
|
|
179 |
souaissa |
153 |
|
180 |
souaissa |
99 |
for(int i=0;i<nb_face1;i++)
|
181 |
|
|
{
|
182 |
souaissa |
153 |
|
183 |
souaissa |
99 |
OT_VECTEUR_4DD g1,G1;
|
184 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
185 |
|
|
int id1=face1->get_id();
|
186 |
souaissa |
153 |
G1= face1->get_vectorisation().calcule_barycentre(T1);
|
187 |
|
|
G1= face1->get_vectorisation().get_nouveau_pt(T1,G1);
|
188 |
|
|
/*
|
189 |
souaissa |
99 |
for(int r=0;r<4;r++) {
|
190 |
|
|
for(int s=0;s<4;s++) {
|
191 |
|
|
g1[r]= g1[r]+V1(s,r)*G1[s];
|
192 |
|
|
}
|
193 |
|
|
}
|
194 |
souaissa |
153 |
*/
|
195 |
|
|
g1refg1=G1-G1ref;
|
196 |
|
|
g1refg1=face1->get_vectorisation().get_nouveau_pt(T1,g1refg1);
|
197 |
|
|
//g1refg1=g1-g1_ref;
|
198 |
souaissa |
99 |
// num2=list.get(2*i+1);
|
199 |
|
|
for(int j=0;j<nb_face2;j++)
|
200 |
|
|
{
|
201 |
|
|
|
202 |
souaissa |
153 |
OT_VECTEUR_4DD g2,G2,g12refg2;
|
203 |
|
|
|
204 |
souaissa |
99 |
MG_FACE* face2=mggeo2->get_mg_face(j);
|
205 |
|
|
int id2=face2->get_id();
|
206 |
souaissa |
153 |
G2= face2->get_vectorisation().calcule_barycentre(T2);
|
207 |
|
|
|
208 |
|
|
/* for(int r=0;r<4;r++) {
|
209 |
souaissa |
99 |
for(int s=0;s<4;s++) {
|
210 |
|
|
g2[r]= g2[r]+V2(s,r)*G2[s];
|
211 |
|
|
}
|
212 |
|
|
}
|
213 |
souaissa |
153 |
*/
|
214 |
|
|
//OT_VECTEUR_4DD g2refg2=g2-g2_ref;
|
215 |
|
|
// g12refg2=G2-G2ref;
|
216 |
|
|
OT_VECTEUR_4DD g2refg2=G2-G2ref;
|
217 |
|
|
//OT_VECTEUR_4DD dif= g1refg1-g2refg2;
|
218 |
|
|
//double2 prec=1e-6;
|
219 |
|
|
// if(dif[0].get_fabs()<=prec&&dif[1].get_fabs()<=prec&&dif[2].get_fabs()<=prec&&dif[3].get_fabs()<=prec)
|
220 |
|
|
if(g2refg2==g1refg1)
|
221 |
souaissa |
99 |
{
|
222 |
|
|
identite.ajouter(id1);
|
223 |
|
|
identite.ajouter(id2);
|
224 |
|
|
|
225 |
|
|
break;
|
226 |
|
|
}
|
227 |
souaissa |
153 |
}
|
228 |
souaissa |
99 |
}
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
|
232 |
|
|
|
233 |
souaissa |
143 |
if(affiche_couleur) this->affecter_les_couleurs(1);
|
234 |
souaissa |
87 |
|
235 |
|
|
}
|
236 |
|
|
|
237 |
|
|
|
238 |
|
|
|
239 |
souaissa |
143 |
void VCT_COMPARAISON::compare_les_deux_geometries_vectoriellement(int affiche_couleur)
|
240 |
souaissa |
87 |
{
|
241 |
souaissa |
66 |
int nb_face1=mggeo1->get_nb_mg_face();
|
242 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
243 |
souaissa |
87 |
similarite.vide();
|
244 |
|
|
for(int i=0;i<nb_face1; i++)
|
245 |
|
|
{
|
246 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
247 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
248 |
|
|
int id1=face1->get_id();
|
249 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
250 |
|
|
OT_TENSEUR ttns1_face(4),ttns1_surf(4);
|
251 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
252 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
253 |
souaissa |
66 |
|
254 |
souaissa |
87 |
tns1_face=face1->get_vectorisation().calcule_tenseur_metrique();
|
255 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_metrique();
|
256 |
souaissa |
66 |
|
257 |
souaissa |
87 |
for(int j=0;j<nb_face2;j++)
|
258 |
|
|
{
|
259 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
260 |
|
|
MG_SURFACE*surf2=face2->get_surface();
|
261 |
|
|
int id2=face2->get_id();
|
262 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
263 |
|
|
OT_TENSEUR ttns2_face(4),ttns2_surf(4);
|
264 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
265 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
266 |
|
|
tns2_face=face2->get_vectorisation().calcule_tenseur_metrique();
|
267 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_metrique();
|
268 |
souaissa |
66 |
|
269 |
souaissa |
87 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
270 |
|
|
{
|
271 |
|
|
if(tns1_face.est_til_equivalent(tns2_face))
|
272 |
|
|
{
|
273 |
|
|
if(tns1_surf.est_til_equivalent(tns2_surf))
|
274 |
|
|
{
|
275 |
|
|
similarite.ajouter(id1);
|
276 |
|
|
similarite.ajouter(id2);
|
277 |
|
|
}
|
278 |
|
|
}
|
279 |
|
|
}
|
280 |
|
|
}
|
281 |
|
|
}
|
282 |
souaissa |
143 |
if (affiche_couleur)this->affecter_les_couleurs(21);
|
283 |
souaissa |
87 |
|
284 |
|
|
}
|
285 |
|
|
|
286 |
souaissa |
143 |
void VCT_COMPARAISON::compare_les_deux_geometries_inertiellement (int affiche_couleur)
|
287 |
souaissa |
87 |
{
|
288 |
souaissa |
153 |
|
289 |
|
|
|
290 |
souaissa |
87 |
int nb_face1=mggeo1->get_nb_mg_face();
|
291 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
292 |
|
|
ssimilarite.vide();
|
293 |
|
|
for(int i=0;i<nb_face1; i++)
|
294 |
|
|
{
|
295 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
296 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
297 |
|
|
int id1=face1->get_id();
|
298 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
299 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
300 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
301 |
|
|
|
302 |
souaissa |
153 |
tns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
303 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
304 |
souaissa |
87 |
vector<double2> ifac1; vector<double2>isurf1;
|
305 |
|
|
for(int r=0;r<4;r++)
|
306 |
|
|
{
|
307 |
|
|
ifac1.insert( ifac1.end(), tns1_face(r,r));
|
308 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
309 |
|
|
}
|
310 |
|
|
|
311 |
souaissa |
66 |
for(int j=0;j<nb_face2;j++)
|
312 |
|
|
{
|
313 |
|
|
|
314 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
315 |
souaissa |
74 |
MG_SURFACE*surf2=face2->get_surface();
|
316 |
souaissa |
66 |
int id2=face2->get_id();
|
317 |
souaissa |
74 |
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
318 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
319 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
320 |
souaissa |
153 |
tns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
321 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
322 |
souaissa |
87 |
vector<double2> ifac2; vector<double2> isurf2;
|
323 |
|
|
for(int r=0;r<4;r++)
|
324 |
|
|
{
|
325 |
|
|
ifac2.insert( ifac2.end(), tns2_face(r,r));
|
326 |
|
|
isurf2.insert( isurf2.end(), tns2_surf(r,r));
|
327 |
|
|
}
|
328 |
souaissa |
66 |
|
329 |
souaissa |
74 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
330 |
souaissa |
66 |
{
|
331 |
souaissa |
87 |
vector<unsigned int> indx1,indx2;
|
332 |
|
|
if(tns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
333 |
souaissa |
66 |
{
|
334 |
souaissa |
87 |
if(tns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
335 |
|
|
{
|
336 |
|
|
ssimilarite.ajouter(id1);
|
337 |
|
|
ssimilarite.ajouter(id2);
|
338 |
|
|
}
|
339 |
souaissa |
66 |
}
|
340 |
souaissa |
87 |
}
|
341 |
souaissa |
66 |
|
342 |
souaissa |
87 |
}
|
343 |
souaissa |
66 |
|
344 |
souaissa |
87 |
}
|
345 |
souaissa |
66 |
|
346 |
souaissa |
143 |
if (affiche_couleur)affecter_les_couleurs(22);
|
347 |
souaissa |
87 |
}
|
348 |
|
|
|
349 |
souaissa |
90 |
void VCT_COMPARAISON::compare_une_geometrie_inertiellement(int modele)
|
350 |
souaissa |
87 |
{
|
351 |
souaissa |
153 |
|
352 |
|
|
|
353 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> ssim_tmp;
|
354 |
souaissa |
87 |
|
355 |
francois |
102 |
MG_GESTIONNAIRE *gst1;
|
356 |
souaissa |
90 |
MG_GEOMETRIE *mgeo1 ;
|
357 |
|
|
int laquelle;
|
358 |
souaissa |
87 |
|
359 |
souaissa |
90 |
switch(modele)
|
360 |
|
|
{
|
361 |
|
|
case 1:
|
362 |
|
|
{
|
363 |
|
|
gst1=gest1;
|
364 |
|
|
mgeo1=mggeo1;
|
365 |
souaissa |
92 |
laquelle=31;
|
366 |
souaissa |
90 |
break;
|
367 |
|
|
}
|
368 |
|
|
case 2:
|
369 |
|
|
{
|
370 |
|
|
gst1=gest2;
|
371 |
|
|
mgeo1=mggeo2;
|
372 |
souaissa |
92 |
laquelle=32;
|
373 |
souaissa |
90 |
break;
|
374 |
|
|
}
|
375 |
souaissa |
87 |
|
376 |
|
|
}
|
377 |
souaissa |
66 |
|
378 |
souaissa |
90 |
int nb_face1=mgeo1->get_nb_mg_face();
|
379 |
souaissa |
99 |
|
380 |
souaissa |
90 |
for(int i=0;i<nb_face1; i++)
|
381 |
souaissa |
87 |
{
|
382 |
souaissa |
90 |
MG_FACE* face1=mgeo1->get_mg_face(i);
|
383 |
souaissa |
87 |
MG_SURFACE*surf1=face1->get_surface();
|
384 |
|
|
int id1=face1->get_id();
|
385 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
386 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
387 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
388 |
souaissa |
66 |
|
389 |
souaissa |
153 |
tns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
390 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
391 |
souaissa |
87 |
vector<double2> ifac1; vector<double2>isurf1;
|
392 |
|
|
for(int r=0;r<4;r++)
|
393 |
|
|
{
|
394 |
|
|
ifac1.insert( ifac1.end(), tns1_face(r,r));
|
395 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
396 |
|
|
}
|
397 |
souaissa |
66 |
|
398 |
souaissa |
90 |
for(int j=0;j<nb_face1;j++)
|
399 |
souaissa |
87 |
{
|
400 |
souaissa |
66 |
|
401 |
souaissa |
90 |
MG_FACE* face2=mgeo1->get_mg_face(j);
|
402 |
souaissa |
87 |
MG_SURFACE*surf2=face2->get_surface();
|
403 |
|
|
int id2=face2->get_id();
|
404 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
405 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
406 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
407 |
souaissa |
153 |
tns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
408 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
409 |
souaissa |
87 |
vector<double2> ifac2; vector<double2> isurf2;
|
410 |
|
|
for(int r=0;r<4;r++)
|
411 |
|
|
{
|
412 |
|
|
ifac2.insert( ifac2.end(), tns2_face(r,r));
|
413 |
|
|
isurf2.insert( isurf2.end(), tns2_surf(r,r));
|
414 |
|
|
}
|
415 |
souaissa |
66 |
|
416 |
souaissa |
87 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
417 |
|
|
{
|
418 |
|
|
vector<unsigned int> indx1,indx2;
|
419 |
|
|
if(tns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
420 |
|
|
{
|
421 |
|
|
if(tns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
422 |
|
|
{
|
423 |
souaissa |
99 |
ssim_tmp.ajouter(id1);
|
424 |
|
|
ssim_tmp.ajouter(id2);
|
425 |
souaissa |
87 |
}
|
426 |
|
|
}
|
427 |
|
|
}
|
428 |
souaissa |
66 |
|
429 |
souaissa |
87 |
}
|
430 |
|
|
|
431 |
|
|
}
|
432 |
souaissa |
99 |
if (modele==1) ssim1=ssim_tmp;
|
433 |
|
|
if (modele==2) ssim2=ssim_tmp;
|
434 |
|
|
|
435 |
souaissa |
90 |
affecter_les_couleurs(laquelle);
|
436 |
souaissa |
66 |
}
|
437 |
|
|
|
438 |
|
|
|
439 |
|
|
|
440 |
souaissa |
82 |
|
441 |
souaissa |
87 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_identitees()
|
442 |
|
|
{
|
443 |
|
|
return identite;
|
444 |
|
|
}
|
445 |
|
|
|
446 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_simalarite_vectorielle(int type_comparais)
|
447 |
souaissa |
87 |
{
|
448 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst_tmp;
|
449 |
|
|
switch ( type_comparais)
|
450 |
|
|
{
|
451 |
|
|
case 12: lst_tmp= similarite;
|
452 |
|
|
case 1: lst_tmp= sim1;
|
453 |
|
|
case 2: lst_tmp= sim2;
|
454 |
|
|
}
|
455 |
|
|
return lst_tmp;
|
456 |
souaissa |
87 |
}
|
457 |
|
|
|
458 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_simalarite_inertielle(int type_comparais)
|
459 |
souaissa |
87 |
{
|
460 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst_tmp;
|
461 |
|
|
switch ( type_comparais)
|
462 |
|
|
{
|
463 |
|
|
case 12: lst_tmp= ssimilarite;
|
464 |
|
|
case 1: lst_tmp= ssim1;
|
465 |
|
|
case 2: lst_tmp= ssim2;
|
466 |
|
|
}
|
467 |
|
|
return lst_tmp;
|
468 |
souaissa |
87 |
}
|
469 |
|
|
|
470 |
|
|
|
471 |
|
|
void VCT_COMPARAISON::affecter_les_couleurs(int niveau)
|
472 |
souaissa |
66 |
{
|
473 |
francois |
144 |
//randomize();
|
474 |
souaissa |
87 |
int nb_face_ident=similarite.get_nb()/2;
|
475 |
|
|
int nb_face_identt=ssimilarite.get_nb()/2;
|
476 |
|
|
int nb_face_iden=identite.get_nb()/2;
|
477 |
|
|
double val;
|
478 |
|
|
TPL_LISTE_ENTITE<int> lst;
|
479 |
|
|
TPL_LISTE_ENTITE<double> lst_val;
|
480 |
|
|
int num1,num2,num1_avant ;
|
481 |
francois |
144 |
if (niveau==1) //pour afficher les identites entre le deux mod�les
|
482 |
souaissa |
87 |
{
|
483 |
|
|
for(int i=0;i< nb_face_iden;i++)
|
484 |
|
|
{
|
485 |
|
|
num1=identite.get(2*i) ;
|
486 |
|
|
num2=identite.get(2*i+1) ;
|
487 |
|
|
if(i>0) num1_avant= identite.get(2*(i-1));
|
488 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(num1);
|
489 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(num2);
|
490 |
|
|
|
491 |
|
|
if(i==0)
|
492 |
|
|
{
|
493 |
|
|
choisir_une_couleur(val);
|
494 |
|
|
while(lst_val.est_dans_la_liste(val))
|
495 |
|
|
{
|
496 |
|
|
choisir_une_couleur(val);
|
497 |
|
|
}
|
498 |
|
|
face1->ajouter_ccf("Cc",val);
|
499 |
|
|
face2->ajouter_ccf("Cc",val);
|
500 |
|
|
lst_val.ajouter(val);
|
501 |
|
|
}
|
502 |
|
|
|
503 |
|
|
if(i>0)
|
504 |
|
|
{
|
505 |
|
|
if(num1!=num1_avant)
|
506 |
|
|
{
|
507 |
|
|
choisir_une_couleur(val);
|
508 |
|
|
while(lst_val.est_dans_la_liste(val))
|
509 |
|
|
{
|
510 |
|
|
choisir_une_couleur(val);
|
511 |
|
|
}
|
512 |
|
|
face1->ajouter_ccf("Cc",val);
|
513 |
|
|
face2->ajouter_ccf("Cc",val);
|
514 |
|
|
lst_val.ajouter(val);
|
515 |
|
|
}
|
516 |
|
|
else{
|
517 |
|
|
face2->ajouter_ccf("Cc",val);
|
518 |
|
|
}
|
519 |
|
|
|
520 |
|
|
}
|
521 |
|
|
}
|
522 |
|
|
|
523 |
|
|
}
|
524 |
|
|
|
525 |
francois |
144 |
if(niveau==21||niveau==22||niveau==23) //pour afficher la similarite entre le deux mod�le vectoriellement ou inertiellement
|
526 |
souaissa |
90 |
{
|
527 |
|
|
TPL_LISTE_ENTITE<int> simu;
|
528 |
|
|
if(niveau==21)simu=similarite;
|
529 |
|
|
if(niveau==22) simu=ssimilarite;
|
530 |
souaissa |
99 |
if(niveau==23) simu=sim_double;
|
531 |
souaissa |
90 |
TPL_LISTE_ENTITE<int> llst1;
|
532 |
|
|
TPL_LISTE_ENTITE<int> llst2;
|
533 |
|
|
int nb_face_sim=simu.get_nb()/2.;
|
534 |
|
|
for(int i=0;i< nb_face_sim;i++)
|
535 |
|
|
{
|
536 |
|
|
TPL_LISTE_ENTITE<int> lst1;
|
537 |
|
|
TPL_LISTE_ENTITE<int> lst2;
|
538 |
|
|
TPL_LISTE_ENTITE<int> llst3;
|
539 |
|
|
num1=simu.get(2*i) ;
|
540 |
|
|
if(!llst1.est_dans_la_liste(num1))
|
541 |
souaissa |
87 |
{
|
542 |
souaissa |
90 |
num2=simu.get(2*i+1) ;
|
543 |
|
|
lst1.ajouter(num1);
|
544 |
|
|
lst2.ajouter(num2);
|
545 |
|
|
llst1.ajouter(num1);
|
546 |
|
|
llst2.ajouter(num2);
|
547 |
|
|
for(int j=1;j< nb_face_sim;j++)
|
548 |
|
|
{
|
549 |
|
|
int Num1=simu.get(2*j) ;
|
550 |
|
|
int Num2=simu.get(2*j+1) ;
|
551 |
souaissa |
87 |
|
552 |
souaissa |
90 |
if(num1==Num1)
|
553 |
|
|
{
|
554 |
|
|
llst3.ajouter(Num2);
|
555 |
|
|
}
|
556 |
|
|
if(num2==Num2||llst3.est_dans_la_liste(Num2))
|
557 |
|
|
{
|
558 |
|
|
if(!lst1.est_dans_la_liste(Num1)) {
|
559 |
|
|
lst1.ajouter(Num1);
|
560 |
|
|
llst1.ajouter(Num1); }
|
561 |
|
|
if(!lst2.est_dans_la_liste(Num2)) {
|
562 |
|
|
lst2.ajouter(Num2);
|
563 |
|
|
llst2.ajouter(Num2); }
|
564 |
|
|
}
|
565 |
souaissa |
87 |
|
566 |
|
|
}
|
567 |
|
|
|
568 |
souaissa |
90 |
choisir_une_couleur(val);
|
569 |
|
|
while(lst_val.est_dans_la_liste(val))
|
570 |
|
|
{
|
571 |
souaissa |
87 |
choisir_une_couleur(val);
|
572 |
souaissa |
90 |
}
|
573 |
|
|
lst_val.ajouter(val);
|
574 |
|
|
int nb1=lst1.get_nb();
|
575 |
|
|
int nb2=lst2.get_nb();
|
576 |
|
|
for(int i=0;i<nb1;i++)
|
577 |
|
|
{
|
578 |
|
|
int n1=lst1.get(i);
|
579 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(n1);
|
580 |
|
|
face1->ajouter_ccf("Cc",val);
|
581 |
souaissa |
87 |
}
|
582 |
souaissa |
90 |
for(int i=0;i<nb2;i++)
|
583 |
|
|
{
|
584 |
|
|
int n2=lst2.get(i);
|
585 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(n2);
|
586 |
|
|
face2->ajouter_ccf("Cc",val);
|
587 |
|
|
}
|
588 |
|
|
|
589 |
|
|
}
|
590 |
|
|
}
|
591 |
souaissa |
87 |
|
592 |
|
|
|
593 |
|
|
}
|
594 |
|
|
|
595 |
francois |
144 |
if(niveau== 31||niveau==32) //pour afficher la similarite dans le premier mod�le ou le second modele
|
596 |
souaissa |
87 |
{
|
597 |
|
|
|
598 |
souaissa |
90 |
MG_GEOMETRIE *mgeo1 ;
|
599 |
|
|
int laquelle;
|
600 |
souaissa |
87 |
|
601 |
souaissa |
90 |
switch(niveau)
|
602 |
|
|
{
|
603 |
|
|
case 31:
|
604 |
|
|
{
|
605 |
|
|
mgeo1=mggeo1;
|
606 |
|
|
laquelle=31;
|
607 |
|
|
break;
|
608 |
souaissa |
87 |
}
|
609 |
souaissa |
90 |
case 32:
|
610 |
|
|
{
|
611 |
|
|
mgeo1=mggeo2;
|
612 |
|
|
laquelle=32;
|
613 |
|
|
break;
|
614 |
|
|
}
|
615 |
|
|
|
616 |
souaissa |
87 |
}
|
617 |
|
|
|
618 |
souaissa |
142 |
|
619 |
souaissa |
90 |
for(int i=0;i< nb_face_identt;i++)
|
620 |
souaissa |
87 |
{
|
621 |
souaissa |
90 |
num1=ssimilarite.get(2*i) ;
|
622 |
|
|
num2=ssimilarite.get(2*i+1) ;
|
623 |
souaissa |
87 |
|
624 |
souaissa |
90 |
if(i>0) num1_avant= ssimilarite.get(2*(i-1));
|
625 |
|
|
MG_FACE* face1=mgeo1->get_mg_faceid(num1);
|
626 |
|
|
MG_FACE* face2=mgeo1->get_mg_faceid(num2);
|
627 |
|
|
if(!lst.est_dans_la_liste(num2))
|
628 |
|
|
{
|
629 |
souaissa |
87 |
if(i==0)
|
630 |
|
|
{
|
631 |
|
|
choisir_une_couleur(val);
|
632 |
souaissa |
90 |
while(lst_val.est_dans_la_liste(val))
|
633 |
|
|
{
|
634 |
|
|
choisir_une_couleur(val);
|
635 |
|
|
}
|
636 |
souaissa |
87 |
face1->ajouter_ccf("Cc",val);
|
637 |
souaissa |
90 |
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
638 |
|
|
lst_val.ajouter(val);
|
639 |
souaissa |
87 |
}
|
640 |
|
|
|
641 |
|
|
if(i>0)
|
642 |
|
|
{
|
643 |
|
|
if(num1!=num1_avant)
|
644 |
|
|
{
|
645 |
souaissa |
90 |
choisir_une_couleur(val);
|
646 |
|
|
while(lst_val.est_dans_la_liste(val))
|
647 |
|
|
{
|
648 |
souaissa |
87 |
choisir_une_couleur(val);
|
649 |
souaissa |
90 |
}
|
650 |
|
|
face1->ajouter_ccf("Cc",val);
|
651 |
|
|
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
652 |
|
|
lst_val.ajouter(val);
|
653 |
souaissa |
87 |
}
|
654 |
|
|
else{
|
655 |
souaissa |
90 |
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
656 |
souaissa |
87 |
}
|
657 |
|
|
|
658 |
|
|
}
|
659 |
souaissa |
90 |
}
|
660 |
souaissa |
87 |
}
|
661 |
|
|
|
662 |
|
|
|
663 |
|
|
}
|
664 |
|
|
|
665 |
|
|
|
666 |
|
|
}
|
667 |
|
|
|
668 |
|
|
|
669 |
|
|
void VCT_COMPARAISON::choisir_une_couleur(double& val)
|
670 |
|
|
{
|
671 |
francois |
144 |
//randomize();
|
672 |
souaissa |
87 |
|
673 |
|
|
unsigned char r=rand() % 255;
|
674 |
|
|
unsigned char g=rand() % 255;
|
675 |
|
|
unsigned char b=rand() % 255;
|
676 |
|
|
val=0.;
|
677 |
|
|
unsigned char* p =(unsigned char*)&val;
|
678 |
|
|
|
679 |
|
|
*p=r;
|
680 |
|
|
p++;*p=g;
|
681 |
|
|
p++;*p=b;
|
682 |
|
|
|
683 |
|
|
}
|
684 |
|
|
|
685 |
|
|
|
686 |
souaissa |
99 |
void VCT_COMPARAISON::trouve_face_de_reference(int &face_ref1,int &face_ref2)// ,TPL_LISTE_ENTITE<int>& list
|
687 |
|
|
{
|
688 |
souaissa |
153 |
|
689 |
|
|
/*
|
690 |
souaissa |
99 |
int nb_simdble=sim_double.get_nb()/2 ;
|
691 |
|
|
|
692 |
|
|
int num1,num2 ;
|
693 |
|
|
|
694 |
|
|
|
695 |
souaissa |
87 |
OT_VECTEUR_4DD Dv,Dv1,Dv2,G1,G2,g1g2;
|
696 |
|
|
OT_TENSEUR V(4),V1(4),V2(4);
|
697 |
|
|
|
698 |
|
|
|
699 |
souaissa |
99 |
int nbsim=nb_sim.get_nb();
|
700 |
|
|
int *t=new int [nbsim];
|
701 |
|
|
int *tt=new int [nbsim];
|
702 |
|
|
for(int i=0;i<nbsim;i++)
|
703 |
|
|
{
|
704 |
souaissa |
142 |
// t[i]= nb_sim.get(i);
|
705 |
|
|
t[i]= i;
|
706 |
souaissa |
143 |
int nbre_faces_simil=nb_sim.get(i);
|
707 |
|
|
tt[i]=nbre_faces_simil;
|
708 |
souaissa |
142 |
|
709 |
souaissa |
99 |
}
|
710 |
|
|
int pos_min,pos_max;
|
711 |
|
|
int min,max;
|
712 |
|
|
int trouve=0;
|
713 |
souaissa |
142 |
|
714 |
|
|
for (int i=0;i<nbsim;i++)
|
715 |
|
|
{
|
716 |
|
|
|
717 |
|
|
for(int j=0;j<nbsim;j++)
|
718 |
|
|
{
|
719 |
|
|
if(tt[j]<tt[i])
|
720 |
|
|
{
|
721 |
|
|
int tmp= tt[i];
|
722 |
|
|
|
723 |
|
|
tt[i]= tt[j];
|
724 |
|
|
tt[j]= tmp;
|
725 |
|
|
t[i]=j;
|
726 |
|
|
t[j]=i;
|
727 |
|
|
}
|
728 |
|
|
}
|
729 |
|
|
}
|
730 |
|
|
|
731 |
souaissa |
153 |
|
732 |
souaissa |
142 |
//pos_max=t[1];
|
733 |
|
|
|
734 |
|
|
if(tt[0]==1)
|
735 |
|
|
{
|
736 |
souaissa |
153 |
pos_min=t[0];
|
737 |
souaissa |
142 |
MG_FACE* fref=mggeo1->get_mg_face(pos_min);
|
738 |
|
|
face_ref1= fref->get_id();
|
739 |
|
|
for(int i=0;i<nb_simdble;i++){
|
740 |
|
|
if (sim_double.get(2*i)==face_ref1)
|
741 |
|
|
face_ref2=sim_double.get(2*i+1);
|
742 |
|
|
}
|
743 |
|
|
return;
|
744 |
|
|
}
|
745 |
|
|
|
746 |
souaissa |
87 |
|
747 |
souaissa |
142 |
int pos1=0;
|
748 |
|
|
int pos2=0;
|
749 |
souaissa |
99 |
|
750 |
souaissa |
142 |
int tr=0;
|
751 |
|
|
trouve=0;
|
752 |
souaissa |
143 |
while(trouve==0&&tr<nbsim-1)
|
753 |
souaissa |
142 |
{
|
754 |
|
|
pos_min=t[tr];
|
755 |
|
|
pos_max=t[tr+1];
|
756 |
|
|
|
757 |
souaissa |
143 |
OT_VECTEUR_4DD g1_ref,g2_ref,G1_ref,G2_ref;
|
758 |
souaissa |
99 |
MG_FACE* face1_ref=mggeo1->get_mg_face(pos_min);
|
759 |
souaissa |
153 |
MG_SURFACE* surf1_ref=face1_ref->get_surface();
|
760 |
souaissa |
99 |
int id1=face1_ref->get_id();
|
761 |
souaissa |
153 |
face1_ref->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
762 |
|
|
G1_ref= face1_ref->get_vectorisation().calcule_barycentre(T1);
|
763 |
|
|
/*
|
764 |
souaissa |
87 |
for(int r=0;r<4;r++) {
|
765 |
|
|
for(int s=0;s<4;s++) {
|
766 |
souaissa |
143 |
g1_ref[r]= g1_ref[r]+V1(s,r)*G1_ref[s];
|
767 |
souaissa |
87 |
}
|
768 |
|
|
}
|
769 |
souaissa |
153 |
/
|
770 |
|
|
g1_ref=face1_ref->get_vectorisation().get_nouveau_pt(T1,G1_ref);
|
771 |
|
|
/* OT_TENSEUR ttns1_face=face1_ref->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
772 |
|
|
vector<double2> ifac1;
|
773 |
|
|
for(int r=0;r<4;r++)
|
774 |
|
|
{
|
775 |
|
|
ifac1.insert( ifac2.end(), ttns1_face(r,r));
|
776 |
|
|
} /
|
777 |
souaissa |
87 |
|
778 |
souaissa |
99 |
MG_FACE* face12_ref=mggeo1->get_mg_face(pos_max);
|
779 |
souaissa |
153 |
face12_ref->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
780 |
souaissa |
99 |
int id2=face12_ref->get_id();
|
781 |
souaissa |
153 |
G2_ref= face12_ref->get_vectorisation().calcule_barycentre(T2);
|
782 |
|
|
/*
|
783 |
souaissa |
87 |
for(int r=0;r<4;r++) {
|
784 |
|
|
for(int s=0;s<4;s++) {
|
785 |
souaissa |
143 |
g2_ref[r]= g2_ref[r]+V1(s,r)*G2_ref[s];
|
786 |
souaissa |
87 |
}
|
787 |
|
|
}
|
788 |
souaissa |
153 |
/
|
789 |
|
|
g2_ref=face12_ref->get_vectorisation().get_nouveau_pt(T1,G2_ref);
|
790 |
souaissa |
87 |
|
791 |
souaissa |
99 |
OT_VECTEUR_4DD g12_ref= g2_ref -g1_ref;
|
792 |
|
|
|
793 |
|
|
|
794 |
souaissa |
87 |
OT_VECTEUR_4DD g1refg1,g2refg2;
|
795 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst1,lst2;
|
796 |
|
|
for(int k=0;k<nb_simdble;k++)
|
797 |
|
|
{
|
798 |
|
|
if(sim_double.get(2*k)==id1)
|
799 |
|
|
lst1.ajouter( sim_double.get(2*k+1));
|
800 |
|
|
if(sim_double.get(2*k)==id2)
|
801 |
|
|
lst2.ajouter(sim_double.get(2*k+1));
|
802 |
|
|
}
|
803 |
souaissa |
87 |
|
804 |
souaissa |
99 |
|
805 |
|
|
|
806 |
souaissa |
142 |
|
807 |
souaissa |
99 |
for(int i=0;i<lst1.get_nb();i++)
|
808 |
souaissa |
87 |
{
|
809 |
souaissa |
99 |
|
810 |
|
|
int num1=lst1.get(i);
|
811 |
|
|
OT_VECTEUR_4DD g1,G1;
|
812 |
|
|
MG_FACE* face1=mggeo2->get_mg_faceid(num1);
|
813 |
souaissa |
153 |
face1->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
814 |
|
|
G1= face1->get_vectorisation().calcule_barycentre(T2);
|
815 |
|
|
/*
|
816 |
souaissa |
87 |
for(int r=0;r<4;r++) {
|
817 |
|
|
for(int s=0;s<4;s++) {
|
818 |
souaissa |
99 |
g1[r]= g1[r]+V2(s,r)*G1[s];
|
819 |
souaissa |
87 |
}
|
820 |
|
|
}
|
821 |
souaissa |
153 |
/
|
822 |
souaissa |
99 |
// g1refg1=g1-g1_ref;
|
823 |
|
|
// num2=list.get(2*i+1);
|
824 |
|
|
for(int j=0;j<lst2.get_nb();j++)
|
825 |
|
|
{
|
826 |
|
|
int num2=lst2.get(j);
|
827 |
souaissa |
87 |
OT_VECTEUR_4DD g2;
|
828 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(num2);
|
829 |
souaissa |
153 |
G2= face2->get_vectorisation().calcule_barycentre(T2);
|
830 |
|
|
/*
|
831 |
souaissa |
87 |
for(int r=0;r<4;r++) {
|
832 |
|
|
for(int s=0;s<4;s++) {
|
833 |
|
|
g2[r]= g2[r]+V2(s,r)*G2[s];
|
834 |
|
|
}
|
835 |
|
|
}
|
836 |
souaissa |
153 |
/
|
837 |
|
|
//OT_VECTEUR_4DD g2g1=g2-g1;
|
838 |
|
|
OT_VECTEUR_4DD g2g1=G2-G1;
|
839 |
souaissa |
99 |
if(g2g1==g12_ref)
|
840 |
souaissa |
87 |
{
|
841 |
souaissa |
99 |
// lst_fin.ajouter(num1);
|
842 |
|
|
// lst_fin.ajouter(num2);
|
843 |
|
|
face_ref1=id1;
|
844 |
|
|
face_ref2=num1;
|
845 |
|
|
trouve=1;
|
846 |
|
|
break;
|
847 |
souaissa |
87 |
}
|
848 |
souaissa |
99 |
}
|
849 |
|
|
if(trouve) break;
|
850 |
souaissa |
87 |
}
|
851 |
souaissa |
142 |
tr++;
|
852 |
|
|
}
|
853 |
souaissa |
100 |
delete [] t;
|
854 |
|
|
delete [] tt;
|
855 |
souaissa |
153 |
*/
|
856 |
souaissa |
87 |
|
857 |
souaissa |
154 |
int p=0;
|
858 |
|
|
int h=0;
|
859 |
|
|
int not_trouve=0;
|
860 |
|
|
while(!not_trouve)
|
861 |
|
|
{
|
862 |
|
|
MG_FACE* face1Ref=mggeo1->get_mg_faceid(sim_double.get(p));
|
863 |
souaissa |
153 |
MG_SURFACE* surf1Ref=face1Ref->get_surface();
|
864 |
souaissa |
154 |
OT_VECTEUR_4DD G1=surf1Ref->get_vectorisation().calcule_barycentre(T1);
|
865 |
|
|
G1= surf1Ref->get_vectorisation().get_nouveau_pt(T1,G1);
|
866 |
souaissa |
153 |
|
867 |
|
|
int idRef1=face1Ref->get_id();
|
868 |
|
|
|
869 |
|
|
int k=0;
|
870 |
souaissa |
154 |
while(idRef1==sim_double.get(2*k+h))
|
871 |
souaissa |
153 |
{
|
872 |
|
|
MG_FACE* face2Ref=mggeo2->get_mg_faceid(sim_double.get(2*k+1));
|
873 |
|
|
int idRef2=face2Ref->get_id();
|
874 |
|
|
MG_SURFACE* surf2Ref=face2Ref->get_surface();
|
875 |
souaissa |
154 |
OT_VECTEUR_4DD G2=surf2Ref->get_vectorisation().calcule_barycentre(T2);
|
876 |
souaissa |
162 |
// if (G1==G2)
|
877 |
|
|
if (surfaces_sont_elles_identiques(face1Ref,face2Ref))
|
878 |
souaissa |
153 |
{
|
879 |
|
|
face_ref1=idRef1;
|
880 |
|
|
face_ref2=idRef2;
|
881 |
souaissa |
154 |
not_trouve=1;
|
882 |
souaissa |
153 |
break;
|
883 |
|
|
}
|
884 |
|
|
k++;
|
885 |
souaissa |
154 |
p=p+2;
|
886 |
souaissa |
153 |
}
|
887 |
souaissa |
154 |
h=p;
|
888 |
souaissa |
142 |
}
|
889 |
souaissa |
154 |
}
|
890 |
souaissa |
142 |
|
891 |
|
|
|
892 |
souaissa |
153 |
void VCT_COMPARAISON::verifier_le_repere(OT_TENSEUR& rep1,OT_TENSEUR& rep2,vector<double2>& inert1,vector<double2>& inert2)
|
893 |
|
|
{
|
894 |
|
|
TPL_LISTE_ENTITE<int> lst;
|
895 |
|
|
for(int i=0;i<4;i++)
|
896 |
|
|
{
|
897 |
|
|
double2 val1=inert1[i];
|
898 |
|
|
for(int j=0;j<4;j++)
|
899 |
|
|
{
|
900 |
|
|
if(!lst.est_dans_la_liste(j+4))
|
901 |
|
|
{
|
902 |
|
|
double2 val2=inert2[j];
|
903 |
|
|
if(val1==val2)
|
904 |
|
|
{
|
905 |
|
|
lst.ajouter(i);
|
906 |
|
|
lst.ajouter(j+4);
|
907 |
|
|
break;
|
908 |
|
|
}
|
909 |
|
|
}
|
910 |
|
|
}
|
911 |
|
|
}
|
912 |
souaissa |
142 |
|
913 |
|
|
|
914 |
souaissa |
153 |
}
|
915 |
souaissa |
142 |
|
916 |
souaissa |
153 |
|
917 |
souaissa |
142 |
int VCT_COMPARAISON::comparer_aretes_faces(MG_FACE* f_ref1,MG_FACE* f_ref2,MG_FACE* face1,MG_FACE* face2,TPL_LISTE_ENTITE<int>& aretes_ident,TPL_LISTE_ENTITE<int>& aretes_sim)
|
918 |
|
|
{
|
919 |
|
|
|
920 |
souaissa |
153 |
|
921 |
souaissa |
142 |
int nb_boucle1=face1->get_nb_mg_boucle();
|
922 |
|
|
int nb_boucle2=face2->get_nb_mg_boucle();
|
923 |
souaissa |
158 |
TPL_LISTE_ENTITE<int> lst1_artes_delamemecourbe;
|
924 |
|
|
TPL_LISTE_ENTITE<int> lst2_artes_delamemecourbe;
|
925 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> arte1_trouvee;
|
926 |
|
|
TPL_LISTE_ENTITE<int> arte2_trouvee;
|
927 |
souaissa |
158 |
OT_VECTEUR_4DD VZER(0.,0.,0.,0.);
|
928 |
souaissa |
142 |
//-----------------------------------------------------------------------------
|
929 |
|
|
OT_VECTEUR_4DD Dv1,Dv2,G1,gf1,gf2,G2;
|
930 |
|
|
OT_TENSEUR V1(4),V2(4);
|
931 |
|
|
|
932 |
souaissa |
153 |
//f_ref1->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
933 |
|
|
//G1=f_ref1->get_vectorisation().calcule_barycentre(T1);
|
934 |
souaissa |
142 |
|
935 |
souaissa |
153 |
MG_SURFACE* surf1_ref=f_ref1->get_surface();
|
936 |
|
|
G1=surf1_ref->get_vectorisation().calcule_barycentre(T1);
|
937 |
|
|
G1=surf1_ref->get_vectorisation().get_nouveau_pt(T1,G1);
|
938 |
|
|
// for(int r=0;r<4;r++) {
|
939 |
|
|
// for(int s=0;s<4;s++) {
|
940 |
|
|
// gf1[r]= gf1[r]+V1(s,r)*G1[s];
|
941 |
|
|
// }
|
942 |
|
|
// }
|
943 |
souaissa |
142 |
|
944 |
souaissa |
153 |
//f_ref2->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
945 |
|
|
//G2=f_ref2->get_vectorisation().calcule_barycentre(T2);
|
946 |
|
|
MG_SURFACE* surf2_ref= f_ref2->get_surface();
|
947 |
|
|
G2=surf1_ref->get_vectorisation().calcule_barycentre(T2);
|
948 |
souaissa |
142 |
|
949 |
souaissa |
153 |
// for(int r=0;r<4;r++) {
|
950 |
|
|
// for(int s=0;s<4;s++) {
|
951 |
|
|
// gf2[r]= gf2[r]+V2(s,r)*G2[s];
|
952 |
|
|
// }
|
953 |
|
|
// }
|
954 |
souaissa |
142 |
|
955 |
|
|
//---------------------------------------------------------------------------
|
956 |
souaissa |
158 |
/* for(int j1=0;j1<nb_boucle1;j1++)
|
957 |
|
|
{
|
958 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
959 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
960 |
|
|
for (int w1 =0; w1<nbarete1;w1++)
|
961 |
|
|
{
|
962 |
|
|
double xyz1[3];
|
963 |
|
|
double xyz2[3];
|
964 |
|
|
vector<double2> viarte1,vicrbe1;
|
965 |
|
|
OT_TENSEUR tns_arete1(4),tns_courbe1(4);
|
966 |
|
|
OT_TENSEUR tm1_art(4),tm1_crb(4);
|
967 |
|
|
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
968 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
969 |
|
|
int id_art1=arete1->get_id();
|
970 |
|
|
MG_COURBE* courbe1=arete1->get_courbe();
|
971 |
|
|
int nb_top1_pts= arete1->get_vectorisation().get_nb_points();
|
972 |
|
|
int nb_geo1_pts= courbe1->get_vectorisation().get_nb_points();
|
973 |
|
|
tm1_art=arete1->get_vectorisation().calcule_tenseur_metrique();
|
974 |
|
|
tm1_crb=courbe1->get_vectorisation().calcule_tenseur_metrique();
|
975 |
|
|
tns_arete1=arete1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
976 |
|
|
tns_courbe1=courbe1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
977 |
|
|
|
978 |
|
|
for(int r=0;r<4;r++)
|
979 |
|
|
{
|
980 |
|
|
viarte1.insert( viarte1.end(), tns_arete1(r,r));
|
981 |
|
|
vicrbe1.insert( vicrbe1.end(), tns_courbe1(r,r));
|
982 |
|
|
}
|
983 |
|
|
for(int j2=0;j2<nb_boucle2;j2++)
|
984 |
|
|
{
|
985 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
986 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
987 |
|
|
for (int w2 =0; w2<nbarete2;w2++)
|
988 |
|
|
{
|
989 |
|
|
double xyz1[3];
|
990 |
|
|
double xyz2[3];
|
991 |
|
|
vector<double2> viarte2,vicrbe2;
|
992 |
|
|
OT_TENSEUR tns_arete2(4),tns_courbe2(4);
|
993 |
|
|
OT_TENSEUR tm2_art(4),tm2_crb(4);
|
994 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
995 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
996 |
|
|
int id_art2=arete2->get_id();
|
997 |
|
|
MG_COURBE* courbe2=arete2->get_courbe();
|
998 |
|
|
int nb_top2_pts= arete2->get_vectorisation().get_nb_points();
|
999 |
|
|
int nb_geo2_pts= courbe2->get_vectorisation().get_nb_points();
|
1000 |
|
|
tm2_art=arete2->get_vectorisation().calcule_tenseur_metrique();
|
1001 |
|
|
tm2_crb=courbe2->get_vectorisation().calcule_tenseur_metrique();
|
1002 |
|
|
tns_arete2=arete2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
1003 |
|
|
tns_courbe2=courbe2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
1004 |
|
|
|
1005 |
|
|
for(int r=0;r<4;r++)
|
1006 |
|
|
{
|
1007 |
|
|
viarte2.insert( viarte2.end(), tns_arete1(r,r));
|
1008 |
|
|
vicrbe2.insert( vicrbe2.end(), tns_courbe1(r,r));
|
1009 |
|
|
}
|
1010 |
|
|
if((nb_geo1_pts==nb_geo2_pts)&&(nb_top1_pts==nb_top2_pts))
|
1011 |
|
|
{
|
1012 |
|
|
if(tm1_art.est_til_equivalent(tm2_art))
|
1013 |
|
|
{
|
1014 |
|
|
if(tm1_crb.est_til_equivalent(tm2_crb))
|
1015 |
|
|
{
|
1016 |
|
|
if(tns_courbe1==tns_courbe2)
|
1017 |
|
|
{
|
1018 |
|
|
lst1_artes_delamemecourbe.ajouter(id_art1);
|
1019 |
|
|
lst2_artes_delamemecourbe.ajouter(id_art2);
|
1020 |
|
|
}
|
1021 |
|
|
}
|
1022 |
|
|
}
|
1023 |
|
|
|
1024 |
|
|
|
1025 |
|
|
}
|
1026 |
|
|
|
1027 |
|
|
|
1028 |
|
|
}
|
1029 |
|
|
}
|
1030 |
|
|
}
|
1031 |
|
|
}
|
1032 |
|
|
|
1033 |
|
|
vector<OT_VECTEUR_4DD> lst1_barycentre;
|
1034 |
|
|
vector<OT_VECTEUR_4DD> lst2_barycentre;
|
1035 |
|
|
TPL_LISTE_ENTITE<int> lst1,lst2;
|
1036 |
|
|
for(int i1=0;i1<lst2_artes_delamemecourbe.get_nb();i1++)
|
1037 |
|
|
{
|
1038 |
|
|
int id21=lst2_artes_delamemecourbe.get(i1);
|
1039 |
|
|
MG_ARETE* art2=mggeo2->get_mg_areteid(id21);
|
1040 |
|
|
OT_VECTEUR_4DD G2=art2->get_vectorisation().calcule_barycentre(T2);
|
1041 |
|
|
if(!lst2.est_dans_la_liste(id21))
|
1042 |
|
|
{
|
1043 |
|
|
lst2_barycentre.insert(lst2_barycentre.end(),G2);
|
1044 |
|
|
for(int i2=0;i2<lst2_artes_delamemecourbe.get_nb();i2++)
|
1045 |
|
|
{
|
1046 |
|
|
int id22=lst2_artes_delamemecourbe.get(i2);
|
1047 |
|
|
int id1=lst1_artes_delamemecourbe.get(i2);
|
1048 |
|
|
if(!lst1.est_dans_la_liste(id1))
|
1049 |
|
|
{
|
1050 |
|
|
if(id21==id22)
|
1051 |
|
|
{
|
1052 |
|
|
MG_ARETE* art1=mggeo1->get_mg_areteid(id1);
|
1053 |
|
|
OT_VECTEUR_4DD G1=art1->get_vectorisation().calcule_barycentre(T1);
|
1054 |
|
|
G1=art1->get_vectorisation().get_nouveau_pt(T1,G1);
|
1055 |
|
|
lst1_barycentre.insert(lst1_barycentre.end(),G1);
|
1056 |
|
|
lst1.ajouter(id1);
|
1057 |
|
|
}
|
1058 |
|
|
}
|
1059 |
|
|
}
|
1060 |
|
|
lst2.ajouter(id21);
|
1061 |
|
|
}
|
1062 |
|
|
}
|
1063 |
|
|
|
1064 |
|
|
|
1065 |
|
|
vector<double2> NOR1,NOR2;
|
1066 |
|
|
vector<OT_VECTEUR_4DD> vi,vj;
|
1067 |
|
|
OT_VECTEUR_4DD g1=lst1_barycentre[0];
|
1068 |
|
|
for(int k=0;k<lst1_barycentre.size();k++)
|
1069 |
|
|
{
|
1070 |
|
|
OT_VECTEUR_4DD gigj_1=lst1_barycentre[k]-g1;
|
1071 |
|
|
|
1072 |
|
|
double2 nor1=gigj_1.norme();
|
1073 |
|
|
OT_VECTEUR_4DD gigj_2=lst1_barycentre[k]-g1;
|
1074 |
|
|
double2 nor2=gigj_2.norme();
|
1075 |
|
|
}
|
1076 |
|
|
for(int k=0;k<lst1_barycentre.size();k++)
|
1077 |
|
|
{
|
1078 |
|
|
OT_VECTEUR_4DD gigj_1=lst1_barycentre[k]-g1;
|
1079 |
|
|
vi.insert(vi.end(),gigj_1);
|
1080 |
|
|
double2 nor1=gigj_1.norme();
|
1081 |
|
|
NOR1.insert(NOR1.end(),nor1);
|
1082 |
|
|
OT_VECTEUR_4DD gigj_2=lst1_barycentre[k]-g1;
|
1083 |
|
|
vj.insert(vj.end(),gigj_2);
|
1084 |
|
|
double2 nor2=gigj_2.norme();
|
1085 |
|
|
NOR2.insert(NOR2.end(),nor2);
|
1086 |
|
|
}
|
1087 |
|
|
|
1088 |
|
|
double2 min1=NOR1[0];
|
1089 |
|
|
double2 min2=NOR2[0];
|
1090 |
|
|
int *t1=new int[lst1.get_nb()];
|
1091 |
|
|
int *t2=new int[lst2.get_nb()];
|
1092 |
|
|
|
1093 |
|
|
for(int r=0;r<lst1.get_nb();r++)
|
1094 |
|
|
{
|
1095 |
|
|
t1[r]=lst1.get(r);
|
1096 |
|
|
t2[r]=lst2.get(r);
|
1097 |
|
|
for(int s=0;s<lst1.get_nb();s++)
|
1098 |
|
|
{
|
1099 |
|
|
if (NOR1[s]<NOR1[r])
|
1100 |
|
|
{
|
1101 |
|
|
double2 tmp1=NOR1[r];
|
1102 |
|
|
NOR1[r]=NOR1[s];
|
1103 |
|
|
NOR1[s]=tmp1;
|
1104 |
|
|
t1[r]=t1[s];
|
1105 |
|
|
}
|
1106 |
|
|
|
1107 |
|
|
if (NOR2[s]<NOR2[r])
|
1108 |
|
|
{
|
1109 |
|
|
double2 tmp2=NOR2[r];
|
1110 |
|
|
NOR2[r]=NOR2[s];
|
1111 |
|
|
NOR2[s]=tmp2;
|
1112 |
|
|
t2[r]=t2[s];
|
1113 |
|
|
}
|
1114 |
|
|
}
|
1115 |
|
|
} */
|
1116 |
|
|
//---------------------------------------------------------------------------
|
1117 |
souaissa |
142 |
int nb_aretes=0;
|
1118 |
|
|
for(int j1=0;j1<nb_boucle1;j1++)
|
1119 |
|
|
{
|
1120 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
1121 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
1122 |
|
|
nb_aretes+=nbarete1;
|
1123 |
|
|
for (int w1 =0; w1<nbarete1;w1++)
|
1124 |
|
|
{
|
1125 |
souaissa |
158 |
double xyz1[3];
|
1126 |
|
|
double xyz2[3];
|
1127 |
souaissa |
142 |
OT_TENSEUR tns_arete1(4),tns_courbe1(4);
|
1128 |
|
|
OT_TENSEUR tm1_art(4),tm1_crb(4);
|
1129 |
|
|
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
1130 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
1131 |
|
|
int id_art1=arete1->get_id();
|
1132 |
|
|
|
1133 |
|
|
MG_COURBE* courbe1=arete1->get_courbe();
|
1134 |
|
|
|
1135 |
|
|
int nb_top1_pts= arete1->get_vectorisation().get_nb_points();
|
1136 |
|
|
int nb_geo1_pts= courbe1->get_vectorisation().get_nb_points();
|
1137 |
|
|
|
1138 |
|
|
tm1_art=arete1->get_vectorisation().calcule_tenseur_metrique();
|
1139 |
|
|
tm1_crb=courbe1->get_vectorisation().calcule_tenseur_metrique();
|
1140 |
|
|
|
1141 |
souaissa |
158 |
MG_COSOMMET* csomt1_art1= arete1->get_cosommet1();
|
1142 |
|
|
MG_COSOMMET* csomt2_art1= arete1->get_cosommet2();
|
1143 |
|
|
MG_SOMMET* som1_art1= csomt1_art1->get_sommet();
|
1144 |
|
|
MG_SOMMET* som2_art1= csomt2_art1->get_sommet();
|
1145 |
|
|
MG_POINT* pt1=som1_art1->get_point();
|
1146 |
|
|
MG_POINT* pt2=som2_art1->get_point();
|
1147 |
|
|
pt1->evaluer(xyz1);
|
1148 |
|
|
OT_VECTEUR_4DD PT11(xyz1[0],xyz1[1],xyz1[2],0);
|
1149 |
|
|
pt2->evaluer(xyz2);
|
1150 |
|
|
OT_VECTEUR_4DD PT12(xyz2[0],xyz2[1],xyz2[2],0);
|
1151 |
souaissa |
142 |
//----------------------------------------------------------------------
|
1152 |
|
|
OT_VECTEUR_4DD B1,g1;
|
1153 |
souaissa |
154 |
B1=courbe1->get_vectorisation().calcule_barycentre(T1);
|
1154 |
souaissa |
158 |
OT_VECTEUR_4DD G1S1=B1-PT11;
|
1155 |
|
|
|
1156 |
souaissa |
154 |
B1=courbe1->get_vectorisation().get_nouveau_pt(T1,B1);
|
1157 |
souaissa |
158 |
G1S1=courbe1->get_vectorisation().get_nouveau_pt(T1,G1S1);
|
1158 |
souaissa |
153 |
// for(int r=0;r<4;r++) {
|
1159 |
|
|
// for(int s=0;s<4;s++)
|
1160 |
|
|
// g1[r]= g1[r]+V1(s,r)*B1[s];
|
1161 |
|
|
// }
|
1162 |
souaissa |
142 |
//----------------------------------------------------------------------
|
1163 |
|
|
|
1164 |
souaissa |
153 |
tns_arete1=arete1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
1165 |
|
|
tns_courbe1=courbe1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
1166 |
souaissa |
142 |
vector<double2> viarte1,vicrbe1;
|
1167 |
|
|
for(int r=0;r<4;r++)
|
1168 |
|
|
{
|
1169 |
|
|
viarte1.insert( viarte1.end(), tns_arete1(r,r));
|
1170 |
|
|
vicrbe1.insert( vicrbe1.end(), tns_courbe1(r,r));
|
1171 |
|
|
}
|
1172 |
souaissa |
153 |
int compt_aretes_modif=0;
|
1173 |
souaissa |
142 |
for(int j2=0;j2<nb_boucle2;j2++)
|
1174 |
|
|
{
|
1175 |
souaissa |
153 |
if(arte1_trouvee.est_dans_la_liste(id_art1)) break;
|
1176 |
souaissa |
142 |
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
1177 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1178 |
|
|
for (int w2 =0; w2<nbarete2;w2++)
|
1179 |
|
|
{
|
1180 |
souaissa |
153 |
if(arte1_trouvee.est_dans_la_liste(id_art1)) break;
|
1181 |
souaissa |
142 |
OT_TENSEUR tns_arete2(4),tns_courbe2(4);
|
1182 |
|
|
OT_TENSEUR tm2_art(4),tm2_crb(4);
|
1183 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1184 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
1185 |
|
|
MG_COURBE* courbe2=arete2->get_courbe();
|
1186 |
|
|
int id_art2=arete2->get_id();
|
1187 |
souaissa |
158 |
MG_COSOMMET* csomt1_art2= arete2->get_cosommet1();
|
1188 |
|
|
MG_COSOMMET* csomt2_art2= arete2->get_cosommet2();
|
1189 |
|
|
MG_SOMMET* som1_art2= csomt1_art2->get_sommet();
|
1190 |
|
|
MG_SOMMET* som2_art2= csomt2_art2->get_sommet();
|
1191 |
|
|
MG_POINT* pt2=som1_art2->get_point();
|
1192 |
|
|
pt2->evaluer(xyz1);
|
1193 |
|
|
OT_VECTEUR_4DD PT21(xyz1[0],xyz1[1],xyz1[2],0);
|
1194 |
|
|
MG_POINT* pt3=som2_art2->get_point();
|
1195 |
|
|
pt3->evaluer(xyz2);
|
1196 |
|
|
OT_VECTEUR_4DD PT22(xyz2[0],xyz2[1],xyz2[2],0);
|
1197 |
souaissa |
142 |
//----------------------------------------------------------------------
|
1198 |
|
|
OT_VECTEUR_4DD B2,g2;
|
1199 |
souaissa |
154 |
B2=courbe2->get_vectorisation().calcule_barycentre(T2);
|
1200 |
souaissa |
158 |
OT_VECTEUR_4DD G2S2=B2-PT21;
|
1201 |
|
|
OT_VECTEUR_4DD G2S3=B2-PT22;
|
1202 |
|
|
OT_VECTEUR_4DD B1B2=B2-B1;
|
1203 |
|
|
OT_VECTEUR_4DD D1= G1S1^G2S2;
|
1204 |
|
|
OT_VECTEUR_4DD D2= G1S1^G2S3;
|
1205 |
|
|
// OT_VECTEUR_4DD D3= B1B2^G2S3;
|
1206 |
souaissa |
153 |
// for(int r=0;r<4;r++) {
|
1207 |
|
|
// for(int s=0;s<4;s++)
|
1208 |
|
|
// g2[r]= g2[r]+V2(s,r)*B2[s];
|
1209 |
|
|
// }
|
1210 |
souaissa |
142 |
//---------------------------------------------------------------------- MG_COURBE* courbe2=arete2->get_courbe();
|
1211 |
|
|
|
1212 |
|
|
int nb_top2_pts= arete2->get_vectorisation().get_nb_points();
|
1213 |
|
|
int nb_geo2_pts= courbe2->get_vectorisation().get_nb_points();
|
1214 |
|
|
|
1215 |
|
|
tm2_art=arete2->get_vectorisation().calcule_tenseur_metrique();
|
1216 |
|
|
tm2_crb=courbe2->get_vectorisation().calcule_tenseur_metrique();
|
1217 |
|
|
|
1218 |
souaissa |
153 |
tns_arete2=arete2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
1219 |
|
|
tns_courbe2=courbe2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
1220 |
souaissa |
142 |
|
1221 |
|
|
vector<double2> viarte2,vicrbe2;
|
1222 |
|
|
for(int r=0;r<4;r++)
|
1223 |
|
|
{
|
1224 |
|
|
viarte2.insert( viarte2.end(), tns_arete2(r,r));
|
1225 |
|
|
vicrbe2.insert( vicrbe2.end(), tns_courbe2(r,r));
|
1226 |
|
|
}
|
1227 |
|
|
|
1228 |
|
|
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
1229 |
|
|
{
|
1230 |
|
|
if(tm1_art.est_til_equivalent(tm2_art))
|
1231 |
|
|
{
|
1232 |
|
|
if(tm1_crb.est_til_equivalent(tm2_crb))
|
1233 |
|
|
{
|
1234 |
|
|
vector<unsigned int> indx1,indx2;
|
1235 |
|
|
int identique=-1;
|
1236 |
souaissa |
153 |
//if(tns_arete1==tns_arete2)//.listes_equivalentes(viarte1,viarte2,indx1))
|
1237 |
|
|
//{
|
1238 |
souaissa |
142 |
if(tns_courbe1==tns_courbe2)//tns_arete1.listes_equivalentes(vicrbe1,vicrbe2,indx2))
|
1239 |
|
|
{
|
1240 |
souaissa |
153 |
OT_VECTEUR_4DD v1=B1-G1;
|
1241 |
|
|
OT_VECTEUR_4DD v2=B2-G2;
|
1242 |
|
|
//OT_VECTEUR_4DD v1=gf1-g1;
|
1243 |
|
|
//OT_VECTEUR_4DD v2=gf2-g2;
|
1244 |
souaissa |
159 |
//if(v1==v2||((D1==VZER||D2==VZER)))
|
1245 |
|
|
if(courbes_sont_elles_identiques(arete1,arete2))
|
1246 |
souaissa |
142 |
{
|
1247 |
souaissa |
158 |
if(!arte2_trouvee.est_dans_la_liste(id_art2))
|
1248 |
|
|
{
|
1249 |
|
|
aretes_ident.ajouter(j1) ;
|
1250 |
|
|
aretes_ident.ajouter(id_art1) ;
|
1251 |
|
|
aretes_ident.ajouter(j2) ;
|
1252 |
|
|
aretes_ident.ajouter(id_art2) ;
|
1253 |
|
|
arte1_trouvee.ajouter(id_art1);
|
1254 |
|
|
arte2_trouvee.ajouter(id_art2);
|
1255 |
|
|
identique=1;
|
1256 |
|
|
}
|
1257 |
souaissa |
142 |
|
1258 |
souaissa |
153 |
|
1259 |
souaissa |
142 |
}
|
1260 |
|
|
|
1261 |
|
|
}
|
1262 |
souaissa |
153 |
// }
|
1263 |
souaissa |
142 |
if(identique>0) break;
|
1264 |
|
|
if(identique<0)
|
1265 |
|
|
{
|
1266 |
|
|
aretes_sim.ajouter(j1) ;
|
1267 |
|
|
aretes_sim.ajouter(id_art1) ;
|
1268 |
|
|
aretes_sim.ajouter(j2) ;
|
1269 |
|
|
aretes_sim.ajouter(id_art2) ;
|
1270 |
|
|
identique=-1;
|
1271 |
|
|
}
|
1272 |
|
|
}
|
1273 |
|
|
}
|
1274 |
|
|
} // aretes2
|
1275 |
|
|
|
1276 |
|
|
} //boucle2
|
1277 |
|
|
|
1278 |
souaissa |
153 |
// }//condition 1 //aretes_identiques
|
1279 |
souaissa |
142 |
}
|
1280 |
|
|
|
1281 |
|
|
}
|
1282 |
|
|
}
|
1283 |
|
|
|
1284 |
|
|
if(nb_aretes==aretes_ident.get_nb()/2) return 1;
|
1285 |
|
|
else return 0;
|
1286 |
|
|
|
1287 |
|
|
}
|
1288 |
|
|
|
1289 |
souaissa |
153 |
void VCT_COMPARAISON::identifier_aretes_face_modifiee(MG_FACE* face1,MG_FACE* face2,TPL_LISTE_ENTITE<int>& aretes_identiques,
|
1290 |
|
|
TPL_LISTE_ENTITE<int>&aretes_simil,TPL_LISTE_ENTITE<int>&lst_corrsp_sommets,TPL_LISTE_ENTITE<int>& aret1_conservees,
|
1291 |
|
|
TPL_LISTE_ENTITE<int>& aret1_disparues,TPL_LISTE_ENTITE<int>& aret2_conservees ,TPL_LISTE_ENTITE<int>& aret2_nouvelles ,
|
1292 |
|
|
TPL_LISTE_ENTITE<int>& aret_partielles)
|
1293 |
souaissa |
142 |
{
|
1294 |
|
|
|
1295 |
|
|
int nb_boucle1=face1->get_nb_mg_boucle();
|
1296 |
|
|
int nb_boucle2=face2->get_nb_mg_boucle();
|
1297 |
|
|
|
1298 |
|
|
|
1299 |
|
|
int cmpt_arete=0;
|
1300 |
|
|
|
1301 |
|
|
TPL_LISTE_ENTITE<int> boucle_face1;
|
1302 |
|
|
TPL_LISTE_ENTITE<int> boucle_face2;
|
1303 |
|
|
|
1304 |
|
|
TPL_LISTE_ENTITE<int> aretes_ident_face1;
|
1305 |
|
|
TPL_LISTE_ENTITE<int> aretes_ident_face2;
|
1306 |
|
|
TPL_LISTE_ENTITE<int> aretes_face1;
|
1307 |
|
|
TPL_LISTE_ENTITE<int> aretes_face2;
|
1308 |
|
|
TPL_LISTE_ENTITE<int> aretes_dif_face2;
|
1309 |
|
|
TPL_LISTE_ENTITE<int> aretes_sim_face1;
|
1310 |
|
|
TPL_LISTE_ENTITE<int> aretes_sim_face2;
|
1311 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> lst_sommet1;
|
1312 |
|
|
TPL_LISTE_ENTITE<int> lst_sommet2;
|
1313 |
souaissa |
142 |
|
1314 |
souaissa |
153 |
for(int b=0;b<lst_corrsp_sommets.get_nb()/2;b++)
|
1315 |
|
|
{
|
1316 |
|
|
lst_sommet1.ajouter( lst_corrsp_sommets.get(2*b));
|
1317 |
|
|
lst_sommet2.ajouter( lst_corrsp_sommets.get(2*b+1));
|
1318 |
|
|
}
|
1319 |
|
|
|
1320 |
souaissa |
142 |
for(int b=0;b<aretes_identiques.get_nb()/4;b++)
|
1321 |
souaissa |
87 |
{
|
1322 |
souaissa |
153 |
int b1= aretes_identiques.get(4*b) ;
|
1323 |
|
|
int b2= aretes_identiques.get(4*b+2) ;
|
1324 |
|
|
int art1= aretes_identiques.get(4*b+1);
|
1325 |
|
|
int art2= aretes_identiques.get(4*b+3);
|
1326 |
souaissa |
142 |
boucle_face1.ajouter( aretes_identiques.get(4*b));
|
1327 |
|
|
boucle_face2.ajouter( aretes_identiques.get(4*b+2));
|
1328 |
|
|
aretes_ident_face1.ajouter(aretes_identiques.get(4*b+1));
|
1329 |
|
|
aretes_ident_face2.ajouter(aretes_identiques.get(4*b+3));
|
1330 |
souaissa |
158 |
aret1_conservees.ajouter(art1);
|
1331 |
|
|
aret2_conservees.ajouter(art2);
|
1332 |
|
|
|
1333 |
souaissa |
142 |
}
|
1334 |
souaissa |
158 |
|
1335 |
|
|
|
1336 |
|
|
for(int j1=0;j1<nb_boucle1;j1++)
|
1337 |
|
|
{
|
1338 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
1339 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
1340 |
|
|
|
1341 |
|
|
for (int w1=0; w1<nbarete1;w1++)
|
1342 |
|
|
{
|
1343 |
|
|
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
1344 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
1345 |
|
|
int id_art1=arete1->get_id();
|
1346 |
|
|
if(!aretes_ident_face1.est_dans_la_liste(id_art1))
|
1347 |
|
|
{
|
1348 |
|
|
aret1_disparues.ajouter(id_art1);
|
1349 |
|
|
}
|
1350 |
|
|
}
|
1351 |
|
|
}
|
1352 |
|
|
|
1353 |
|
|
for(int j2=0;j2<nb_boucle2;j2++)
|
1354 |
|
|
{
|
1355 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
1356 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1357 |
|
|
for (int w2=0; w2<nbarete2;w2++)
|
1358 |
|
|
{
|
1359 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1360 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
1361 |
|
|
int id_art2=arete2->get_id();
|
1362 |
|
|
if(!aretes_ident_face2.est_dans_la_liste(id_art2))
|
1363 |
|
|
{
|
1364 |
|
|
aret2_nouvelles.ajouter(id_art2);
|
1365 |
|
|
}
|
1366 |
|
|
|
1367 |
|
|
}
|
1368 |
|
|
}
|
1369 |
|
|
/*
|
1370 |
souaissa |
142 |
for(int b=0;b<aretes_simil.get_nb()/4;b++)
|
1371 |
|
|
{
|
1372 |
|
|
aretes_sim_face1.ajouter(aretes_simil.get(4*b+1));
|
1373 |
|
|
aretes_sim_face2.ajouter(aretes_simil.get(4*b+3));
|
1374 |
|
|
}
|
1375 |
|
|
|
1376 |
souaissa |
153 |
MG_FACE* Face_ref1=mggeo1->get_mg_faceid(face_ref1) ;
|
1377 |
|
|
MG_FACE* Face_ref2=mggeo2->get_mg_faceid(face_ref2) ;
|
1378 |
|
|
|
1379 |
souaissa |
142 |
for(int j1=0;j1<nb_boucle1;j1++)
|
1380 |
|
|
{
|
1381 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
1382 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
1383 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> lst_aret1_modif;
|
1384 |
|
|
TPL_LISTE_ENTITE<int> lst_aret2_modif;
|
1385 |
|
|
TPL_LISTE_ENTITE<int> lst_art1_partiel;
|
1386 |
|
|
TPL_LISTE_ENTITE<int> lst_art2_partiel;
|
1387 |
souaissa |
142 |
int compt1=0;
|
1388 |
|
|
int boucle;
|
1389 |
|
|
int start_boucle,end_boucle;
|
1390 |
|
|
int cmpt=0;
|
1391 |
|
|
TPL_LISTE_ENTITE<int> arete_boucle1;
|
1392 |
|
|
TPL_LISTE_ENTITE<int> arete_boucle2;
|
1393 |
|
|
|
1394 |
|
|
if(boucle_face1.est_dans_la_liste(j1))
|
1395 |
|
|
{
|
1396 |
|
|
for(int k=0;k<boucle_face1.get_nb();k++)
|
1397 |
|
|
{
|
1398 |
|
|
if (j1==boucle_face1.get(k))
|
1399 |
|
|
{
|
1400 |
souaissa |
153 |
int art1=aretes_ident_face1.get(k);
|
1401 |
|
|
int art2= aretes_ident_face2.get(k);
|
1402 |
souaissa |
142 |
arete_boucle1.ajouter(aretes_ident_face1.get(k));
|
1403 |
|
|
arete_boucle2.ajouter(aretes_ident_face2.get(k));
|
1404 |
|
|
boucle=boucle_face2.get(k);
|
1405 |
|
|
}
|
1406 |
|
|
}
|
1407 |
|
|
}
|
1408 |
|
|
|
1409 |
souaissa |
153 |
for (int w1=0; w1<nbarete1;w1++)
|
1410 |
souaissa |
87 |
{
|
1411 |
souaissa |
142 |
|
1412 |
souaissa |
153 |
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
1413 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
1414 |
|
|
int id_art=arete1->get_id();
|
1415 |
|
|
int trouv=-1;
|
1416 |
|
|
for (int w1=0; w1<arete_boucle1.get_nb();w1++)
|
1417 |
|
|
{
|
1418 |
|
|
int id_art1=arete_boucle1.get(w1);
|
1419 |
|
|
int id_art2=arete_boucle2.get(w1);
|
1420 |
|
|
|
1421 |
|
|
if(id_art1==id_art)
|
1422 |
souaissa |
142 |
{
|
1423 |
souaissa |
153 |
aret1_conservees.ajouter(id_art1);
|
1424 |
|
|
aret2_conservees.ajouter(id_art2);
|
1425 |
|
|
trouv=1;
|
1426 |
|
|
break;
|
1427 |
souaissa |
142 |
}
|
1428 |
souaissa |
153 |
}
|
1429 |
|
|
if(trouv<0)
|
1430 |
souaissa |
142 |
{
|
1431 |
souaissa |
153 |
//if(!aretes_sim_face1.est_dans_la_liste(id_art1))
|
1432 |
|
|
aret1_disparues.ajouter(id_art);
|
1433 |
|
|
//lst_aret1_modif.ajouter(id_art1);
|
1434 |
souaissa |
142 |
}
|
1435 |
souaissa |
153 |
|
1436 |
|
|
}
|
1437 |
souaissa |
142 |
|
1438 |
souaissa |
153 |
// for(int j2=0;j2<nb_boucle2;j2++)
|
1439 |
|
|
// {
|
1440 |
|
|
// MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
1441 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(boucle);
|
1442 |
souaissa |
142 |
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1443 |
|
|
|
1444 |
|
|
for (int w2=0; w2<nbarete2;w2++)
|
1445 |
souaissa |
153 |
{
|
1446 |
souaissa |
142 |
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1447 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
1448 |
|
|
int id_art2=arete2->get_id();
|
1449 |
|
|
if(!arete_boucle2.est_dans_la_liste(id_art2))
|
1450 |
|
|
{
|
1451 |
|
|
aret2_nouvelles.ajouter(id_art2);
|
1452 |
souaissa |
153 |
//lst_aret2_modif.ajouter(id_art2);
|
1453 |
|
|
//for(int is=0;is<aretes_sim_face2.get_nb();is++)
|
1454 |
|
|
//{
|
1455 |
|
|
//if(aretes_sim_face2.get(is)==id_art2)
|
1456 |
|
|
// {
|
1457 |
|
|
// aret2_partielles.ajouter(id_art2);
|
1458 |
|
|
// }
|
1459 |
|
|
// }
|
1460 |
souaissa |
142 |
|
1461 |
|
|
}
|
1462 |
souaissa |
153 |
// else
|
1463 |
|
|
|
1464 |
|
|
// aret2_conservees.ajouter(id_art2);
|
1465 |
|
|
}
|
1466 |
|
|
|
1467 |
|
|
//verifier parmi les deux listes des aretes modifiees
|
1468 |
|
|
//celles qui sont nouvelles ou partiellements modifees
|
1469 |
|
|
/*
|
1470 |
|
|
for(int m1=0;m1<lst_aret1_modif.get_nb();m1++)
|
1471 |
souaissa |
142 |
{
|
1472 |
souaissa |
153 |
int id_art1=lst_aret1_modif.get(m1);
|
1473 |
|
|
MG_ARETE* art1=mggeo1->get_mg_areteid(id_art1);
|
1474 |
souaissa |
142 |
|
1475 |
souaissa |
153 |
OT_TENSEUR tm1_art(4),tm1_crb(4);
|
1476 |
|
|
MG_COURBE* courbe1=art1->get_courbe();
|
1477 |
|
|
tm1_art=art1->get_vectorisation().calcule_tenseur_metrique();
|
1478 |
|
|
tm1_crb=courbe1->get_vectorisation().calcule_tenseur_metrique();
|
1479 |
souaissa |
142 |
|
1480 |
souaissa |
153 |
|
1481 |
|
|
MG_COSOMMET* csomt1_art1= art1->get_cosommet1();
|
1482 |
|
|
MG_COSOMMET* csomt2_art1= art1->get_cosommet2();
|
1483 |
|
|
MG_SOMMET* som1_art1= csomt1_art1->get_sommet();
|
1484 |
|
|
MG_SOMMET* som2_art1= csomt2_art1->get_sommet();
|
1485 |
|
|
int id_som11= som1_art1->get_id();
|
1486 |
|
|
int id_som21= som2_art1->get_id();
|
1487 |
|
|
int s11_ou_s21;
|
1488 |
|
|
if(lst_sommet1.est_dans_la_liste(id_som11)) s11_ou_s21=1;
|
1489 |
|
|
if(lst_sommet1.est_dans_la_liste(id_som21)) s11_ou_s21=2;
|
1490 |
souaissa |
142 |
|
1491 |
souaissa |
153 |
if(lst_sommet1.est_dans_la_liste(id_som11)||lst_sommet1.est_dans_la_liste(id_som21))
|
1492 |
|
|
{
|
1493 |
|
|
for(int m2=0;m2<lst_aret2_modif.get_nb();m2++)
|
1494 |
|
|
{
|
1495 |
|
|
int id_art2=lst_aret2_modif.get(m2);
|
1496 |
|
|
MG_ARETE* art2=mggeo2->get_mg_areteid(id_art2);
|
1497 |
|
|
OT_TENSEUR tm2_art(4),tm2_crb(4);
|
1498 |
|
|
MG_COURBE* courbe2=art2->get_courbe();
|
1499 |
|
|
tm2_art=art1->get_vectorisation().calcule_tenseur_metrique();
|
1500 |
|
|
tm2_crb=courbe2->get_vectorisation().calcule_tenseur_metrique();
|
1501 |
|
|
|
1502 |
|
|
MG_COSOMMET* csomt1_art2= art2->get_cosommet1();
|
1503 |
|
|
MG_COSOMMET* csomt2_art2= art2->get_cosommet2();
|
1504 |
|
|
MG_SOMMET* som1_art2= csomt1_art2->get_sommet();
|
1505 |
|
|
MG_SOMMET* som2_art2= csomt2_art2->get_sommet();
|
1506 |
|
|
int id_som12= som1_art2->get_id();
|
1507 |
|
|
int id_som22= som2_art2->get_id();
|
1508 |
|
|
int s12_ou_s22;
|
1509 |
|
|
if(lst_sommet2.est_dans_la_liste(id_som12)) s12_ou_s22=1;
|
1510 |
|
|
if(lst_sommet2.est_dans_la_liste(id_som22)) s12_ou_s22=2;
|
1511 |
|
|
|
1512 |
|
|
//if(lst_sommet2.est_dans_la_liste(id_som12)||lst_sommet2.est_dans_la_liste(id_som22))
|
1513 |
|
|
// {
|
1514 |
|
|
if(tm1_art.est_til_equivalent(tm2_art)&&tm1_crb.est_til_equivalent(tm2_crb))
|
1515 |
|
|
{
|
1516 |
|
|
aret_partielles.ajouter(id_art1);
|
1517 |
|
|
aret_partielles.ajouter(id_art2);
|
1518 |
|
|
lst_art1_partiel.ajouter(id_art1);
|
1519 |
|
|
lst_art2_partiel.ajouter(id_art2);
|
1520 |
|
|
if (s11_ou_s21==1&&s12_ou_s22==1)
|
1521 |
|
|
{
|
1522 |
|
|
aret_partielles.ajouter(id_som11);
|
1523 |
|
|
}
|
1524 |
|
|
if (s11_ou_s21==2&&s12_ou_s22==1)
|
1525 |
|
|
{
|
1526 |
|
|
aret_partielles.ajouter(id_som21);
|
1527 |
|
|
}
|
1528 |
|
|
if (s12_ou_s22==1&&s12_ou_s22==2)
|
1529 |
|
|
{
|
1530 |
|
|
aret_partielles.ajouter(id_som12);
|
1531 |
|
|
}
|
1532 |
|
|
if (s12_ou_s22==2&&s12_ou_s22==2)
|
1533 |
|
|
{
|
1534 |
|
|
aret_partielles.ajouter(id_som22);
|
1535 |
|
|
}
|
1536 |
|
|
|
1537 |
|
|
}
|
1538 |
|
|
// }
|
1539 |
|
|
|
1540 |
|
|
}
|
1541 |
|
|
}
|
1542 |
|
|
} // for m1=
|
1543 |
|
|
|
1544 |
|
|
|
1545 |
|
|
|
1546 |
|
|
for(int m1=0;m1<lst_aret1_modif.get_nb();m1++)
|
1547 |
|
|
{
|
1548 |
|
|
int id_art1=lst_aret1_modif.get(m1);
|
1549 |
|
|
if( !lst_art1_partiel.est_dans_la_liste(id_art1))
|
1550 |
|
|
aret1_disparues.ajouter(id_art1);
|
1551 |
|
|
}
|
1552 |
|
|
for(int m2=0;m2<lst_aret1_modif.get_nb();m2++)
|
1553 |
|
|
{
|
1554 |
|
|
int id_art2=lst_aret2_modif.get(m2);
|
1555 |
|
|
if( !lst_art2_partiel.est_dans_la_liste(id_art2))
|
1556 |
|
|
aret2_nouvelles.ajouter(id_art2);
|
1557 |
souaissa |
158 |
} /
|
1558 |
souaissa |
153 |
|
1559 |
souaissa |
142 |
} //boucle_face1
|
1560 |
|
|
|
1561 |
|
|
|
1562 |
souaissa |
153 |
for(int j2=0;j2<nb_boucle2;j2++)
|
1563 |
|
|
{
|
1564 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
1565 |
souaissa |
142 |
|
1566 |
souaissa |
153 |
if (!boucle_face2.est_dans_la_liste(j2))
|
1567 |
|
|
{
|
1568 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1569 |
|
|
for (int w2=0; w2<nbarete2;w2++)
|
1570 |
|
|
{
|
1571 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1572 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
1573 |
|
|
int id_art2=arete2->get_id();
|
1574 |
|
|
aret2_nouvelles.ajouter(id_art2);
|
1575 |
souaissa |
142 |
|
1576 |
souaissa |
153 |
}
|
1577 |
|
|
}
|
1578 |
|
|
}//boucle j2
|
1579 |
souaissa |
158 |
*/
|
1580 |
souaissa |
142 |
|
1581 |
|
|
|
1582 |
souaissa |
153 |
}
|
1583 |
|
|
|
1584 |
|
|
|
1585 |
|
|
|
1586 |
souaissa |
142 |
void VCT_COMPARAISON::identifier_les_modifications_appliquees(VCT_COMPARAISON_RESULTAT& Results)
|
1587 |
|
|
{
|
1588 |
|
|
|
1589 |
souaissa |
143 |
TPL_LISTE_ENTITE<int> face1_conservees;
|
1590 |
|
|
TPL_LISTE_ENTITE<int> face2_conservees;
|
1591 |
|
|
TPL_LISTE_ENTITE<int> faces_nouvelles;
|
1592 |
souaissa |
142 |
|
1593 |
souaissa |
143 |
TPL_LISTE_ENTITE<int> aret_ident;
|
1594 |
|
|
TPL_LISTE_ENTITE<int> aret_modif;
|
1595 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
1596 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
1597 |
|
|
TPL_LISTE_ENTITE<int> lst_face1,lst_face2,lst_facloc1,lst_facloc2,dif1,dif2;
|
1598 |
|
|
|
1599 |
souaissa |
153 |
|
1600 |
souaissa |
158 |
TPL_LISTE_ENTITE<int> faces1_partiellement_modf;
|
1601 |
|
|
TPL_LISTE_ENTITE<int> faces2_partiellement_modf;
|
1602 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> Aret1_conservees;
|
1603 |
|
|
TPL_LISTE_ENTITE<int> Aret1_disparues;
|
1604 |
|
|
TPL_LISTE_ENTITE<int> Aret2_conservees ;
|
1605 |
|
|
TPL_LISTE_ENTITE<int> Aret2_nouvelles ;
|
1606 |
|
|
TPL_LISTE_ENTITE<int> Aret2_partielles ;
|
1607 |
|
|
TPL_LISTE_ENTITE<int> face1_disparues;
|
1608 |
souaissa |
142 |
for(int i=0;i<nb_face1;i++)
|
1609 |
|
|
{
|
1610 |
|
|
OT_VECTEUR_4DD g1,G1;
|
1611 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
1612 |
|
|
int id1=face1->get_id();
|
1613 |
|
|
lst_face1.ajouter(id1);
|
1614 |
souaissa |
87 |
}
|
1615 |
souaissa |
142 |
|
1616 |
|
|
for(int i=0;i<nb_face2;i++)
|
1617 |
|
|
{
|
1618 |
|
|
OT_VECTEUR_4DD g1,G1;
|
1619 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(i);
|
1620 |
|
|
int id2=face2->get_id();
|
1621 |
|
|
lst_face2.ajouter(id2);
|
1622 |
|
|
}
|
1623 |
|
|
|
1624 |
souaissa |
153 |
|
1625 |
|
|
|
1626 |
souaissa |
143 |
MG_FACE* Face_ref1=mggeo1->get_mg_faceid(face_ref1) ;
|
1627 |
|
|
MG_FACE* Face_ref2=mggeo2->get_mg_faceid(face_ref2) ;
|
1628 |
souaissa |
145 |
int nb_faces_identique=identite.get_nb()/2;
|
1629 |
|
|
for(int i=0;i<nb_faces_identique;i++)
|
1630 |
souaissa |
142 |
{
|
1631 |
|
|
CORRESPONDANCE CORRESP;
|
1632 |
|
|
int face1_id=identite.get(2*i);
|
1633 |
|
|
int face2_id=identite.get(2*i+1);
|
1634 |
|
|
MG_FACE* Face1=mggeo1->get_mg_faceid(face1_id);
|
1635 |
|
|
MG_FACE* Face2=mggeo2->get_mg_faceid(face2_id);
|
1636 |
|
|
face1_conservees.ajouter(face1_id);
|
1637 |
|
|
face2_conservees.ajouter(face2_id);
|
1638 |
souaissa |
145 |
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,Face1);
|
1639 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,Face2);
|
1640 |
souaissa |
142 |
CORRESP.eleorigine=Face1;
|
1641 |
|
|
CORRESP.elemodifie=Face2;
|
1642 |
|
|
Results.ajouter_liste_topologie(CORRESP);
|
1643 |
souaissa |
143 |
|
1644 |
|
|
//----------------------------------------
|
1645 |
|
|
TPL_LISTE_ENTITE<int> aretes_identiques;
|
1646 |
|
|
TPL_LISTE_ENTITE<int> aretes_similaires;
|
1647 |
|
|
|
1648 |
|
|
//------------------------------------------
|
1649 |
|
|
this->comparer_aretes_faces(Face_ref1,Face_ref2,Face1,Face2,aretes_identiques,aretes_similaires);
|
1650 |
|
|
|
1651 |
|
|
int nb_aretes_trouvees=aretes_identiques.get_nb()/4;
|
1652 |
|
|
|
1653 |
|
|
if(nb_aretes_trouvees)
|
1654 |
souaissa |
153 |
{
|
1655 |
|
|
CORRESPONDANCE corsp;
|
1656 |
|
|
for(int i1=0;i1<nb_aretes_trouvees;i1++)
|
1657 |
|
|
{
|
1658 |
|
|
int art1_id=aretes_identiques.get(4*i1+1);
|
1659 |
|
|
MG_ARETE*art1_cons=mggeo1->get_mg_areteid(art1_id);
|
1660 |
|
|
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,art1_cons);
|
1661 |
|
|
int art2_id=aretes_identiques.get(4*i1+3);
|
1662 |
|
|
MG_ARETE*art2_cons=mggeo2->get_mg_areteid(art2_id);
|
1663 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,art2_cons);
|
1664 |
souaissa |
143 |
|
1665 |
souaissa |
153 |
corsp.eleorigine=art1_cons;
|
1666 |
|
|
corsp.elemodifie=art2_cons;
|
1667 |
|
|
Results.ajouter_liste_topologie(corsp);
|
1668 |
|
|
}
|
1669 |
|
|
}
|
1670 |
souaissa |
143 |
|
1671 |
|
|
|
1672 |
souaissa |
142 |
}
|
1673 |
|
|
|
1674 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> lst_corrsp_sommets;
|
1675 |
|
|
this->identifier_les_sommets(Face_ref1,Face_ref2,lst_corrsp_sommets,Results);
|
1676 |
souaissa |
143 |
|
1677 |
|
|
|
1678 |
|
|
for(int t=0;t<lst_face1.get_nb();t++)
|
1679 |
|
|
{
|
1680 |
|
|
if(!face1_conservees.est_dans_la_liste(lst_face1.get(t)) )
|
1681 |
souaissa |
142 |
dif1.ajouter(lst_face1.get(t));
|
1682 |
souaissa |
143 |
}
|
1683 |
|
|
for(int it=0;it<lst_face2.get_nb();it++)
|
1684 |
|
|
{
|
1685 |
|
|
if(!face2_conservees.est_dans_la_liste(lst_face2.get(it)))
|
1686 |
souaissa |
142 |
dif2.ajouter(lst_face2.get(it));
|
1687 |
souaissa |
143 |
}
|
1688 |
souaissa |
87 |
|
1689 |
|
|
|
1690 |
souaissa |
142 |
for(int i=0;i<dif1.get_nb();i++)
|
1691 |
|
|
{
|
1692 |
|
|
int Num1=dif1.get(i);
|
1693 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(Num1);
|
1694 |
souaissa |
153 |
MG_SURFACE* surf1=face1->get_surface();
|
1695 |
souaissa |
158 |
OT_VECTEUR_4DD G1=face1->get_vectorisation().calcule_barycentre(T1);
|
1696 |
souaissa |
153 |
G1=surf1->get_vectorisation().get_nouveau_pt(T1,G1);
|
1697 |
souaissa |
142 |
for(int j=0;j<dif2.get_nb();j++)
|
1698 |
|
|
{
|
1699 |
|
|
int Num2=dif2.get(j);
|
1700 |
|
|
TPL_LISTE_ENTITE<int> aretes_identiques;
|
1701 |
|
|
TPL_LISTE_ENTITE<int> aretes_similaires;
|
1702 |
|
|
TPL_LISTE_ENTITE<int> aretes_conservees;
|
1703 |
|
|
TPL_LISTE_ENTITE<int> nouvelles_aretes ;
|
1704 |
|
|
TPL_LISTE_ENTITE<int> aret1_conservees;
|
1705 |
|
|
TPL_LISTE_ENTITE<int> aret1_disparues;
|
1706 |
|
|
TPL_LISTE_ENTITE<int> aret2_conservees ;
|
1707 |
|
|
TPL_LISTE_ENTITE<int> aret2_nouvelles ;
|
1708 |
|
|
TPL_LISTE_ENTITE<int> aret2_partielles ;
|
1709 |
souaissa |
87 |
|
1710 |
souaissa |
142 |
MG_FACE* face2=mggeo2->get_mg_faceid(Num2);
|
1711 |
souaissa |
153 |
MG_SURFACE* surf2=face2->get_surface();
|
1712 |
souaissa |
158 |
OT_VECTEUR_4DD G2=face2->get_vectorisation().calcule_barycentre(T2);
|
1713 |
souaissa |
159 |
// if(!faces1_partiellement_modf.est_dans_la_liste(Num1))
|
1714 |
|
|
// {
|
1715 |
souaissa |
145 |
|
1716 |
souaissa |
158 |
if(surfaces_sont_elles_identiques(face1,face2)) //G1==G2
|
1717 |
|
|
{
|
1718 |
souaissa |
153 |
comparer_aretes_faces(Face_ref1,Face_ref2,face1,face2,aretes_identiques,aretes_similaires);
|
1719 |
|
|
int nb_aretes_trouvees=aretes_identiques.get_nb()/2;
|
1720 |
|
|
if(nb_aretes_trouvees)
|
1721 |
|
|
identifier_aretes_face_modifiee(face1,face2,aretes_identiques,aretes_similaires,lst_corrsp_sommets,aret1_conservees,aret1_disparues,aret2_conservees ,aret2_nouvelles ,aret2_partielles);
|
1722 |
|
|
int id_face2=face2->get_id();
|
1723 |
souaissa |
158 |
|
1724 |
|
|
if(nb_aretes_trouvees)
|
1725 |
|
|
{
|
1726 |
souaissa |
159 |
// if (!face2_conservees.est_dans_la_liste(Num2))
|
1727 |
|
|
// {
|
1728 |
souaissa |
153 |
CORRESPONDANCE CORRESP_FACE;
|
1729 |
|
|
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,face1);
|
1730 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,face2);
|
1731 |
|
|
CORRESP_FACE.eleorigine=face1;
|
1732 |
|
|
CORRESP_FACE.elemodifie=face2;
|
1733 |
|
|
Results.ajouter_liste_topologie(CORRESP_FACE);
|
1734 |
|
|
face1_conservees.ajouter(Num1);
|
1735 |
|
|
face2_conservees.ajouter(Num2);
|
1736 |
souaissa |
143 |
|
1737 |
souaissa |
153 |
for(int i1=0;i1<aret1_conservees.get_nb();i1++)
|
1738 |
|
|
{
|
1739 |
|
|
int art1_id=aret1_conservees.get(i1);
|
1740 |
|
|
Aret1_conservees.ajouter(art1_id);
|
1741 |
|
|
MG_ARETE*art1_cons=mggeo1->get_mg_areteid(art1_id);
|
1742 |
|
|
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,art1_cons);
|
1743 |
|
|
int art2_id= aret2_conservees.get(i1) ;
|
1744 |
|
|
Aret2_conservees.ajouter(art2_id);
|
1745 |
|
|
MG_ARETE*art2_cons=mggeo2->get_mg_areteid(art2_id);
|
1746 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,art2_cons);
|
1747 |
|
|
CORRESPONDANCE CORRESP;
|
1748 |
|
|
CORRESP.eleorigine=art1_cons;
|
1749 |
|
|
CORRESP.elemodifie=art2_cons;
|
1750 |
|
|
Results.ajouter_liste_topologie(CORRESP);
|
1751 |
|
|
}
|
1752 |
souaissa |
142 |
|
1753 |
souaissa |
153 |
for(int i1=0;i1<aret1_disparues.get_nb();i1++)
|
1754 |
|
|
{
|
1755 |
|
|
int art_dsp=aret1_disparues.get(i1) ;
|
1756 |
|
|
Aret1_disparues.ajouter(art_dsp);
|
1757 |
|
|
//MG_ARETE*art_disp=mggeo1->get_mg_areteid(art_dsp);
|
1758 |
|
|
//Results.ajouter_liste_topologie(ORIGINE_DISPARUE,art_disp);
|
1759 |
|
|
}
|
1760 |
souaissa |
142 |
|
1761 |
souaissa |
153 |
for(int i1=0;i1<aret2_nouvelles.get_nb();i1++)
|
1762 |
|
|
{
|
1763 |
|
|
int art_nv= aret2_nouvelles.get(i1) ;
|
1764 |
|
|
Aret2_nouvelles.ajouter(art_nv);
|
1765 |
|
|
//MG_ARETE*art_app=mggeo2->get_mg_areteid(art_nv);
|
1766 |
|
|
//Results.ajouter_liste_topologie(MODIFIE_APPARUE,art_app);
|
1767 |
|
|
}
|
1768 |
|
|
//for(int i1=0;i1<aret2_partielles.get_nb()/2;i1++){
|
1769 |
|
|
// int art1_prt=aret2_partielles.get(2*i1);
|
1770 |
|
|
// int art2_prt=aret2_partielles.get(2*i1+1);
|
1771 |
|
|
|
1772 |
|
|
//il faut metttre les points des sous artes avec leurs correspondances;
|
1773 |
|
|
|
1774 |
|
|
//Results.ajouter_liste_topologie(MODIFIE_APPARUE,art_app);
|
1775 |
|
|
|
1776 |
|
|
// Aret2_partielles.ajouter(art1_prt);
|
1777 |
|
|
// }
|
1778 |
souaissa |
158 |
faces1_partiellement_modf.ajouter(Num1);
|
1779 |
|
|
faces2_partiellement_modf.ajouter(Num2);
|
1780 |
souaissa |
159 |
// }//verid
|
1781 |
souaissa |
158 |
}// if()nb_aretes_trouvees
|
1782 |
souaissa |
153 |
|
1783 |
souaissa |
158 |
} //if (G1==G2)
|
1784 |
souaissa |
159 |
// }
|
1785 |
souaissa |
153 |
}
|
1786 |
|
|
}
|
1787 |
|
|
|
1788 |
|
|
|
1789 |
|
|
|
1790 |
|
|
|
1791 |
|
|
|
1792 |
|
|
for(int i=0;i<Aret2_nouvelles.get_nb();i++)
|
1793 |
|
|
{
|
1794 |
|
|
int art_nouv=Aret2_nouvelles.get(i);
|
1795 |
|
|
if(! Aret2_conservees.est_dans_la_liste(Aret2_nouvelles.get(i)))
|
1796 |
|
|
{
|
1797 |
|
|
MG_ARETE*art_app=mggeo2->get_mg_areteid(art_nouv);
|
1798 |
|
|
Results.ajouter_liste_topologie(MODIFIE_APPARUE,art_app);
|
1799 |
|
|
}
|
1800 |
|
|
}
|
1801 |
|
|
|
1802 |
|
|
for(int i=0;i<Aret1_disparues.get_nb();i++)
|
1803 |
|
|
{
|
1804 |
|
|
int art_nouv=Aret1_disparues.get(i);
|
1805 |
|
|
if(! Aret1_conservees.est_dans_la_liste(Aret1_disparues.get(i)))
|
1806 |
|
|
{
|
1807 |
|
|
MG_ARETE*art_disp=mggeo1->get_mg_areteid(art_nouv);
|
1808 |
|
|
Results.ajouter_liste_topologie(ORIGINE_DISPARUE,art_disp);
|
1809 |
|
|
}
|
1810 |
souaissa |
142 |
}
|
1811 |
|
|
|
1812 |
souaissa |
153 |
|
1813 |
souaissa |
142 |
for(int j=0;j<dif2.get_nb();j++)
|
1814 |
|
|
{
|
1815 |
souaissa |
158 |
if(!face2_conservees.est_dans_la_liste(dif2.get(j)))
|
1816 |
souaissa |
142 |
{
|
1817 |
|
|
int nouv_face=dif2.get(j);
|
1818 |
|
|
faces_nouvelles.ajouter(nouv_face);
|
1819 |
|
|
MG_FACE* Face_Nouvelle=mggeo2->get_mg_faceid(nouv_face);
|
1820 |
souaissa |
145 |
Results.ajouter_liste_topologie(MODIFIE_APPARUE,Face_Nouvelle);
|
1821 |
souaissa |
143 |
int nb_boucle2=Face_Nouvelle->get_nb_mg_boucle();
|
1822 |
|
|
|
1823 |
|
|
for(int j=0;j<nb_boucle2;j++)
|
1824 |
|
|
{
|
1825 |
|
|
MG_BOUCLE* Boucle2 = Face_Nouvelle->get_mg_boucle(j);
|
1826 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1827 |
|
|
for(int w2=0;w2<nbarete2;w2++)
|
1828 |
|
|
{
|
1829 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1830 |
|
|
MG_ARETE* arete_nouvelle = coArete2->get_arete();
|
1831 |
souaissa |
145 |
Results.ajouter_liste_topologie(MODIFIE_APPARUE,arete_nouvelle);
|
1832 |
souaissa |
143 |
MG_COSOMMET* cosommt1= arete_nouvelle->get_cosommet1();
|
1833 |
|
|
MG_COSOMMET* cosommt2= arete_nouvelle->get_cosommet2();
|
1834 |
|
|
MG_SOMMET* nouveau_sommet1= cosommt1->get_sommet();
|
1835 |
|
|
MG_SOMMET* nouveau_sommet2= cosommt2->get_sommet();
|
1836 |
souaissa |
145 |
Results.ajouter_liste_topologie(MODIFIE_APPARUE,nouveau_sommet1);
|
1837 |
|
|
Results.ajouter_liste_topologie(MODIFIE_APPARUE,nouveau_sommet2);
|
1838 |
souaissa |
143 |
}
|
1839 |
|
|
}
|
1840 |
|
|
}
|
1841 |
|
|
}
|
1842 |
|
|
|
1843 |
souaissa |
153 |
for(int i1=0;i1<nb_face1;i1++)
|
1844 |
|
|
{
|
1845 |
|
|
MG_FACE*face1=mggeo1->get_mg_face(i1);
|
1846 |
|
|
int face1_id=face1->get_id();
|
1847 |
|
|
if(!face1_conservees.est_dans_la_liste(face1_id))
|
1848 |
|
|
{
|
1849 |
|
|
Results.ajouter_liste_topologie(ORIGINE_DISPARUE,face1);
|
1850 |
|
|
int nb_boucle1=face1->get_nb_mg_boucle();
|
1851 |
|
|
for(int j1=0;j1<nb_boucle1;j1++)
|
1852 |
|
|
{
|
1853 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
1854 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
1855 |
|
|
for (int w1 =0; w1<nbarete1;w1++)
|
1856 |
|
|
{
|
1857 |
|
|
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
1858 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
1859 |
|
|
int id_art1=arete1->get_id();
|
1860 |
|
|
Results.ajouter_liste_topologie(ORIGINE_DISPARUE,arete1);
|
1861 |
souaissa |
143 |
|
1862 |
souaissa |
153 |
}
|
1863 |
|
|
}
|
1864 |
|
|
}
|
1865 |
|
|
}
|
1866 |
souaissa |
143 |
|
1867 |
souaissa |
153 |
for(int i=0;i<nb_face1;i++)
|
1868 |
|
|
{
|
1869 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
1870 |
|
|
MG_SURFACE* surf1=face1->get_surface();
|
1871 |
|
|
int id1=face1->get_id();
|
1872 |
|
|
if(!face1_conservees.est_dans_la_liste(id1))
|
1873 |
|
|
{
|
1874 |
|
|
OT_TENSEUR tns1_surf(4),tns2_surf(4);
|
1875 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
1876 |
|
|
vector<double2> isurf1;
|
1877 |
|
|
for(int r=0;r<4;r++)
|
1878 |
|
|
{
|
1879 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
1880 |
|
|
}
|
1881 |
|
|
for(int j=0;j<nb_face2;j++)
|
1882 |
|
|
{
|
1883 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
1884 |
|
|
MG_SURFACE* surf2=face2->get_surface();
|
1885 |
|
|
int id2=face2->get_id();
|
1886 |
|
|
CORRESPONDANCE CORRESP_FACE;
|
1887 |
|
|
OT_VECTEUR_4DD G1=surf1->get_vectorisation().calcule_barycentre(T1);
|
1888 |
|
|
OT_VECTEUR_4DD G2=surf2->get_vectorisation().calcule_barycentre(T2);
|
1889 |
|
|
G1=surf1->get_vectorisation().get_nouveau_pt(T1,G1);
|
1890 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
1891 |
|
|
vector<double2> isurf2;
|
1892 |
|
|
for(int r=0;r<4;r++)
|
1893 |
|
|
{
|
1894 |
|
|
isurf2.insert( isurf2.end(), tns1_surf(r,r));
|
1895 |
|
|
}
|
1896 |
|
|
vector<unsigned int> indx1;
|
1897 |
|
|
if(tns1_surf.listes_equivalentes(isurf1,isurf2,indx1))
|
1898 |
|
|
{
|
1899 |
|
|
if(G1==G2)
|
1900 |
|
|
{
|
1901 |
|
|
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,face1);
|
1902 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,face2);
|
1903 |
|
|
CORRESP_FACE.eleorigine=face1;
|
1904 |
|
|
CORRESP_FACE.elemodifie=face2;
|
1905 |
|
|
Results.ajouter_liste_topologie(CORRESP_FACE);
|
1906 |
|
|
|
1907 |
|
|
}
|
1908 |
|
|
}
|
1909 |
|
|
}
|
1910 |
|
|
}
|
1911 |
|
|
}
|
1912 |
|
|
|
1913 |
souaissa |
158 |
identite.vide();
|
1914 |
|
|
for(int i=0;i<face1_conservees.get_nb();i++)
|
1915 |
|
|
{
|
1916 |
|
|
identite.ajouter( face1_conservees.get(i));
|
1917 |
|
|
identite.ajouter( face2_conservees.get(i));
|
1918 |
|
|
}
|
1919 |
|
|
this->affecter_les_couleurs(1);
|
1920 |
|
|
|
1921 |
souaissa |
143 |
}
|
1922 |
|
|
|
1923 |
souaissa |
158 |
int VCT_COMPARAISON::surfaces_sont_elles_identiques(MG_FACE* face1,MG_FACE* face2)
|
1924 |
|
|
{
|
1925 |
|
|
MG_SURFACE* surf1=face1->get_surface();
|
1926 |
|
|
MG_SURFACE* surf2=face2->get_surface();
|
1927 |
|
|
vector<double2> isurf1,isurf2;
|
1928 |
|
|
vector<unsigned int> indx1;
|
1929 |
|
|
TPL_LISTE_ENTITE<double> parm1,parm2;
|
1930 |
|
|
OT_VECTEUR_4DD Dv1,Dv2,axe3;
|
1931 |
|
|
OT_VECTEUR_4DD VNUL(0.,0.,0.,0.);
|
1932 |
|
|
double2 ZER=0.;
|
1933 |
|
|
OT_TENSEUR tm1_surf(4),tm2_surf(4),tns1_surf(4),tns2_surf(4),V1(4),V2(4);
|
1934 |
|
|
OT_VECTEUR_4DD G1=surf1->get_vectorisation().calcule_barycentre(T1);
|
1935 |
|
|
G1=surf1->get_vectorisation().get_nouveau_pt(T1,G1);
|
1936 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
1937 |
|
|
OT_VECTEUR_4DD G2=surf2->get_vectorisation().calcule_barycentre(T2);
|
1938 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
1939 |
|
|
tm1_surf=surf1->get_vectorisation().calcule_tenseur_metrique();
|
1940 |
|
|
tm2_surf=surf2->get_vectorisation().calcule_tenseur_metrique();
|
1941 |
|
|
|
1942 |
|
|
surf1->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
1943 |
|
|
surf2->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
1944 |
|
|
|
1945 |
|
|
for(int r=0;r<4;r++)
|
1946 |
|
|
{
|
1947 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
1948 |
|
|
isurf2.insert( isurf2.end(), tns2_surf(r,r));
|
1949 |
|
|
}
|
1950 |
|
|
|
1951 |
|
|
if(surf2->get_type_geometrique(parm2)==MGCo_PLAN)
|
1952 |
|
|
{
|
1953 |
|
|
axe3[0]= parm2.get(3);
|
1954 |
|
|
axe3[1]= parm2.get(4);
|
1955 |
|
|
axe3[2]= parm2.get(5);
|
1956 |
|
|
axe3[3]= 0;
|
1957 |
|
|
G1=face1->get_vectorisation().calcule_barycentre(T1);
|
1958 |
|
|
G2=face2->get_vectorisation().calcule_barycentre(T2);
|
1959 |
|
|
|
1960 |
|
|
}
|
1961 |
souaissa |
159 |
if(surf2->get_type_geometrique(parm1)==MGCo_CYLINDRE||surf2->get_type_geometrique(parm2)==MGCo_CONE)
|
1962 |
souaissa |
158 |
{
|
1963 |
|
|
axe3[0]= parm2.get(3);
|
1964 |
|
|
axe3[1]= parm2.get(4);
|
1965 |
|
|
axe3[2]= parm2.get(5);
|
1966 |
|
|
axe3[3]= 0;
|
1967 |
|
|
}
|
1968 |
|
|
//axe3=surf1->get_vectorisation().get_nouveau_pt(T1,axe3);
|
1969 |
|
|
double2 d1=axe3[0]*G1[0]+axe3[1]*G1[1]+axe3[2]*G1[3];
|
1970 |
|
|
double2 d2=axe3[0]*G2[0]+axe3[1]*G2[1]+axe3[2]*G2[3];
|
1971 |
|
|
|
1972 |
|
|
if(tm1_surf.est_til_equivalent(tm2_surf))
|
1973 |
|
|
{
|
1974 |
|
|
if (tns1_surf.listes_equivalentes(isurf1,isurf2,indx1))
|
1975 |
|
|
{
|
1976 |
|
|
OT_VECTEUR_4DD G1G2= G1-G2;
|
1977 |
|
|
double2 mm=G1G2*axe3;
|
1978 |
|
|
if(ZER==mm)
|
1979 |
|
|
{
|
1980 |
|
|
return 1;
|
1981 |
|
|
}
|
1982 |
|
|
}
|
1983 |
|
|
}
|
1984 |
|
|
return 0;
|
1985 |
|
|
}
|
1986 |
|
|
|
1987 |
souaissa |
159 |
|
1988 |
|
|
int VCT_COMPARAISON::courbes_sont_elles_identiques(MG_ARETE* arete1,MG_ARETE* arete2)
|
1989 |
|
|
{
|
1990 |
|
|
MG_COURBE* courb1=arete1->get_courbe();
|
1991 |
|
|
MG_COURBE* courb2=arete2->get_courbe();
|
1992 |
|
|
vector<double2> icourb1,icourb2;
|
1993 |
|
|
vector<unsigned int> indx1;
|
1994 |
|
|
TPL_LISTE_ENTITE<double> parm1,parm2;
|
1995 |
|
|
OT_VECTEUR_4DD Dv1,Dv2,axe3;
|
1996 |
|
|
OT_VECTEUR_4DD VNUL(0.,0.,0.,0.);
|
1997 |
|
|
double2 ZER=0.;
|
1998 |
|
|
OT_TENSEUR tm1_surf(4),tm2_surf(4),tns1_surf(4),tns2_surf(4),V1(4),V2(4);
|
1999 |
|
|
OT_VECTEUR_4DD G1=courb1->get_vectorisation().calcule_barycentre(T1);
|
2000 |
|
|
G1=courb1->get_vectorisation().get_nouveau_pt(T1,G1);
|
2001 |
|
|
tns1_surf=courb1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
2002 |
|
|
OT_VECTEUR_4DD G2=courb2->get_vectorisation().calcule_barycentre(T2);
|
2003 |
|
|
tns2_surf=courb2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
2004 |
|
|
tm1_surf=courb1->get_vectorisation().calcule_tenseur_metrique();
|
2005 |
|
|
tm2_surf=courb2->get_vectorisation().calcule_tenseur_metrique();
|
2006 |
|
|
|
2007 |
|
|
courb1->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
2008 |
|
|
courb2->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
2009 |
|
|
|
2010 |
|
|
for(int r=0;r<4;r++)
|
2011 |
|
|
{
|
2012 |
|
|
icourb1.insert( icourb1.end(), tns1_surf(r,r));
|
2013 |
|
|
icourb2.insert( icourb2.end(), tns2_surf(r,r));
|
2014 |
|
|
}
|
2015 |
|
|
|
2016 |
|
|
if(courb2->get_type_geometrique(parm2)==MGCo_LINE)
|
2017 |
|
|
{
|
2018 |
|
|
axe3[0]= parm2.get(3);
|
2019 |
|
|
axe3[1]= parm2.get(4);
|
2020 |
|
|
axe3[2]= parm2.get(5);
|
2021 |
|
|
axe3[3]= 0;
|
2022 |
|
|
G1=arete1->get_vectorisation().calcule_barycentre(T1);
|
2023 |
|
|
G2=arete2->get_vectorisation().calcule_barycentre(T2);
|
2024 |
|
|
|
2025 |
|
|
}
|
2026 |
|
|
if(courb2->get_type_geometrique(parm1)==MGCo_CIRCLE||courb2->get_type_geometrique(parm2)==MGCo_ELLIPSE)
|
2027 |
|
|
{
|
2028 |
|
|
axe3[0]= parm2.get(3);
|
2029 |
|
|
axe3[1]= parm2.get(4);
|
2030 |
|
|
axe3[2]= parm2.get(5);
|
2031 |
|
|
axe3[3]= 0;
|
2032 |
|
|
}
|
2033 |
|
|
|
2034 |
|
|
if(tm1_surf.est_til_equivalent(tm2_surf))
|
2035 |
|
|
{
|
2036 |
|
|
if (tns1_surf.listes_equivalentes(icourb1,icourb2,indx1))
|
2037 |
|
|
{
|
2038 |
|
|
OT_VECTEUR_4DD G1G2= G1-G2;
|
2039 |
|
|
OT_VECTEUR_4DD mm=G1G2^axe3;
|
2040 |
|
|
if(VNUL==mm)
|
2041 |
|
|
{
|
2042 |
|
|
return 1;
|
2043 |
|
|
}
|
2044 |
|
|
}
|
2045 |
|
|
}
|
2046 |
|
|
return 0;
|
2047 |
|
|
|
2048 |
|
|
|
2049 |
|
|
|
2050 |
|
|
|
2051 |
|
|
}
|
2052 |
|
|
|
2053 |
|
|
|
2054 |
|
|
|
2055 |
|
|
|
2056 |
|
|
|
2057 |
|
|
|
2058 |
souaissa |
153 |
void VCT_COMPARAISON::identifier_les_sommets(MG_FACE* face1_ref,MG_FACE* face2_ref,TPL_LISTE_ENTITE<int>& lst_corrsp_sommets,VCT_COMPARAISON_RESULTAT& Results)
|
2059 |
souaissa |
143 |
{
|
2060 |
souaissa |
153 |
|
2061 |
souaissa |
143 |
OT_VECTEUR_4DD Dv1,Dv2,G1,gf1,gf2,G2;
|
2062 |
|
|
OT_TENSEUR V1(4),V2(4);
|
2063 |
souaissa |
153 |
TPL_LISTE_ENTITE<int> lst1_som_trouve;
|
2064 |
|
|
TPL_LISTE_ENTITE<int> lst2_som_trouve;
|
2065 |
|
|
face1_ref->get_vectorisation().calcule_axes_dinertie(T1,Dv1,V1);
|
2066 |
|
|
G1=face1_ref->get_vectorisation().calcule_barycentre(T1);
|
2067 |
souaissa |
143 |
|
2068 |
souaissa |
153 |
/*
|
2069 |
souaissa |
143 |
for(int r=0;r<4;r++) {
|
2070 |
|
|
for(int s=0;s<4;s++) {
|
2071 |
|
|
gf1[r]= gf1[r]+V1(s,r)*G1[s];
|
2072 |
|
|
}
|
2073 |
souaissa |
153 |
} */
|
2074 |
souaissa |
143 |
|
2075 |
souaissa |
153 |
face2_ref->get_vectorisation().calcule_axes_dinertie(T2,Dv2,V2);
|
2076 |
|
|
G2=face2_ref->get_vectorisation().calcule_barycentre(T2);
|
2077 |
|
|
/*
|
2078 |
souaissa |
143 |
for(int r=0;r<4;r++) {
|
2079 |
|
|
for(int s=0;s<4;s++) {
|
2080 |
|
|
gf2[r]= gf2[r]+V2(s,r)*G2[s];
|
2081 |
|
|
}
|
2082 |
souaissa |
153 |
} */
|
2083 |
souaissa |
143 |
|
2084 |
|
|
int nb_sommet1= mggeo1->get_nb_mg_sommet();
|
2085 |
|
|
int nb_sommet2= mggeo2->get_nb_mg_sommet();
|
2086 |
|
|
|
2087 |
|
|
|
2088 |
souaissa |
153 |
|
2089 |
souaissa |
143 |
for(int i=0;i<nb_sommet1;i++)
|
2090 |
|
|
{
|
2091 |
|
|
double xyz1[3];
|
2092 |
souaissa |
153 |
OT_VECTEUR_4DD S1,s1, G1G1REF;
|
2093 |
souaissa |
143 |
MG_SOMMET *som1=mggeo1->get_mg_sommet(i);
|
2094 |
|
|
MG_POINT* pt1=som1->get_point();
|
2095 |
|
|
int som1_id=som1->get_id();
|
2096 |
|
|
pt1->evaluer(xyz1);
|
2097 |
|
|
for(int t=0;t<3;t++) s1[t]=xyz1[t];
|
2098 |
souaissa |
153 |
G1G1REF=s1-G1;
|
2099 |
|
|
G1G1REF=face1_ref->get_vectorisation().get_nouveau_pt(T1,G1G1REF);
|
2100 |
|
|
/*
|
2101 |
souaissa |
143 |
for(int r=0;r<4;r++) {
|
2102 |
|
|
for(int s=0;s<4;s++) {
|
2103 |
|
|
S1[r]= S1[r]+V1(s,r)*s1[s];
|
2104 |
|
|
}
|
2105 |
souaissa |
153 |
} */
|
2106 |
souaissa |
143 |
|
2107 |
souaissa |
153 |
|
2108 |
souaissa |
143 |
for(int j=0;j<nb_sommet2;j++)
|
2109 |
|
|
{
|
2110 |
|
|
double xyz2[3];
|
2111 |
souaissa |
153 |
OT_VECTEUR_4DD S2,s2,G2G2REF;
|
2112 |
souaissa |
143 |
MG_SOMMET *som2=mggeo2->get_mg_sommet(j);
|
2113 |
|
|
MG_POINT* pt2=som2->get_point();
|
2114 |
|
|
int som2_id=som2->get_id();
|
2115 |
souaissa |
153 |
if( lst1_som_trouve.est_dans_la_liste(som1_id)) break;
|
2116 |
|
|
|
2117 |
souaissa |
143 |
pt2->evaluer(xyz2);
|
2118 |
|
|
for(int t=0;t<3;t++) s2[t]=xyz2[t];
|
2119 |
souaissa |
153 |
G2G2REF=s2-G2;
|
2120 |
|
|
/*
|
2121 |
souaissa |
143 |
for(int r=0;r<4;r++) {
|
2122 |
|
|
for(int s=0;s<4;s++) {
|
2123 |
|
|
S2[r]= S2[r]+V2(s,r)*s2[s];
|
2124 |
|
|
}
|
2125 |
souaissa |
153 |
} */
|
2126 |
souaissa |
143 |
|
2127 |
souaissa |
153 |
if (G1G1REF==G2G2REF)
|
2128 |
souaissa |
143 |
{
|
2129 |
francois |
144 |
Results.ajouter_liste_topologie(ORIGINE_CONSERVEE,som1);
|
2130 |
|
|
Results.ajouter_liste_topologie(MODIFIE_CONSERVEE,som2);
|
2131 |
souaissa |
143 |
CORRESPONDANCE CORRESP;
|
2132 |
|
|
CORRESP.eleorigine=som1;
|
2133 |
|
|
CORRESP.elemodifie=som2;
|
2134 |
|
|
Results.ajouter_liste_topologie(CORRESP);
|
2135 |
souaissa |
153 |
lst_corrsp_sommets.ajouter(som1_id);
|
2136 |
|
|
lst_corrsp_sommets.ajouter(som2_id);
|
2137 |
|
|
lst1_som_trouve.ajouter(som1_id);
|
2138 |
|
|
lst2_som_trouve.ajouter(som2_id);
|
2139 |
|
|
}
|
2140 |
souaissa |
143 |
|
2141 |
|
|
}
|
2142 |
souaissa |
153 |
|
2143 |
|
|
|
2144 |
|
|
|
2145 |
souaissa |
143 |
}
|
2146 |
souaissa |
142 |
|
2147 |
souaissa |
143 |
|
2148 |
souaissa |
153 |
for(int i=0;i<nb_sommet1;i++)
|
2149 |
|
|
{
|
2150 |
|
|
MG_SOMMET *som=mggeo1->get_mg_sommet(i);
|
2151 |
|
|
int som_id=som->get_id();
|
2152 |
|
|
if(! lst1_som_trouve.est_dans_la_liste(som_id))
|
2153 |
|
|
{
|
2154 |
souaissa |
143 |
|
2155 |
souaissa |
153 |
Results.ajouter_liste_topologie(ORIGINE_DISPARUE,som);
|
2156 |
souaissa |
143 |
|
2157 |
souaissa |
153 |
}
|
2158 |
souaissa |
143 |
|
2159 |
souaissa |
153 |
}
|
2160 |
souaissa |
143 |
|
2161 |
souaissa |
153 |
for(int i=0;i<nb_sommet2;i++)
|
2162 |
|
|
{
|
2163 |
|
|
MG_SOMMET *som=mggeo2->get_mg_sommet(i);
|
2164 |
|
|
int som_id=som->get_id();
|
2165 |
|
|
if(! lst2_som_trouve.est_dans_la_liste(som_id))
|
2166 |
|
|
{
|
2167 |
|
|
|
2168 |
|
|
Results.ajouter_liste_topologie(MODIFIE_APPARUE,som);
|
2169 |
|
|
|
2170 |
|
|
}
|
2171 |
|
|
|
2172 |
|
|
}
|
2173 |
|
|
|
2174 |
souaissa |
87 |
}
|
2175 |
|
|
|
2176 |
|
|
|
2177 |
souaissa |
153 |
|
2178 |
|
|
|
2179 |
|
|
|
2180 |
|
|
void VCT_COMPARAISON::get_syteme_daxes_globale()
|
2181 |
|
|
{
|
2182 |
|
|
|
2183 |
|
|
OT_VECTEUR_4DD Dv1,Dv2,Dw,G1,G2,G1G2;
|
2184 |
|
|
OT_TENSEUR p(4),q(4),pT,qT;
|
2185 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
2186 |
|
|
int nb_face2=mggeo1->get_nb_mg_face();
|
2187 |
|
|
OT_VECTEUR_4DD VNul(0.,0.,0.,0.);
|
2188 |
|
|
double2 cof=-1;
|
2189 |
|
|
int plan=-1;
|
2190 |
|
|
for(int i=3;i<nb_face1;i++)
|
2191 |
|
|
{
|
2192 |
|
|
OT_TENSEUR inertie_face1(4);
|
2193 |
|
|
vector<double2> iface1;
|
2194 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
2195 |
|
|
int id_face1=face1->get_id();
|
2196 |
|
|
face1->get_vectorisation().calcule_axes_dinertie(T1,Dv1,p);
|
2197 |
|
|
pT=p.transpose();
|
2198 |
|
|
G1= face1->get_vectorisation().calcule_barycentre(T1);
|
2199 |
|
|
inertie_face1=face1->get_vectorisation().calcule_tenseur_inertie_base_locale(T1);
|
2200 |
|
|
vector<OT_VECTEUR_4DD>& list_points1=face1->get_vectorisation().get_points_controle();
|
2201 |
|
|
vector<OT_VECTEUR_4DD>& list_vecteurs1=face1->get_vectorisation().get_vecteurs();
|
2202 |
|
|
OT_VECTEUR_4DD Normal1(0.,0.,0.,0.),N1;
|
2203 |
|
|
OT_VECTEUR_4DD axe11,axe12,axe13;
|
2204 |
|
|
int cmpt=0;
|
2205 |
|
|
|
2206 |
|
|
OT_VECTEUR_4DD v11= list_vecteurs1[0];
|
2207 |
|
|
int nb_vecteur1=list_vecteurs1.size();
|
2208 |
|
|
for(unsigned int pi=0;pi<nb_vecteur1-1;pi++)
|
2209 |
|
|
{
|
2210 |
|
|
|
2211 |
|
|
OT_VECTEUR_4DD v2= list_vecteurs1[pi+1];
|
2212 |
|
|
if(pi==0)
|
2213 |
|
|
Normal1=v11^v2;
|
2214 |
|
|
if (pi>0)
|
2215 |
|
|
N1=v11^v2;
|
2216 |
|
|
OT_VECTEUR_4DD colineaire= Normal1^N1;
|
2217 |
|
|
if(colineaire==VNul)
|
2218 |
|
|
{
|
2219 |
|
|
cmpt++;
|
2220 |
|
|
}
|
2221 |
|
|
}
|
2222 |
|
|
vector<OT_VECTEUR_4DD> axes1;
|
2223 |
|
|
if ( cmpt== list_vecteurs1.size()-1)
|
2224 |
|
|
{
|
2225 |
|
|
plan=1;
|
2226 |
|
|
axe11=list_vecteurs1[0];
|
2227 |
|
|
axe12=Normal1^axe11;
|
2228 |
|
|
axe13=Normal1;
|
2229 |
|
|
axes1.insert(axes1.end(),axe11);
|
2230 |
|
|
axes1.insert(axes1.end(),axe12);
|
2231 |
|
|
axes1.insert(axes1.end(),axe13);
|
2232 |
|
|
}
|
2233 |
|
|
|
2234 |
|
|
VCT_OUTILS VOUTIL(4);
|
2235 |
|
|
OT_MATRICE_3D sys_axes1=VOUTIL.get_system_axes(G1,axes1,list_points1) ;
|
2236 |
|
|
|
2237 |
|
|
for(int r=0;r<4;r++)
|
2238 |
|
|
{
|
2239 |
|
|
iface1.insert( iface1.end(), inertie_face1(r,r));
|
2240 |
|
|
}
|
2241 |
|
|
|
2242 |
|
|
for(int j=4;j<nb_face2;j++)
|
2243 |
|
|
{
|
2244 |
|
|
OT_TENSEUR inertie_face2(4);
|
2245 |
|
|
vector<double2> iface2;
|
2246 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
2247 |
|
|
int id_face2=face2->get_id();
|
2248 |
|
|
face2->get_vectorisation().calcule_axes_dinertie(T2,Dv2,q);
|
2249 |
|
|
G2= face2->get_vectorisation().calcule_barycentre(T2);
|
2250 |
|
|
qT=q.transpose();
|
2251 |
|
|
inertie_face2=face2->get_vectorisation().calcule_tenseur_inertie_base_locale(T2);
|
2252 |
|
|
vector<OT_VECTEUR_4DD>& list_points2=face2->get_vectorisation().get_points_controle();
|
2253 |
|
|
vector<OT_VECTEUR_4DD>& list_vecteurs2=face2->get_vectorisation().get_vecteurs();
|
2254 |
|
|
OT_VECTEUR_4DD Normal2(0.,0.,0.,0.),N1;
|
2255 |
|
|
OT_VECTEUR_4DD axe21,axe22,axe23;
|
2256 |
|
|
int cmpt=0;
|
2257 |
|
|
OT_VECTEUR_4DD v21= list_vecteurs2[0];
|
2258 |
|
|
int nb_vecteur2=list_vecteurs2.size();
|
2259 |
|
|
for(unsigned int pj=0;pj<nb_vecteur2-1;pj++)
|
2260 |
|
|
{
|
2261 |
|
|
OT_VECTEUR_4DD v2= list_vecteurs2[pj+1];
|
2262 |
|
|
if(pj==0)
|
2263 |
|
|
Normal2=v21^v2;
|
2264 |
|
|
if (pj>0)
|
2265 |
|
|
N1=v21^v2;
|
2266 |
|
|
OT_VECTEUR_4DD colineaire= Normal2^N1;
|
2267 |
|
|
if(colineaire==VNul)
|
2268 |
|
|
{
|
2269 |
|
|
cmpt++;
|
2270 |
|
|
}
|
2271 |
|
|
}
|
2272 |
|
|
vector<OT_VECTEUR_4DD> axes2;
|
2273 |
|
|
if ( cmpt== list_vecteurs2.size()-1)
|
2274 |
|
|
{
|
2275 |
|
|
plan=1;
|
2276 |
|
|
axe21=list_vecteurs2[0];
|
2277 |
|
|
axe22=Normal2^axe21;
|
2278 |
|
|
axe23=Normal2;
|
2279 |
|
|
axes2.insert(axes2.end(),axe21);
|
2280 |
|
|
axes2.insert(axes2.end(),axe22);
|
2281 |
|
|
axes2.insert(axes2.end(),axe23);
|
2282 |
|
|
}
|
2283 |
|
|
|
2284 |
|
|
VCT_OUTILS VOUTIL(4);
|
2285 |
|
|
OT_MATRICE_3D sys_axes2=VOUTIL.get_system_axes(G2,axes2,list_points2) ;
|
2286 |
|
|
|
2287 |
|
|
OT_MATRICE_3D T= sys_axes2*sys_axes1.transpose();
|
2288 |
|
|
|
2289 |
|
|
|
2290 |
|
|
|
2291 |
|
|
|
2292 |
|
|
|
2293 |
|
|
/*
|
2294 |
|
|
for(int r=0;r<4;r++)
|
2295 |
|
|
{
|
2296 |
|
|
iface2.insert( iface2.end(), inertie_face2(r,r));
|
2297 |
|
|
}
|
2298 |
|
|
vector<unsigned int> indx1,indx2;
|
2299 |
|
|
OT_TENSEUR T=q*pT;
|
2300 |
|
|
|
2301 |
|
|
if(inertie_face2.listes_equivalentes(iface1,iface2,indx1))
|
2302 |
|
|
{
|
2303 |
|
|
|
2304 |
|
|
for(int ii=0;ii<list_points1.size();ii++)
|
2305 |
|
|
{
|
2306 |
|
|
OT_VECTEUR_4DD pt1= list_points1[ii];
|
2307 |
|
|
OT_VECTEUR_4DD pt11;
|
2308 |
|
|
|
2309 |
|
|
for(int r=0;r<4;r++)
|
2310 |
|
|
{
|
2311 |
|
|
for(int s=0;s<4;s++)
|
2312 |
|
|
pt11[r]=pt11[r]+T(r,s)*G1[s];
|
2313 |
|
|
}
|
2314 |
|
|
|
2315 |
|
|
for(int jj=0;jj<list_points2.size();jj++)
|
2316 |
|
|
{
|
2317 |
|
|
OT_VECTEUR_4DD pt2= list_points2[jj];
|
2318 |
|
|
OT_VECTEUR_4DD pt22;
|
2319 |
|
|
for(int r=0;r<4;r++)
|
2320 |
|
|
{
|
2321 |
|
|
for(int s=0;s<4;s++)
|
2322 |
|
|
pt22[r]=pt22[r]+T(r,s)*G2[s];
|
2323 |
|
|
}
|
2324 |
|
|
if(pt11==G2)
|
2325 |
|
|
{
|
2326 |
|
|
int g=0;
|
2327 |
|
|
}
|
2328 |
|
|
|
2329 |
|
|
|
2330 |
|
|
}
|
2331 |
|
|
|
2332 |
|
|
|
2333 |
|
|
|
2334 |
|
|
}
|
2335 |
|
|
|
2336 |
|
|
|
2337 |
|
|
} */
|
2338 |
|
|
|
2339 |
|
|
|
2340 |
|
|
}
|
2341 |
|
|
}
|
2342 |
|
|
|
2343 |
|
|
|
2344 |
|
|
}
|
2345 |
|
|
|
2346 |
|
|
|
2347 |
|
|
|
2348 |
|
|
|
2349 |
|
|
|
2350 |
francois |
144 |
std::ostream& operator <<(std::ostream& os,VCT_COMPARAISON& vct_cmp)
|
2351 |
souaissa |
142 |
{
|
2352 |
|
|
vct_cmp.enregistrer(os) ;
|
2353 |
|
|
return os;
|
2354 |
|
|
}
|
2355 |
souaissa |
87 |
|
2356 |
|
|
|
2357 |
|
|
|
2358 |
souaissa |
142 |
|
2359 |
|
|
|
2360 |
souaissa |
87 |
void VCT_COMPARAISON::enregistrer(ostream& os)
|
2361 |
souaissa |
142 |
{
|
2362 |
|
|
os<<"COMPARAISON VECTORIELLE DE DEUX GEOMETRIES"<<endl;
|
2363 |
|
|
int nb_cl=2;
|
2364 |
|
|
int nb_lg=similarite.get_nb()/2;
|
2365 |
souaissa |
66 |
os<<"FACES_PREMIERE_GEOMETRIE : ";
|
2366 |
|
|
for(int j=0;j<nb_lg;j++)
|
2367 |
souaissa |
87 |
os<<setw(5)<<similarite.get(j*nb_cl+0);
|
2368 |
souaissa |
66 |
os<<endl;
|
2369 |
|
|
os<<"FACES_SECONDE_GEOMETRIE : ";
|
2370 |
|
|
for(int j=0;j<nb_lg;j++)
|
2371 |
souaissa |
87 |
os<<setw(5)<<similarite.get(j*nb_cl+1);
|
2372 |
souaissa |
66 |
os<<endl;
|
2373 |
|
|
|
2374 |
souaissa |
87 |
//affecter_une_couleur();
|
2375 |
souaissa |
82 |
|
2376 |
|
|
|
2377 |
souaissa |
142 |
}
|
2378 |
souaissa |
143 |
|
2379 |
|
|
|
2380 |
|
|
|
2381 |
souaissa |
153 |
int VCT_COMPARAISON::modele_a_change_de_repere()
|
2382 |
|
|
{
|
2383 |
|
|
int nb_sommet1= mggeo1->get_nb_mg_sommet();
|
2384 |
|
|
int nb_sommet2= mggeo2->get_nb_mg_sommet();
|
2385 |
souaissa |
143 |
|
2386 |
souaissa |
153 |
int trouve=0;
|
2387 |
|
|
int cmt=0;
|
2388 |
|
|
for(int i=0;i<nb_sommet1;i++)
|
2389 |
|
|
{
|
2390 |
|
|
double xyz1[3];
|
2391 |
|
|
OT_VECTEUR_4DD S1,s1;
|
2392 |
|
|
MG_SOMMET *som1=
|
2393 |
|
|
mggeo1->get_mg_sommet(i);
|
2394 |
|
|
MG_POINT* pt1=som1->get_point();
|
2395 |
|
|
int som1_id=som1->get_id();
|
2396 |
|
|
pt1->evaluer(xyz1);
|
2397 |
|
|
for(int t=0;t<3;t++) s1[t]=xyz1[t];
|
2398 |
|
|
|
2399 |
|
|
|
2400 |
|
|
for(int j=0;j<nb_sommet2;j++)
|
2401 |
|
|
{
|
2402 |
|
|
double xyz2[3];
|
2403 |
|
|
OT_VECTEUR_4DD S2,s2;
|
2404 |
|
|
MG_SOMMET *som2=mggeo2->get_mg_sommet(j);
|
2405 |
|
|
MG_POINT* pt2=som2->get_point();
|
2406 |
|
|
int som2_id=som2->get_id();
|
2407 |
|
|
pt2->evaluer(xyz2);
|
2408 |
|
|
for(int t=0;t<3;t++) s2[t]=xyz2[t];
|
2409 |
|
|
|
2410 |
|
|
|
2411 |
|
|
if (s1==s2)
|
2412 |
|
|
{
|
2413 |
|
|
trouve=1;
|
2414 |
|
|
break;
|
2415 |
|
|
}
|
2416 |
|
|
|
2417 |
|
|
}
|
2418 |
|
|
if (trouve==-1) return trouve;
|
2419 |
|
|
}
|
2420 |
|
|
|
2421 |
|
|
|
2422 |
|
|
return trouve;
|
2423 |
|
|
|
2424 |
|
|
}
|
2425 |
|
|
|