Back to index

salome-geom  6.5.0
Functions
ShHealOper_FillHoles.cxx File Reference
#include <Basics_OCCTVersion.hxx>
#include <ShapeFix_Shell.hxx>
#include <ShapeFix_Face.hxx>
#include <ShHealOper_FillHoles.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_HCurve.hxx>
#include <BRep_Builder.hxx>
#include <BRepFill_CurveConstraint.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <Geom_Curve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <GeomPlate_Surface.hxx>
#include <GeomPlate_MakeApprox.hxx>
#include <GeomPlate_CurveConstraint.hxx>
#include <GeomPlate_PlateG0Criterion.hxx>
#include <GeomPlate_BuildPlateSurface.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <Precision.hxx>

Go to the source code of this file.

Functions

static Standard_Boolean isCircle (const TopoDS_Edge theEdge)
 Handle (Geom_Surface) ShHealOper_FillHoles

Function Documentation

Handle ( Geom_Surface  )

Definition at line 272 of file ShHealOper_FillHoles.cxx.

{
  Handle(Geom_BSplineSurface) aSurf;
  try {
      GeomPlate_BuildPlateSurface aBuilder(myDegree, myNbPtsOnCur, myNbIter,
                                                 myTol2d, myTol3d, myTolAng, myTolCrv);
      TopoDS_Iterator aIter;
      for(aIter.Initialize (theWire); aIter.More(); aIter.Next()) {

        TopoDS_Edge ae = TopoDS::Edge(aIter.Value());
        BRepAdaptor_Curve adC(ae);
        Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC);
        Handle(BRepFill_CurveConstraint) aConst =
            new BRepFill_CurveConstraint (aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
        //Handle(GeomPlate_CurveConstraint) aConst =
         // new GeomPlate_CurveConstraint(aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
        aBuilder.Add (aConst);
      }
      aBuilder.Perform();
      if(!aBuilder.IsDone())
        return aSurf;
      Handle(GeomPlate_Surface) aPlSurf = aBuilder.Surface();

      //for filling holes without initial specified surface
      //the initial surface should be build by GeomPlate itself
      //following code was taken from BRepFill_Filling::Build

      Standard_Real aDist = aBuilder.G0Error();
      TColgp_SequenceOfXY S2d;
      TColgp_SequenceOfXYZ S3d;
      S2d.Clear();
      S3d.Clear();
      aBuilder.Disc2dContour(4,S2d);
      aBuilder.Disc3dContour(4,0,S3d);
      Standard_Real amaxTol = Max( myTol3d, 10* aDist);
      GeomPlate_PlateG0Criterion Criterion( S2d, S3d, amaxTol );
      GeomPlate_MakeApprox Approx( aPlSurf, Criterion, myTol3d, myMaxSeg, myMaxDeg );
      aSurf = Approx.Surface();
      if(aSurf.IsNull())
        return aSurf;

      theCurves2d = aBuilder.Curves2d();
      theOrders    = aBuilder.Order();
      theSenses    = aBuilder.Sense();
    }

  catch (Standard_Failure) {
    aSurf.Nullify();
    return aSurf;
  }
  return aSurf;
}

Here is the call graph for this function:

static Standard_Boolean isCircle ( const TopoDS_Edge  theEdge) [static]

Definition at line 197 of file ShHealOper_FillHoles.cxx.

{
  Standard_Real aFirst, aLast;
  Handle(Geom_Curve) aC3D = BRep_Tool::Curve(theEdge,aFirst, aLast );
  if(aC3D.IsNull()) return Standard_False;
  Standard_Boolean isCirc = (aC3D->Value(aFirst).Distance(aC3D->Value(aLast)) <
     aC3D->Value(aFirst).Distance(aC3D->Value((aFirst +aLast)/2)));
  return isCirc;
}

Here is the call graph for this function:

Here is the caller graph for this function: