From: jfa Date: Fri, 21 Nov 2008 11:52:24 +0000 (+0000) Subject: Bug 0020043: EDF 865 GEOM: Object is non valid after translation. Fix object after... X-Git-Tag: V5_1_0rc2~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=315665caedc3625a3ea07282d0de7dea3418ab1c;p=modules%2Fgeom.git Bug 0020043: EDF 865 GEOM: Object is non valid after translation. Fix object after translation. --- diff --git a/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx b/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx index fba11c209..5854f6b71 100644 --- a/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx @@ -24,11 +24,15 @@ #include #include #include -#include -#include -#include -#include + +#include +#include + +#include #include +#include +#include + #include #include #include @@ -37,7 +41,10 @@ #include #include #include -#include + +#include +#include +#include //======================================================================= //function : GetID @@ -237,9 +244,22 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const } 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"); + } + aFunction->SetValue(aShape); log.SetTouched(Label());