0028456: BRepBuilderAPI_MakeFace modifies the input shape
[occt.git] / src / BRepLib / BRepLib.hxx
index c711e34..4d4b89c 100644 (file)
@@ -45,6 +45,7 @@ class BRepLib_MakeSolid;
 class BRepLib_FindSurface;
 class BRepLib_FuseEdges;
 class BRepLib_CheckCurveOnSurface;
+class BRepTools_ReShape;
 
 
 //! The BRepLib package provides general utilities for
@@ -130,23 +131,58 @@ public:
   //! Use  only  in interfaces or  processing assimilate batch
   Standard_EXPORT static Standard_Boolean UpdateEdgeTolerance (const TopoDS_Shape& S, const Standard_Real MinToleranceRequest, const Standard_Real MaxToleranceToCheck);
   
-  //! Computes new 2d curve(s)  for the edge <E> to have
+  //! Computes new 2d curve(s)  for the edge <theEdge> to have
   //! the same parameter  as  the  3d curve.
   //! The algorithm is not done if the flag SameParameter
   //! was True  on the  Edge.
-  Standard_EXPORT static void SameParameter (const TopoDS_Edge& E, const Standard_Real Tolerance = 1.0e-5);
+  Standard_EXPORT static void SameParameter (const TopoDS_Edge& theEdge, const Standard_Real Tolerance = 1.0e-5);
+
+  //! Computes new 2d curve(s)  for the edge <theEdge> to have
+  //! the same parameter  as  the  3d curve.
+  //! The algorithm is not done if the flag SameParameter
+  //! was True  on the  Edge.<br>
+  //! theNewTol is a new tolerance of vertices of the input edge
+  //! (not applied inside the algorithm, but pre-computed).
+  //! If IsUseOldEdge is true then the input edge will be modified,
+  //! otherwise the new copy of input edge will be created.
+  //! Returns the new edge as a result, can be ignored if IsUseOldEdge is true.
+  Standard_EXPORT static TopoDS_Edge SameParameter(const TopoDS_Edge& theEdge,
+  const Standard_Real theTolerance, Standard_Real& theNewTol, const Standard_Boolean IsUseOldEdge);
   
   //! Computes new 2d curve(s) for all the edges of  <S>
   //! to have the same parameter  as  the  3d curve.
   //! The algorithm is not done if the flag SameParameter
   //! was True  on an  Edge.
-  Standard_EXPORT static void SameParameter (const TopoDS_Shape& S, const Standard_Real Tolerance = 1.0e-5, const Standard_Boolean forced = Standard_False);
-  
+  Standard_EXPORT static void SameParameter(const TopoDS_Shape& S,
+    const Standard_Real Tolerance = 1.0e-5, const Standard_Boolean forced = Standard_False);
+
+  //! Computes new 2d curve(s) for all the edges of  <S>
+  //! to have the same parameter  as  the  3d curve.
+  //! The algorithm is not done if the flag SameParameter
+  //! was True  on an  Edge.<br>
+  //! theReshaper is used to record the modifications of input shape <S> to prevent any 
+  //! modifications on the shape itself.
+  //! Thus the input shape (and its subshapes) will not be modified, instead the reshaper will 
+  //! contain a modified empty-copies of original subshapes as substitutions.
+  Standard_EXPORT static void SameParameter(const TopoDS_Shape& S, BRepTools_ReShape& theReshaper,
+    const Standard_Real Tolerance = 1.0e-5, const Standard_Boolean forced = Standard_False );
   //! Replaces tolerance   of  FACE EDGE VERTEX  by  the
   //! tolerance Max of their connected handling shapes.
   //! It is not necessary to use this call after
   //! SameParameter. (called in)
   Standard_EXPORT static void UpdateTolerances (const TopoDS_Shape& S, const Standard_Boolean verifyFaceTolerance = Standard_False);
+
+  //! Replaces tolerance   of  FACE EDGE VERTEX  by  the
+  //! tolerance Max of their connected handling shapes.
+  //! It is not necessary to use this call after
+  //! SameParameter. (called in)<br>
+  //! theReshaper is used to record the modifications of input shape <S> to prevent any 
+  //! modifications on the shape itself.
+  //! Thus the input shape (and its subshapes) will not be modified, instead the reshaper will 
+  //! contain a modified empty-copies of original subshapes as substitutions.
+  Standard_EXPORT static void UpdateTolerances (const TopoDS_Shape& S, BRepTools_ReShape& theReshaper, 
+    const Standard_Boolean verifyFaceTolerance = Standard_False );
   
   //! Checks tolerances of edges (including inner points) and vertices
   //! of a shape and updates them to satisfy "SameParameter" condition