1 |
souaissa |
66 |
//---------------------------------------------------------------------------
|
2 |
|
|
#include"gestionversion.h"
|
3 |
|
|
|
4 |
|
|
#pragma hdrstop
|
5 |
|
|
|
6 |
|
|
#include "vct_comparaison.h"
|
7 |
souaissa |
74 |
#include"ot_mathematique.h"
|
8 |
souaissa |
87 |
#include "vct_face.h"
|
9 |
|
|
#include "vct_surface.h"
|
10 |
souaissa |
142 |
#include <iomanip.h>
|
11 |
souaissa |
87 |
|
12 |
souaissa |
66 |
//---------------------------------------------------------------------------
|
13 |
|
|
|
14 |
|
|
#pragma package(smart_init)
|
15 |
|
|
|
16 |
|
|
|
17 |
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)
|
18 |
souaissa |
66 |
{
|
19 |
francois |
89 |
}
|
20 |
souaissa |
66 |
|
21 |
souaissa |
99 |
VCT_COMPARAISON::~VCT_COMPARAISON()
|
22 |
|
|
{
|
23 |
|
|
}
|
24 |
souaissa |
66 |
|
25 |
francois |
89 |
|
26 |
|
|
void VCT_COMPARAISON::compare_les_deux_geometries(void)
|
27 |
|
|
{
|
28 |
souaissa |
87 |
int nb_face1=mggeo1->get_nb_mg_face();
|
29 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
30 |
souaissa |
66 |
|
31 |
souaissa |
87 |
for(int i=0;i<nb_face1; i++)
|
32 |
|
|
{
|
33 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
34 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
35 |
|
|
int id1=face1->get_id();
|
36 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
37 |
|
|
OT_TENSEUR ttns1_face(4),ttns1_surf(4);
|
38 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
39 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
40 |
|
|
|
41 |
|
|
tns1_face=face1->get_vectorisation().calcule_tenseur_metrique();
|
42 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_metrique();
|
43 |
|
|
|
44 |
|
|
ttns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
45 |
|
|
ttns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
46 |
|
|
vector<double2> ifac1; vector<double2>isurf1;
|
47 |
|
|
for(int r=0;r<4;r++)
|
48 |
|
|
{
|
49 |
|
|
ifac1.insert( ifac1.end(), ttns1_face(r,r));
|
50 |
|
|
isurf1.insert( isurf1.end(), ttns1_surf(r,r));
|
51 |
|
|
}
|
52 |
souaissa |
99 |
int cmpt=0;
|
53 |
souaissa |
87 |
for(int j=0;j<nb_face2;j++)
|
54 |
|
|
{
|
55 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
56 |
|
|
MG_SURFACE*surf2=face2->get_surface();
|
57 |
|
|
int id2=face2->get_id();
|
58 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
59 |
|
|
OT_TENSEUR ttns2_face(4),ttns2_surf(4);
|
60 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
61 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
62 |
|
|
tns2_face=face2->get_vectorisation().calcule_tenseur_metrique();
|
63 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_metrique();
|
64 |
|
|
ttns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
65 |
|
|
ttns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
66 |
|
|
vector<double2> ifac2; vector<double2> isurf2;
|
67 |
|
|
for(int r=0;r<4;r++)
|
68 |
|
|
{
|
69 |
|
|
ifac2.insert( ifac2.end(), ttns2_face(r,r));
|
70 |
|
|
isurf2.insert( isurf2.end(), ttns2_surf(r,r));
|
71 |
|
|
}
|
72 |
|
|
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
73 |
|
|
{
|
74 |
|
|
if(tns1_face.est_til_equivalent(tns2_face))
|
75 |
|
|
{
|
76 |
|
|
if(tns1_surf.est_til_equivalent(tns2_surf))
|
77 |
|
|
{
|
78 |
|
|
similarite.ajouter(id1);
|
79 |
|
|
similarite.ajouter(id2);
|
80 |
|
|
vector<unsigned int> indx1,indx2;
|
81 |
|
|
if(ttns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
82 |
|
|
{
|
83 |
|
|
if(ttns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
84 |
|
|
{
|
85 |
souaissa |
99 |
sim_double.ajouter(id1) ;
|
86 |
|
|
sim_double.ajouter(id2) ;
|
87 |
|
|
cmpt++;
|
88 |
souaissa |
87 |
}
|
89 |
souaissa |
99 |
}
|
90 |
souaissa |
87 |
|
91 |
souaissa |
99 |
}
|
92 |
souaissa |
87 |
}
|
93 |
souaissa |
99 |
}
|
94 |
|
|
}
|
95 |
souaissa |
87 |
|
96 |
souaissa |
99 |
nb_sim.ajouter(cmpt);
|
97 |
souaissa |
87 |
}
|
98 |
|
|
|
99 |
souaissa |
99 |
this->affecter_les_couleurs(23);
|
100 |
souaissa |
66 |
}
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
francois |
89 |
void VCT_COMPARAISON::trouver_les_identites(void)
|
105 |
souaissa |
87 |
{
|
106 |
souaissa |
142 |
|
107 |
|
|
TPL_LISTE_ENTITE<int> lst_fin;
|
108 |
souaissa |
87 |
TPL_LISTE_ENTITE<int> lst;
|
109 |
souaissa |
90 |
compare_les_deux_geometries();
|
110 |
souaissa |
99 |
int nb_face1=mggeo1->get_nb_mg_face();
|
111 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
112 |
souaissa |
90 |
|
113 |
souaissa |
99 |
int nb_fsim1=sim_double.get_nb()/2;
|
114 |
|
|
int nb_fsim2=sim_double.get_nb()/2;
|
115 |
souaissa |
87 |
|
116 |
|
|
|
117 |
|
|
|
118 |
souaissa |
99 |
this->trouve_face_de_reference(face_ref1,face_ref2);//,ls,lst_fin
|
119 |
souaissa |
87 |
|
120 |
souaissa |
99 |
OT_VECTEUR_4DD Dv,Dv1,Dv2,G1,G2,g1g2;
|
121 |
|
|
OT_TENSEUR V(4),V1(4),V2(4);
|
122 |
|
|
OT_VECTEUR_4DD g1_ref,g2_ref;
|
123 |
|
|
MG_FACE* face1_ref=mggeo1->get_mg_faceid(face_ref1);
|
124 |
|
|
face1_ref->get_vectorisation().calcule_axes_dinertie(Dv1,V1);
|
125 |
|
|
G1= face1_ref->get_vectorisation().calcule_barycentre();
|
126 |
|
|
|
127 |
|
|
for(int r=0;r<4;r++) {
|
128 |
|
|
for(int s=0;s<4;s++) {
|
129 |
|
|
g1_ref[r]= g1_ref[r]+V1(s,r)*G1[s];
|
130 |
|
|
}
|
131 |
|
|
}
|
132 |
|
|
|
133 |
|
|
|
134 |
|
|
MG_FACE* face2_ref=mggeo2->get_mg_faceid(face_ref2);
|
135 |
|
|
face2_ref->get_vectorisation().calcule_axes_dinertie(Dv2,V2);
|
136 |
|
|
G2= face2_ref->get_vectorisation().calcule_barycentre();
|
137 |
|
|
for(int r=0;r<4;r++) {
|
138 |
|
|
for(int s=0;s<4;s++) {
|
139 |
|
|
g2_ref[r]= g2_ref[r]+V2(s,r)*G2[s];
|
140 |
|
|
}
|
141 |
|
|
}
|
142 |
|
|
|
143 |
|
|
|
144 |
|
|
OT_VECTEUR_4DD g1refg1,g2refg2;
|
145 |
|
|
TPL_LISTE_ENTITE<int> lst1,lst2;
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
for(int i=0;i<nb_face1;i++)
|
149 |
|
|
{
|
150 |
|
|
OT_VECTEUR_4DD g1,G1;
|
151 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
152 |
|
|
int id1=face1->get_id();
|
153 |
|
|
G1= face1->get_vectorisation().calcule_barycentre();
|
154 |
|
|
for(int r=0;r<4;r++) {
|
155 |
|
|
for(int s=0;s<4;s++) {
|
156 |
|
|
g1[r]= g1[r]+V1(s,r)*G1[s];
|
157 |
|
|
}
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
g1refg1=g1-g1_ref;
|
161 |
|
|
// num2=list.get(2*i+1);
|
162 |
|
|
for(int j=0;j<nb_face2;j++)
|
163 |
|
|
{
|
164 |
|
|
|
165 |
|
|
OT_VECTEUR_4DD g2;
|
166 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
167 |
|
|
int id2=face2->get_id();
|
168 |
|
|
G2= face2->get_vectorisation().calcule_barycentre();
|
169 |
|
|
for(int r=0;r<4;r++) {
|
170 |
|
|
for(int s=0;s<4;s++) {
|
171 |
|
|
g2[r]= g2[r]+V2(s,r)*G2[s];
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
OT_VECTEUR_4DD g2refg2=g2-g2_ref;
|
176 |
|
|
if(g1refg1==g2refg2)
|
177 |
|
|
{
|
178 |
|
|
identite.ajouter(id1);
|
179 |
|
|
identite.ajouter(id2);
|
180 |
|
|
|
181 |
|
|
break;
|
182 |
|
|
}
|
183 |
|
|
}
|
184 |
|
|
}
|
185 |
|
|
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
|
189 |
souaissa |
87 |
this->affecter_les_couleurs(1);
|
190 |
|
|
|
191 |
|
|
}
|
192 |
|
|
|
193 |
|
|
|
194 |
|
|
|
195 |
|
|
void VCT_COMPARAISON::compare_les_deux_geometries_vectoriellement()
|
196 |
|
|
{
|
197 |
souaissa |
66 |
int nb_face1=mggeo1->get_nb_mg_face();
|
198 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
199 |
souaissa |
87 |
similarite.vide();
|
200 |
|
|
for(int i=0;i<nb_face1; i++)
|
201 |
|
|
{
|
202 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
203 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
204 |
|
|
int id1=face1->get_id();
|
205 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
206 |
|
|
OT_TENSEUR ttns1_face(4),ttns1_surf(4);
|
207 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
208 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
209 |
souaissa |
66 |
|
210 |
souaissa |
87 |
tns1_face=face1->get_vectorisation().calcule_tenseur_metrique();
|
211 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_metrique();
|
212 |
souaissa |
66 |
|
213 |
souaissa |
87 |
for(int j=0;j<nb_face2;j++)
|
214 |
|
|
{
|
215 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
216 |
|
|
MG_SURFACE*surf2=face2->get_surface();
|
217 |
|
|
int id2=face2->get_id();
|
218 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
219 |
|
|
OT_TENSEUR ttns2_face(4),ttns2_surf(4);
|
220 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
221 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
222 |
|
|
tns2_face=face2->get_vectorisation().calcule_tenseur_metrique();
|
223 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_metrique();
|
224 |
souaissa |
66 |
|
225 |
souaissa |
87 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
226 |
|
|
{
|
227 |
|
|
if(tns1_face.est_til_equivalent(tns2_face))
|
228 |
|
|
{
|
229 |
|
|
if(tns1_surf.est_til_equivalent(tns2_surf))
|
230 |
|
|
{
|
231 |
|
|
similarite.ajouter(id1);
|
232 |
|
|
similarite.ajouter(id2);
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
}
|
236 |
|
|
}
|
237 |
|
|
}
|
238 |
|
|
this->affecter_les_couleurs(21);
|
239 |
|
|
|
240 |
|
|
}
|
241 |
|
|
|
242 |
|
|
void VCT_COMPARAISON::compare_les_deux_geometries_inertiellement()
|
243 |
|
|
{
|
244 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
245 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
246 |
|
|
ssimilarite.vide();
|
247 |
|
|
for(int i=0;i<nb_face1; i++)
|
248 |
|
|
{
|
249 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
250 |
|
|
MG_SURFACE*surf1=face1->get_surface();
|
251 |
|
|
int id1=face1->get_id();
|
252 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
253 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
254 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
255 |
|
|
|
256 |
|
|
tns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
257 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
258 |
|
|
vector<double2> ifac1; vector<double2>isurf1;
|
259 |
|
|
for(int r=0;r<4;r++)
|
260 |
|
|
{
|
261 |
|
|
ifac1.insert( ifac1.end(), tns1_face(r,r));
|
262 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
263 |
|
|
}
|
264 |
|
|
|
265 |
souaissa |
66 |
for(int j=0;j<nb_face2;j++)
|
266 |
|
|
{
|
267 |
|
|
|
268 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
269 |
souaissa |
74 |
MG_SURFACE*surf2=face2->get_surface();
|
270 |
souaissa |
66 |
int id2=face2->get_id();
|
271 |
souaissa |
74 |
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
272 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
273 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
274 |
souaissa |
87 |
tns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
275 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
276 |
|
|
vector<double2> ifac2; vector<double2> isurf2;
|
277 |
|
|
for(int r=0;r<4;r++)
|
278 |
|
|
{
|
279 |
|
|
ifac2.insert( ifac2.end(), tns2_face(r,r));
|
280 |
|
|
isurf2.insert( isurf2.end(), tns2_surf(r,r));
|
281 |
|
|
}
|
282 |
souaissa |
66 |
|
283 |
souaissa |
74 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
284 |
souaissa |
66 |
{
|
285 |
souaissa |
87 |
vector<unsigned int> indx1,indx2;
|
286 |
|
|
if(tns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
287 |
souaissa |
66 |
{
|
288 |
souaissa |
87 |
if(tns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
289 |
|
|
{
|
290 |
|
|
ssimilarite.ajouter(id1);
|
291 |
|
|
ssimilarite.ajouter(id2);
|
292 |
|
|
}
|
293 |
souaissa |
66 |
}
|
294 |
souaissa |
87 |
}
|
295 |
souaissa |
66 |
|
296 |
souaissa |
87 |
}
|
297 |
souaissa |
66 |
|
298 |
souaissa |
87 |
}
|
299 |
souaissa |
66 |
|
300 |
souaissa |
90 |
affecter_les_couleurs(22);
|
301 |
souaissa |
87 |
}
|
302 |
|
|
|
303 |
souaissa |
90 |
void VCT_COMPARAISON::compare_une_geometrie_inertiellement(int modele)
|
304 |
souaissa |
87 |
{
|
305 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> ssim_tmp;
|
306 |
souaissa |
87 |
|
307 |
francois |
102 |
MG_GESTIONNAIRE *gst1;
|
308 |
souaissa |
90 |
MG_GEOMETRIE *mgeo1 ;
|
309 |
|
|
int laquelle;
|
310 |
souaissa |
87 |
|
311 |
souaissa |
90 |
switch(modele)
|
312 |
|
|
{
|
313 |
|
|
case 1:
|
314 |
|
|
{
|
315 |
|
|
gst1=gest1;
|
316 |
|
|
mgeo1=mggeo1;
|
317 |
souaissa |
92 |
laquelle=31;
|
318 |
souaissa |
90 |
break;
|
319 |
|
|
}
|
320 |
|
|
case 2:
|
321 |
|
|
{
|
322 |
|
|
gst1=gest2;
|
323 |
|
|
mgeo1=mggeo2;
|
324 |
souaissa |
92 |
laquelle=32;
|
325 |
souaissa |
90 |
break;
|
326 |
|
|
}
|
327 |
souaissa |
87 |
|
328 |
|
|
}
|
329 |
souaissa |
66 |
|
330 |
souaissa |
90 |
int nb_face1=mgeo1->get_nb_mg_face();
|
331 |
souaissa |
99 |
|
332 |
souaissa |
90 |
for(int i=0;i<nb_face1; i++)
|
333 |
souaissa |
87 |
{
|
334 |
souaissa |
90 |
MG_FACE* face1=mgeo1->get_mg_face(i);
|
335 |
souaissa |
87 |
MG_SURFACE*surf1=face1->get_surface();
|
336 |
|
|
int id1=face1->get_id();
|
337 |
|
|
OT_TENSEUR tns1_face(4),tns1_surf(4);
|
338 |
|
|
int nb_top1_pts= face1->get_vectorisation().get_nb_points();
|
339 |
|
|
int nb_geo1_pts= surf1->get_vectorisation().get_nb_points();
|
340 |
souaissa |
66 |
|
341 |
souaissa |
87 |
tns1_face=face1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
342 |
|
|
tns1_surf=surf1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
343 |
|
|
vector<double2> ifac1; vector<double2>isurf1;
|
344 |
|
|
for(int r=0;r<4;r++)
|
345 |
|
|
{
|
346 |
|
|
ifac1.insert( ifac1.end(), tns1_face(r,r));
|
347 |
|
|
isurf1.insert( isurf1.end(), tns1_surf(r,r));
|
348 |
|
|
}
|
349 |
souaissa |
66 |
|
350 |
souaissa |
90 |
for(int j=0;j<nb_face1;j++)
|
351 |
souaissa |
87 |
{
|
352 |
souaissa |
66 |
|
353 |
souaissa |
90 |
MG_FACE* face2=mgeo1->get_mg_face(j);
|
354 |
souaissa |
87 |
MG_SURFACE*surf2=face2->get_surface();
|
355 |
|
|
int id2=face2->get_id();
|
356 |
|
|
OT_TENSEUR tns2_face(4),tns2_surf(4);
|
357 |
|
|
int nb_top2_pts= face2->get_vectorisation().get_nb_points();
|
358 |
|
|
int nb_geo2_pts= surf2->get_vectorisation().get_nb_points();
|
359 |
|
|
tns2_face=face2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
360 |
|
|
tns2_surf=surf2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
361 |
|
|
vector<double2> ifac2; vector<double2> isurf2;
|
362 |
|
|
for(int r=0;r<4;r++)
|
363 |
|
|
{
|
364 |
|
|
ifac2.insert( ifac2.end(), tns2_face(r,r));
|
365 |
|
|
isurf2.insert( isurf2.end(), tns2_surf(r,r));
|
366 |
|
|
}
|
367 |
souaissa |
66 |
|
368 |
souaissa |
87 |
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
369 |
|
|
{
|
370 |
|
|
vector<unsigned int> indx1,indx2;
|
371 |
|
|
if(tns1_face.listes_equivalentes(ifac1,ifac2,indx1))
|
372 |
|
|
{
|
373 |
|
|
if(tns1_face.listes_equivalentes(isurf1,isurf2,indx2))
|
374 |
|
|
{
|
375 |
souaissa |
99 |
ssim_tmp.ajouter(id1);
|
376 |
|
|
ssim_tmp.ajouter(id2);
|
377 |
souaissa |
87 |
}
|
378 |
|
|
}
|
379 |
|
|
}
|
380 |
souaissa |
66 |
|
381 |
souaissa |
87 |
}
|
382 |
|
|
|
383 |
|
|
}
|
384 |
souaissa |
99 |
if (modele==1) ssim1=ssim_tmp;
|
385 |
|
|
if (modele==2) ssim2=ssim_tmp;
|
386 |
|
|
|
387 |
souaissa |
90 |
affecter_les_couleurs(laquelle);
|
388 |
souaissa |
66 |
}
|
389 |
|
|
|
390 |
|
|
|
391 |
|
|
|
392 |
souaissa |
82 |
|
393 |
souaissa |
87 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_identitees()
|
394 |
|
|
{
|
395 |
|
|
return identite;
|
396 |
|
|
}
|
397 |
|
|
|
398 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_simalarite_vectorielle(int type_comparais)
|
399 |
souaissa |
87 |
{
|
400 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst_tmp;
|
401 |
|
|
switch ( type_comparais)
|
402 |
|
|
{
|
403 |
|
|
case 12: lst_tmp= similarite;
|
404 |
|
|
case 1: lst_tmp= sim1;
|
405 |
|
|
case 2: lst_tmp= sim2;
|
406 |
|
|
}
|
407 |
|
|
return lst_tmp;
|
408 |
souaissa |
87 |
}
|
409 |
|
|
|
410 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> VCT_COMPARAISON::get_liste_des_simalarite_inertielle(int type_comparais)
|
411 |
souaissa |
87 |
{
|
412 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst_tmp;
|
413 |
|
|
switch ( type_comparais)
|
414 |
|
|
{
|
415 |
|
|
case 12: lst_tmp= ssimilarite;
|
416 |
|
|
case 1: lst_tmp= ssim1;
|
417 |
|
|
case 2: lst_tmp= ssim2;
|
418 |
|
|
}
|
419 |
|
|
return lst_tmp;
|
420 |
souaissa |
87 |
}
|
421 |
|
|
|
422 |
|
|
|
423 |
|
|
void VCT_COMPARAISON::affecter_les_couleurs(int niveau)
|
424 |
souaissa |
66 |
{
|
425 |
souaissa |
142 |
randomize();
|
426 |
souaissa |
87 |
int nb_face_ident=similarite.get_nb()/2;
|
427 |
|
|
int nb_face_identt=ssimilarite.get_nb()/2;
|
428 |
|
|
int nb_face_iden=identite.get_nb()/2;
|
429 |
|
|
double val;
|
430 |
|
|
TPL_LISTE_ENTITE<int> lst;
|
431 |
|
|
TPL_LISTE_ENTITE<double> lst_val;
|
432 |
|
|
int num1,num2,num1_avant ;
|
433 |
souaissa |
90 |
if (niveau==1) //pour afficher les identites entre le deux modèles
|
434 |
souaissa |
87 |
{
|
435 |
|
|
for(int i=0;i< nb_face_iden;i++)
|
436 |
|
|
{
|
437 |
|
|
num1=identite.get(2*i) ;
|
438 |
|
|
num2=identite.get(2*i+1) ;
|
439 |
|
|
if(i>0) num1_avant= identite.get(2*(i-1));
|
440 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(num1);
|
441 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(num2);
|
442 |
|
|
|
443 |
|
|
if(i==0)
|
444 |
|
|
{
|
445 |
|
|
choisir_une_couleur(val);
|
446 |
|
|
while(lst_val.est_dans_la_liste(val))
|
447 |
|
|
{
|
448 |
|
|
choisir_une_couleur(val);
|
449 |
|
|
}
|
450 |
|
|
face1->ajouter_ccf("Cc",val);
|
451 |
|
|
face2->ajouter_ccf("Cc",val);
|
452 |
|
|
lst_val.ajouter(val);
|
453 |
|
|
}
|
454 |
|
|
|
455 |
|
|
if(i>0)
|
456 |
|
|
{
|
457 |
|
|
if(num1!=num1_avant)
|
458 |
|
|
{
|
459 |
|
|
choisir_une_couleur(val);
|
460 |
|
|
while(lst_val.est_dans_la_liste(val))
|
461 |
|
|
{
|
462 |
|
|
choisir_une_couleur(val);
|
463 |
|
|
}
|
464 |
|
|
face1->ajouter_ccf("Cc",val);
|
465 |
|
|
face2->ajouter_ccf("Cc",val);
|
466 |
|
|
lst_val.ajouter(val);
|
467 |
|
|
}
|
468 |
|
|
else{
|
469 |
|
|
face2->ajouter_ccf("Cc",val);
|
470 |
|
|
}
|
471 |
|
|
|
472 |
|
|
}
|
473 |
|
|
}
|
474 |
|
|
|
475 |
|
|
}
|
476 |
|
|
|
477 |
souaissa |
99 |
if(niveau==21||niveau==22||niveau==23) //pour afficher la similarite entre le deux modèle vectoriellement ou inertiellement
|
478 |
souaissa |
90 |
{
|
479 |
|
|
TPL_LISTE_ENTITE<int> simu;
|
480 |
|
|
if(niveau==21)simu=similarite;
|
481 |
|
|
if(niveau==22) simu=ssimilarite;
|
482 |
souaissa |
99 |
if(niveau==23) simu=sim_double;
|
483 |
souaissa |
90 |
TPL_LISTE_ENTITE<int> llst1;
|
484 |
|
|
TPL_LISTE_ENTITE<int> llst2;
|
485 |
|
|
int nb_face_sim=simu.get_nb()/2.;
|
486 |
|
|
for(int i=0;i< nb_face_sim;i++)
|
487 |
|
|
{
|
488 |
|
|
TPL_LISTE_ENTITE<int> lst1;
|
489 |
|
|
TPL_LISTE_ENTITE<int> lst2;
|
490 |
|
|
TPL_LISTE_ENTITE<int> llst3;
|
491 |
|
|
num1=simu.get(2*i) ;
|
492 |
|
|
if(!llst1.est_dans_la_liste(num1))
|
493 |
souaissa |
87 |
{
|
494 |
souaissa |
90 |
num2=simu.get(2*i+1) ;
|
495 |
|
|
lst1.ajouter(num1);
|
496 |
|
|
lst2.ajouter(num2);
|
497 |
|
|
llst1.ajouter(num1);
|
498 |
|
|
llst2.ajouter(num2);
|
499 |
|
|
for(int j=1;j< nb_face_sim;j++)
|
500 |
|
|
{
|
501 |
|
|
int Num1=simu.get(2*j) ;
|
502 |
|
|
int Num2=simu.get(2*j+1) ;
|
503 |
souaissa |
87 |
|
504 |
souaissa |
90 |
if(num1==Num1)
|
505 |
|
|
{
|
506 |
|
|
llst3.ajouter(Num2);
|
507 |
|
|
}
|
508 |
|
|
if(num2==Num2||llst3.est_dans_la_liste(Num2))
|
509 |
|
|
{
|
510 |
|
|
if(!lst1.est_dans_la_liste(Num1)) {
|
511 |
|
|
lst1.ajouter(Num1);
|
512 |
|
|
llst1.ajouter(Num1); }
|
513 |
|
|
if(!lst2.est_dans_la_liste(Num2)) {
|
514 |
|
|
lst2.ajouter(Num2);
|
515 |
|
|
llst2.ajouter(Num2); }
|
516 |
|
|
}
|
517 |
souaissa |
87 |
|
518 |
|
|
}
|
519 |
|
|
|
520 |
souaissa |
90 |
choisir_une_couleur(val);
|
521 |
|
|
while(lst_val.est_dans_la_liste(val))
|
522 |
|
|
{
|
523 |
souaissa |
87 |
choisir_une_couleur(val);
|
524 |
souaissa |
90 |
}
|
525 |
|
|
lst_val.ajouter(val);
|
526 |
|
|
int nb1=lst1.get_nb();
|
527 |
|
|
int nb2=lst2.get_nb();
|
528 |
|
|
for(int i=0;i<nb1;i++)
|
529 |
|
|
{
|
530 |
|
|
int n1=lst1.get(i);
|
531 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(n1);
|
532 |
|
|
face1->ajouter_ccf("Cc",val);
|
533 |
souaissa |
87 |
}
|
534 |
souaissa |
90 |
for(int i=0;i<nb2;i++)
|
535 |
|
|
{
|
536 |
|
|
int n2=lst2.get(i);
|
537 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(n2);
|
538 |
|
|
face2->ajouter_ccf("Cc",val);
|
539 |
|
|
}
|
540 |
|
|
|
541 |
|
|
}
|
542 |
|
|
}
|
543 |
souaissa |
87 |
|
544 |
|
|
|
545 |
|
|
}
|
546 |
|
|
|
547 |
souaissa |
142 |
if(niveau== 31||niveau==32) //pour afficher la similarite dans le premier modèle ou le second modele
|
548 |
souaissa |
87 |
{
|
549 |
|
|
|
550 |
souaissa |
90 |
MG_GEOMETRIE *mgeo1 ;
|
551 |
|
|
int laquelle;
|
552 |
souaissa |
87 |
|
553 |
souaissa |
90 |
switch(niveau)
|
554 |
|
|
{
|
555 |
|
|
case 31:
|
556 |
|
|
{
|
557 |
|
|
mgeo1=mggeo1;
|
558 |
|
|
laquelle=31;
|
559 |
|
|
break;
|
560 |
souaissa |
87 |
}
|
561 |
souaissa |
90 |
case 32:
|
562 |
|
|
{
|
563 |
|
|
mgeo1=mggeo2;
|
564 |
|
|
laquelle=32;
|
565 |
|
|
break;
|
566 |
|
|
}
|
567 |
|
|
|
568 |
souaissa |
87 |
}
|
569 |
|
|
|
570 |
souaissa |
142 |
|
571 |
souaissa |
90 |
for(int i=0;i< nb_face_identt;i++)
|
572 |
souaissa |
87 |
{
|
573 |
souaissa |
90 |
num1=ssimilarite.get(2*i) ;
|
574 |
|
|
num2=ssimilarite.get(2*i+1) ;
|
575 |
souaissa |
87 |
|
576 |
souaissa |
90 |
if(i>0) num1_avant= ssimilarite.get(2*(i-1));
|
577 |
|
|
MG_FACE* face1=mgeo1->get_mg_faceid(num1);
|
578 |
|
|
MG_FACE* face2=mgeo1->get_mg_faceid(num2);
|
579 |
|
|
if(!lst.est_dans_la_liste(num2))
|
580 |
|
|
{
|
581 |
souaissa |
87 |
if(i==0)
|
582 |
|
|
{
|
583 |
|
|
choisir_une_couleur(val);
|
584 |
souaissa |
90 |
while(lst_val.est_dans_la_liste(val))
|
585 |
|
|
{
|
586 |
|
|
choisir_une_couleur(val);
|
587 |
|
|
}
|
588 |
souaissa |
87 |
face1->ajouter_ccf("Cc",val);
|
589 |
souaissa |
90 |
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
590 |
|
|
lst_val.ajouter(val);
|
591 |
souaissa |
87 |
}
|
592 |
|
|
|
593 |
|
|
if(i>0)
|
594 |
|
|
{
|
595 |
|
|
if(num1!=num1_avant)
|
596 |
|
|
{
|
597 |
souaissa |
90 |
choisir_une_couleur(val);
|
598 |
|
|
while(lst_val.est_dans_la_liste(val))
|
599 |
|
|
{
|
600 |
souaissa |
87 |
choisir_une_couleur(val);
|
601 |
souaissa |
90 |
}
|
602 |
|
|
face1->ajouter_ccf("Cc",val);
|
603 |
|
|
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
604 |
|
|
lst_val.ajouter(val);
|
605 |
souaissa |
87 |
}
|
606 |
|
|
else{
|
607 |
souaissa |
90 |
if(num1!=num2) face2->ajouter_ccf("Cc",val); lst.ajouter(num2);
|
608 |
souaissa |
87 |
}
|
609 |
|
|
|
610 |
|
|
}
|
611 |
souaissa |
90 |
}
|
612 |
souaissa |
87 |
}
|
613 |
|
|
|
614 |
|
|
|
615 |
|
|
}
|
616 |
|
|
|
617 |
|
|
|
618 |
|
|
}
|
619 |
|
|
|
620 |
|
|
|
621 |
|
|
void VCT_COMPARAISON::choisir_une_couleur(double& val)
|
622 |
|
|
{
|
623 |
souaissa |
142 |
randomize();
|
624 |
souaissa |
87 |
|
625 |
|
|
unsigned char r=rand() % 255;
|
626 |
|
|
unsigned char g=rand() % 255;
|
627 |
|
|
unsigned char b=rand() % 255;
|
628 |
|
|
val=0.;
|
629 |
|
|
unsigned char* p =(unsigned char*)&val;
|
630 |
|
|
|
631 |
|
|
*p=r;
|
632 |
|
|
p++;*p=g;
|
633 |
|
|
p++;*p=b;
|
634 |
|
|
|
635 |
|
|
}
|
636 |
|
|
|
637 |
|
|
|
638 |
souaissa |
99 |
void VCT_COMPARAISON::trouve_face_de_reference(int &face_ref1,int &face_ref2)// ,TPL_LISTE_ENTITE<int>& list
|
639 |
|
|
{
|
640 |
|
|
//compare_les_deux_geometries();
|
641 |
|
|
int nb_simdble=sim_double.get_nb()/2 ;
|
642 |
|
|
|
643 |
|
|
int num1,num2 ;
|
644 |
|
|
|
645 |
|
|
|
646 |
souaissa |
87 |
OT_VECTEUR_4DD Dv,Dv1,Dv2,G1,G2,g1g2;
|
647 |
|
|
OT_TENSEUR V(4),V1(4),V2(4);
|
648 |
|
|
|
649 |
|
|
|
650 |
souaissa |
99 |
int nbsim=nb_sim.get_nb();
|
651 |
|
|
int *t=new int [nbsim];
|
652 |
|
|
int *tt=new int [nbsim];
|
653 |
|
|
for(int i=0;i<nbsim;i++)
|
654 |
|
|
{
|
655 |
souaissa |
142 |
// t[i]= nb_sim.get(i);
|
656 |
|
|
t[i]= i;
|
657 |
souaissa |
99 |
tt[i]=nb_sim.get(i);
|
658 |
souaissa |
142 |
|
659 |
souaissa |
99 |
}
|
660 |
|
|
int pos_min,pos_max;
|
661 |
|
|
int min,max;
|
662 |
|
|
int trouve=0;
|
663 |
souaissa |
142 |
|
664 |
|
|
for (int i=0;i<nbsim;i++)
|
665 |
|
|
{
|
666 |
|
|
|
667 |
|
|
for(int j=0;j<nbsim;j++)
|
668 |
|
|
{
|
669 |
|
|
if(tt[j]<tt[i])
|
670 |
|
|
{
|
671 |
|
|
int tmp= tt[i];
|
672 |
|
|
|
673 |
|
|
tt[i]= tt[j];
|
674 |
|
|
tt[j]= tmp;
|
675 |
|
|
t[i]=j;
|
676 |
|
|
t[j]=i;
|
677 |
|
|
}
|
678 |
|
|
}
|
679 |
|
|
}
|
680 |
|
|
|
681 |
|
|
//pos_min=t[0];
|
682 |
|
|
//pos_max=t[1];
|
683 |
|
|
|
684 |
|
|
if(tt[0]==1)
|
685 |
|
|
{
|
686 |
|
|
MG_FACE* fref=mggeo1->get_mg_face(pos_min);
|
687 |
|
|
face_ref1= fref->get_id();
|
688 |
|
|
for(int i=0;i<nb_simdble;i++){
|
689 |
|
|
if (sim_double.get(2*i)==face_ref1)
|
690 |
|
|
face_ref2=sim_double.get(2*i+1);
|
691 |
|
|
}
|
692 |
|
|
return;
|
693 |
|
|
}
|
694 |
|
|
|
695 |
|
|
/*
|
696 |
souaissa |
99 |
sort (tt,tt+nbsim);
|
697 |
|
|
for (int i=0;i<nbsim;i++)
|
698 |
|
|
{
|
699 |
|
|
if(tt[i]>0)
|
700 |
|
|
{
|
701 |
|
|
min=tt[i];
|
702 |
|
|
break;
|
703 |
|
|
}
|
704 |
|
|
}
|
705 |
souaissa |
87 |
|
706 |
souaissa |
99 |
for (int i=0;i<nbsim;i++)
|
707 |
|
|
{
|
708 |
|
|
if(tt[i]>min)
|
709 |
|
|
{
|
710 |
|
|
max=tt[i];
|
711 |
|
|
trouve=1;
|
712 |
|
|
break;
|
713 |
|
|
}
|
714 |
souaissa |
87 |
}
|
715 |
souaissa |
99 |
for (int i=0;i<nbsim;i++)
|
716 |
|
|
{
|
717 |
|
|
if(t[i]==min)
|
718 |
|
|
{
|
719 |
|
|
pos_min=i;
|
720 |
|
|
break;
|
721 |
|
|
}
|
722 |
|
|
}
|
723 |
|
|
for (int i=0;i<nbsim;i++)
|
724 |
|
|
{
|
725 |
|
|
if(t[i]==max&&i!=pos_min)
|
726 |
|
|
{
|
727 |
|
|
pos_max=i;
|
728 |
|
|
break;
|
729 |
|
|
}
|
730 |
|
|
}
|
731 |
|
|
if(!trouve)
|
732 |
|
|
{
|
733 |
|
|
pos_max=pos_min+1;
|
734 |
|
|
max= t[pos_max];
|
735 |
souaissa |
87 |
}
|
736 |
souaissa |
142 |
*/
|
737 |
souaissa |
99 |
|
738 |
|
|
|
739 |
|
|
|
740 |
|
|
|
741 |
|
|
|
742 |
souaissa |
142 |
int pos1=0;
|
743 |
|
|
int pos2=0;
|
744 |
|
|
/*
|
745 |
|
|
if(min==1)
|
746 |
|
|
{
|
747 |
|
|
MG_FACE* fref=mggeo1->get_mg_face(pos_min);
|
748 |
|
|
face_ref1= fref->get_id();
|
749 |
|
|
for(int i=0;i<nb_simdble;i++){
|
750 |
|
|
if (sim_double.get(2*i)==face_ref1)
|
751 |
|
|
face_ref2=sim_double.get(2*i+1);
|
752 |
|
|
}
|
753 |
|
|
return;
|
754 |
|
|
}
|
755 |
souaissa |
99 |
|
756 |
souaissa |
142 |
*/
|
757 |
|
|
int tr=0;
|
758 |
|
|
trouve=0;
|
759 |
|
|
while(trouve==0)
|
760 |
|
|
{
|
761 |
|
|
pos_min=t[tr];
|
762 |
|
|
pos_max=t[tr+1];
|
763 |
|
|
|
764 |
souaissa |
87 |
OT_VECTEUR_4DD g1_ref,g2_ref;
|
765 |
souaissa |
99 |
MG_FACE* face1_ref=mggeo1->get_mg_face(pos_min);
|
766 |
|
|
int id1=face1_ref->get_id();
|
767 |
souaissa |
87 |
face1_ref->get_vectorisation().calcule_axes_dinertie(Dv1,V1);
|
768 |
|
|
G1= face1_ref->get_vectorisation().calcule_barycentre();
|
769 |
|
|
|
770 |
|
|
for(int r=0;r<4;r++) {
|
771 |
|
|
for(int s=0;s<4;s++) {
|
772 |
|
|
g1_ref[r]= g1_ref[r]+V1(s,r)*G1[s];
|
773 |
|
|
}
|
774 |
|
|
}
|
775 |
|
|
|
776 |
|
|
|
777 |
souaissa |
99 |
MG_FACE* face12_ref=mggeo1->get_mg_face(pos_max);
|
778 |
|
|
face12_ref->get_vectorisation().calcule_axes_dinertie(Dv2,V2);
|
779 |
|
|
int id2=face12_ref->get_id();
|
780 |
|
|
G2= face12_ref->get_vectorisation().calcule_barycentre();
|
781 |
souaissa |
87 |
for(int r=0;r<4;r++) {
|
782 |
|
|
for(int s=0;s<4;s++) {
|
783 |
souaissa |
99 |
g2_ref[r]= g2_ref[r]+V1(s,r)*G2[s];
|
784 |
souaissa |
87 |
}
|
785 |
|
|
}
|
786 |
|
|
|
787 |
souaissa |
99 |
OT_VECTEUR_4DD g12_ref= g2_ref -g1_ref;
|
788 |
|
|
|
789 |
|
|
|
790 |
souaissa |
87 |
OT_VECTEUR_4DD g1refg1,g2refg2;
|
791 |
souaissa |
99 |
TPL_LISTE_ENTITE<int> lst1,lst2;
|
792 |
|
|
for(int k=0;k<nb_simdble;k++)
|
793 |
|
|
{
|
794 |
|
|
if(sim_double.get(2*k)==id1)
|
795 |
|
|
lst1.ajouter( sim_double.get(2*k+1));
|
796 |
|
|
if(sim_double.get(2*k)==id2)
|
797 |
|
|
lst2.ajouter(sim_double.get(2*k+1));
|
798 |
|
|
}
|
799 |
souaissa |
87 |
|
800 |
souaissa |
99 |
|
801 |
|
|
|
802 |
souaissa |
142 |
|
803 |
souaissa |
99 |
for(int i=0;i<lst1.get_nb();i++)
|
804 |
souaissa |
87 |
{
|
805 |
souaissa |
99 |
|
806 |
|
|
int num1=lst1.get(i);
|
807 |
|
|
OT_VECTEUR_4DD g1,G1;
|
808 |
|
|
MG_FACE* face1=mggeo2->get_mg_faceid(num1);
|
809 |
|
|
face1->get_vectorisation().calcule_axes_dinertie(Dv2,V2);
|
810 |
souaissa |
87 |
G1= face1->get_vectorisation().calcule_barycentre();
|
811 |
|
|
for(int r=0;r<4;r++) {
|
812 |
|
|
for(int s=0;s<4;s++) {
|
813 |
souaissa |
99 |
g1[r]= g1[r]+V2(s,r)*G1[s];
|
814 |
souaissa |
87 |
}
|
815 |
|
|
}
|
816 |
|
|
|
817 |
souaissa |
99 |
// g1refg1=g1-g1_ref;
|
818 |
|
|
// num2=list.get(2*i+1);
|
819 |
|
|
for(int j=0;j<lst2.get_nb();j++)
|
820 |
|
|
{
|
821 |
|
|
int num2=lst2.get(j);
|
822 |
souaissa |
87 |
OT_VECTEUR_4DD g2;
|
823 |
|
|
MG_FACE* face2=mggeo2->get_mg_faceid(num2);
|
824 |
|
|
G2= face2->get_vectorisation().calcule_barycentre();
|
825 |
|
|
for(int r=0;r<4;r++) {
|
826 |
|
|
for(int s=0;s<4;s++) {
|
827 |
|
|
g2[r]= g2[r]+V2(s,r)*G2[s];
|
828 |
|
|
}
|
829 |
|
|
}
|
830 |
|
|
|
831 |
souaissa |
99 |
OT_VECTEUR_4DD g2g1=g2-g1;
|
832 |
|
|
if(g2g1==g12_ref)
|
833 |
souaissa |
87 |
{
|
834 |
souaissa |
99 |
// lst_fin.ajouter(num1);
|
835 |
|
|
// lst_fin.ajouter(num2);
|
836 |
|
|
face_ref1=id1;
|
837 |
|
|
face_ref2=num1;
|
838 |
|
|
trouve=1;
|
839 |
|
|
break;
|
840 |
souaissa |
87 |
}
|
841 |
souaissa |
99 |
}
|
842 |
|
|
if(trouve) break;
|
843 |
souaissa |
87 |
}
|
844 |
souaissa |
142 |
tr++;
|
845 |
|
|
}
|
846 |
souaissa |
100 |
delete [] t;
|
847 |
|
|
delete [] tt;
|
848 |
souaissa |
87 |
|
849 |
|
|
|
850 |
souaissa |
142 |
}
|
851 |
|
|
|
852 |
|
|
|
853 |
|
|
|
854 |
|
|
|
855 |
|
|
|
856 |
|
|
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)
|
857 |
|
|
{
|
858 |
|
|
|
859 |
|
|
int nb_boucle1=face1->get_nb_mg_boucle();
|
860 |
|
|
int nb_boucle2=face2->get_nb_mg_boucle();
|
861 |
|
|
|
862 |
|
|
|
863 |
|
|
//-----------------------------------------------------------------------------
|
864 |
|
|
OT_VECTEUR_4DD Dv1,Dv2,G1,gf1,gf2,G2;
|
865 |
|
|
OT_TENSEUR V1(4),V2(4);
|
866 |
|
|
|
867 |
|
|
f_ref1->get_vectorisation().calcule_axes_dinertie(Dv1,V1);
|
868 |
|
|
G1=f_ref1->get_vectorisation().calcule_barycentre();
|
869 |
|
|
|
870 |
|
|
for(int r=0;r<4;r++) {
|
871 |
|
|
for(int s=0;s<4;s++) {
|
872 |
|
|
gf1[r]= gf1[r]+V1(s,r)*G1[s];
|
873 |
|
|
}
|
874 |
|
|
}
|
875 |
|
|
|
876 |
|
|
f_ref2->get_vectorisation().calcule_axes_dinertie(Dv2,V2);
|
877 |
|
|
G2=f_ref2->get_vectorisation().calcule_barycentre();
|
878 |
|
|
|
879 |
|
|
for(int r=0;r<4;r++) {
|
880 |
|
|
for(int s=0;s<4;s++) {
|
881 |
|
|
gf2[r]= gf2[r]+V2(s,r)*G2[s];
|
882 |
|
|
}
|
883 |
|
|
}
|
884 |
|
|
|
885 |
|
|
//---------------------------------------------------------------------------
|
886 |
|
|
int nb_aretes=0;
|
887 |
|
|
for(int j1=0;j1<nb_boucle1;j1++)
|
888 |
|
|
{
|
889 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
890 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
891 |
|
|
nb_aretes+=nbarete1;
|
892 |
|
|
for (int w1 =0; w1<nbarete1;w1++)
|
893 |
|
|
{
|
894 |
|
|
|
895 |
|
|
OT_TENSEUR tns_arete1(4),tns_courbe1(4);
|
896 |
|
|
OT_TENSEUR tm1_art(4),tm1_crb(4);
|
897 |
|
|
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
898 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
899 |
|
|
int id_art1=arete1->get_id();
|
900 |
|
|
|
901 |
|
|
MG_COURBE* courbe1=arete1->get_courbe();
|
902 |
|
|
|
903 |
|
|
int nb_top1_pts= arete1->get_vectorisation().get_nb_points();
|
904 |
|
|
int nb_geo1_pts= courbe1->get_vectorisation().get_nb_points();
|
905 |
|
|
|
906 |
|
|
tm1_art=arete1->get_vectorisation().calcule_tenseur_metrique();
|
907 |
|
|
tm1_crb=courbe1->get_vectorisation().calcule_tenseur_metrique();
|
908 |
|
|
|
909 |
|
|
|
910 |
|
|
|
911 |
|
|
//----------------------------------------------------------------------
|
912 |
|
|
OT_VECTEUR_4DD B1,g1;
|
913 |
|
|
B1=arete1->get_vectorisation().calcule_barycentre();
|
914 |
|
|
for(int r=0;r<4;r++) {
|
915 |
|
|
for(int s=0;s<4;s++)
|
916 |
|
|
g1[r]= g1[r]+V1(s,r)*B1[s];
|
917 |
|
|
}
|
918 |
|
|
//----------------------------------------------------------------------
|
919 |
|
|
|
920 |
|
|
tns_arete1=arete1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
921 |
|
|
tns_courbe1=courbe1->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
922 |
|
|
vector<double2> viarte1,vicrbe1;
|
923 |
|
|
for(int r=0;r<4;r++)
|
924 |
|
|
{
|
925 |
|
|
viarte1.insert( viarte1.end(), tns_arete1(r,r));
|
926 |
|
|
vicrbe1.insert( vicrbe1.end(), tns_courbe1(r,r));
|
927 |
|
|
}
|
928 |
|
|
int compt_aretes_modif=0;
|
929 |
|
|
for(int j2=0;j2<nb_boucle2;j2++)
|
930 |
|
|
{
|
931 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
932 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
933 |
|
|
for (int w2 =0; w2<nbarete2;w2++)
|
934 |
|
|
{
|
935 |
|
|
OT_TENSEUR tns_arete2(4),tns_courbe2(4);
|
936 |
|
|
OT_TENSEUR tm2_art(4),tm2_crb(4);
|
937 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
938 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
939 |
|
|
MG_COURBE* courbe2=arete2->get_courbe();
|
940 |
|
|
int id_art2=arete2->get_id();
|
941 |
|
|
if(!aretes_ident.est_dans_la_liste(id_art2))
|
942 |
|
|
{
|
943 |
|
|
//----------------------------------------------------------------------
|
944 |
|
|
OT_VECTEUR_4DD B2,g2;
|
945 |
|
|
B2=arete2->get_vectorisation().calcule_barycentre();
|
946 |
|
|
for(int r=0;r<4;r++) {
|
947 |
|
|
for(int s=0;s<4;s++)
|
948 |
|
|
g2[r]= g2[r]+V2(s,r)*B2[s];
|
949 |
|
|
}
|
950 |
|
|
//---------------------------------------------------------------------- MG_COURBE* courbe2=arete2->get_courbe();
|
951 |
|
|
|
952 |
|
|
int nb_top2_pts= arete2->get_vectorisation().get_nb_points();
|
953 |
|
|
int nb_geo2_pts= courbe2->get_vectorisation().get_nb_points();
|
954 |
|
|
|
955 |
|
|
tm2_art=arete2->get_vectorisation().calcule_tenseur_metrique();
|
956 |
|
|
tm2_crb=courbe2->get_vectorisation().calcule_tenseur_metrique();
|
957 |
|
|
|
958 |
|
|
tns_arete2=arete2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
959 |
|
|
tns_courbe2=courbe2->get_vectorisation().calcule_tenseur_inertie_base_locale();
|
960 |
|
|
|
961 |
|
|
vector<double2> viarte2,vicrbe2;
|
962 |
|
|
for(int r=0;r<4;r++)
|
963 |
|
|
{
|
964 |
|
|
viarte2.insert( viarte2.end(), tns_arete2(r,r));
|
965 |
|
|
vicrbe2.insert( vicrbe2.end(), tns_courbe2(r,r));
|
966 |
|
|
}
|
967 |
|
|
|
968 |
|
|
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
969 |
|
|
{
|
970 |
|
|
if(tm1_art.est_til_equivalent(tm2_art))
|
971 |
|
|
{
|
972 |
|
|
if(tm1_crb.est_til_equivalent(tm2_crb))
|
973 |
|
|
{
|
974 |
|
|
vector<unsigned int> indx1,indx2;
|
975 |
|
|
int identique=-1;
|
976 |
|
|
if(tns_arete1==tns_arete2)//.listes_equivalentes(viarte1,viarte2,indx1))
|
977 |
|
|
{
|
978 |
|
|
if(tns_courbe1==tns_courbe2)//tns_arete1.listes_equivalentes(vicrbe1,vicrbe2,indx2))
|
979 |
|
|
{
|
980 |
|
|
OT_VECTEUR_4DD v1=gf1-g1;
|
981 |
|
|
OT_VECTEUR_4DD v2=gf2-g2;
|
982 |
|
|
|
983 |
|
|
if(v1==v2)
|
984 |
|
|
{
|
985 |
|
|
aretes_ident.ajouter(j1) ;
|
986 |
|
|
aretes_ident.ajouter(id_art1) ;
|
987 |
|
|
aretes_ident.ajouter(j2) ;
|
988 |
|
|
aretes_ident.ajouter(id_art2) ;
|
989 |
|
|
identique=1;
|
990 |
|
|
|
991 |
|
|
}
|
992 |
|
|
|
993 |
|
|
}
|
994 |
|
|
}
|
995 |
|
|
if(identique>0) break;
|
996 |
|
|
if(identique<0)
|
997 |
|
|
{
|
998 |
|
|
aretes_sim.ajouter(j1) ;
|
999 |
|
|
aretes_sim.ajouter(id_art1) ;
|
1000 |
|
|
aretes_sim.ajouter(j2) ;
|
1001 |
|
|
aretes_sim.ajouter(id_art2) ;
|
1002 |
|
|
identique=-1;
|
1003 |
|
|
}
|
1004 |
|
|
}
|
1005 |
|
|
}
|
1006 |
|
|
} // aretes2
|
1007 |
|
|
|
1008 |
|
|
} //boucle2
|
1009 |
|
|
|
1010 |
|
|
}//condition 1 //aretes_identiques
|
1011 |
|
|
}
|
1012 |
|
|
|
1013 |
|
|
}
|
1014 |
|
|
}
|
1015 |
|
|
|
1016 |
|
|
if(nb_aretes==aretes_ident.get_nb()/2) return 1;
|
1017 |
|
|
else return 0;
|
1018 |
|
|
|
1019 |
|
|
}
|
1020 |
|
|
|
1021 |
|
|
void VCT_COMPARAISON::identifier_aretes_face_modifiee(MG_FACE* face1,MG_FACE* face2,TPL_LISTE_ENTITE<int>& aretes_identiques,TPL_LISTE_ENTITE<int>&aretes_simil,TPL_LISTE_ENTITE<int>& aret1_conservees,
|
1022 |
|
|
TPL_LISTE_ENTITE<int>& aret1_disparues,
|
1023 |
|
|
TPL_LISTE_ENTITE<int>& aret2_conservees ,
|
1024 |
|
|
TPL_LISTE_ENTITE<int>& aret2_nouvelles ,
|
1025 |
|
|
TPL_LISTE_ENTITE<int>& aret2_partielles)
|
1026 |
|
|
{
|
1027 |
|
|
|
1028 |
|
|
int nb_boucle1=face1->get_nb_mg_boucle();
|
1029 |
|
|
int nb_boucle2=face2->get_nb_mg_boucle();
|
1030 |
|
|
|
1031 |
|
|
|
1032 |
|
|
int cmpt_arete=0;
|
1033 |
|
|
|
1034 |
|
|
TPL_LISTE_ENTITE<int> boucle_face1;
|
1035 |
|
|
TPL_LISTE_ENTITE<int> boucle_face2;
|
1036 |
|
|
|
1037 |
|
|
TPL_LISTE_ENTITE<int> aretes_ident_face1;
|
1038 |
|
|
TPL_LISTE_ENTITE<int> aretes_ident_face2;
|
1039 |
|
|
TPL_LISTE_ENTITE<int> aretes_face1;
|
1040 |
|
|
TPL_LISTE_ENTITE<int> aretes_face2;
|
1041 |
|
|
TPL_LISTE_ENTITE<int> aretes_dif_face2;
|
1042 |
|
|
TPL_LISTE_ENTITE<int> aretes_sim_face1;
|
1043 |
|
|
TPL_LISTE_ENTITE<int> aretes_sim_face2;
|
1044 |
|
|
|
1045 |
|
|
for(int b=0;b<aretes_identiques.get_nb()/4;b++)
|
1046 |
souaissa |
87 |
{
|
1047 |
souaissa |
142 |
boucle_face1.ajouter( aretes_identiques.get(4*b));
|
1048 |
|
|
boucle_face2.ajouter( aretes_identiques.get(4*b+2));
|
1049 |
|
|
aretes_ident_face1.ajouter(aretes_identiques.get(4*b+1));
|
1050 |
|
|
aretes_ident_face2.ajouter(aretes_identiques.get(4*b+3));
|
1051 |
|
|
}
|
1052 |
|
|
for(int b=0;b<aretes_simil.get_nb()/4;b++)
|
1053 |
|
|
{
|
1054 |
|
|
aretes_sim_face1.ajouter(aretes_simil.get(4*b+1));
|
1055 |
|
|
aretes_sim_face2.ajouter(aretes_simil.get(4*b+3));
|
1056 |
|
|
}
|
1057 |
|
|
|
1058 |
|
|
for(int j1=0;j1<nb_boucle1;j1++)
|
1059 |
|
|
{
|
1060 |
|
|
MG_BOUCLE* Boucle1 = face1->get_mg_boucle(j1);
|
1061 |
|
|
int nbarete1 = Boucle1->get_nb_mg_coarete();
|
1062 |
|
|
TPL_LISTE_ENTITE<int> lst_aret_dif;
|
1063 |
|
|
int compt1=0;
|
1064 |
|
|
int boucle;
|
1065 |
|
|
int start_boucle,end_boucle;
|
1066 |
|
|
int cmpt=0;
|
1067 |
|
|
TPL_LISTE_ENTITE<int> arete_boucle1;
|
1068 |
|
|
TPL_LISTE_ENTITE<int> arete_boucle2;
|
1069 |
|
|
|
1070 |
|
|
if(boucle_face1.est_dans_la_liste(j1))
|
1071 |
|
|
{
|
1072 |
|
|
for(int k=0;k<boucle_face1.get_nb();k++)
|
1073 |
|
|
{
|
1074 |
|
|
if (j1==boucle_face1.get(k))
|
1075 |
|
|
{
|
1076 |
|
|
arete_boucle1.ajouter(aretes_ident_face1.get(k));
|
1077 |
|
|
arete_boucle2.ajouter(aretes_ident_face2.get(k));
|
1078 |
|
|
boucle=boucle_face2.get(k);
|
1079 |
|
|
}
|
1080 |
|
|
}
|
1081 |
|
|
}
|
1082 |
|
|
|
1083 |
|
|
for (int w1=0; w1<nbarete1;w1++)
|
1084 |
souaissa |
87 |
{
|
1085 |
souaissa |
142 |
MG_COARETE* coArete1 = Boucle1->get_mg_coarete(w1);
|
1086 |
|
|
MG_ARETE* arete1 = coArete1->get_arete();
|
1087 |
|
|
int id_art1=arete1->get_id();
|
1088 |
|
|
|
1089 |
|
|
if(!arete_boucle1.est_dans_la_liste(id_art1))
|
1090 |
|
|
{
|
1091 |
|
|
aret1_disparues.ajouter(id_art1);
|
1092 |
|
|
}
|
1093 |
|
|
else
|
1094 |
|
|
{
|
1095 |
|
|
aret1_conservees.ajouter(id_art1);
|
1096 |
|
|
}
|
1097 |
souaissa |
87 |
}
|
1098 |
souaissa |
142 |
|
1099 |
|
|
|
1100 |
|
|
for(int j2=0;j2<nb_boucle2;j2++)
|
1101 |
|
|
{
|
1102 |
|
|
MG_BOUCLE* Boucle2 = face2->get_mg_boucle(j2);
|
1103 |
|
|
int nbarete2 = Boucle2->get_nb_mg_coarete();
|
1104 |
|
|
|
1105 |
|
|
for (int w2=0; w2<nbarete2;w2++)
|
1106 |
|
|
{
|
1107 |
|
|
MG_COARETE* coArete2 = Boucle2->get_mg_coarete(w2);
|
1108 |
|
|
MG_ARETE* arete2 = coArete2->get_arete();
|
1109 |
|
|
int id_art2=arete2->get_id();
|
1110 |
|
|
if(!arete_boucle2.est_dans_la_liste(id_art2))
|
1111 |
|
|
{
|
1112 |
|
|
aret2_nouvelles.ajouter(id_art2);
|
1113 |
|
|
if (aretes_simil.est_dans_la_liste(id_art2))
|
1114 |
|
|
aret2_partielles.ajouter(id_art2);
|
1115 |
|
|
|
1116 |
|
|
}
|
1117 |
|
|
else
|
1118 |
|
|
{
|
1119 |
|
|
aret2_conservees.ajouter(id_art2);
|
1120 |
|
|
}
|
1121 |
|
|
|
1122 |
|
|
}
|
1123 |
|
|
}
|
1124 |
|
|
|
1125 |
|
|
|
1126 |
|
|
} //boucle_face1
|
1127 |
|
|
|
1128 |
|
|
|
1129 |
|
|
|
1130 |
|
|
}
|
1131 |
|
|
|
1132 |
|
|
|
1133 |
|
|
|
1134 |
|
|
void VCT_COMPARAISON::identifier_les_modifications_appliquees(VCT_COMPARAISON_RESULTAT& Results)
|
1135 |
|
|
//void VCT_COMPARAISON::identifier_les_modifications_appliquees(VCT_COMPARAISON_RESULTAT& Results)
|
1136 |
|
|
{
|
1137 |
|
|
//VCT_COMPARAISON_RESULTAT Results(gest1,gest2,mggeo1,mggeo2);
|
1138 |
|
|
|
1139 |
|
|
TPL_LISTE_ENTITE<int> face1_conservees;
|
1140 |
|
|
TPL_LISTE_ENTITE<int> face2_conservees;
|
1141 |
|
|
TPL_LISTE_ENTITE<int> faces_nouvelles;
|
1142 |
|
|
|
1143 |
|
|
TPL_LISTE_ENTITE<int> aret_ident;
|
1144 |
|
|
TPL_LISTE_ENTITE<int> aret_modif;
|
1145 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
1146 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
1147 |
|
|
TPL_LISTE_ENTITE<int> lst_face1,lst_face2,lst_facloc1,lst_facloc2,dif1,dif2;
|
1148 |
|
|
for(int i=0;i<nb_face1;i++)
|
1149 |
|
|
{
|
1150 |
|
|
OT_VECTEUR_4DD g1,G1;
|
1151 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
1152 |
|
|
int id1=face1->get_id();
|
1153 |
|
|
lst_face1.ajouter(id1);
|
1154 |
souaissa |
87 |
}
|
1155 |
souaissa |
142 |
|
1156 |
|
|
for(int i=0;i<nb_face2;i++)
|
1157 |
|
|
{
|
1158 |
|
|
OT_VECTEUR_4DD g1,G1;
|
1159 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(i);
|
1160 |
|
|
int id2=face2->get_id();
|
1161 |
|
|
lst_face2.ajouter(id2);
|
1162 |
|
|
}
|
1163 |
|
|
|
1164 |
|
|
for(int i=0;i<identite.get_nb()/2;i++)
|
1165 |
|
|
{
|
1166 |
|
|
CORRESPONDANCE CORRESP;
|
1167 |
|
|
int face1_id=identite.get(2*i);
|
1168 |
|
|
int face2_id=identite.get(2*i+1);
|
1169 |
|
|
MG_FACE* Face1=mggeo1->get_mg_faceid(face1_id);
|
1170 |
|
|
MG_FACE* Face2=mggeo2->get_mg_faceid(face2_id);
|
1171 |
|
|
face1_conservees.ajouter(face1_id);
|
1172 |
|
|
face2_conservees.ajouter(face2_id);
|
1173 |
|
|
Results.ajouter_liste_topologie(100,Face1);
|
1174 |
|
|
Results.ajouter_liste_topologie(300,Face2);
|
1175 |
|
|
CORRESP.eleorigine=Face1;
|
1176 |
|
|
CORRESP.elemodifie=Face2;
|
1177 |
|
|
Results.ajouter_liste_topologie(CORRESP);
|
1178 |
|
|
}
|
1179 |
|
|
|
1180 |
|
|
for(int t=0;t<lst_face1.get_nb();t++)
|
1181 |
|
|
{
|
1182 |
|
|
if(!face1_conservees.est_dans_la_liste(lst_face1.get(t)) )
|
1183 |
|
|
dif1.ajouter(lst_face1.get(t));
|
1184 |
souaissa |
87 |
}
|
1185 |
souaissa |
142 |
for(int it=0;it<lst_face2.get_nb();it++)
|
1186 |
|
|
{
|
1187 |
|
|
if(!face2_conservees.est_dans_la_liste(lst_face2.get(it)))
|
1188 |
|
|
dif2.ajouter(lst_face2.get(it));
|
1189 |
|
|
}
|
1190 |
souaissa |
87 |
|
1191 |
|
|
|
1192 |
souaissa |
142 |
MG_FACE* Face_ref1=mggeo1->get_mg_faceid(face_ref1) ;
|
1193 |
|
|
MG_FACE* Face_ref2=mggeo2->get_mg_faceid(face_ref2) ;
|
1194 |
|
|
TPL_LISTE_ENTITE<int> faces_partiellement_modf;
|
1195 |
|
|
TPL_LISTE_ENTITE<int> Aret1_conservees;
|
1196 |
|
|
TPL_LISTE_ENTITE<int> Aret1_disparues;
|
1197 |
|
|
TPL_LISTE_ENTITE<int> Aret2_conservees ;
|
1198 |
|
|
TPL_LISTE_ENTITE<int> Aret2_nouvelles ;
|
1199 |
|
|
TPL_LISTE_ENTITE<int> Aret2_partielles ;
|
1200 |
souaissa |
87 |
|
1201 |
souaissa |
142 |
for(int i=0;i<dif1.get_nb();i++)
|
1202 |
|
|
{
|
1203 |
|
|
int Num1=dif1.get(i);
|
1204 |
|
|
MG_FACE* face1=mggeo1->get_mg_faceid(Num1);
|
1205 |
|
|
for(int j=0;j<dif2.get_nb();j++)
|
1206 |
|
|
{
|
1207 |
|
|
int Num2=dif2.get(j);
|
1208 |
|
|
TPL_LISTE_ENTITE<int> aretes_identiques;
|
1209 |
|
|
TPL_LISTE_ENTITE<int> aretes_similaires;
|
1210 |
|
|
TPL_LISTE_ENTITE<int> aretes_conservees;
|
1211 |
|
|
TPL_LISTE_ENTITE<int> nouvelles_aretes ;
|
1212 |
|
|
TPL_LISTE_ENTITE<int> aret1_conservees;
|
1213 |
|
|
TPL_LISTE_ENTITE<int> aret1_disparues;
|
1214 |
|
|
TPL_LISTE_ENTITE<int> aret2_conservees ;
|
1215 |
|
|
TPL_LISTE_ENTITE<int> aret2_nouvelles ;
|
1216 |
|
|
TPL_LISTE_ENTITE<int> aret2_partielles ;
|
1217 |
souaissa |
87 |
|
1218 |
souaissa |
142 |
MG_FACE* face2=mggeo2->get_mg_faceid(Num2);
|
1219 |
|
|
comparer_aretes_faces(Face_ref1,Face_ref2,face1,face2,aretes_identiques,aretes_similaires);
|
1220 |
|
|
identifier_aretes_face_modifiee(face1,face2,aretes_identiques,aretes_similaires,aret1_conservees,aret1_disparues,aret2_conservees ,aret2_nouvelles ,aret2_partielles);
|
1221 |
|
|
int id_face2=face2->get_id();
|
1222 |
|
|
int nb_aretes_trouvees=aretes_identiques.get_nb()/2;
|
1223 |
|
|
if(nb_aretes_trouvees)
|
1224 |
|
|
{
|
1225 |
|
|
for(int i1=0;i1<aret1_conservees.get_nb();i1++){
|
1226 |
|
|
int art1_id=aret1_conservees.get(i1);
|
1227 |
|
|
Aret1_conservees.ajouter(art1_id);
|
1228 |
|
|
MG_ARETE*art1_cons=mggeo1->get_mg_areteid(art1_id);
|
1229 |
|
|
Results.ajouter_liste_topologie(100,art1_cons);
|
1230 |
|
|
// }
|
1231 |
|
|
//for(int i1=0;i1<aret2_conservees.get_nb();i1++){
|
1232 |
|
|
int art2_id= aret2_conservees.get(i1) ;
|
1233 |
|
|
Aret2_conservees.ajouter(art2_id);
|
1234 |
|
|
MG_ARETE*art2_cons=mggeo2->get_mg_areteid(art2_id);
|
1235 |
|
|
Results.ajouter_liste_topologie(300,art2_cons);
|
1236 |
|
|
CORRESPONDANCE CORRESP;
|
1237 |
|
|
CORRESP.eleorigine=art1_cons;
|
1238 |
|
|
CORRESP.elemodifie=art2_cons;
|
1239 |
|
|
Results.ajouter_liste_topologie(CORRESP);
|
1240 |
|
|
}
|
1241 |
souaissa |
87 |
|
1242 |
souaissa |
142 |
for(int i1=0;i1<aret1_disparues.get_nb();i1++){
|
1243 |
|
|
int art_dsp=aret1_disparues.get(i1) ;
|
1244 |
|
|
Aret1_disparues.ajouter(art_dsp);
|
1245 |
|
|
MG_ARETE*art_disp=mggeo1->get_mg_areteid(art_dsp);
|
1246 |
|
|
Results.ajouter_liste_topologie(200,art_disp);
|
1247 |
|
|
}
|
1248 |
|
|
|
1249 |
|
|
for(int i1=0;i1<aret2_nouvelles.get_nb();i1++){
|
1250 |
|
|
int art_nv= aret2_nouvelles.get(i1) ;
|
1251 |
|
|
Aret2_nouvelles.ajouter(art_nv);
|
1252 |
|
|
MG_ARETE*art_app=mggeo2->get_mg_areteid(art_nv);
|
1253 |
|
|
Results.ajouter_liste_topologie(400,art_app);
|
1254 |
|
|
}
|
1255 |
|
|
for(int i1=0;i1<aret2_partielles.get_nb();i1++){
|
1256 |
|
|
int art_prt=aret2_partielles.get(i1);
|
1257 |
|
|
Aret2_partielles.ajouter(art_prt);
|
1258 |
|
|
}
|
1259 |
|
|
faces_partiellement_modf.ajouter(Num2);
|
1260 |
|
|
}
|
1261 |
|
|
|
1262 |
|
|
}
|
1263 |
|
|
|
1264 |
|
|
}
|
1265 |
|
|
|
1266 |
|
|
for(int j=0;j<dif2.get_nb();j++)
|
1267 |
|
|
{
|
1268 |
|
|
if(!faces_partiellement_modf.est_dans_la_liste(dif2.get(j)))
|
1269 |
|
|
{
|
1270 |
|
|
int nouv_face=dif2.get(j);
|
1271 |
|
|
faces_nouvelles.ajouter(nouv_face);
|
1272 |
|
|
MG_FACE* Face_Nouvelle=mggeo2->get_mg_faceid(nouv_face);
|
1273 |
|
|
Results.ajouter_liste_topologie(400,Face_Nouvelle);
|
1274 |
|
|
}
|
1275 |
|
|
}
|
1276 |
|
|
|
1277 |
souaissa |
87 |
}
|
1278 |
|
|
|
1279 |
|
|
|
1280 |
souaissa |
142 |
std::ostream& operator <<(std::ostream& os,const VCT_COMPARAISON& vct_cmp)
|
1281 |
|
|
{
|
1282 |
|
|
vct_cmp.enregistrer(os) ;
|
1283 |
|
|
return os;
|
1284 |
|
|
}
|
1285 |
souaissa |
87 |
|
1286 |
|
|
|
1287 |
|
|
|
1288 |
souaissa |
142 |
|
1289 |
|
|
|
1290 |
souaissa |
87 |
void VCT_COMPARAISON::enregistrer(ostream& os)
|
1291 |
souaissa |
142 |
{
|
1292 |
|
|
os<<"COMPARAISON VECTORIELLE DE DEUX GEOMETRIES"<<endl;
|
1293 |
|
|
int nb_cl=2;
|
1294 |
|
|
int nb_lg=similarite.get_nb()/2;
|
1295 |
souaissa |
66 |
os<<"FACES_PREMIERE_GEOMETRIE : ";
|
1296 |
|
|
for(int j=0;j<nb_lg;j++)
|
1297 |
souaissa |
87 |
os<<setw(5)<<similarite.get(j*nb_cl+0);
|
1298 |
souaissa |
66 |
os<<endl;
|
1299 |
|
|
os<<"FACES_SECONDE_GEOMETRIE : ";
|
1300 |
|
|
for(int j=0;j<nb_lg;j++)
|
1301 |
souaissa |
87 |
os<<setw(5)<<similarite.get(j*nb_cl+1);
|
1302 |
souaissa |
66 |
os<<endl;
|
1303 |
|
|
|
1304 |
souaissa |
87 |
//affecter_une_couleur();
|
1305 |
souaissa |
82 |
|
1306 |
|
|
|
1307 |
souaissa |
142 |
}
|