{
TopoDS_LockedShape::Raise("BRep_Builder::MakeEdge");
}
- TE->Closed(Standard_False);
MakeShape(E,TE);
}
const TopLoc_Location l = L.Predivided(E.Location());
UpdateCurves(TE->ChangeCurves(),C,l);
- if (!C.IsNull()) TE->Closed(C->IsClosed());
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
const TopLoc_Location l = L.Predivided(E.Location());
UpdateCurves(TE->ChangeCurves(),C1,C2,S,l);
- if (!C1.IsNull() && !C2.IsNull())
- TE->Closed(C1->IsClosed() && C2->IsClosed());
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
const TopLoc_Location l = L.Predivided(E.Location());
UpdateCurves(TE->ChangeCurves(),C1,C2,S,l,Pf,Pl);
- if (!C1.IsNull() && !C2.IsNull())
- TE->Closed(C1->IsClosed() && C2->IsClosed());
-
+
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
}
while (itcr.More())
{
if (itcr.Value()->IsPolygonOnTriangulation(T,l))
- {
+ {
// cr is used to keep a reference on the curve representation
// this avoid deleting it as its content may be referenced by T
cr = itcr.Value();
lcr.Remove(itcr);
isModified = Standard_True;
break;
- }
+ }
itcr.Next();
}
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
- if (!GC.IsNull()) {
- if (!Only3d || GC->IsCurve3D())
- GC->SetRange(First,Last);
- if (GC->IsCurve3D()) {
- // Set the closedness flag to the correct value.
- Handle(Geom_Curve) C = GC->Curve3D();
-
- //fixing a bug PRO18577 to avoid infinite values of First and Last
- if ( !C.IsNull() &&
- !Precision::IsNegativeInfinite(First) &&
- !Precision::IsPositiveInfinite(Last) ) {
- Standard_Boolean closed =
- C->Value(First).IsEqual(C->Value(Last),BRep_Tool::Tolerance(E));
- TE->Closed(closed);
- }
- }
- }
+ if (!GC.IsNull() && (!Only3d || GC->IsCurve3D()))
+ GC->SetRange(First,Last);
itcr.Next();
}
while (itcr.More()) {
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
- if (!GC.IsNull()) {
- if (GC->IsCurveOnSurface(S,l)) {
- GC->SetRange(First,Last);
-
- // Set the closedness flag to the correct value.
- Handle(Geom2d_Curve) PC = GC->PCurve();
- gp_Pnt2d P1 = PC->Value(First);
- gp_Pnt2d P2 = PC->Value(Last);
- gp_Pnt PP1 = S->Value(P1.X(),P1.Y());
- gp_Pnt PP2 = S->Value(P2.X(),P2.Y());
- Standard_Boolean closed = PP1.IsEqual(PP2,BRep_Tool::Tolerance(E));
- TE->Closed(closed);
- break;
- }
+ if (!GC.IsNull() && GC->IsCurveOnSurface(S,l))
+ {
+ GC->SetRange(First,Last);
+ break;
}
itcr.Next();
}
-----------------------------------------------------------
-----------------------------------------------------------
- -- Solid --
+ -- Shape --
-----------------------------------------------------------
-----------------------------------------------------------
IsClosed (myclass; S : Shape from TopoDS) returns Boolean from Standard;
- ---Purpose: If S is Solid or Shell, returns True if it has no free boundaries (edges).
- -- If S is Wire, returns True if it has no free ends (vertices).
- -- (Internal and External sub-shepes are ignored in this check.)
- -- For other shape types returns S.Closed().
+ ---Purpose: If S is Shell, returns True if it has no free boundaries (edges).
+ -- If S is Wire, returns True if it has no free ends (vertices).
+ -- (Internal and External sub-shepes are ignored in these checks)
+ -- If S is Edge, returns True if its vertices are the same.
+ -- For other shape types returns S.Closed().
-----------------------------------------------------------
-----------------------------------------------------------
//=======================================================================
Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
{
- if (theShape.ShapeType() == TopAbs_SHELL || theShape.ShapeType() == TopAbs_SOLID)
+ if (theShape.ShapeType() == TopAbs_SHELL)
{
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
TopExp_Explorer exp (theShape.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
}
return hasBound && aMap.IsEmpty();
}
+ else if (theShape.ShapeType() == TopAbs_EDGE)
+ {
+ TopoDS_Vertex aVFirst, aVLast;
+ TopExp::Vertices(TopoDS::Edge(theShape), aVFirst, aVLast);
+ return !aVFirst.IsNull() && aVFirst.IsSame(aVLast);
+ }
return theShape.Closed();
}
{
gp_Pnt2d pf, pl;
BRep_Tool::UVPoints( EE, myFace, pf, pl );
- if (pf.Distance(pl) <= Tol && !EE.Closed())
+ if (pf.Distance(pl) <= Tol && !BRep_Tool::IsClosed(EE))
NE.Remove(it);
else
it.Next();
TopoDS_Solid theTool;
B.MakeSolid(theTool);
B.Add(theTool,theCylinder.Shell());
- theTool.Closed(Standard_True);
myTopFace = theCylinder.TopFace();
myBotFace = theCylinder.BottomFace();
TopoDS_Solid theTool;
B.MakeSolid(theTool);
B.Add(theTool,theCylinder.Shell());
- theTool.Closed(Standard_True);
myTopFace = theCylinder.TopFace();
myBotFace = theCylinder.BottomFace();
TopoDS_Solid theTool;
B.MakeSolid(theTool);
B.Add(theTool,theCylinder.Shell());
- theTool.Closed(Standard_True);
myTopFace = theCylinder.TopFace();
myBotFace = theCylinder.BottomFace();
TopoDS_Solid theTool;
B.MakeSolid(theTool);
B.Add(theTool,theCylinder.Shell());
- theTool.Closed(Standard_True);
myTopFace = theCylinder.TopFace();
myBotFace = theCylinder.BottomFace();
TopoDS_Solid theTool;
B.MakeSolid(theTool);
B.Add(theTool,theCylinder.Shell());
- theTool.Closed(Standard_True);
myTopFace = theCylinder.TopFace();
myBotFace.Nullify();
TopoDS_Edge Edge3, Edge4;
Iso = Surf->UIso(f1);
-// Tol = Max(BT.Tolerance(V1f), BT.Tolerance(V2f));
Tol = Max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f));
if (Iso->Value(f2).Distance(Iso->Value(l2)) > Tol) {
B.MakeEdge(Edge3,Iso,Precision::Confusion());
}
else {
Iso = Surf->UIso(l1);
-// Tol = Max(BT.Tolerance(V1l), BT.Tolerance(V2l));
Tol = Max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l));
if (Iso->Value(l2).Distance(Iso->Value(f2)) > Tol) {
B.MakeEdge(Edge4,Iso,Precision::Confusion());
Edge1 = TopoDS::Edge(ex1.Current());
Edge2 = TopoDS::Edge(ex2.Current());
- Standard_Boolean Periodic = Edge1.Closed() && Edge2.Closed();
+ Standard_Boolean Periodic =
+ BRep_Tool::IsClosed(Edge1) && BRep_Tool::IsClosed(Edge2);
ex1.Next();
ex2.Next();
CT2d = new Geom2d_TrimmedCurve(C2d,f,l);
if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
- E.Closed()) {
+ BRep_Tool::IsClosed(E)) {
//---------------------------
// Cut closed circle.
//---------------------------
Handle(Geom2d_Curve) aCurveOnPlate = CurvesOnPlate->Value(i);
TopoDS_Edge NewEdge = TopoDS::Edge(anEdge.EmptyCopied());
- NewEdge.Closed(anEdge.Closed());
+
TopoDS_Vertex V1, V2;
TopExp::Vertices(anEdge, V1, V2, Standard_True); //with orientation
BB.UpdateVertex(V1, dmax);
Edge2 = TopoDS::Edge(ex2.Current());
}
- Standard_Boolean Periodic
- = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
+ Standard_Boolean Periodic = (BRep_Tool::IsClosed(Edge1) || degen1) &&
+ (BRep_Tool::IsClosed(Edge2) || degen2);
// ATTENTION : a non-punctual wire should not
// contain a punctual edge
if (!wPoint1) ex1.Next();
Vf_toMap = V1f;
Vl_toMap = V1l;
}
-
- if(Periodic) {
- Standard_Boolean E1IsReallyClosed = BRepTools::Compare(V1f,V1l);
- Standard_Boolean E2IsReallyClosed = BRepTools::Compare(V2f,V2l);
- Periodic
- = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
- }
+
// processing of KPart
Standard_Integer IType = DetectKPart(Edge1,Edge2);
if (IType==0) {
Last = aux;
C = CBis;
}
- if ((ii>1) || (!E.Closed()) ) { // Cut C
+ if ((ii>1) || (!BRep_Tool::IsClosed(E)) ) { // Cut C
Handle(Geom_TrimmedCurve) TC =
new (Geom_TrimmedCurve) (C,First, Last);
C = TC;
C = Ct->BasisCurve();
}
- TopoDS_Vertex V1,V2;
- TopExp::Vertices(E,V1,V2);
- if ((C->IsKind(STANDARD_TYPE(Geom_Circle)) && V1.IsSame(V2)) || //closed circle
+ if ((C->IsKind(STANDARD_TYPE(Geom_Circle)) && BRep_Tool::IsClosed(E)) || //closed circle
IsOpenResult)
{
Standard_Real anOffset = myOffset;
B.MakeShell(TopoDS::Shell(result));
B.MakeWire(W);
B.Add(W, S);
- W.Closed(S.Closed());
+ W.Closed(BRep_Tool::IsClosed(S));
TheS = W;
if (!FirstShape.IsNull()) {
B.MakeWire(W);
B.Add(W, FirstShape);
- W.Closed(FirstShape.Closed());
+ W.Closed(BRep_Tool::IsClosed(FirstShape));
TheFirst = W;
}
if (!LastShape.IsNull()) {
B.MakeWire(W);
B.Add(W, LastShape);
- W.Closed(LastShape.Closed());
+ W.Closed(BRep_Tool::IsClosed(LastShape));
TheLast = W;
}
result.Closed (BRep_Tool::IsClosed (result));
BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
BB.Degenerated( DegEdge, Standard_True );
- DegEdge.Closed( Standard_True );
BB.MakeWire( wire );
BB.Add( wire, DegEdge );
C = CBis;
}
- Standard_Boolean IsReallyClosed = E.Closed();
- //IFV - some checking when closed flag is wrong
- if(IsReallyClosed) {
- TopoDS_Vertex V1, V2;
- TopExp::Vertices(E, V1, V2);
- if(V1.IsNull() || V2.IsNull()) {
- IsReallyClosed = Standard_False;
- }
- else {
- IsReallyClosed = V1.IsSame(V2);
- }
- }
- if (IsReallyClosed &&
+ Standard_Boolean IsClosed = BRep_Tool::IsClosed(E);
+ if (IsClosed &&
Abs(C->FirstParameter() - First) > Precision::PConfusion())
- IsReallyClosed = Standard_False; //trimmed curve differs
+ IsClosed = Standard_False; //trimmed curve differs
- if ((ii>1) || !IsReallyClosed ) { // Trim C
+ if ((ii>1) || !IsClosed ) { // Trim C
Handle(Geom_TrimmedCurve) TC = new Geom_TrimmedCurve(C,First, Last);
C = TC;
}
Standard_Real First, Last;
BRep_Builder B;
- Standard_Boolean is_closed ;
- is_closed = AnEdge.Closed() ;
-
B.UpdateEdge(AnEdge,C3d,LocalLoc,0.0e0);
BRep_Tool::Range(AnEdge, S, LC, First, Last);
B.Range(AnEdge, First, Last); //Do not forget 3D range.(PRO6412)
- TopoDS_Edge E = AnEdge ;
- E.Closed(is_closed) ;
-
}
else {
//
max_deviation = Max( tolerance, Tolerance );
if (NewCurvePtr.IsNull())
return Standard_False;
- Standard_Boolean is_closed ;
- is_closed = AnEdge.Closed() ;
B.UpdateEdge(TopoDS::Edge(AnEdge),
NewCurvePtr,
L[0],
max_deviation) ;
- TopoDS_Edge E = AnEdge ;
- E.Closed(is_closed) ;
if (jj == 1 ) {
//
// if there is only one curve on surface attached to the edge
// copy the edge
TopoDS_Shape Dummy = EE.EmptyCopied();
myEdge = TopoDS::Edge(Dummy);
- myEdge.Closed(EE.Closed());
for (it.Initialize(EE); it.More(); it.Next()) {
TopoDS_Edge newEd=TopoDS::Edge(aLocalShape);
// TopoDS_Edge newEd=TopoDS::Edge(curEd.EmptyCopied());
BB.Transfert(curEd, newEd);
- newEd.Closed(curEd.Closed());
TopTools_ListIteratorOfListOfShape itV(nlist);
for (; itV.More(); itV.Next()) {
BB.Add(newEd, itV.Value());
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
// 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
// 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);
BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
BB.Degenerated( DegEdge, Standard_True );
- DegEdge.Closed( Standard_True );
TopoDS_Wire DegWire;
BB.MakeWire( DegWire );
VV.Orientation(TopAbs_REVERSED);
myBuilder.Add(E,VV);
myBuilder.Range(E,P1,P2);
- E.Closed(Standard_True);
}
//=======================================================================
void BRepPrim_Builder::CompleteWire(TopoDS_Wire& W)const
{
+ W.Closed(BRep_Tool::IsClosed(W));
BRepTools::Update(W);
}
void BRepPrim_Builder::CompleteShell(TopoDS_Shell& S)const
{
+ S.Closed(BRep_Tool::IsClosed(S));
BRepTools::Update(S);
}
BRep_Builder B;
B.MakeSolid(TopoDS::Solid(myShape));
B.Add(myShape,((BRepPrim_OneAxis*) OneAxis())->Shell());
- myShape.Closed(Standard_True);
Done();
}
BRep_Builder B;
B.MakeSolid(TopoDS::Solid(myShape));
B.Add(myShape,myWedge.Shell());
- myShape.Closed(Standard_True);
Done();
}
BB.Add( DegEdge, aVertex.Oriented(TopAbs_FORWARD) );
BB.Add( DegEdge, aVertex.Oriented(TopAbs_REVERSED) );
BB.Degenerated( DegEdge, Standard_True );
- DegEdge.Closed( Standard_True );
+
TopoDS_Wire DegWire;
BB.MakeWire( DegWire );
BB.Add( DegWire, DegEdge );
TopoDS_Shape wi;
myBuilder.MakeWire(wi);
myBuilder.Add(wi,newShape,Or);
+ wi.Closed(BRep_Tool::IsClosed(wi));
WireSeq.Append(wi);
}
else{
}
}
else{
+ newWire.Closed(BRep_Tool::IsClosed(newWire));
myBuilder.Add(myShapes(iGenS,iDirS),newWire);
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
}
myBuiltShapes(iGenS,iDirS) = Standard_True;
}
- myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
+ // Change the "Closed" flag only for Wires and Shells
+ if (myShapes(iGenS, iDirS).ShapeType() == TopAbs_WIRE ||
+ myShapes(iGenS, iDirS).ShapeType() == TopAbs_SHELL)
+ myShapes(iGenS,iDirS).Closed (BRep_Tool::IsClosed (myShapes(iGenS,iDirS)));
return myShapes(iGenS,iDirS);
}
Handle(Geom_Circle) GC = new Geom_Circle(Axis,O.Distance(P));
Standard_Real tol = BRep_Tool::Tolerance(TopoDS::Vertex(aGenV));
myBuilder.Builder().MakeEdge(E, GC, tol);
-
- gp_Pnt PLast = GC->Value(myAng);
- if(PLast.SquareDistance(P) > tol*tol) E.Closed(Standard_False);
-
}
-
-
-
return E;
}
if ( (modif < 0 && buildmode < 2) || (modif == 0 && buildmode < 1) )
return C;
else
- {
- S.Closed (BRep_Tool::IsClosed (S));
return S;
- }
}
if (st == TopAbs_SHELL) {
//BRepTools_Edge sbe;
CopyRanges ( TopoDS::Edge ( result ), TopoDS::Edge ( shape ),0,1 );
}
-
- if (st == TopAbs_FACE) {
+ else if (st == TopAbs_FACE) {
TopoDS_Face face = TopoDS::Face ( shape );
if( BRep_Tool::NaturalRestriction( face ) ) {
BRep_Builder aB;
aB.NaturalRestriction( TopoDS::Face ( result ), Standard_True );
}
}
+ else if (st == TopAbs_WIRE || st == TopAbs_SHELL)
+ result.Closed (BRep_Tool::IsClosed (result));
result.Orientation(orien);
- result.Closed (BRep_Tool::IsClosed (result));
myStatus = locStatus;
Replace ( shape, result );
Ec = TopoDS::Edge(It.Value());
Standard_Boolean bonedge = !BRep_Tool::Degenerated(Ec);
if(bonedge){
- TopoDS_Vertex v1,v2;
- TopExp::Vertices(Ec,v1,v2);
- Standard_Boolean eclosed = v1.IsSame(v2);
+ Standard_Boolean eclosed = BRep_Tool::IsClosed(Ec);
Standard_Integer nboc = 0;
for(j = 0; j <= i && bonedge; j++){
if(!eclosed) bonedge = !Ec.IsSame(E[j]);
Standard_Real dist2f = p2.Distance ( pf );
Standard_Real dist1l = p1.Distance ( pl );
Standard_Real dist2l = p2.Distance ( pl );
- if ( E.Closed() || dist1f + dist2l <= dist1l + dist2f ) {
+ if ( V1.IsSame(V2) || dist1f + dist2l <= dist1l + dist2f + Precision::Confusion() ) {
//:77 if (BRepTools::Compare(V1, Vf)) //the part 'else' only if, in fact, edge should be reversed
V1.Orientation(TopAbs_FORWARD);
B.Add(E,V1);
B.Add(result,itr.Value().Oriented(orient));
}
}
- result.Closed (BRep_Tool::IsClosed(result));
+ // Assign "Closed" flag for Wires and Shells only
+ if (result.ShapeType() == TopAbs_WIRE || result.ShapeType() == TopAbs_SHELL)
+ result.Closed (BRep_Tool::IsClosed(result));
myMap(S).Append(result);
}
else {
ShapeBuild_Edge sbe;
sbe.CopyRanges ( TopoDS::Edge ( result ), TopoDS::Edge ( shape ));
}
+ else if (st == TopAbs_WIRE || st == TopAbs_SHELL)
+ result.Closed (BRep_Tool::IsClosed (result));
result.Orientation(orient);
- result.Closed (BRep_Tool::IsClosed (result));
myStatus = locStatus;
Replace ( shape, result );
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 :
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) {
}
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);
}
if ( modif )
{
- result.Closed (BRep_Tool::IsClosed (result));
+ if (result.ShapeType() == TopAbs_WIRE || result.ShapeType() == TopAbs_SHELL)
+ result.Closed (BRep_Tool::IsClosed (result));
res = result;
}
}
}
if(isModified)
{
- aCopyRes.Closed (BRep_Tool::IsClosed (aCopyRes));
+ if (aCopyRes.ShapeType() == TopAbs_WIRE || aCopyRes.ShapeType() == TopAbs_SHELL)
+ aCopyRes.Closed (BRep_Tool::IsClosed (aCopyRes));
Context()->Replace(aResult,aCopyRes);
}
myStatus |= aStatus;
if (!(aBAS.IsUPeriodic() || aBAS.IsVPeriodic())) return 1;
//we process here only fully closed edges (Vf == Vl)
- if(!anEdgeObj.Closed() || !anEdgeTool.Closed())
+ if(!BRep_Tool::IsClosed(anEdgeObj) || !BRep_Tool::IsClosed(anEdgeTool))
return 1;
Standard_Real f = 0., l = 0., tolpc = 0. ,
Vl = TopoDS::Vertex(myDataStructure->Shape(iref));
Vl.Orientation(TopAbs_REVERSED);
}
- Standard_Boolean bitclosed = Vf.IsSame(Vl);
- aNewEdge.Closed(bitclosed);
myBuildTool.AddEdgeVertex (aNewEdge, Vf);
myBuildTool.Parameter (aNewEdge, Vf, ParF);
// Make new edge from EdgeF
TopoDS_Edge aNewEdge;
myBuildTool.CopyEdge (EdgeF, aNewEdge);
-
- Standard_Boolean bitclosed = aV1.IsSame(aV2);
- aNewEdge.Closed(bitclosed);
myBuildTool.AddEdgeVertex (aNewEdge, aV1);
myBuildTool.Parameter (aNewEdge, aV1, aPar1);
aShell.Closed (BRep_Tool::IsClosed(aShell));
BB.Add (aSolid, aShell);
}
- aSolid.Closed (BRep_Tool::IsClosed(aSolid));
aResult=aSolid;
//update section curves
}
else if (nV == 1) {
const TopoDS_Shape& E = mapVon1E.FindFromIndex(1);
- Standard_Boolean Eclosed = E.Closed();
+ Standard_Boolean Eclosed = BRep_Tool::IsClosed(E);
Standard_Boolean dgE = BRep_Tool::Degenerated(TopoDS::Edge(E));
if (dgE) res = ISVERTEX;
else if (Eclosed) res = CLOSEDW;
{
const TopoDS_Edge &E = TopoDS::Edge (itE.Value());
Standard_Integer I = myBlockBuilder.Element(E);
- if (!E.Closed() && myBlockBuilder.ElementIsValid(I))
+ if (!BRep_Tool::IsClosed(E) && myBlockBuilder.ElementIsValid(I))
{
TopoDS_Vertex Vf,Vl;
TopExp::Vertices (E, Vf, Vl);
} // EDBUloop.InitVertex : on vertices of new edge newEdge
Standard_Boolean addedge = (nVF == 1 && nVR == 1);
- Standard_Boolean bitclosed = Standard_False;
- if (nVF == 1 && nVR == 1) {
- bitclosed = VF.IsSame(VR);
- newEdge.Closed(bitclosed);
- }
if (addedge) {
if (tosplit) {
TopTools_ListOfShape loe; Standard_Boolean ok = TopOpeBRepTool_TOOL::SplitE(TopoDS::Edge(newEdge),loe);
-- - Modified : Has been modified.
-- - Checked : Has been checked.
-- - Orientable : Can be oriented.
- -- - Closed : Is closed.
+ -- - Closed : Is closed (note that only Wires and Shells may be closed).
-- - Infinite : Is infinite.
-- - Convex : Is convex.
--
OCC25202 result b 1 ff1 3 ff2
set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
puts "OK : value of IsClosed flag is correct"
} else {
puts "Error : value of IsClosed flag is not correct"
prism result ff 0 0 20
set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
puts "OK : value of IsClosed flag is correct"
} else {
puts "Error : value of IsClosed flag is not correct"
revol result ff 0 0 0 1 0 0 90
set info [whatis result]
-if { [regexp {Closed} ${info}] } {
+if { [regexp {Closed} ${info}] != 1 } {
puts "OK : value of IsClosed flag is correct"
} else {
puts "Error : value of IsClosed flag is not correct"