1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025656: Specification of semantic of Closed flag of an edge

1. Using of the "Closed" flag was unified:
  a) this flag is applicable for TopoDS_Wire and TopoDS_Shell only, because these entities may hedge an area in 2D space or a volume in 3D space correspondingly;
  b) other types of TopoDS shapes are passing over this flag;
  c) changing of this flag should be controlled by high-level algorithms (not BRep_Builder).
2. Implemented verification of the closedness of edges. An edge is closed if and only if its first and last vertices are the same.
3. Test cases were changed according to new behavior.
This commit is contained in:
azv
2014-12-30 07:37:51 +03:00
committed by bugmaster
parent a195430212
commit da72a17c80
43 changed files with 87 additions and 238 deletions

View File

@@ -179,43 +179,6 @@ static void UpdateEdge (const TopoDS_Edge& E,
B.UpdateEdge(E,NC1,NC2,F,Tol);
}
//=======================================================================
//function : Range3d
//purpose : Set the range only on the 3d curve
// waitint that BRep_Builder does it !!
//=======================================================================
static void Range3d (const TopoDS_Edge& E,
const Standard_Real First,
const Standard_Real Last)
{
// set the range to all the representations
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
BRep_ListOfCurveRepresentation& lcr = TE->ChangeCurves();
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
Handle(BRep_GCurve) GC;
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
if (!GC.IsNull()) {
if (GC->IsCurve3D()) {
GC->SetRange(First,Last);
// Set the closedness flag to the correct value.
Handle(Geom_Curve) C = GC->Curve3D();
if ( !C.IsNull() ) {
Standard_Boolean closed =
C->Value(First).IsEqual(C->Value(Last),BRep_Tool::Tolerance(E));
TE->Closed(closed);
}
}
}
itcr.Next();
}
TE->Modified(Standard_True);
}
//=======================================================================
//function : ComputeCurve3d
@@ -1165,12 +1128,11 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path,
// mise a same range de la nouvelle pcurve.
if ( !C1is3D && !C1Denerated)
myBuilder.SameRange (Edge1,Standard_False);
if ( !C1is3D && !C1Denerated)
Range3d(Edge1,U1,U2);
myBuilder.Range (Edge1,myFace,U1,U2);
Range3d(Edge1,U1,U2);
myBuilder.Range (Edge1,myFace,U1,U2);
{
myBuilder.SameRange (Edge1,Standard_False);
myBuilder.Range(Edge1,U1,U2, Standard_True);
}
myBuilder.Range(Edge1,myFace,U1,U2);
BRepLib::SameRange(Edge1);
// mise a sameparameter pour les KPart
@@ -1206,7 +1168,8 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path,
// mise a same range de la nouvelle pcurve.
myBuilder.SameRange (Edge2,Standard_False);
if ( !C2is3D && !C2Denerated) Range3d(Edge2,U1,U2);
if ( !C2is3D && !C2Denerated)
myBuilder.Range(Edge2, U1, U2, Standard_True);
myBuilder.Range(Edge2,myFace,U1,U2);
BRepLib::SameRange(Edge2);