1 |
francois |
1157 |
//####//------------------------------------------------------------ |
2 |
|
|
//####//------------------------------------------------------------ |
3 |
|
|
//####// MAGiC |
4 |
|
|
//####// Jean Christophe Cuilliere et Vincent FRANCOIS |
5 |
|
|
//####// Departement de Genie Mecanique - UQTR |
6 |
|
|
//####//------------------------------------------------------------ |
7 |
|
|
//####// MAGIC est un projet de recherche de l equipe ERICCA |
8 |
|
|
//####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres |
9 |
|
|
//####// http://www.uqtr.ca/ericca |
10 |
|
|
//####// http://www.uqtr.ca/ |
11 |
|
|
//####//------------------------------------------------------------ |
12 |
|
|
//####//------------------------------------------------------------ |
13 |
|
|
//####// |
14 |
|
|
//####// visufile.cpp |
15 |
|
|
//####// |
16 |
|
|
//####//------------------------------------------------------------ |
17 |
|
|
//####//------------------------------------------------------------ |
18 |
|
|
//####// COPYRIGHT 2000-2024 |
19 |
|
|
//####// jeu 13 jun 2024 11:57:20 EDT |
20 |
|
|
//####//------------------------------------------------------------ |
21 |
|
|
//####//------------------------------------------------------------ |
22 |
francois |
363 |
#include "gestionversion.h" |
23 |
|
|
|
24 |
|
|
#include <iostream> |
25 |
|
|
#include "mg_file.h" |
26 |
|
|
#include <string.h> |
27 |
|
|
#include <map> |
28 |
|
|
|
29 |
|
|
void affiche(char* message) |
30 |
|
|
{ |
31 |
francois |
1157 |
|
32 |
francois |
363 |
std::cout << message << std::endl; |
33 |
|
|
} |
34 |
|
|
#ifdef _COMPARESTEP_ |
35 |
|
|
#include "occ_import.h" |
36 |
|
|
#endif |
37 |
|
|
struct color |
38 |
|
|
{ |
39 |
|
|
color(unsigned char r=255,unsigned char g=255,unsigned char b=255,unsigned char a=255) : R(r),G(g),B(b),A(a) {} |
40 |
|
|
unsigned char R; |
41 |
|
|
unsigned char G; |
42 |
|
|
unsigned char B; |
43 |
|
|
unsigned char A; //Alpha |
44 |
|
|
}; |
45 |
|
|
|
46 |
|
|
struct groupe_couleur |
47 |
|
|
{ |
48 |
|
|
int num; |
49 |
|
|
std::map<unsigned long,unsigned long> A; |
50 |
|
|
std::map<unsigned long,unsigned long> B; |
51 |
|
|
bool est_dans_A(unsigned long val) |
52 |
|
|
{ |
53 |
|
|
std::map<unsigned long,unsigned long>::iterator it=A.find(val); |
54 |
|
|
if (it!=A.end()) return true; |
55 |
|
|
return false; |
56 |
|
|
}; |
57 |
|
|
bool est_dans_B(unsigned long val) |
58 |
|
|
{ |
59 |
|
|
std::map<unsigned long,unsigned long>::iterator it=B.find(val); |
60 |
|
|
if (it!=B.end()) return true; |
61 |
|
|
return false; |
62 |
|
|
}; |
63 |
|
|
}; |
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
struct data_fichier |
68 |
|
|
{ |
69 |
|
|
std::string nomA; |
70 |
|
|
std::string nomB; |
71 |
|
|
std::map<int,groupe_couleur> list_face_similaire; |
72 |
|
|
std::map<int,groupe_couleur> list_face_identique; |
73 |
|
|
std::map<int,groupe_couleur> list_face_localise; |
74 |
|
|
std::map<int,groupe_couleur> list_arete_localise; |
75 |
|
|
std::map<int,groupe_couleur> list_sommet_localise; |
76 |
|
|
std::map<int,groupe_couleur> list_face_modifie; |
77 |
|
|
std::map<int,groupe_couleur> list_arete_modifie; |
78 |
|
|
}; |
79 |
|
|
|
80 |
|
|
|
81 |
|
|
void ini_couleur(std::vector<color> &tabcoul,int dim) |
82 |
|
|
{ |
83 |
|
|
int ecart=255/(dim+1); |
84 |
|
|
std::map<int,int> list; |
85 |
|
|
for (int i=0;i<dim*dim*dim;i++) |
86 |
|
|
{ |
87 |
|
|
int r=rand()%dim+1; |
88 |
|
|
int g=rand()%dim+1; |
89 |
|
|
int b=rand()%dim+1; |
90 |
|
|
int c=r*ecart+255*g*ecart+255*255*b*ecart; |
91 |
|
|
std::pair<int,int> tmp(c,c); |
92 |
|
|
std::pair<std::map<int,int>::iterator,bool> ret=list.insert(tmp); |
93 |
|
|
if (ret.second==false) i--; |
94 |
|
|
else |
95 |
|
|
{ |
96 |
|
|
color cc(r*ecart,g*ecart,b*ecart); |
97 |
|
|
tabcoul.push_back(cc); |
98 |
|
|
} |
99 |
|
|
} |
100 |
|
|
} |
101 |
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
void ajouter_liste_couleur(std::map<int,groupe_couleur> &list,unsigned long valA,unsigned long valB) |
105 |
|
|
{ |
106 |
|
|
static int num_couleur=0; |
107 |
|
|
std::map<int,groupe_couleur>::iterator it; |
108 |
|
|
for (it=list.begin();it!=list.end();it++) |
109 |
|
|
{ |
110 |
|
|
bool res=it->second.est_dans_A(valA); |
111 |
|
|
if (res==true) |
112 |
|
|
{ |
113 |
|
|
it->second.A.insert(std::pair<unsigned long,unsigned long>(valA,valA)); |
114 |
|
|
it->second.B.insert(std::pair<unsigned long,unsigned long>(valB,valB)); |
115 |
|
|
return; |
116 |
|
|
} |
117 |
|
|
|
118 |
|
|
res=it->second.est_dans_B(valB); |
119 |
|
|
if (res==true) |
120 |
|
|
{ |
121 |
|
|
it->second.A.insert(std::pair<unsigned long,unsigned long>(valA,valA)); |
122 |
|
|
it->second.B.insert(std::pair<unsigned long,unsigned long>(valB,valB)); |
123 |
|
|
return; |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
} |
127 |
|
|
groupe_couleur gc; |
128 |
|
|
std::pair<std::map<int,groupe_couleur>::iterator,bool> ret=list.insert(std::pair<int,groupe_couleur>(num_couleur,gc)); |
129 |
|
|
ret.first->second.num=num_couleur; |
130 |
|
|
ret.first->second.A.insert(std::pair<unsigned long,unsigned long>(valA,valA)); |
131 |
|
|
ret.first->second.B.insert(std::pair<unsigned long,unsigned long>(valB,valB)); |
132 |
|
|
num_couleur++; |
133 |
|
|
} |
134 |
|
|
|
135 |
|
|
|
136 |
|
|
void lire_fichier(char *nom,data_fichier &data) |
137 |
|
|
{ |
138 |
|
|
FILE* in=fopen(nom,"rt"); |
139 |
|
|
|
140 |
|
|
while (!feof(in)) |
141 |
|
|
{ |
142 |
|
|
char mess[255],mess2[255]; |
143 |
|
|
fgets(mess,255,in); |
144 |
|
|
if (strlen(mess)>1) |
145 |
|
|
if (mess[0]=='/') |
146 |
|
|
if (mess[1]=='/') continue; |
147 |
|
|
if (strcmp(mess,"Model A:\n")==0) |
148 |
|
|
{ |
149 |
|
|
fgets(mess,255,in); |
150 |
|
|
sscanf(mess,"%s",mess2); |
151 |
|
|
data.nomA=mess2; |
152 |
|
|
} |
153 |
|
|
else if (strcmp(mess,"Model B:\n")==0) |
154 |
|
|
{ |
155 |
|
|
fgets(mess,255,in); |
156 |
|
|
sscanf(mess,"%s",mess2); |
157 |
|
|
data.nomB=mess2; |
158 |
|
|
} |
159 |
|
|
else |
160 |
|
|
{ |
161 |
|
|
char mot1[255],mot2[255],mot3[255]; |
162 |
|
|
int nb; |
163 |
|
|
int n=sscanf(mess,"%d %s %s %s",&nb,mot1,mot2,mot3); |
164 |
|
|
std::map<int,groupe_couleur> *list=NULL; |
165 |
|
|
if (n>2) |
166 |
|
|
{ |
167 |
|
|
if (strcmp(mot1,"Similar")==0) |
168 |
|
|
if (strcmp(mot2,"faces")==0) |
169 |
|
|
list= &(data.list_face_similaire); |
170 |
|
|
if (strcmp(mot1,"Identical")==0) |
171 |
|
|
if (strcmp(mot2,"faces")==0) |
172 |
|
|
list= &(data.list_face_identique); |
173 |
|
|
if (strcmp(mot1,"Localized")==0) |
174 |
|
|
if (strcmp(mot2,"identical")==0) |
175 |
|
|
if (strcmp(mot3,"faces")==0) |
176 |
|
|
list=&(data.list_face_localise); |
177 |
|
|
if (strcmp(mot1,"Localized")==0) |
178 |
|
|
if (strcmp(mot2,"identical")==0) |
179 |
|
|
if (strcmp(mot3,"edges")==0) |
180 |
|
|
list=&(data.list_arete_localise); |
181 |
|
|
if (strcmp(mot1,"Localized")==0) |
182 |
|
|
if (strcmp(mot2,"identical")==0) |
183 |
|
|
if (strcmp(mot3,"vertices")==0) |
184 |
|
|
list=&(data.list_sommet_localise); |
185 |
|
|
if (strcmp(mot1,"Localized")==0) |
186 |
|
|
if (strcmp(mot2,"modified")==0) |
187 |
|
|
if (strcmp(mot3,"faces")==0) |
188 |
|
|
list=&(data.list_face_modifie); |
189 |
|
|
if (strcmp(mot1,"Localized")==0) |
190 |
|
|
if (strcmp(mot2,"modified")==0) |
191 |
|
|
if (strcmp(mot3,"edges")==0) |
192 |
|
|
list=&(data.list_arete_modifie); |
193 |
|
|
if (list!=NULL) |
194 |
|
|
for (int i=0;i<nb;i++) |
195 |
|
|
{ |
196 |
|
|
fgets(mess,255,in); |
197 |
|
|
unsigned long valA,valB; |
198 |
francois |
479 |
sscanf(mess,"%lu %lu",&valA,&valB); |
199 |
francois |
363 |
ajouter_liste_couleur(*list,valA,valB); |
200 |
|
|
} |
201 |
|
|
} |
202 |
|
|
} |
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
} |
207 |
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
fclose(in); |
211 |
|
|
} |
212 |
|
|
|
213 |
|
|
|
214 |
|
|
void affiche_structure(char* nom,char c,MG_GEOMETRIE* geo,MG_MAILLAGE* mai,bool A,std::vector<color> &tabcoul, std::map<int,groupe_couleur> &list_face, std::map<int,groupe_couleur> &list_arete, std::map<int,groupe_couleur> &list_sommet) |
215 |
|
|
{ |
216 |
|
|
char nomtmp[500]; |
217 |
|
|
strcpy(nomtmp,nom); |
218 |
|
|
int i=0; |
219 |
|
|
while (nomtmp[i]!=0) |
220 |
|
|
{ |
221 |
|
|
if (nomtmp[i]=='.') {nomtmp[i]=0;break;} |
222 |
|
|
i++; |
223 |
|
|
} |
224 |
|
|
char nomfichier[500]; |
225 |
|
|
if (A==true) sprintf(nomfichier,"%s_%c_A.vtk",nomtmp,c); |
226 |
|
|
else sprintf(nomfichier,"%s_%c_B.vtk",nomtmp,c); |
227 |
|
|
std::map<unsigned long,int> correspondance; |
228 |
|
|
std::map<int,groupe_couleur>::iterator it; |
229 |
|
|
for (it=list_face.begin();it!=list_face.end();it++) |
230 |
|
|
{ |
231 |
|
|
groupe_couleur gc=it->second; |
232 |
|
|
int numcolor=gc.num; |
233 |
|
|
std::map<unsigned long,unsigned long>::iterator it2; |
234 |
|
|
std::map<unsigned long,unsigned long> *tmp; |
235 |
|
|
if (A==true) tmp=&(gc.A); |
236 |
|
|
else tmp=&(gc.B); |
237 |
|
|
for (it2=tmp->begin();it2!=tmp->end();it2++) |
238 |
|
|
{ |
239 |
|
|
unsigned long idface=it2->second; |
240 |
|
|
correspondance.insert(std::pair<unsigned long,int>(idface,numcolor) ); |
241 |
|
|
} |
242 |
|
|
} |
243 |
|
|
for (it=list_arete.begin();it!=list_arete.end();it++) |
244 |
|
|
{ |
245 |
|
|
groupe_couleur gc=it->second; |
246 |
|
|
int numcolor=gc.num; |
247 |
|
|
std::map<unsigned long,unsigned long>::iterator it2; |
248 |
|
|
std::map<unsigned long,unsigned long> *tmp; |
249 |
|
|
if (A==true) tmp=&(gc.A); |
250 |
|
|
else tmp=&(gc.B); |
251 |
|
|
for (it2=tmp->begin();it2!=tmp->end();it2++) |
252 |
|
|
{ |
253 |
|
|
unsigned long idarete=it2->second; |
254 |
|
|
correspondance.insert(std::pair<unsigned long,int>(idarete,numcolor) ); |
255 |
|
|
} |
256 |
|
|
} |
257 |
|
|
for (it=list_sommet.begin();it!=list_sommet.end();it++) |
258 |
|
|
{ |
259 |
|
|
groupe_couleur gc=it->second; |
260 |
|
|
int numcolor=gc.num; |
261 |
|
|
std::map<unsigned long,unsigned long>::iterator it2; |
262 |
|
|
std::map<unsigned long,unsigned long> *tmp; |
263 |
|
|
if (A==true) tmp=&(gc.A); |
264 |
|
|
else tmp=&(gc.B); |
265 |
|
|
for (it2=tmp->begin();it2!=tmp->end();it2++) |
266 |
|
|
{ |
267 |
|
|
unsigned long idsommet=it2->second; |
268 |
|
|
correspondance.insert(std::pair<unsigned long,int>(idsommet,numcolor) ); |
269 |
|
|
} |
270 |
|
|
} |
271 |
|
|
FILE* out=fopen(nomfichier,"wt"); |
272 |
|
|
fprintf(out,"# vtk DataFile Version 2.0\n"); |
273 |
|
|
fprintf(out,"vtk output\n"); |
274 |
|
|
fprintf(out,"ASCII\n"); |
275 |
|
|
fprintf(out,"DATASET POLYDATA\n"); |
276 |
|
|
int nbnoeud=mai->get_nb_mg_noeud(); |
277 |
|
|
TPL_LISTE_ENTITE<MG_SEGMENT*> lstseg; |
278 |
|
|
LISTE_MG_SEGMENT::iterator itseg; |
279 |
|
|
for (MG_SEGMENT* seg=mai->get_premier_segment(itseg);seg!=NULL;seg=mai->get_suivant_segment(itseg)) |
280 |
|
|
if (seg->get_lien_topologie()->get_dimension()==1) lstseg.ajouter(seg); |
281 |
|
|
fprintf(out,"POINTS %d double\n",nbnoeud); |
282 |
|
|
LISTE_MG_NOEUD::iterator itn; |
283 |
|
|
i=0; |
284 |
|
|
for (MG_NOEUD* no=mai->get_premier_noeud(itn);no!=NULL;no=mai->get_suivant_noeud(itn)) |
285 |
|
|
{ |
286 |
|
|
fprintf(out,"%lf %lf %lf\n",no->get_x(),no->get_y(),no->get_z()); |
287 |
|
|
no->change_nouveau_numero(i); |
288 |
|
|
i++; |
289 |
|
|
} |
290 |
|
|
fprintf(out,"VERTICES %d %d\n",geo->get_nb_mg_sommet(),2*geo->get_nb_mg_sommet()); |
291 |
|
|
LISTE_MG_SOMMET::iterator its; |
292 |
|
|
for (MG_SOMMET* som=geo->get_premier_sommet(its);som!=NULL;som=geo->get_suivant_sommet(its)) |
293 |
|
|
{ |
294 |
|
|
MG_NOEUD* no=(MG_NOEUD*)som->get_lien_maillage()->get(0); |
295 |
|
|
fprintf(out,"1 %d\n",no->get_nouveau_numero()); |
296 |
|
|
} |
297 |
|
|
fprintf(out,"LINES %d %d\n",lstseg.get_nb(),lstseg.get_nb()*3); |
298 |
|
|
for (int j=0;j<lstseg.get_nb();j++) |
299 |
|
|
fprintf(out,"2 %d %d\n",lstseg.get(j)->get_noeud1()->get_nouveau_numero(),lstseg.get(j)->get_noeud2()->get_nouveau_numero()); |
300 |
|
|
|
301 |
|
|
fprintf(out,"POLYGONS %d %d\n",mai->get_nb_mg_triangle(),4*mai->get_nb_mg_triangle()); |
302 |
|
|
LISTE_MG_TRIANGLE::iterator itt; |
303 |
|
|
for (MG_TRIANGLE* tri=mai->get_premier_triangle(itt);tri!=NULL;tri=mai->get_suivant_triangle(itt)) |
304 |
|
|
fprintf(out,"3 %d %d %d\n",tri->get_noeud1()->get_nouveau_numero(),tri->get_noeud2()->get_nouveau_numero(),tri->get_noeud3()->get_nouveau_numero()); |
305 |
|
|
fprintf(out,"CELL_DATA %d\n",geo->get_nb_mg_sommet()+lstseg.get_nb()+mai->get_nb_mg_triangle()); |
306 |
|
|
fprintf(out,"COLOR_SCALARS color 4\n"); |
307 |
|
|
for (MG_SOMMET* som=geo->get_premier_sommet(its);som!=NULL;som=geo->get_suivant_sommet(its)) |
308 |
|
|
{ |
309 |
|
|
double r=0.; |
310 |
|
|
double g=0.; |
311 |
|
|
double b=0.; |
312 |
|
|
if (c!='L') {r=1.;g=1.;b=1.;} |
313 |
|
|
unsigned long id=som->get_id(); |
314 |
|
|
std::map<unsigned long,int>::iterator it=correspondance.find(id); |
315 |
|
|
if (it!=correspondance.end()) |
316 |
|
|
{ |
317 |
|
|
int num=it->second; |
318 |
|
|
r=tabcoul[num].R*1./255.; |
319 |
|
|
g=tabcoul[num].G*1./255.; |
320 |
|
|
b=tabcoul[num].B*1./255.; |
321 |
|
|
} |
322 |
|
|
fprintf(out,"%lf %lf %lf 1.\n",r,g,b); |
323 |
|
|
} |
324 |
|
|
for (int j=0;j<lstseg.get_nb();j++) |
325 |
|
|
{ |
326 |
|
|
double r=0.; |
327 |
|
|
double g=0.; |
328 |
|
|
double b=0.; |
329 |
|
|
if (c!='L') {r=1.;g=1.;b=1.;} |
330 |
|
|
unsigned long id=lstseg.get(j)->get_lien_topologie()->get_id(); |
331 |
|
|
std::map<unsigned long,int>::iterator it=correspondance.find(id); |
332 |
|
|
if (it!=correspondance.end()) |
333 |
|
|
{ |
334 |
|
|
int num=it->second; |
335 |
|
|
r=tabcoul[num].R*1./255.; |
336 |
|
|
g=tabcoul[num].G*1./255.; |
337 |
|
|
b=tabcoul[num].B*1./255.; |
338 |
|
|
} |
339 |
|
|
fprintf(out,"%lf %lf %lf 1.\n",r,g,b); |
340 |
|
|
} |
341 |
|
|
for (MG_TRIANGLE* tri=mai->get_premier_triangle(itt);tri!=NULL;tri=mai->get_suivant_triangle(itt)) |
342 |
|
|
{ |
343 |
|
|
double r=0.; |
344 |
|
|
double g=0.; |
345 |
|
|
double b=0.; |
346 |
|
|
//if (c!='L') {r=1.;g=1.;b=1.;} |
347 |
|
|
unsigned long id=tri->get_lien_topologie()->get_id(); |
348 |
|
|
std::map<unsigned long,int>::iterator it=correspondance.find(id); |
349 |
|
|
if (it!=correspondance.end()) |
350 |
|
|
{ |
351 |
|
|
int num=it->second; |
352 |
|
|
r=tabcoul[num].R*1./255.; |
353 |
|
|
g=tabcoul[num].G*1./255.; |
354 |
|
|
b=tabcoul[num].B*1./255.; |
355 |
|
|
} |
356 |
|
|
fprintf(out,"%lf %lf %lf 1.\n",r,g,b); |
357 |
|
|
} |
358 |
|
|
fclose(out); |
359 |
|
|
|
360 |
|
|
|
361 |
|
|
|
362 |
|
|
|
363 |
|
|
|
364 |
|
|
}; |
365 |
|
|
|
366 |
|
|
|
367 |
|
|
|
368 |
|
|
|
369 |
|
|
|
370 |
|
|
|
371 |
|
|
|
372 |
francois |
1157 |
|
373 |
francois |
363 |
int main(int argc,char **argv) |
374 |
|
|
{ |
375 |
francois |
370 |
#ifndef USE_ENGLISH |
376 |
francois |
363 |
printf("******************************\n"); |
377 |
francois |
370 |
printf("* Exportation des fichiers *\n"); |
378 |
|
|
printf("* de visualisation VTK *\n"); |
379 |
|
|
printf("* par *\n"); |
380 |
|
|
printf("* Jean-Christophe Cuillière *\n"); |
381 |
|
|
printf("* et *\n"); |
382 |
|
|
printf("* Vincent Francois *\n"); |
383 |
|
|
printf("* ERICCA-UQTR *\n"); |
384 |
|
|
printf("******************************\n\n\n"); |
385 |
|
|
if (argc!=2) |
386 |
|
|
{ |
387 |
|
|
printf("Visufile.exe erreur de syntaxe - Mauvais nombre d'arguments\n\n"); |
388 |
|
|
return 0; |
389 |
|
|
|
390 |
|
|
} |
391 |
|
|
#else |
392 |
|
|
printf("******************************\n"); |
393 |
francois |
363 |
printf("* VTK Comparison *\n"); |
394 |
|
|
printf("* visualization export *\n"); |
395 |
|
|
printf("* by *\n"); |
396 |
|
|
printf("* Jean-Christophe Cuillière *\n"); |
397 |
|
|
printf("* and *\n"); |
398 |
|
|
printf("* Vincent Francois *\n"); |
399 |
|
|
printf("* ERICCA-UQTR *\n"); |
400 |
|
|
printf("******************************\n\n\n"); |
401 |
francois |
370 |
if (argc!=2) |
402 |
|
|
{ |
403 |
francois |
1061 |
printf("Visufile.exe syntax error - Bad number arguments\n visucompare.exe nom_fichier_resultat_comparaison\n\n"); |
404 |
francois |
370 |
return 0; |
405 |
|
|
|
406 |
|
|
} |
407 |
|
|
#endif |
408 |
francois |
375 |
GESTIONVERSION v; |
409 |
|
|
char version[500]; |
410 |
|
|
v.print(version); |
411 |
|
|
affiche(version); |
412 |
francois |
363 |
if (argc!=2) |
413 |
|
|
{ |
414 |
|
|
printf("Visufile syntax error - Bad number arguments\n\n"); |
415 |
|
|
return 0; |
416 |
|
|
|
417 |
|
|
} |
418 |
|
|
|
419 |
|
|
|
420 |
|
|
std::map<int,groupe_couleur> list_vide; |
421 |
|
|
std::vector<color> tabcoul; |
422 |
|
|
ini_couleur(tabcoul,10); |
423 |
|
|
bool A=true; |
424 |
|
|
bool B=false; |
425 |
|
|
data_fichier df; |
426 |
|
|
lire_fichier(argv[1],df); |
427 |
|
|
#ifdef _COMPARESTEP_ |
428 |
|
|
MG_GESTIONNAIRE gesta; |
429 |
|
|
MG_GESTIONNAIRE gestb; |
430 |
francois |
365 |
OCC_IMPORT occimport1,occimport2; |
431 |
|
|
MG_GEOMETRIE* geo1=occimport1.importer(gesta,(char*)df.nomA.c_str(),FICHIERSTEP,1.,1e-6); |
432 |
|
|
MG_GEOMETRIE* geo2=occimport2.importer(gestb,(char*)df.nomB.c_str(),FICHIERSTEP,1.,1e-6); |
433 |
|
|
occimport1.importer(gesta,geo1,1.,2); |
434 |
|
|
occimport2.importer(gestb,geo2,1.,2); |
435 |
francois |
363 |
#else |
436 |
|
|
MG_FILE gesta((char*)df.nomA.c_str()); |
437 |
|
|
MG_FILE gestb((char*)df.nomB.c_str()); |
438 |
|
|
#endif |
439 |
francois |
370 |
#ifndef USE_ENGLISH |
440 |
francois |
479 |
printf(" Faces similaires : %d\n",(int)df.list_face_similaire.size()); |
441 |
|
|
printf(" Faces identiques : %d\n",(int)df.list_face_identique.size()); |
442 |
|
|
printf(" Faces localisees : %d\n",(int)df.list_face_localise.size()); |
443 |
|
|
printf(" Aretes localisees : %d\n",(int)df.list_arete_localise.size()); |
444 |
|
|
printf(" Sommets localises : %d\n",(int)df.list_sommet_localise.size()); |
445 |
|
|
printf(" Faces modifiees : %d \n",(int)df.list_face_modifie.size()); |
446 |
|
|
printf(" Aretes modifiees : %d\n",(int)df.list_arete_modifie.size()); |
447 |
francois |
370 |
#else |
448 |
francois |
479 |
printf(" Similar faces : %d\n",(int)df.list_face_similaire.size()); |
449 |
|
|
printf(" Identical faces : %d\n",(int)df.list_face_identique.size()); |
450 |
|
|
printf(" Localized faces : %d\n",(int)df.list_face_localise.size()); |
451 |
|
|
printf(" Localized edges : %d\n",(int)df.list_arete_localise.size()); |
452 |
|
|
printf(" Localized vertices : %d\n",(int)df.list_sommet_localise.size()); |
453 |
|
|
printf(" Modified faces : %d \n",(int)df.list_face_modifie.size()); |
454 |
|
|
printf(" Modified edges : %d\n",(int)df.list_arete_modifie.size()); |
455 |
francois |
370 |
#endif |
456 |
francois |
363 |
|
457 |
|
|
MG_GEOMETRIE* geoa=gesta.get_mg_geometrie(0); |
458 |
|
|
MG_GEOMETRIE* geob=gestb.get_mg_geometrie(0); |
459 |
|
|
MG_MAILLAGE* maia=gesta.get_mg_maillage(0); |
460 |
|
|
MG_MAILLAGE* maib=gestb.get_mg_maillage(0); |
461 |
|
|
affiche_structure(argv[1],'M',geoa,maia,A,tabcoul,df.list_face_modifie,df.list_arete_modifie,list_vide); |
462 |
|
|
affiche_structure(argv[1],'I',geoa,maia,A,tabcoul,df.list_face_identique,list_vide,list_vide); |
463 |
|
|
affiche_structure(argv[1],'S',geoa,maia,A,tabcoul,df.list_face_similaire,list_vide,list_vide); |
464 |
|
|
affiche_structure(argv[1],'L',geoa,maia,A,tabcoul,df.list_face_localise,df.list_arete_localise,df.list_sommet_localise); |
465 |
|
|
affiche_structure(argv[1],'M',geob,maib,B,tabcoul,df.list_face_modifie,df.list_arete_modifie,list_vide); |
466 |
|
|
affiche_structure(argv[1],'I',geob,maib,B,tabcoul,df.list_face_identique,list_vide,list_vide); |
467 |
|
|
affiche_structure(argv[1],'S',geob,maib,B,tabcoul,df.list_face_similaire,list_vide,list_vide); |
468 |
|
|
affiche_structure(argv[1],'L',geob,maib,B,tabcoul,df.list_face_localise,df.list_arete_localise,df.list_sommet_localise); |
469 |
|
|
return 0; |
470 |
|
|
} |
471 |
|
|
|
472 |
|
|
|
473 |
|
|
|
474 |
|
|
#pragma package(smart_init) |