1 |
souaissa |
66 |
//---------------------------------------------------------------------------
|
2 |
|
|
#include"gestionversion.h"
|
3 |
|
|
|
4 |
|
|
#pragma hdrstop
|
5 |
|
|
|
6 |
|
|
#include "vct_comparaison.h"
|
7 |
|
|
#include "vct_face.h"
|
8 |
|
|
#include <iomanip>
|
9 |
|
|
//---------------------------------------------------------------------------
|
10 |
|
|
|
11 |
|
|
#pragma package(smart_init)
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
VCT_COMPARAISON::VCT_COMPARAISON(char*fil1,char*fil2)
|
15 |
|
|
{
|
16 |
|
|
|
17 |
|
|
gest1=new MG_FILE(fil1);
|
18 |
|
|
gest2=new MG_FILE(fil2);
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
24 |
|
|
|
25 |
|
|
void VCT_COMPARAISON:: get_comparaison_geometrie()
|
26 |
|
|
{
|
27 |
|
|
|
28 |
|
|
MG_GEOMETRIE*mggeo1=gest1->get_mg_geometrie(0);
|
29 |
|
|
MG_GEOMETRIE*mggeo2=gest2->get_mg_geometrie(0);
|
30 |
|
|
|
31 |
|
|
int nb_face1=mggeo1->get_nb_mg_face();
|
32 |
|
|
int nb_face2=mggeo2->get_nb_mg_face();
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
for(int i=0;i<nb_face1; i++)
|
38 |
|
|
{
|
39 |
|
|
MG_FACE* face1=mggeo1->get_mg_face(i);
|
40 |
|
|
int id1=face1->get_id();
|
41 |
|
|
VCT_FACE vct_face1(face1);
|
42 |
|
|
OT_TNS<double2,4> tns1_face,tns1_arete;
|
43 |
|
|
|
44 |
|
|
int nb_geo1_pts= vct_face1.get_nb_geo_points();
|
45 |
|
|
int nb_top1_pts= vct_face1.get_nb_topo_points();
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
tns1_face=vct_face1.get_tenseur_metrique_surface();
|
49 |
|
|
tns1_arete=vct_face1.get_tenseur_metrique_aretes();
|
50 |
|
|
|
51 |
|
|
for(int j=0;j<nb_face2;j++)
|
52 |
|
|
{
|
53 |
|
|
|
54 |
|
|
MG_FACE* face2=mggeo2->get_mg_face(j);
|
55 |
|
|
VCT_FACE vct_face2(face2);
|
56 |
|
|
int id2=face2->get_id();
|
57 |
|
|
OT_TNS<double2,4> tns2_face,tns2_arete;
|
58 |
|
|
|
59 |
|
|
int nb_geo2_pts= vct_face2.get_nb_geo_points();
|
60 |
|
|
int nb_top2_pts= vct_face2.get_nb_topo_points();
|
61 |
|
|
|
62 |
|
|
tns2_face=vct_face2.get_tenseur_metrique_surface();
|
63 |
|
|
tns2_arete=vct_face2.get_tenseur_metrique_aretes();
|
64 |
|
|
|
65 |
|
|
if(nb_geo1_pts==nb_geo2_pts&&nb_top1_pts==nb_top2_pts)
|
66 |
|
|
{
|
67 |
|
|
if(tns1_face.is_equivalent_at(tns2_face))//&&(tns1_arete==tns2_arete))
|
68 |
|
|
{
|
69 |
|
|
if(tns1_arete.is_equivalent_at(tns2_arete))
|
70 |
|
|
carte_geometrique_faces.insert(carte_geometrique_faces.end(),i);
|
71 |
|
|
carte_geometrique_faces.insert(carte_geometrique_faces.end(),j);
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
/*
|
75 |
|
|
if (tns1_arete==tns2_arete)
|
76 |
|
|
{
|
77 |
|
|
carte_geometrique_aretes(i,j)=1;
|
78 |
|
|
}
|
79 |
|
|
|
80 |
|
|
if(tns1_arete.is_equivalent_at(tns2_arete))
|
81 |
|
|
{
|
82 |
|
|
carte_geometrique_aretes(i,j)=1;
|
83 |
|
|
}
|
84 |
|
|
if((tns1_face==tns2_face))//&&(tns1_arete==tns2_arete))
|
85 |
|
|
{
|
86 |
|
|
carte_geometrique_faces(i,j)=1;
|
87 |
|
|
}
|
88 |
|
|
*/
|
89 |
|
|
|
90 |
|
|
}
|
91 |
|
|
|
92 |
|
|
}
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
VCT_COMPARAISON::~VCT_COMPARAISON()
|
105 |
|
|
{
|
106 |
|
|
delete gest1;
|
107 |
|
|
delete gest2;
|
108 |
|
|
}
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
void VCT_COMPARAISON::enregistrer(std::ostream& os)
|
113 |
|
|
{
|
114 |
|
|
os<<"COMPARAISON VECTORIELLE DE DEUX GEOMETRIES"<<endl;
|
115 |
|
|
int nb_cl=2;
|
116 |
|
|
int nb_lg=carte_geometrique_faces.size()/2;
|
117 |
|
|
os<<"FACES_PREMIERE_GEOMETRIE : ";
|
118 |
|
|
for(int j=0;j<nb_lg;j++)
|
119 |
|
|
os<<setw(5)<<carte_geometrique_faces[j*nb_cl+0];
|
120 |
|
|
os<<endl;
|
121 |
|
|
os<<"FACES_SECONDE_GEOMETRIE : ";
|
122 |
|
|
for(int j=0;j<nb_lg;j++)
|
123 |
|
|
os<<setw(5)<<carte_geometrique_faces[j*nb_cl+1];
|
124 |
|
|
os<<endl;
|
125 |
|
|
|
126 |
|
|
}
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
std::ostream& operator <<(std::ostream& os,const VCT_COMPARAISON& vct_cmp)
|
130 |
|
|
{
|
131 |
|
|
vct_cmp.enregistrer(os) ;
|
132 |
|
|
return os;
|
133 |
|
|
}
|