From: vsr Date: Fri, 16 Jan 2015 12:33:47 +0000 (+0300) Subject: Fix pb in non-regression scripts, caused by previous integration X-Git-Tag: V7_5_1rc1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cad7d404aa7bff9048739462b0b040af5b971dff;p=modules%2Fgeom.git Fix pb in non-regression scripts, caused by previous integration --- diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index 389ca6f5e..111a509cd 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -579,7 +579,7 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation TColStd_IndexedDataMapOfTransientTransient aMapTShapes; TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy); - if ( GEOMUtils::FixShapeTolerance(aShapeCopy) ) { + if ( GEOMUtils::FixShapeTolerance(aShapeCopy, true) ) { int iType, nbTypesCopy [TopAbs_SHAPE]; for (iType = 0; iType < TopAbs_SHAPE; ++iType) diff --git a/src/GEOMUtils/GEOMUtils.cxx b/src/GEOMUtils/GEOMUtils.cxx index 3773646b8..055276d89 100644 --- a/src/GEOMUtils/GEOMUtils.cxx +++ b/src/GEOMUtils/GEOMUtils.cxx @@ -1094,20 +1094,28 @@ bool GEOMUtils::CheckShape( TopoDS_Shape& shape, bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape, TopAbs_ShapeEnum type, - Standard_Real tolerance ) + Standard_Real tolerance, + bool checkGeometry ) { ShapeFix_ShapeTolerance aSft; aSft.LimitTolerance( shape, tolerance, tolerance, type ); Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape( shape ); aSfs->Perform(); shape = aSfs->Shape(); - return CheckShape( shape ); + return CheckShape( shape, checkGeometry ); +} + +bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape, + Standard_Real tolerance, + bool checkGeometry ) +{ + return FixShapeTolerance( shape, TopAbs_SHAPE, tolerance, checkGeometry ); } bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape, - Standard_Real tolerance ) + bool checkGeometry ) { - return FixShapeTolerance( shape, TopAbs_SHAPE, tolerance ); + return FixShapeTolerance( shape, Precision::Confusion(), checkGeometry ); } bool GEOMUtils::FixShapeCurves( TopoDS_Shape& shape ) diff --git a/src/GEOMUtils/GEOMUtils.hxx b/src/GEOMUtils/GEOMUtils.hxx index b75501024..48cef6533 100644 --- a/src/GEOMUtils/GEOMUtils.hxx +++ b/src/GEOMUtils/GEOMUtils.hxx @@ -228,22 +228,33 @@ namespace GEOMUtils * \param type topology type which tolerance is to be limited; TopAbs_SHAPE means * all types of topology * \param tolerance expected tolerance value (1e-7 by default) + * \param checkGeometry check geometry validity of result * \return \c true if resulting shape is valid * * \note Resulting tolerance of the shape is not mandatory equal to requested value * as it might be changed by fixshape operation in order to get valid shape where possible + * \note By default, result only checked for topology validity; check of geometry can be done by + * passing \c true to \a checkGeometry parameter */ Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape, TopAbs_ShapeEnum type, - Standard_Real tolerance = Precision::Confusion() ); + Standard_Real tolerance = Precision::Confusion(), + bool checkGeometry = false ); /*! * \brief Limit shape tolerance to the given value * This is overloaded function, it behaves exactly as previous one */ Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape, - Standard_Real tolerance = Precision::Confusion() ); - + Standard_Real tolerance = Precision::Confusion(), + bool checkGeometry = false ); + + /*! + * \brief Limit shape tolerance to the given value + * This is overloaded function, it behaves exactly as previous one + */ + Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape, + bool checkGeometry ); /*! * \brief Fix curves of the given shape