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:
@@ -314,41 +314,6 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
|
||||
return aC2d;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//static : Range3d
|
||||
//purpose : contournement du Range de BRep_Builder pour ne pas affecter
|
||||
// les ranges des pcurves.
|
||||
//=======================================================================
|
||||
|
||||
static void Range3d (const TopoDS_Edge& E,
|
||||
const Standard_Real First, const Standard_Real Last,
|
||||
const Standard_Real myPrecision)
|
||||
{
|
||||
// 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),myPrecision);
|
||||
TE->Closed(closed);
|
||||
}
|
||||
}
|
||||
}
|
||||
itcr.Next();
|
||||
}
|
||||
|
||||
TE->Modified(Standard_True);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SameRange (Temp)
|
||||
//purpose :
|
||||
@@ -585,7 +550,7 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve (const TopoDS_Edge& edge,
|
||||
Standard_Real G3dCFirst = c3d->FirstParameter();
|
||||
Standard_Real G3dCLast = c3d->LastParameter();
|
||||
B.UpdateEdge(edge, c3d, 0.);
|
||||
Range3d(edge, G3dCFirst, G3dCLast, 0.);
|
||||
B.Range(edge, G3dCFirst, G3dCLast, Standard_True);
|
||||
}
|
||||
} // end try
|
||||
catch(Standard_Failure) {
|
||||
|
@@ -432,18 +432,16 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
|
||||
}
|
||||
|
||||
if(isClosed || myCreateOpenSolidMode) {
|
||||
if(BRep_Tool::IsClosed(tmpShape)) {
|
||||
TopoDS_Iterator itersh(tmpShape);
|
||||
TopoDS_Shell aShell;
|
||||
if(itersh.More() && itersh.Value().ShapeType() == TopAbs_SHELL)
|
||||
aShell = TopoDS::Shell(itersh.Value());
|
||||
if(!aShell.IsNull()) {
|
||||
TopoDS_Solid aSol = SolidFromShell(aShell);
|
||||
if(ShapeExtend::DecodeStatus(myStatus,ShapeExtend_DONE2)) {
|
||||
SendWarning (Message_Msg ("FixAdvSolid.FixOrientation.MSG20"));// Orientaion of shell was corrected.
|
||||
Context()->Replace(tmpShape,aSol);
|
||||
tmpShape = aSol;
|
||||
}
|
||||
TopoDS_Iterator itersh(tmpShape);
|
||||
TopoDS_Shell aShell;
|
||||
if(itersh.More() && itersh.Value().ShapeType() == TopAbs_SHELL)
|
||||
aShell = TopoDS::Shell(itersh.Value());
|
||||
if(!aShell.IsNull()) {
|
||||
TopoDS_Solid aSol = SolidFromShell(aShell);
|
||||
if(ShapeExtend::DecodeStatus(myStatus,ShapeExtend_DONE2)) {
|
||||
SendWarning (Message_Msg ("FixAdvSolid.FixOrientation.MSG20"));// Orientaion of shell was corrected.
|
||||
Context()->Replace(tmpShape,aSol);
|
||||
tmpShape = aSol;
|
||||
}
|
||||
}
|
||||
mySolid = TopoDS::Solid(tmpShape);
|
||||
|
Reference in New Issue
Block a user