-// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Standard_Stream.hxx>
-
#include <GEOMImpl_HealingDriver.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOMImpl_IHealing.hxx>
#include <TNaming_CopyShape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
#include <BRep_Builder.hxx>
#include <BRepAdaptor_Curve.hxx>
-#include <BRepCheck_Analyzer.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <TopExp.hxx>
{
Standard_Real aTol = theHI->GetTolerance();
- TopoDS_Compound faceCompound;
+ TopoDS_Compound aCompound;
BRep_Builder builder;
- builder.MakeCompound( faceCompound );
+ builder.MakeCompound( aCompound );
- TopExp_Explorer faceExp( theOriginalShape, TopAbs_FACE );
- for ( ; faceExp.More(); faceExp.Next() )
- builder.Add( faceCompound, faceExp.Current() );
-
+ builder.Add( aCompound, theOriginalShape );
Handle(TColStd_HSequenceOfTransient) otherObjs = theHI->GetShapes();
for ( int ind = 1; ind <= otherObjs->Length(); ind++)
{
Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(otherObjs->Value(ind));
- TopoDS_Shape aShape = aRefShape->GetValue();
- if (aShape.IsNull())
- Standard_NullObject::Raise("Null object given");
- for ( faceExp.Init( aShape, TopAbs_FACE ); faceExp.More(); faceExp.Next() )
- builder.Add( faceCompound, faceExp.Current() );
+ builder.Add( aCompound, aRefShape->GetValue() );
}
- ShHealOper_Sewing aHealer (faceCompound, aTol);
+ ShHealOper_Sewing aHealer (aCompound, aTol);
// Set non-manifold mode.
aHealer.SetNonManifoldMode(isAllowNonManifold);
TopoDS_Shape& theOutShape) const
{
Standard_Real aTol = theHI->GetTolerance();
+ TopAbs_ShapeEnum aType = theHI->GetType();
+
if (aTol < Precision::Confusion())
aTol = Precision::Confusion();
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy);
}
- // 2. Limit tolerance.
- ShapeFix_ShapeTolerance aSFT;
- aSFT.LimitTolerance(aShapeCopy, aTol, aTol, TopAbs_SHAPE);
-
- // 3. Fix obtained shape.
- Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy);
- aSfs->Perform();
- theOutShape = aSfs->Shape();
- BRepCheck_Analyzer ana (theOutShape, Standard_True);
- if (!ana.IsValid())
+ // 2. Limit tolerance.
+ if (!GEOMUtils::FixShapeTolerance(aShapeCopy, aType, aTol))
StdFail_NotDone::Raise("Non valid shape result");
+ // 3. Set the result
+ theOutShape = aShapeCopy;
+
// 4. Collect statistics
{
ShHealOper_Tool tool;
}
theOutShape = aFinalWire;
- BRepCheck_Analyzer ana (theOutShape, Standard_True);
- if (!ana.IsValid())
+ if (!GEOMUtils::CheckShape(theOutShape, true))
StdFail_NotDone::Raise("Non valid shape result");
}
theOperationName = "LIMIT_TOLERANCE";
AddParam( theParams, "Selected shape", aCI.GetOriginal() );
AddParam( theParams, "Tolerance", aCI.GetTolerance() );
+ AddParam( theParams, "Type", aCI.GetType() );
break;
case FUSE_COLLINEAR_EDGES:
theOperationName = "FUSE_EDGES";