mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0032601: Foundation Classes - Poly_Connect hangs on the given incorrect triangulation
This commit is contained in:
@@ -223,6 +223,8 @@ void Poly_Connect::Initialize(const Standard_Integer N)
|
||||
mytr = myfirst;
|
||||
mysense = Standard_True;
|
||||
mymore = (myfirst != 0);
|
||||
myPassedTr.Clear();
|
||||
myPassedTr.Add (mytr);
|
||||
if (mymore)
|
||||
{
|
||||
Standard_Integer i, no[3];
|
||||
@@ -247,15 +249,16 @@ void Poly_Connect::Next()
|
||||
if (mysense) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (t[i] != 0) {
|
||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||
for (j = 0; j < 3; j++) {
|
||||
if ((n[j] == mynode) && (n[(j+1)%3] == myothernode)) {
|
||||
mytr = t[i];
|
||||
myothernode = n[(j+2)%3];
|
||||
mymore = (mytr != myfirst);
|
||||
return;
|
||||
}
|
||||
}
|
||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||
for (j = 0; j < 3; j++) {
|
||||
if ((n[j] == mynode) && (n[(j+1)%3] == myothernode)) {
|
||||
mytr = t[i];
|
||||
myothernode = n[(j+2)%3];
|
||||
mymore = !myPassedTr.Contains (mytr);
|
||||
myPassedTr.Add (mytr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// sinon, depart vers la gauche.
|
||||
@@ -270,15 +273,16 @@ void Poly_Connect::Next()
|
||||
if (!mysense) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (t[i] != 0) {
|
||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||
for (j = 0; j < 3; j++) {
|
||||
if ((n[j] == mynode) && (n[(j+2)%3] == myothernode)) {
|
||||
mytr = t[i];
|
||||
myothernode = n[(j+1)%3];
|
||||
mymore = Standard_True;
|
||||
return;
|
||||
}
|
||||
}
|
||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||
for (j = 0; j < 3; j++) {
|
||||
if ((n[j] == mynode) && (n[(j+2)%3] == myothernode)) {
|
||||
mytr = t[i];
|
||||
myothernode = n[(j+1)%3];
|
||||
mymore = !myPassedTr.Contains (mytr);
|
||||
myPassedTr.Add (mytr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_PackedMapOfInteger.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Poly_Triangulation;
|
||||
@@ -159,6 +160,7 @@ private:
|
||||
Standard_Integer myothernode;
|
||||
Standard_Boolean mysense;
|
||||
Standard_Boolean mymore;
|
||||
TColStd_PackedMapOfInteger myPassedTr;
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user