mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0030346: Modeling Algorithms - BRepPrimAPI_MakeRevol throws "BRepSweep_Translation::MakeEmptyVertex"
Implementation of method "IsDeleted(...)" for MakeRevol and MakePrism algorithms. Problem (exception) occurs during history building and was caused by an attempt to obtain generated shape for subshape, which was really "deleted" by algorithm - this input subshape and its possible generated shape was not used in result.
This commit is contained in:
@@ -114,7 +114,10 @@ TopoDS_Shape BRepPrimAPI_MakePrism::LastShape()
|
||||
const TopTools_ListOfShape& BRepPrimAPI_MakePrism::Generated (const TopoDS_Shape& S)
|
||||
{
|
||||
myGenerated.Clear();
|
||||
myGenerated.Append(myPrism.Shape (S));
|
||||
if (myPrism.IsUsed(S) && myPrism.GenIsUsed(S))
|
||||
{
|
||||
myGenerated.Append(myPrism.Shape(S));
|
||||
}
|
||||
return myGenerated;
|
||||
|
||||
}
|
||||
@@ -146,3 +149,13 @@ TopoDS_Shape BRepPrimAPI_MakePrism::LastShape(const TopoDS_Shape &theShape)
|
||||
}
|
||||
|
||||
// Modified by skv - Fri Mar 4 15:50:09 2005 End
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDeleted
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepPrimAPI_MakePrism::IsDeleted(const TopoDS_Shape& S)
|
||||
{
|
||||
return !myPrism.IsUsed(S);
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,10 @@ public:
|
||||
|
||||
//! Returns ListOfShape from TopTools.
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Returns true if the shape S has been deleted.
|
||||
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
|
||||
//! Returns the TopoDS Shape of the bottom of the prism.
|
||||
//! generated with theShape (subShape of the generating shape).
|
||||
Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
|
||||
@@ -96,9 +99,6 @@ public:
|
||||
//! generated with theShape (subShape of the generating shape).
|
||||
Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
@@ -240,16 +240,49 @@ TopoDS_Shape BRepPrimAPI_MakeRevol::LastShape()
|
||||
const TopTools_ListOfShape& BRepPrimAPI_MakeRevol::Generated (const TopoDS_Shape& S)
|
||||
{
|
||||
myGenerated.Clear();
|
||||
|
||||
if (!myRevol.IsUsed(S))
|
||||
{
|
||||
return myGenerated;
|
||||
}
|
||||
|
||||
TopoDS_Shape aGS = myRevol.Shape(S);
|
||||
if (!aGS.IsNull())
|
||||
{
|
||||
if (BRepTools_History::IsSupportedType(aGS))
|
||||
{
|
||||
if (aGS.ShapeType() == TopAbs_EDGE)
|
||||
{
|
||||
Standard_Boolean isDeg = BRep_Tool::Degenerated(TopoDS::Edge(aGS));
|
||||
if (isDeg)
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape anIt(myDegenerated);
|
||||
for (; anIt.More(); anIt.Next())
|
||||
{
|
||||
if (aGS.IsSame(anIt.Value()))
|
||||
{
|
||||
myGenerated.Append(aGS);
|
||||
if (!myHist.IsNull())
|
||||
{
|
||||
TopTools_ListIteratorOfListOfShape anIt1(myHist->Modified(aGS));
|
||||
for (; anIt1.More(); anIt1.Next())
|
||||
{
|
||||
myGenerated.Append(anIt1.Value());
|
||||
}
|
||||
return myGenerated;
|
||||
}
|
||||
}
|
||||
}
|
||||
return myGenerated;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (myHist.IsNull())
|
||||
{
|
||||
myGenerated.Append(aGS);
|
||||
return myGenerated;
|
||||
}
|
||||
//
|
||||
if (myHist->Modified(aGS).IsEmpty())
|
||||
{
|
||||
myGenerated.Append(aGS);
|
||||
@@ -261,18 +294,19 @@ const TopTools_ListOfShape& BRepPrimAPI_MakeRevol::Generated (const TopoDS_Shape
|
||||
{
|
||||
myGenerated.Append(anIt.Value());
|
||||
}
|
||||
if (aGS.ShapeType() == TopAbs_EDGE)
|
||||
{
|
||||
if (BRep_Tool::Degenerated(TopoDS::Edge(aGS)))
|
||||
{
|
||||
//Append initial common deg. edge
|
||||
myGenerated.Append(aGS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return myGenerated;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsDeleted
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepPrimAPI_MakeRevol::IsDeleted(const TopoDS_Shape& S)
|
||||
{
|
||||
return !myRevol.IsUsed(S);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstShape
|
||||
|
@@ -95,6 +95,10 @@ public:
|
||||
//! Warning: shape S must be shape of type VERTEX, EDGE, FACE, SOLID.
|
||||
//! For shapes of other types method always returns empty list
|
||||
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
|
||||
//! Returns true if the shape S has been deleted.
|
||||
Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Returns the TopoDS Shape of the beginning of the revolution,
|
||||
//! generated with theShape (subShape of the generating shape).
|
||||
|
Reference in New Issue
Block a user