mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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 ()
|
Standard_Boolean HLRBRep_Data::MoreEdge ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (iFaceTest) {
|
if (iFaceTest) {
|
||||||
if (myFaceItr2.MoreEdge()) { // all edges must be tested if
|
if (myFaceItr2.MoreEdge()) { // all edges must be tested if
|
||||||
myLE = myFaceItr2.Edge (); // the face is not a simple
|
myLE = myFaceItr2.Edge (); // the face is not a simple
|
||||||
@@ -927,49 +926,92 @@ Standard_Boolean HLRBRep_Data::MoreEdge ()
|
|||||||
return myCurSortEd <= myNbrSortEd;
|
return myCurSortEd <= myNbrSortEd;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : NextEdge
|
//function : GetNextEdge
|
||||||
//purpose :
|
//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)
|
void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
|
||||||
{
|
{
|
||||||
|
if (skip)
|
||||||
if (skip) {
|
{
|
||||||
if (iFaceTest) myFaceItr2.NextEdge();
|
if (iFaceTest)
|
||||||
else myCurSortEd++;
|
myFaceItr2.NextEdge();
|
||||||
|
else
|
||||||
|
myCurSortEd++;
|
||||||
}
|
}
|
||||||
if (!MoreEdge()) return;
|
|
||||||
if (iFaceTest) {
|
if (iFaceTest && !MoreEdge())
|
||||||
myLE = myFaceItr2.Edge ();
|
return;
|
||||||
myLEOutLine = myFaceItr2.OutLine ();
|
|
||||||
myLEInternal = myFaceItr2.Internal();
|
if (!iFaceTest)
|
||||||
myLEDouble = myFaceItr2.Double ();
|
{
|
||||||
myLEIsoLine = myFaceItr2.IsoLine ();
|
GetNextEdge();
|
||||||
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;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
myLE = Edge();
|
myLE = myFaceItr2.Edge ();
|
||||||
myLEOutLine = Standard_False;
|
myLEOutLine = myFaceItr2.OutLine ();
|
||||||
myLEInternal = Standard_False;
|
myLEInternal = myFaceItr2.Internal();
|
||||||
myLEDouble = Standard_False;
|
myLEDouble = myFaceItr2.Double ();
|
||||||
myLEIsoLine = Standard_False;
|
myLEIsoLine = myFaceItr2.IsoLine ();
|
||||||
myLEData = &myEData(myLE);
|
myLEData = &myEData(myLE);
|
||||||
myLEGeom = &myLEData->ChangeGeometry();
|
myLEGeom = &myLEData->ChangeGeometry();
|
||||||
myLEMinMax = &myLEData->MinMax();
|
myLEMinMax = &myLEData->MinMax();
|
||||||
myLETol = myLEData->Tolerance();
|
myLETol = myLEData->Tolerance();
|
||||||
myLEType = myLEGeom->GetType();
|
myLEType = myLEGeom->GetType();
|
||||||
}
|
if (((HLRBRep_EdgeData*)myLEData)->Vertical() ||
|
||||||
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();
|
NextEdge();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1003,7 +1045,7 @@ void HLRBRep_Data::NextEdge (const Standard_Boolean skip)
|
|||||||
(iFaceBack,myLEGeom,(Standard_Real)myLETol)) {
|
(iFaceBack,myLEGeom,(Standard_Real)myLETol)) {
|
||||||
NextEdge();
|
NextEdge();
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
return; // edge is OK
|
return; // edge is OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,6 +109,8 @@ public:
|
|||||||
Standard_EXPORT Standard_Boolean MoreEdge();
|
Standard_EXPORT Standard_Boolean MoreEdge();
|
||||||
|
|
||||||
Standard_EXPORT void NextEdge (const Standard_Boolean skip = Standard_True);
|
Standard_EXPORT void NextEdge (const Standard_Boolean skip = Standard_True);
|
||||||
|
|
||||||
|
Standard_EXPORT void GetNextEdge();
|
||||||
|
|
||||||
//! Returns the current Edge
|
//! Returns the current Edge
|
||||||
Standard_EXPORT Standard_Integer Edge() const;
|
Standard_EXPORT Standard_Integer Edge() const;
|
||||||
@@ -236,7 +238,9 @@ private:
|
|||||||
Standard_Boolean iFaceBack;
|
Standard_Boolean iFaceBack;
|
||||||
Standard_Boolean iFaceSimp;
|
Standard_Boolean iFaceSimp;
|
||||||
Standard_Boolean iFaceSmpl;
|
Standard_Boolean iFaceSmpl;
|
||||||
|
public:
|
||||||
Standard_Boolean iFaceTest;
|
Standard_Boolean iFaceTest;
|
||||||
|
private:
|
||||||
Standard_Integer myHideCount;
|
Standard_Integer myHideCount;
|
||||||
Standard_Real myDeca[16];
|
Standard_Real myDeca[16];
|
||||||
Standard_Real mySurD[16];
|
Standard_Real mySurD[16];
|
||||||
|
Reference in New Issue
Block a user