Salome HOME
1) Fix for issue 0022706 with MakePipeTShape (workaround for Fillet problem)
[modules/geom.git] / src / GEOMImpl / GEOMImpl_ScaleDriver.cxx
index 3525ed57b489258e6e4bdb61a57893f28f36368c..9cc1d62653280f78c04156ed6ed08669b180990f 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ScaleDriver.hxx>
 #include <GEOMImpl_IScale.hxx>
 #include <GEOMImpl_Types.hxx>
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <BRepBuilderAPI_Transform.hxx>
 #include <BRepBuilderAPI_GTransform.hxx>
 #include <BRep_Tool.hxx>
-#include <BRepAlgo.hxx>
-#include <BRepCheck_Analyzer.hxx>
 
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
 #include <Precision.hxx>
@@ -175,19 +168,8 @@ Standard_Integer GEOMImpl_ScaleDriver::Execute(TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
 
   aFunction->SetValue(aShape);