262 |
const Triangle*& currentTriangle, |
const Triangle*& currentTriangle, |
263 |
const Cell* cell); |
const Cell* cell); |
264 |
|
|
265 |
TinyVector<3,size_t> __putEdgeRef(const size_t& ncase, |
TinyVector<3,size_t>& __putEdgeRef(const size_t& ncase, |
266 |
const Triangle& currentTriangle, |
const Triangle& currentTriangle, |
267 |
TriangleCut& K); |
TriangleCut& K); |
268 |
|
|
269 |
void __createListTriangle(const TriangleCut& K, |
void __createListTriangle(const TriangleCut& K, |
270 |
const Cell* cell); |
const Cell* cell); |
1235 |
TinyVector<3,int>& pp) |
TinyVector<3,int>& pp) |
1236 |
{ |
{ |
1237 |
const TinyVector<3,TinyVector<2,int> >& tt2=K.edgecut; |
const TinyVector<3,TinyVector<2,int> >& tt2=K.edgecut; |
1238 |
if(ncase==0) { |
switch(ncase) { |
1239 |
|
case 0: { |
1240 |
tt[0]=tt2[0][0]; |
tt[0]=tt2[0][0]; |
1241 |
tt[1]=tt2[1][0]; |
tt[1]=tt2[1][0]; |
1242 |
tt[2]=tt2[2][0]; |
tt[2]=tt2[2][0]; |
1243 |
pp[0]=0; |
pp[0]=0; |
1244 |
pp[1]=1; |
pp[1]=1; |
1245 |
pp[2]=2; |
pp[2]=2; |
1246 |
} else { |
break; |
1247 |
if(ncase==1) { |
} |
1248 |
tt[0]=tt2[0][0]; |
case 1: { |
1249 |
tt[1]=tt2[2][0]; |
tt[0]=tt2[0][0]; |
1250 |
tt[2]=tt2[1][0]; |
tt[1]=tt2[2][0]; |
1251 |
pp[0]=0; |
tt[2]=tt2[1][0]; |
1252 |
pp[1]=2; |
pp[0]=0; |
1253 |
pp[2]=1; |
pp[1]=2; |
1254 |
} else { |
pp[2]=1; |
1255 |
if(ncase==2) { |
break; |
1256 |
tt[0]=tt2[1][0]; |
} |
1257 |
tt[1]=tt2[2][0]; |
case 2: { |
1258 |
tt[2]=tt2[0][0]; |
tt[0]=tt2[1][0]; |
1259 |
pp[0]=1; |
tt[1]=tt2[2][0]; |
1260 |
pp[1]=2; |
tt[2]=tt2[0][0]; |
1261 |
// CECILE: est-il normal que pp[2] ne soit pas défini ? |
pp[0]=1; |
1262 |
} |
pp[1]=2; |
1263 |
} |
// CECILE: est-il normal que pp[2] ne soit pas défini ? |
1264 |
|
break; |
1265 |
|
} |
1266 |
} |
} |
1267 |
} |
} |
1268 |
|
|
1285 |
|
|
1286 |
__determinateCase(ncase,K,tt,pp); |
__determinateCase(ncase,K,tt,pp); |
1287 |
|
|
1288 |
if(numberin==0) { |
switch (numberin) { |
1289 |
|
case 0: { |
1290 |
if(tt[0]==1) { |
if(tt[0]==1) { |
1291 |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
1292 |
if(tt[1]==1) { |
if(tt[1]==1) { |
1305 |
ffout(0) <<"pbs 111\n"; |
ffout(0) <<"pbs 111\n"; |
1306 |
} |
} |
1307 |
} |
} |
1308 |
} else { |
break; |
1309 |
if(numberin==1) { |
} |
1310 |
std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
case 1: { |
1311 |
const Vertex& D=*((*it).second); |
std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
1312 |
if(tt[0]==1) { |
const Vertex& D=*((*it).second); |
1313 |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
if(tt[0]==1) { |
1314 |
if(tt[1]==1) { |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
1315 |
const Vertex& C=__determinateNumber(pp[1],pointsint); |
if(tt[1]==1) { |
1316 |
__addTriangle(A,B,D,cell); |
const Vertex& C=__determinateNumber(pp[1],pointsint); |
1317 |
__addTriangle(A,D,C,cell); |
__addTriangle(A,B,D,cell); |
1318 |
} else { |
__addTriangle(A,D,C,cell); |
|
ffout(0)<<"-------- warning trou in 0\n"<<std::flush; |
|
|
ffout(0)<<V0.Vector3()<<"\n"; |
|
|
ffout(0)<<V1.Vector3()<<"\n"; |
|
|
ffout(0)<<V2.Vector3()<<"\n"; |
|
|
__addTriangle(A,B,D,cell); |
|
|
} |
|
1319 |
} else { |
} else { |
1320 |
if(tt[1]==1) { |
ffout(0)<<"-------- warning trou in 0\n"<<std::flush; |
1321 |
ffout(0)<<"-------- warning trou in\n"<<std::flush; |
ffout(0)<<V0.Vector3()<<"\n"; |
1322 |
const Vertex& B=__determinateNumber(pp[1],pointsint); |
ffout(0)<<V1.Vector3()<<"\n"; |
1323 |
__addTriangle(A,B,D,cell); |
ffout(0)<<V2.Vector3()<<"\n"; |
1324 |
} else { |
__addTriangle(A,B,D,cell); |
|
ffout(0) <<"pbs 1\n"<<std::flush; |
|
|
} |
|
1325 |
} |
} |
1326 |
} else { |
} else { |
1327 |
|
if(tt[1]==1) { |
1328 |
|
ffout(0)<<"-------- warning trou in\n"<<std::flush; |
1329 |
|
const Vertex& B=__determinateNumber(pp[1],pointsint); |
1330 |
|
__addTriangle(A,B,D,cell); |
1331 |
|
} else { |
1332 |
|
ffout(0) <<"pbs 1\n"<<std::flush; |
1333 |
|
} |
1334 |
|
} |
1335 |
|
break; |
1336 |
|
} |
1337 |
|
default: { |
1338 |
#warning is it true? |
#warning is it true? |
1339 |
//a faire si plus d' 1 point d'intersection pas dans le triangle |
//a faire si plus d' 1 point d'intersection pas dans le triangle |
1340 |
ffout(0) << numberin<<" be careful 1\n"<<std::flush; |
ffout(0) << numberin<<" be careful 1\n"<<std::flush; |
1341 |
//POUR STEPH : peut generer des tr plats |
//POUR STEPH : peut generer des tr plats |
1342 |
// ffout(0)<<V0.Vector3()<<"\n"; |
// ffout(0)<<V0.Vector3()<<"\n"; |
1343 |
//ffout(0)<<V1.Vector3()<<"\n"; |
//ffout(0)<<V1.Vector3()<<"\n"; |
1344 |
//ffout(0)<<V2.Vector3()<<"\n"; |
//ffout(0)<<V2.Vector3()<<"\n"; |
1345 |
TinyVector<10,const Vertex*> P,Ptemp; |
TinyVector<10,const Vertex*> P,Ptemp; |
1346 |
size_t i=0; |
size_t i=0; |
1347 |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
1348 |
it!=pointsin.end() ; ++it) { |
it!=pointsin.end() ; ++it) { |
1349 |
P[i+1]=(*it).second; |
P[i+1]=(*it).second; |
1350 |
++i; |
++i; |
1351 |
} |
} |
1352 |
|
|
1353 |
if(tt[0]==1) { |
if(tt[0]==1) { |
1354 |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
const Vertex& B=__determinateNumber(pp[0],pointsint); |
1355 |
P[0]=&B; |
P[0]=&B; |
1356 |
if(tt[1]==1) { |
if(tt[1]==1) { |
1357 |
const Vertex& C=__determinateNumber(pp[1],pointsint); |
const Vertex& C=__determinateNumber(pp[1],pointsint); |
1358 |
size_t size=numberin+1; |
size_t size=numberin+1; |
1359 |
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
1360 |
|
size_t num=1; |
1361 |
|
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
1362 |
|
for(size_t i=2 ; i<size ; ++i) { |
1363 |
|
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
1364 |
|
if(normtemp<=norm) { |
1365 |
|
norm=normtemp; |
1366 |
|
Ptemp[i-1]=P[num]; |
1367 |
|
num=i; |
1368 |
|
} else { |
1369 |
|
Ptemp[i-1]=P[i]; |
1370 |
|
} |
1371 |
|
} |
1372 |
|
__addTriangle(A,*P[0],*P[num],cell); |
1373 |
|
Ptemp[0]=P[num]; |
1374 |
|
P=Ptemp; |
1375 |
|
--size; |
1376 |
|
// ffout(0)<<"size = "<<size<<"\n"; |
1377 |
|
} |
1378 |
|
__addTriangle(A,*P[0],*P[1],cell); |
1379 |
|
__addTriangle(A,*P[1],C,cell); |
1380 |
|
/* if(tt[2]==1) { |
1381 |
|
const Vertex& D=__determinateNumber(pp[2],pointsint); |
1382 |
|
for(size_t i=0 ; i<numberin ; ++i) { |
1383 |
|
P[i+1]=(pointsin[i]); |
1384 |
|
} |
1385 |
|
P[0]=&B; |
1386 |
|
size=numberin+1; |
1387 |
|
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
1388 |
size_t num=1; |
size_t num=1; |
1389 |
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
1390 |
for(size_t i=2 ; i<size ; ++i) { |
for(size_t i=2 ; i<size ; ++i) { |
1391 |
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
1392 |
if(normtemp<=norm) { |
if(normtemp<=norm) { |
1393 |
norm=normtemp; |
norm=normtemp; |
1394 |
Ptemp[i-1]=P[num]; |
Ptemp[i-1]=P[num]; |
1395 |
num=i; |
num=i; |
1396 |
} else { |
} |
1397 |
Ptemp[i-1]=P[i]; |
else { |
1398 |
} |
Ptemp[i-1]=P[i]; |
1399 |
|
} |
1400 |
} |
} |
1401 |
__addTriangle(A,*P[0],*P[num],cell); |
__addTriangle(D,*P[0],*P[num],cell); |
1402 |
Ptemp[0]=P[num]; |
Ptemp[0]=P[num]; |
1403 |
P=Ptemp; |
P=Ptemp; |
1404 |
--size; |
--size; |
1405 |
// ffout(0)<<"size = "<<size<<"\n"; |
// ffout(0)<<"size = "<<size<<"\n"; |
1406 |
} |
} |
1407 |
__addTriangle(A,*P[0],*P[1],cell); |
__addTriangle(D,*P[0],*P[1],cell); |
|
__addTriangle(A,*P[1],C,cell); |
|
|
/* if(tt[2]==1) { |
|
|
const Vertex& D=__determinateNumber(pp[2],pointsint); |
|
|
for(size_t i=0 ; i<numberin ; ++i) { |
|
|
P[i+1]=(pointsin[i]); |
|
|
} |
|
|
P[0]=&B; |
|
|
size=numberin+1; |
|
|
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
|
|
size_t num=1; |
|
|
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
|
|
for(size_t i=2 ; i<size ; ++i) { |
|
|
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
|
|
if(normtemp<=norm) { |
|
|
norm=normtemp; |
|
|
Ptemp[i-1]=P[num]; |
|
|
num=i; |
|
|
} |
|
|
else { |
|
|
Ptemp[i-1]=P[i]; |
|
|
} |
|
|
} |
|
|
__addTriangle(D,*P[0],*P[num],cell); |
|
|
Ptemp[0]=P[num]; |
|
|
P=Ptemp; |
|
|
--size; |
|
|
// ffout(0)<<"size = "<<size<<"\n"; |
|
|
} |
|
|
__addTriangle(D,*P[0],*P[1],cell); |
|
1408 |
// __addTriangle(D,*P[1],C,cell); |
// __addTriangle(D,*P[1],C,cell); |
1409 |
}*/ |
}*/ |
|
} else { |
|
|
ffout(0)<<"une seule arete cut pbs\n"; |
|
|
} |
|
1410 |
} else { |
} else { |
1411 |
ffout(0)<<"une seule arete cut pbs2\n"; |
ffout(0)<<"une seule arete cut pbs\n"; |
1412 |
} |
} |
1413 |
|
} else { |
1414 |
|
ffout(0)<<"une seule arete cut pbs2\n"; |
1415 |
} |
} |
1416 |
} |
} |
1417 |
|
} |
1418 |
} |
} |
1419 |
|
|
1420 |
void SurfaceMeshGenerator::Internals:: |
void SurfaceMeshGenerator::Internals:: |
1434 |
const int& numberin=pointsin.size(); |
const int& numberin=pointsin.size(); |
1435 |
|
|
1436 |
size_t ncase0=0,ncase1=1; |
size_t ncase0=0,ncase1=1; |
1437 |
|
switch (ncase) { |
1438 |
if(ncase==0) { |
case 0: { |
1439 |
ttn0=tt2[1][0]; |
ttn0=tt2[1][0]; |
1440 |
ttn1=tt2[2][0]; |
ttn1=tt2[2][0]; |
1441 |
p0=1; |
p0=1; |
1442 |
p1=2; |
p1=2; |
1443 |
} else { |
break; |
1444 |
if(ncase==1) { |
} |
1445 |
ttn0=tt2[0][0]; |
case 1: { |
1446 |
ttn1=tt2[2][0]; |
ttn0=tt2[0][0]; |
1447 |
p0=0; |
ttn1=tt2[2][0]; |
1448 |
p1=2; |
p0=0; |
1449 |
ncase0=0; |
p1=2; |
1450 |
ncase1=2; |
ncase0=0; |
1451 |
} else { |
ncase1=2; |
1452 |
if(ncase==2) { |
break; |
1453 |
ttn0=tt2[0][0]; |
} |
1454 |
ttn1=tt2[1][0]; |
case 2: { |
1455 |
p0=0; |
ttn0=tt2[0][0]; |
1456 |
p1=1; |
ttn1=tt2[1][0]; |
1457 |
ncase0=1; |
p0=0; |
1458 |
ncase1=2; |
p1=1; |
1459 |
} |
ncase0=1; |
1460 |
} |
ncase1=2; |
1461 |
|
} |
1462 |
} |
} |
1463 |
|
|
1464 |
const Vertex& A=K(ncase0); |
const Vertex& A=K(ncase0); |
1465 |
const Vertex& B=K(ncase1); |
const Vertex& B=K(ncase1); |
1466 |
|
|
1467 |
if(numberin==0) { |
switch (numberin) { |
1468 |
|
case 0: { |
1469 |
if(ttn0==1) { |
if(ttn0==1) { |
1470 |
const Vertex& C=__determinateNumber(p0,pointsint); |
const Vertex& C=__determinateNumber(p0,pointsint); |
1471 |
if(ttn1==1) { |
if(ttn1==1) { |
1488 |
ffout(0)<<V2.Vector3()<<"\n"; |
ffout(0)<<V2.Vector3()<<"\n"; |
1489 |
} |
} |
1490 |
} |
} |
1491 |
} else |
break; |
1492 |
if(numberin==1 /*or numberin==2*/) { |
} |
1493 |
std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
case 1: { |
1494 |
const Vertex& E=*((*it).second); |
std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
1495 |
|
const Vertex& E=*((*it).second); |
1496 |
if(ttn0==1) { |
|
1497 |
const Vertex& C=__determinateNumber(p0,pointsint); |
if(ttn0==1) { |
1498 |
if(ttn1==1) { |
const Vertex& C=__determinateNumber(p0,pointsint); |
1499 |
const Vertex& D=__determinateNumber(p1,pointsint); |
if(ttn1==1) { |
1500 |
__addTriangle(A,C,E,cell); |
const Vertex& D=__determinateNumber(p1,pointsint); |
1501 |
__addTriangle(A,E,B,cell); |
__addTriangle(A,C,E,cell); |
1502 |
__addTriangle(B,E,D,cell); |
__addTriangle(A,E,B,cell); |
1503 |
} else { |
__addTriangle(B,E,D,cell); |
|
__addTriangle(A,B,E,cell); |
|
|
__addTriangle(C,E,B,cell); |
|
|
} |
|
1504 |
} else { |
} else { |
1505 |
if(ttn1==1) { |
__addTriangle(A,B,E,cell); |
1506 |
const Vertex& D=__determinateNumber(p1,pointsint); |
__addTriangle(C,E,B,cell); |
|
__addTriangle(D,E,B,cell); |
|
|
__addTriangle(A,B,E,cell); |
|
|
} else { |
|
|
__addTriangle(A,B,E,cell); |
|
|
} |
|
1507 |
} |
} |
1508 |
} else |
} else { |
1509 |
if(numberin>=2) { |
if(ttn1==1) { |
1510 |
//POUR STEPH : peut generer des tr plats |
const Vertex& D=__determinateNumber(p1,pointsint); |
1511 |
ffout(0) << numberin <<"be careful 2\n"<<std::flush; |
__addTriangle(D,E,B,cell); |
1512 |
// ffout(0)<<V0.Vector3()<<"\n"; |
__addTriangle(A,B,E,cell); |
1513 |
// ffout(0)<<V1.Vector3()<<"\n"; |
} else { |
1514 |
// ffout(0)<<V2.Vector3()<<"\n"; |
__addTriangle(A,B,E,cell); |
1515 |
TinyVector<10,const Vertex*> P,Ptemp; |
} |
1516 |
size_t i=0; |
} |
1517 |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
break; |
1518 |
it!=pointsin.end() ; ++it) { |
} |
1519 |
P[i+1]=(*it).second; |
case 2: { |
1520 |
++i; |
//POUR STEPH : peut generer des tr plats |
1521 |
} |
ffout(0) << numberin <<"be careful 2\n"<<std::flush; |
1522 |
|
// ffout(0)<<V0.Vector3()<<"\n"; |
1523 |
// CECILE: les deux 'if' qui suivent en sont-ils vraiment ou |
// ffout(0)<<V1.Vector3()<<"\n"; |
1524 |
// veux-tu vérifier simplement que l'assertion est vérifiée ? |
// ffout(0)<<V2.Vector3()<<"\n"; |
1525 |
// Dans ce cas, il serait bien préférable d'utiliser assert() |
TinyVector<10,const Vertex*> P,Ptemp; |
1526 |
|
size_t i=0; |
1527 |
if(ttn0==1) { |
for(std::map<const Vertex*,const Vertex*>::const_iterator it=pointsin.begin(); |
1528 |
const Vertex& C=__determinateNumber(p0,pointsint); |
it!=pointsin.end() ; ++it) { |
1529 |
__addTriangle(A,B,C,cell); |
P[i+1]=(*it).second; |
1530 |
P[0]=&C; |
++i; |
1531 |
if(ttn1==1) { |
} |
1532 |
const Vertex& D=__determinateNumber(p1,pointsint); |
|
1533 |
size_t size=numberin+1; |
// CECILE: les deux 'if' qui suivent en sont-ils vraiment ou |
1534 |
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
// veux-tu vérifier simplement que l'assertion est vérifiée ? |
1535 |
size_t num=1; |
// Dans ce cas, il serait bien préférable d'utiliser assert() |
1536 |
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
|
1537 |
for(size_t i=2 ; i<size ; ++i) { |
if(ttn0==1) { |
1538 |
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
const Vertex& C=__determinateNumber(p0,pointsint); |
1539 |
if(normtemp<=norm) { |
__addTriangle(A,B,C,cell); |
1540 |
norm=normtemp; |
P[0]=&C; |
1541 |
Ptemp[i-1]=P[num]; |
if(ttn1==1) { |
1542 |
num=i; |
const Vertex& D=__determinateNumber(p1,pointsint); |
1543 |
} else { |
size_t size=numberin+1; |
1544 |
Ptemp[i-1]=P[i]; |
for(size_t boucle=0 ; boucle<numberin-1 ; ++boucle) { |
1545 |
} |
size_t num=1; |
1546 |
} |
real_t norm=Norm((*P[0]).Vector3()-(*P[1]).Vector3()); |
1547 |
__addTriangle(B,*P[0],*P[num],cell); |
for(size_t i=2 ; i<size ; ++i) { |
1548 |
Ptemp[0]=P[num]; |
real_t normtemp=Norm((*P[0]).Vector3()-(*P[i]).Vector3()); |
1549 |
P=Ptemp; |
if(normtemp<=norm) { |
1550 |
--size; |
norm=normtemp; |
1551 |
// ffout(0)<<"size = "<<size<<"\n"; |
Ptemp[i-1]=P[num]; |
1552 |
|
num=i; |
1553 |
|
} else { |
1554 |
|
Ptemp[i-1]=P[i]; |
1555 |
} |
} |
|
__addTriangle(B,*P[0],*P[1],cell); |
|
|
__addTriangle(B,*P[1],D,cell); |
|
|
//__addTriangle(A,B,D,cell); |
|
|
} else { |
|
|
ffout(0)<<"une seule arete cut pbs\n"; |
|
1556 |
} |
} |
1557 |
} else { |
__addTriangle(B,*P[0],*P[num],cell); |
1558 |
ffout(0)<<"une seule arete cut pbs2\n"; |
Ptemp[0]=P[num]; |
1559 |
|
P=Ptemp; |
1560 |
|
--size; |
1561 |
|
// ffout(0)<<"size = "<<size<<"\n"; |
1562 |
} |
} |
1563 |
|
__addTriangle(B,*P[0],*P[1],cell); |
1564 |
|
__addTriangle(B,*P[1],D,cell); |
1565 |
|
//__addTriangle(A,B,D,cell); |
1566 |
|
} else { |
1567 |
|
ffout(0)<<"une seule arete cut pbs\n"; |
1568 |
} |
} |
1569 |
|
} else { |
1570 |
|
ffout(0)<<"une seule arete cut pbs2\n"; |
1571 |
|
} |
1572 |
|
} |
1573 |
|
} |
1574 |
} |
} |
1575 |
|
|
1576 |
void SurfaceMeshGenerator::Internals:: |
void SurfaceMeshGenerator::Internals:: |
1657 |
} |
} |
1658 |
} |
} |
1659 |
} |
} |
1660 |
if(cc[0]!=0) { |
|
1661 |
temp+=1; |
for (size_t n=0; n < cc.size(); ++n) { |
1662 |
if(tt[0][0]==0) { |
if(cc[n]!=0) { |
1663 |
tt[0][0]=1; |
temp+=1; |
1664 |
pointsIntersection[0][0]= |
if(tt[n][0]==0) { |
1665 |
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[0]-1]); |
tt[n][0]=1; |
1666 |
} else { |
pointsIntersection[n][0]= |
1667 |
tt[0][1]=1; |
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[n]-1]); |
1668 |
pointsIntersection[0][1]= |
} else { |
1669 |
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[0]-1]); |
tt[n][1]=1; |
1670 |
} |
pointsIntersection[n][1]= |
1671 |
} |
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[n]-1]); |
1672 |
if(cc[1]!=0) { |
} |
|
temp+=1; |
|
|
if(tt[1][0]==0) { |
|
|
tt[1][0]=1; |
|
|
pointsIntersection[1][0]= |
|
|
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[1]-1]); |
|
|
} else{ |
|
|
tt[1][1]=1; |
|
|
pointsIntersection[1][1]= |
|
|
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[1]-1]); |
|
|
} |
|
|
} |
|
|
if(cc[2]!=0) { |
|
|
temp+=1; |
|
|
if(tt[2][0]==0) { |
|
|
tt[2][0]=1; |
|
|
pointsIntersection[2][0]= |
|
|
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[2]-1]); |
|
|
} else{ |
|
|
tt[2][1]=1; |
|
|
pointsIntersection[2][1]= |
|
|
(pairTriangleToIntersectionPoints[pT].listofPoints[cc[2]-1]); |
|
1673 |
} |
} |
1674 |
} |
} |
1675 |
|
|
1680 |
if(sum>3) { |
if(sum>3) { |
1681 |
ffout(0)<<"sum "<<sum<<"\n"<<std::flush; |
ffout(0)<<"sum "<<sum<<"\n"<<std::flush; |
1682 |
} |
} |
1683 |
if(sum==0) { |
|
1684 |
|
switch (sum) { |
1685 |
|
case 0: { |
1686 |
r=0; |
r=0; |
1687 |
for(size_t i=1 ; i<pairTriangleToIntersectionPoints[pT].size() ;++i) |
for(size_t i=1 ; i<pairTriangleToIntersectionPoints[pT].size() ;++i) |
1688 |
pointsin[(pairTriangleToIntersectionPoints[pT].listofPoints[i])]= |
pointsin[(pairTriangleToIntersectionPoints[pT].listofPoints[i])]= |
1689 |
(pairTriangleToIntersectionPoints[pT].listofPoints[i]); |
(pairTriangleToIntersectionPoints[pT].listofPoints[i]); |
1690 |
} else { |
break; |
1691 |
if(sum==2 or sum==5) { |
} |
1692 |
r=0; |
case 2: |
1693 |
} else { |
case 5: { |
1694 |
if(sum==4 or sum==1) { |
r=0; |
1695 |
r=1; |
break; |
1696 |
} else { |
case 4: |
1697 |
if(sum==3) { |
case 1: |
1698 |
r=2; |
r=1; |
1699 |
} else { |
break; |
1700 |
ffout(0) << "pbs sum = "<<sum<<" size " |
} |
1701 |
<< pairTriangleToIntersectionPoints[pT].size()<<" \n"; |
case 3: { |
1702 |
ffout(0) << K(0) << "\n"; |
r=2; |
1703 |
ffout(0) << K(1) << "\n"; |
break; |
1704 |
ffout(0) << K(2) << "\n"; |
} |
1705 |
ffout(0) << cc[0] << " " << cc[1] << " " << cc[2] << "\n"; |
default: { |
1706 |
} |
ffout(0) << "pbs sum = "<<sum<<" size " |
1707 |
} |
<< pairTriangleToIntersectionPoints[pT].size()<<" \n"; |
1708 |
} |
ffout(0) << K(0) << "\n"; |
1709 |
|
ffout(0) << K(1) << "\n"; |
1710 |
|
ffout(0) << K(2) << "\n"; |
1711 |
|
ffout(0) << cc[0] << " " << cc[1] << " " << cc[2] << "\n"; |
1712 |
|
} |
1713 |
} |
} |
1714 |
if(pointsin.find(pairTriangleToIntersectionPoints[pT].listofPoints[r]) |
if(pointsin.find(pairTriangleToIntersectionPoints[pT].listofPoints[r]) |
1715 |
==pointsin.end()) { |
==pointsin.end()) { |
1761 |
if(pairTriangleToIntersectionPoints.find(pT)!= |
if(pairTriangleToIntersectionPoints.find(pT)!= |
1762 |
pairTriangleToIntersectionPoints.end()) { |
pairTriangleToIntersectionPoints.end()) { |
1763 |
|
|
1764 |
TinyVector<3,size_t >cc; |
TinyVector<3,size_t> cc; |
1765 |
if(numobject<objectNumber) { |
if(numobject<objectNumber) { |
1766 |
cc=(pairTriangleToIntersectionPoints[pT]).cutTriangle1; |
cc=(pairTriangleToIntersectionPoints[pT]).cutTriangle1; |
1767 |
} else { |
} else { |
1768 |
cc=(pairTriangleToIntersectionPoints[pT]).cutTriangle2; |
cc=(pairTriangleToIntersectionPoints[pT]).cutTriangle2; |
1769 |
} |
} |
1770 |
if(cc[0]!=0) { |
|
1771 |
tt[0]=1; |
for (size_t n=0; n<3; ++n) { |
1772 |
} |
if(cc[n]!=0) { |
1773 |
if(cc[1]!=0) { |
tt[n]=1; |
1774 |
tt[1]=1; |
} |
|
} |
|
|
if(cc[2]!=0) { |
|
|
tt[2]=1; |
|
1775 |
} |
} |
1776 |
} |
} |
1777 |
else { |
else { |
1782 |
return tt; |
return tt; |
1783 |
} |
} |
1784 |
|
|
1785 |
TinyVector<3,size_t> SurfaceMeshGenerator::Internals:: |
TinyVector<3,size_t>& SurfaceMeshGenerator::Internals:: |
1786 |
__putEdgeRef(const size_t& ncase, |
__putEdgeRef(const size_t& ncase, |
1787 |
const Triangle& currentTriangle, |
const Triangle& currentTriangle, |
1788 |
TriangleCut& K) |
TriangleCut& K) |
1807 |
__inout(numobject,tt[0][0],V0,V1); |
__inout(numobject,tt[0][0],V0,V1); |
1808 |
__inout(numobject,tt[1][0],V0,V2); |
__inout(numobject,tt[1][0],V0,V2); |
1809 |
__inout(numobject,tt[2][0],V1,V2); |
__inout(numobject,tt[2][0],V1,V2); |
1810 |
|
|
1811 |
if(ncase==0) { |
if(ncase==0) { |
1812 |
if(tt[0][0]+tt[1][0]+tt[2][0]==0 and ((*edgesRefVertex[numobject])[V0]+ |
if(tt[0][0]+tt[1][0]+tt[2][0]==0 and ((*edgesRefVertex[numobject])[V0]+ |
1813 |
(*edgesRefVertex[numobject])[V1]+(*edgesRefVertex[numobject])[V2])>=4) { |
(*edgesRefVertex[numobject])[V1]+(*edgesRefVertex[numobject])[V2])>=4) { |
1816 |
(*edgesRefVertex[numobject])[V2]=2; |
(*edgesRefVertex[numobject])[V2]=2; |
1817 |
} |
} |
1818 |
} else { |
} else { |
1819 |
|
// CECILE: s'agit-il d'un bug ? à quoi sert le deuxième ncase==0 ? |
1820 |
|
// Si on arrive ici, on est sûr qu'il n'est pas vérifié |
1821 |
if(ncase==1 or ncase==0) { |
if(ncase==1 or ncase==0) { |
1822 |
if((*edgesRefVertex[numobject])[V0]==2 ) { |
for (size_t n=0; n<3; ++n) { |
1823 |
ii[0]=1; |
if((*edgesRefVertex[numobject])[&K(n)]==2 ) { |
1824 |
} else { |
ii[n]=1; |
1825 |
ii[0]=0; |
} else { |
1826 |
} |
ii[n]=0; |
1827 |
|
} |
|
if((*edgesRefVertex[numobject])[V1]==2 ) { |
|
|
ii[1]=1; |
|
|
} else { |
|
|
ii[1]=0; |
|
|
} |
|
|
|
|
|
if((*edgesRefVertex[numobject])[V2]==2 ) { |
|
|
ii[2]=1; |
|
|
} else { |
|
|
ii[2]=0; |
|
1828 |
} |
} |
1829 |
} |
} |
1830 |
} |
} |
2220 |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin(); |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin(); |
2221 |
jt0!=listTriangle0.end() ; ++jt0) { |
jt0!=listTriangle0.end() ; ++jt0) { |
2222 |
const Triangle* T=(*jt0); |
const Triangle* T=(*jt0); |
2223 |
const Vertex V0=(*T)(0); |
const Vertex& V0 = (*T)(0); |
2224 |
const Vertex V1=(*T)(1); |
const Vertex& V1 = (*T)(1); |
2225 |
const Vertex V2=(*T)(2); |
const Vertex& V2 = (*T)(2); |
2226 |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
2227 |
|
|
2228 |
K.edgecut =__determinateEdgeCut(numobject,objectNumber,T,*i); |
K.edgecut =__determinateEdgeCut(numobject,objectNumber,T,*i); |
2229 |
K.isInTriangle =__putEdgeRef(0,(*T),K); |
|
2230 |
|
// CECILE: Je commente cette affectation qui ne sert à rien (selon moi) |
2231 |
|
// K.isInTriangle = |
2232 |
|
__putEdgeRef(0,(*T),K); |
2233 |
} |
} |
2234 |
} |
} |
2235 |
} |
} |
2245 |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin() ; |
for(std::list<Triangle*>::iterator jt0=listTriangle0.begin() ; |
2246 |
jt0!=listTriangle0.end() ; ++jt0) { |
jt0!=listTriangle0.end() ; ++jt0) { |
2247 |
const Triangle* T=(*jt0); |
const Triangle* T=(*jt0); |
2248 |
const Vertex& V0=(*T)(0); |
const Vertex& V0 = (*T)(0); |
2249 |
const Vertex& V1=(*T)(1); |
const Vertex& V1 = (*T)(1); |
2250 |
const Vertex& V2=(*T)(2); |
const Vertex& V2 = (*T)(2); |
2251 |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
TriangleCut K(V0,V1,V2,numobject,objectNumber); |
2252 |
triangleWithVertex.clear(); |
triangleWithVertex.clear(); |
2253 |
vertexInTriangles.clear(); |
vertexInTriangles.clear(); |
2254 |
|
|
2255 |
__createLocalListIntersection(objectNumber,T,K,*i); |
__createLocalListIntersection(objectNumber,T,K,*i); |
2256 |
K.isInTriangle =__putEdgeRef(1,*T,K); |
|
2257 |
|
// CECILE: Je commente cette affectation qui ne sert à rien (selon moi) |
2258 |
|
// K.isInTriangle = |
2259 |
|
__putEdgeRef(1,*T,K); |
2260 |
|
|
2261 |
if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 ) { |
if(K.isInTriangle[0]+K.isInTriangle[1]+K.isInTriangle[2]==0 ) { |
2262 |
++err; |
++err; |