]> OCCT Git - occt-copy.git/commitdiff
Tolerance post Build (Perform) fix was changed for BRepOffset_MakeOffset. CR23610_5
authorabk <abk@opencascade.com>
Thu, 14 Mar 2013 12:57:54 +0000 (16:57 +0400)
committerabk <abk@opencascade.com>
Thu, 14 Mar 2013 12:57:54 +0000 (16:57 +0400)
Standard_Boolean parameter theCopy with default value Standard_False was
added to methods LocOpe_WiresOnShape::Bind to determine whether bind
passing shape or its copy.

Tolerance post Build (Perform) fix was created for
- BiTgte_Blend,
- LocOpe_Spliter.

Commands checkshape were added to tests:
- bugs modalg_2 bug22864,
-               bug22946,
-      modalg_4 bug8842_1.

Minor change in BRepFeat_SplitShape.cxx.

src/BRepFeat/BRepFeat_SplitShape.cxx
src/BRepOffset/BRepOffset_MakeOffset.cxx
src/BiTgte/BiTgte_Blend.cdl
src/BiTgte/BiTgte_Blend.cxx
src/LocOpe/LocOpe_Spliter.cxx
src/LocOpe/LocOpe_WiresOnShape.cdl
src/LocOpe/LocOpe_WiresOnShape.cxx
tests/bugs/modalg_2/bug22864
tests/bugs/modalg_2/bug22946
tests/bugs/modalg_4/bug8842_1

index 387383fb8b8e9730de6abdcb4577758e5ae5b0e4..486c0bab1b9c29a337de7123b95d387de13c110f 100755 (executable)
 void BRepFeat_SplitShape::Build ()
 {
   mySShape.Perform(myWOnShape);
-  if (mySShape.IsDone()) {
-    Done();
+  if (mySShape.IsDone())
+  {
     myShape = mySShape.ResultingShape();
+    Done();
   }
 }
 
index 7e452f4146b23da0cfc04145bbbf1e8741e0725e..ca8b748f4481e3b14597982c854e92d82029cbbd 100755 (executable)
@@ -44,6 +44,7 @@
 #include <BRepCheck_Vertex.hxx>
 #include <BRepLib.hxx>
 #include <BRepLib_MakeVertex.hxx>
+#include <BRepLib_ToleranceRule.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 #include <BRep_TVertex.hxx>
@@ -761,10 +762,10 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   // ----------------------------
   if (!myOffsetShape.IsNull()) {
     UpdateTolerance (myOffsetShape,myFaces);
-    BRepLib::UpdateTolerances( myOffsetShape );
   }
 
   CorrectConicalFaces();
+  BRepLib_ToleranceRule::SetProperTolerances(myOffsetShape);
 
   myDone = Standard_True;
 }
index 580b533b61c76d8ac3ece45a39578a3905b652ce..d76073b5fd5d506abc5445ffcc7c26bac2202b15 100755 (executable)
@@ -308,6 +308,9 @@ is
        ---Purpose: Computes the center lines
     is static;
 
+    IsProtectedFromModification(me; theS : Shape from TopoDS) returns Boolean from Standard;
+    ---Purpose: Indicates if theS is protected from modification.
+
     ComputeSurfaces( me    : in out)
        ---Purpose: Perform the generated surfaces.
     is static private;
@@ -359,5 +362,6 @@ fields
     myNbBranches     : Integer              from Standard;
     myIndices        : HArray1OfInteger     from TColStd;     
     myDone           : Boolean              from Standard;
+    myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
 
 end Blend;
index 1cafb07758f0e349f1d26458f126319b8ec4749a..5c120d9614d7f9e406117ffaac2081d64bf6cc74 100755 (executable)
@@ -38,6 +38,7 @@
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 #include <BRepLib_MakeEdge.hxx>
+#include <BRepLib_ToleranceRule.hxx>
 #include <BRepOffset_DataMapOfShapeOffset.hxx>
 #include <BRepOffset_DataMapIteratorOfDataMapOfShapeOffset.hxx>
 #include <BRepOffset_Offset.hxx>
@@ -844,6 +845,8 @@ BiTgte_Blend::BiTgte_Blend(const TopoDS_Shape&    S,
                           const Standard_Real    Tol,
                           const Standard_Boolean NUBS)
 {
+  TopExp::MapShapes(S, myProtectedFromModificationShapes);
+  //
   myAsDes = new BRepAlgo_AsDes();
   Init(S,Radius,Tol,NUBS);
 }
@@ -859,6 +862,8 @@ void BiTgte_Blend::Init(const TopoDS_Shape&    S,
                        const Standard_Real    Tol,
                        const Standard_Boolean NUBS) 
 {
+  TopExp::MapShapes(S, myProtectedFromModificationShapes);
+  //
   Clear();
   myShape      = S;
   myTol        = Tol;
@@ -1060,6 +1065,7 @@ void BiTgte_Blend::Perform(const Standard_Boolean BuildShape)
   // Finally construct curves 3d from edges to be transfered
   // since the partition is provided ( A Priori);
   BRepLib::BuildCurves3d(myResult, Precision::Confusion());
+  BRepLib_ToleranceRule::SetProperTolerances(myResult, *this);
 
 #ifdef DEB
   ChFi3d_ResultChron(cl_total, t_total);
@@ -1855,6 +1861,15 @@ void BiTgte_Blend::ComputeCenters()
 #endif
 }
 
+//=======================================================================
+//function : IsProtectedFromModification
+//purpose  :
+//=======================================================================
+Standard_Boolean BiTgte_Blend::IsProtectedFromModification(
+  const TopoDS_Shape & theS) const
+{
+  return myProtectedFromModificationShapes.Contains(theS);
+}
 
 //=======================================================================
 //function : ComputeSurfaces
index 9f23592c1a8702c16d219ca91ad66ac707ddd10e..fdaca2dd78b5e7b7d4976f49744af4f41aa6998f 100755 (executable)
@@ -56,6 +56,7 @@
 #include <TopExp.hxx>
 
 #include <Standard_ConstructionError.hxx>
+#include <BRepLib_ToleranceRule.hxx>
 
 
 //  Modified by skv - Mon May 31 13:00:30 2004 OCC5865 Begin
@@ -99,6 +100,8 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_ProjectedWires)& PW)
   BRepTools_Substitution theSubs;
   BRep_Builder BB;
 
+  // LocOpe_ProjectedWires::InitEdgeIterator() is much more then simple
+  // initialization.
   for (PW->InitEdgeIterator(); PW->MoreEdge(); PW->NextEdge()) {
     const TopoDS_Edge& edg = PW->Edge();
     mapE.Add(edg);
@@ -432,6 +435,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_ProjectedWires)& PW)
     }
   }
 
+  BRepLib_ToleranceRule::SetProperTolerances(myRes);
   myDone = Standard_True;
 }
 
index 5171f208051b59c597cbc1ed36e50328a2b9e962..f1dcfaee16806d85c86aaabd43087ec192c9d193 100755 (executable)
@@ -55,23 +55,24 @@ is
        is static;
 
     Bind(me: mutable; W: Wire from TopoDS;
-                      F: Face from TopoDS)
+      F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
                     
        is static;
 
     Bind(me: mutable; Comp: Compound from TopoDS;
-                      F:    Face from TopoDS)
+      F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
                     
        is static;
 
     Bind(me: mutable; E: Edge from TopoDS;
-                      F: Face from TopoDS)
+      F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
                      
        is static;
 
 
     Bind(me: mutable; EfromW: Edge from TopoDS;
-                     EonFace: Edge from TopoDS)
+      EonFace: Edge from TopoDS;
+      theCopy : Boolean from Standard = Standard_False)
                      
        is static;
 
index 2072fedb9ba798a8c7e87179d2efedf7321595cc..d8c308f2c1781bde18d371bf8cee1eda14c08735 100755 (executable)
@@ -24,6 +24,7 @@
 
 #include <TopExp_Explorer.hxx>
 #include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_Copy.hxx>
 #include <BRep_Tool.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
@@ -117,10 +118,10 @@ void LocOpe_WiresOnShape::Init(const TopoDS_Shape& S)
 //=======================================================================
 
 void LocOpe_WiresOnShape::Bind(const TopoDS_Wire& W,
-                              const TopoDS_Face& F)
+  const TopoDS_Face & F, Standard_Boolean theCopy)
 {
   for (TopExp_Explorer exp(W, TopAbs_EDGE); exp.More(); exp.Next()) {
-    Bind(TopoDS::Edge(exp.Current()),F);
+    Bind(TopoDS::Edge(exp.Current()), F, theCopy);
   }
 }
 
@@ -130,10 +131,10 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Wire& W,
 //=======================================================================
 
 void LocOpe_WiresOnShape::Bind(const TopoDS_Compound& Comp,
-                              const TopoDS_Face& F)
+  const TopoDS_Face & F, Standard_Boolean theCopy)
 {
   for (TopExp_Explorer exp(Comp, TopAbs_EDGE); exp.More(); exp.Next()) {
-    Bind(TopoDS::Edge(exp.Current()),F);
+    Bind(TopoDS::Edge(exp.Current()), F, theCopy);
   }
   myFacesWithSection.Add(F);
 }
@@ -144,7 +145,7 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Compound& Comp,
 //=======================================================================
 
 void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
-                              const TopoDS_Face& F)
+  const TopoDS_Face & F, Standard_Boolean theCopy)
 {
 //  if (!myMapEF.IsBound(E)) {
   if (!myMapEF.Contains(E)) {
@@ -157,7 +158,12 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
     }
     if (!exp.More()) {
 //      myMapEF.Bind(E,F);
-      myMapEF.Add(E,F);
+      TopoDS_Shape anE = E;
+      if (theCopy)
+      {
+        anE = BRepBuilderAPI_Copy(E).Shape();
+      }
+      myMapEF.Add(anE, F);
     }
   }
   else {
@@ -172,12 +178,17 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
 //=======================================================================
 
 void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& Ewir,
-                              const TopoDS_Edge& Efac)
+  const TopoDS_Edge & Efac, Standard_Boolean theCopy)
 {
   if (Ewir.IsSame(Efac)) {
     return;
   }
-  myMap.Bind(Ewir,Efac);
+  TopoDS_Shape anE = Ewir;
+  if (theCopy)
+  {
+    anE = BRepBuilderAPI_Copy(Ewir).Shape();
+  }
+  myMap.Bind(anE, Efac);
 }
 
 
index 47c6d02e8944392acb1ad2a06f5728fea66438f4..39a16d1ab27af1cb304ffef49f052af8dd7e8568 100755 (executable)
@@ -9,7 +9,9 @@ puts ""
 set BugNumber OCC22864
 
 restore [locate_data_file bug22864_face1.brep] f1 
+checkshape f1
 restore [locate_data_file bug22864_face2.brep] f2 
+checkshape f2
 
 shape aShape C
 add f1 aShape
@@ -33,6 +35,7 @@ set Numbers 11
 for {set i 0} {$i < ${Numbers}} {incr i} {
     puts "i=$i"
     rollingball result aShape 15 @ f1 f2
+    checkshape result
     
     set nb_info [nbshapes result]
     regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
index 7717eb422ca18858500cbe28543a8ee81197bda7..392034d81a433bed483bb0a7c48e67cc65329649 100755 (executable)
@@ -9,9 +9,12 @@ puts ""
 set BugNumber OCC22946
 
 restore [locate_data_file OCC22946-FaceWithNewCurves.brep] a 
+checkshape a
 restore [locate_data_file OCC22946-CompoundWithoutPcurves.brep] b 
+checkshape b
 
 splitshape result a a b
+checkshape result
 
 set square 6.06498e+08
 set 3dviewer 0
index 99915df68e814ede58c209f47afa1d7dfb5e5584..749de7e6af80f56557c1a4d1dd3b8849e2016f8c 100755 (executable)
@@ -33,6 +33,7 @@ puts "   cone_CATIA + 5"
 if [catch { myoffset result con1 5 0 } catch_result] {
   puts "${BugNumber}: Faulty (1)"
 } else {
+checkshape result
 
 set square 32396.2