1 // File: ShHealOper_FillHoles.hxx
2 // Created: 26.04.04 17:15:10
3 // Author: Galina KULIKOVA
4 // < MODULE = KERNEL> <PACKAGE = ShHealOper> : <Shape Healing Operations>
5 // Copyright (C) 2003 CEA
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef ShHealOper_FillHoles_HeaderFile
26 #define ShHealOper_FillHoles_HeaderFile
28 #include <MMgt_TShared.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopTools_SequenceOfShape.hxx>
31 #include <TopoDS_Wire.hxx>
32 #include <TColGeom2d_HArray1OfCurve.hxx>
33 #include <Geom_Surface.hxx>
34 #include <TColStd_HArray1OfInteger.hxx>
35 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
36 #include <ShHealOper_Tool.hxx>
37 #include <TopTools_HSequenceOfShape.hxx>
38 #include <TopTools_IndexedMapOfShape.hxx>
40 /// Class ShHealOper_FillHoles
41 //Intended for filling holes.
43 class ShHealOper_FillHoles : public ShHealOper_Tool
46 // ---------- PUBLIC METHODS ----------
48 Standard_EXPORT ShHealOper_FillHoles ();
49 // Empty constructor initializes class by default parameters.
51 Standard_EXPORT ShHealOper_FillHoles (const TopoDS_Shape& theShape);
53 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
54 //Method for initalization by whole shape.
56 Standard_EXPORT void InitParameters(Standard_Integer theDegree = 3,//3(2)
57 Standard_Integer theNbPtsOnCur =5,//3,
58 Standard_Integer theNbIter = 12,//3
59 Standard_Real theTol3d = 0.0001,//0.001,
60 Standard_Real theTol2d = 1.e-5,
61 Standard_Real theTolAng = 0.01,
62 Standard_Real theTolCrv = 0.01,
63 Standard_Integer theMaxDeg = 8,
64 Standard_Integer theMaxSeg =9);
65 //Initialization of the parameters for creation of the surface by GeomPlate.
67 Standard_EXPORT Standard_Boolean Fill();
68 //Fill all holes detectected as free boundaries.
70 Standard_EXPORT Standard_Boolean Fill(const TopTools_SequenceOfShape& theFillShapes);
71 //Fill hole specified by wires or edges.
75 // ---------- PRIVATE METHODS ----------
77 Standard_Boolean prepareWires(const TopTools_SequenceOfShape& theFillShapes,
78 Handle(TopTools_HSequenceOfShape)& theSeqWires);
80 Handle(Geom_Surface) buildSurface(const TopoDS_Wire& theWire,
81 Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
82 Handle(TColStd_HArray1OfInteger)& theOrders,
83 Handle(TColStd_HArray1OfInteger)& theSenses);
85 Standard_Boolean addFace(const Handle(Geom_Surface)& theSurf,
86 const TopoDS_Wire& theWire,
87 const Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
88 const Handle(TColStd_HArray1OfInteger)& theOrders,
89 const Handle(TColStd_HArray1OfInteger)& theSenses);
91 void getResShape(const TopoDS_Shape& theAddShape,
92 const TopTools_IndexedMapOfShape& aMapParent,
93 const Standard_Boolean theHasShell);
95 // ---------- PRIVATE FIELDS ----------
97 TopTools_IndexedDataMapOfShapeListOfShape myEdgeShells;
99 TopTools_IndexedDataMapOfShapeListOfShape myEdgeComps;
100 TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaces;
101 Standard_Integer myNbPtsOnCur;
102 Standard_Integer myNbIter;
103 Standard_Integer myDegree;
104 Standard_Real myTol2d;
105 Standard_Real myTol3d;
106 Standard_Real myTolAng;
107 Standard_Real myTolCrv;
108 Standard_Integer myMaxDeg;
109 Standard_Integer myMaxSeg;
111 // Declaration of CASCADE RTTI
112 //DEFINE_STANDARD_RTTI (ShHealOper_FillHoles)
115 // Definition of HANDLE object using Standard_DefineHandle.hxx
116 //DEFINE_STANDARD_HANDLE (ShHealOper_FillHoles, )