X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_FilletDriver.cxx;h=034d2f274d8e56ffad30d3d32987ab8a16740f4b;hb=58803ba33ee53a5944d565373782e5f0868c5461;hp=33e942e793d79bdd18626c942dc78fb9fa12b920;hpb=7d880c6a8262b6d670ed70ee2b9ec25c199a46d4;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_FilletDriver.cxx b/src/GEOMImpl/GEOMImpl_FilletDriver.cxx index 33e942e79..034d2f274 100644 --- a/src/GEOMImpl/GEOMImpl_FilletDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FilletDriver.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -20,31 +20,30 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include - #include #include #include #include +#include #include #include -#include -#include - #include #include #include #include #include - -#include -#include - -#include -#include #include +// Debug PipeTShape function: uncomment the macro below to correct tolerance +// of resulting face after fillet creation +// VSR 30/12/2014: macro disabled +//#define FIX_FACE_TOLERANCE +// Debug PipeTShape function: uncomment the macro below to correct tolerance +// of resulting curves after fillet creation +// VSR 30/12/2014: macro disabled +//#define FIX_CURVES_TOLERANCES + //======================================================================= //function : GetID //purpose : @@ -131,24 +130,20 @@ Standard_Integer GEOMImpl_FilletDriver::Execute(TFunction_Logbook& log) const if (!fill.IsDone()) { StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius"); } - aShape = fill.Shape(); + aShape = GEOMUtils::ReduceCompound( fill.Shape() ); if (aShape.IsNull()) return 0; - // Check shape validity - BRepCheck_Analyzer ana (aShape, false); - if (!ana.IsValid()) { - // 08.07.2008 added by skl during fixing bug 19761 from Mantis - ShapeFix_ShapeTolerance aSFT; - aSFT.LimitTolerance(aShape, Precision::Confusion(), - Precision::Confusion(), TopAbs_SHAPE); - Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape); - aSfs->Perform(); - aShape = aSfs->Shape(); - ana.Init(aShape); - if (!ana.IsValid()) - StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result"); - } +#if defined(FIX_CURVES_TOLERANCES) + bool isOk = GEOMUtils::FixShapeCurves(aShape); +#elif defined(FIX_FACE_TOLERANCE) + bool isOk = GEOMUtils::FixShapeTolerance(aShape, TopAbs_FACE); +#else + // 08.07.2008 added by skl during fixing bug 19761 from Mantis + bool isOk = GEOMUtils::CheckShape(aShape) || GEOMUtils::FixShapeTolerance(aShape); +#endif + if ( !isOk ) + StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result"); aFunction->SetValue(aShape);