// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Standard_Stream.hxx>
-
#include <GEOMImpl_TranslateDriver.hxx>
#include <GEOMImpl_ITranslate.hxx>
-#include <GEOMImpl_ITransformOperations.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
#include <GEOMUtils.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Edge.hxx>
#include <gp_Trsf.hxx>
#include <gp_Pnt.hxx>
B.Add(aCompound, anOriginal.Located(aLocRes));
}
aShape = aCompound;
- //aShape = GEOMImpl_ITransformOperations::TranslateShape1D(anOriginal, &TI);
}
else if (aType == TRANSLATE_2D) {
Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
}
}
aShape = aCompound;
- //aShape = GEOMImpl_ITransformOperations::TranslateShape2D(anOriginal, &TI);
}
else return 0;
if (aShape.IsNull()) return 0;
- BRepCheck_Analyzer ana (aShape, Standard_True);
- 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, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+ Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
aFunction->SetValue(aShape);