1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: ShHealOper_FillHoles.hxx
24 // Created: 26.04.04 17:15:10
25 // Author: Galina KULIKOVA
27 #ifndef ShHealOper_FillHoles_HeaderFile
28 #define ShHealOper_FillHoles_HeaderFile
30 #include <MMgt_TShared.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <TopTools_SequenceOfShape.hxx>
33 #include <TopoDS_Wire.hxx>
34 #include <TColGeom2d_HArray1OfCurve.hxx>
35 #include <Geom_Surface.hxx>
36 #include <TColStd_HArray1OfInteger.hxx>
37 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
38 #include <ShHealOper_Tool.hxx>
39 #include <TopTools_HSequenceOfShape.hxx>
40 #include <TopTools_IndexedMapOfShape.hxx>
42 /// Class ShHealOper_FillHoles
43 //Intended for filling holes.
45 class ShHealOper_FillHoles : public ShHealOper_Tool
48 // ---------- PUBLIC METHODS ----------
50 Standard_EXPORT ShHealOper_FillHoles ();
51 // Empty constructor initializes class by default parameters.
53 Standard_EXPORT ShHealOper_FillHoles (const TopoDS_Shape& theShape);
55 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
56 //Method for initalization by whole shape.
58 Standard_EXPORT void InitParameters(Standard_Integer theDegree = 3,//3(2)
59 Standard_Integer theNbPtsOnCur =5,//3,
60 Standard_Integer theNbIter = 12,//3
61 Standard_Real theTol3d = 0.0001,//0.001,
62 Standard_Real theTol2d = 1.e-5,
63 Standard_Real theTolAng = 0.01,
64 Standard_Real theTolCrv = 0.01,
65 Standard_Integer theMaxDeg = 8,
66 Standard_Integer theMaxSeg =9);
67 //Initialization of the parameters for creation of the surface by GeomPlate.
69 Standard_EXPORT Standard_Boolean Fill();
70 //Fill all holes detectected as free boundaries.
72 Standard_EXPORT Standard_Boolean Fill(const TopTools_SequenceOfShape& theFillShapes);
73 //Fill hole specified by wires or edges.
77 // ---------- PRIVATE METHODS ----------
79 Standard_Boolean prepareWires(const TopTools_SequenceOfShape& theFillShapes,
80 Handle(TopTools_HSequenceOfShape)& theSeqWires);
82 Handle(Geom_Surface) buildSurface(const TopoDS_Wire& theWire,
83 Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
84 Handle(TColStd_HArray1OfInteger)& theOrders,
85 Handle(TColStd_HArray1OfInteger)& theSenses);
87 Standard_Boolean addFace(const Handle(Geom_Surface)& theSurf,
88 const TopoDS_Wire& theWire,
89 const Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
90 const Handle(TColStd_HArray1OfInteger)& theOrders,
91 const Handle(TColStd_HArray1OfInteger)& theSenses);
93 void getResShape(const TopoDS_Shape& theAddShape,
94 const TopTools_IndexedMapOfShape& aMapParent,
95 const Standard_Boolean theHasShell);
97 // ---------- PRIVATE FIELDS ----------
99 TopTools_IndexedDataMapOfShapeListOfShape myEdgeShells;
101 TopTools_IndexedDataMapOfShapeListOfShape myEdgeComps;
102 TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaces;
103 Standard_Integer myNbPtsOnCur;
104 Standard_Integer myNbIter;
105 Standard_Integer myDegree;
106 Standard_Real myTol2d;
107 Standard_Real myTol3d;
108 Standard_Real myTolAng;
109 Standard_Real myTolCrv;
110 Standard_Integer myMaxDeg;
111 Standard_Integer myMaxSeg;
113 // Declaration of CASCADE RTTI
114 //DEFINE_STANDARD_RTTI (ShHealOper_FillHoles)
117 // Definition of HANDLE object using Standard_DefineHandle.hxx
118 //DEFINE_STANDARD_HANDLE (ShHealOper_FillHoles, )