mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
get rid of recursive loop (HLRBRep_Data::NextEdge())
This commit is contained in:
@@ -899,7 +899,6 @@ void HLRBRep_Data::InitEdge (const Standard_Integer FI,
|
||||
Standard_Boolean HLRBRep_Data::MoreEdge ()
|
||||
{
|
||||
|
||||
|
||||
if (iFaceTest) {
|
||||
if (myFaceItr2.MoreEdge()) { // all edges must be tested if
|
||||
myLE = myFaceItr2.Edge (); // the face is not a simple
|
||||
@@ -927,49 +926,92 @@ Standard_Boolean HLRBRep_Data::MoreEdge ()
|
||||
return myCurSortEd <= myNbrSortEd;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NextEdge
|
||||
//function : GetNextEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void HLRBRep_Data::GetNextEdge()
|
||||
{
|
||||
if (myCurSortEd > myNbrSortEd)
|
||||
return;
|
||||
for (;myCurSortEd <= myNbrSortEd;myCurSortEd++)
|
||||
{
|
||||
myLE = myEdgeIndices(myCurSortEd);
|
||||
if (myEData(myLE).Vertical() || myEData(myLE).Status().AllHidden())
|
||||
continue;
|
||||
myLEData = &myEData(myLE);
|
||||
if (myLEData->HideCount() > myHideCount-2)
|
||||
continue;
|
||||
|
||||
myLEMinMax = &myLEData->MinMax();
|
||||
|
||||
if (((iFaceMinMax->Max[0] - myLEMinMax->Min[0]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[0] - iFaceMinMax->Min[0]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[1] - myLEMinMax->Min[1]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[1] - iFaceMinMax->Min[1]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[2] - myLEMinMax->Min[2]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[2] - iFaceMinMax->Min[2]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[3] - myLEMinMax->Min[3]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[3] - iFaceMinMax->Min[3]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[4] - myLEMinMax->Min[4]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[4] - iFaceMinMax->Min[4]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[5] - myLEMinMax->Min[5]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[5] - iFaceMinMax->Min[5]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[6] - myLEMinMax->Min[6]) & 0x80008000) != 0 ||
|
||||
((myLEMinMax->Max[6] - iFaceMinMax->Min[6]) & 0x80008000) != 0 ||
|
||||
((iFaceMinMax->Max[7] - myLEMinMax->Min[7]) & 0x80008000) != 0)
|
||||
continue;
|
||||
myLEGeom = &myLEData->ChangeGeometry();
|
||||
myLETol = myLEData->Tolerance();
|
||||
if (((HLRBRep_Surface*)iFaceGeom)->IsAbove
|
||||
(iFaceBack,myLEGeom,(Standard_Real)myLETol))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
myLEOutLine = Standard_False;
|
||||
myLEInternal = Standard_False;
|
||||
myLEDouble = Standard_False;
|
||||
myLEIsoLine = Standard_False;
|
||||
myLEType = myLEGeom->GetType();
|
||||
}
|
||||
|
||||
void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
|
||||
{
|
||||
|
||||
if (skip) {
|
||||
if (iFaceTest) myFaceItr2.NextEdge();
|
||||
else myCurSortEd++;
|
||||
if (skip)
|
||||
{
|
||||
if (iFaceTest)
|
||||
myFaceItr2.NextEdge();
|
||||
else
|
||||
myCurSortEd++;
|
||||
}
|
||||
if (!MoreEdge()) return;
|
||||
if (iFaceTest) {
|
||||
myLE = myFaceItr2.Edge ();
|
||||
myLEOutLine = myFaceItr2.OutLine ();
|
||||
myLEInternal = myFaceItr2.Internal();
|
||||
myLEDouble = myFaceItr2.Double ();
|
||||
myLEIsoLine = myFaceItr2.IsoLine ();
|
||||
myLEData = &myEData(myLE);
|
||||
myLEGeom = &myLEData->ChangeGeometry();
|
||||
myLEMinMax = &myLEData->MinMax();
|
||||
myLETol = myLEData->Tolerance();
|
||||
myLEType = myLEGeom->GetType();
|
||||
if (((HLRBRep_EdgeData*)myLEData)->Vertical() ||
|
||||
(myLEDouble &&
|
||||
((HLRBRep_EdgeData*)myLEData)->HideCount() == myHideCount-1))
|
||||
NextEdge();
|
||||
((HLRBRep_EdgeData*)myLEData)->HideCount(myHideCount-1);
|
||||
|
||||
if (iFaceTest && !MoreEdge())
|
||||
return;
|
||||
|
||||
if (!iFaceTest)
|
||||
{
|
||||
GetNextEdge();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
myLE = Edge();
|
||||
myLEOutLine = Standard_False;
|
||||
myLEInternal = Standard_False;
|
||||
myLEDouble = Standard_False;
|
||||
myLEIsoLine = Standard_False;
|
||||
myLEData = &myEData(myLE);
|
||||
myLEGeom = &myLEData->ChangeGeometry();
|
||||
myLEMinMax = &myLEData->MinMax();
|
||||
myLETol = myLEData->Tolerance();
|
||||
myLEType = myLEGeom->GetType();
|
||||
}
|
||||
if (((HLRBRep_EdgeData*)myLEData)->Vertical()) {
|
||||
|
||||
myLE = myFaceItr2.Edge ();
|
||||
myLEOutLine = myFaceItr2.OutLine ();
|
||||
myLEInternal = myFaceItr2.Internal();
|
||||
myLEDouble = myFaceItr2.Double ();
|
||||
myLEIsoLine = myFaceItr2.IsoLine ();
|
||||
myLEData = &myEData(myLE);
|
||||
myLEGeom = &myLEData->ChangeGeometry();
|
||||
myLEMinMax = &myLEData->MinMax();
|
||||
myLETol = myLEData->Tolerance();
|
||||
myLEType = myLEGeom->GetType();
|
||||
if (((HLRBRep_EdgeData*)myLEData)->Vertical() ||
|
||||
(myLEDouble &&
|
||||
((HLRBRep_EdgeData*)myLEData)->HideCount() == myHideCount-1))
|
||||
NextEdge();
|
||||
((HLRBRep_EdgeData*)myLEData)->HideCount(myHideCount-1);
|
||||
return;
|
||||
|
||||
/*if (((HLRBRep_EdgeData*)myLEData)->Vertical()) {
|
||||
NextEdge();
|
||||
return;
|
||||
}
|
||||
@@ -1003,7 +1045,7 @@ void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
|
||||
(iFaceBack,myLEGeom,(Standard_Real)myLETol)) {
|
||||
NextEdge();
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
return; // edge is OK
|
||||
}
|
||||
|
||||
|
@@ -109,6 +109,8 @@ public:
|
||||
Standard_EXPORT Standard_Boolean MoreEdge();
|
||||
|
||||
Standard_EXPORT void NextEdge (const Standard_Boolean skip = Standard_True);
|
||||
|
||||
Standard_EXPORT void GetNextEdge();
|
||||
|
||||
//! Returns the current Edge
|
||||
Standard_EXPORT Standard_Integer Edge() const;
|
||||
@@ -236,7 +238,9 @@ private:
|
||||
Standard_Boolean iFaceBack;
|
||||
Standard_Boolean iFaceSimp;
|
||||
Standard_Boolean iFaceSmpl;
|
||||
public:
|
||||
Standard_Boolean iFaceTest;
|
||||
private:
|
||||
Standard_Integer myHideCount;
|
||||
Standard_Real myDeca[16];
|
||||
Standard_Real mySurD[16];
|
||||
|
Reference in New Issue
Block a user