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