Salome HOME
Copyrights update 2015.
[modules/geom.git] / src / ShHealOper / ShHealOper_FillHoles.hxx
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // File:      ShHealOper_FillHoles.hxx
24 // Created:   26.04.04 17:15:10
25 // Author:    Galina KULIKOVA
26 //
27 #ifndef ShHealOper_FillHoles_HeaderFile
28 #define ShHealOper_FillHoles_HeaderFile
29
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>
41
42 ///  Class ShHealOper_FillHoles
43 //Intended for filling holes.
44
45 class ShHealOper_FillHoles : public ShHealOper_Tool
46 {
47  public:
48   // ---------- PUBLIC METHODS ----------
49
50   Standard_EXPORT ShHealOper_FillHoles ();
51   // Empty constructor initializes class by default parameters.
52   
53   Standard_EXPORT ShHealOper_FillHoles (const TopoDS_Shape& theShape);
54
55   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
56   //Method for initalization by whole shape.
57   
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.
68
69   Standard_EXPORT Standard_Boolean Fill();
70   //Fill all holes detectected as free boundaries.
71   
72    Standard_EXPORT Standard_Boolean Fill(const TopTools_SequenceOfShape& theFillShapes);
73   //Fill hole specified by wires or edges.
74
75
76  private:
77   // ---------- PRIVATE METHODS ----------
78   
79   Standard_Boolean prepareWires(const TopTools_SequenceOfShape& theFillShapes,
80                                 Handle(TopTools_HSequenceOfShape)& theSeqWires);
81
82   Handle(Geom_Surface) buildSurface(const TopoDS_Wire& theWire,
83                                     Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
84                                     Handle(TColStd_HArray1OfInteger)& theOrders,
85                                     Handle(TColStd_HArray1OfInteger)& theSenses);
86   
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);
92
93   void getResShape(const TopoDS_Shape& theAddShape,
94                    const TopTools_IndexedMapOfShape& aMapParent,
95                    const Standard_Boolean theHasShell);
96  private:
97   // ---------- PRIVATE FIELDS ----------
98
99   TopTools_IndexedDataMapOfShapeListOfShape myEdgeShells;
100   
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;
112  public:
113 // Declaration of CASCADE RTTI
114 //DEFINE_STANDARD_RTTI (ShHealOper_FillHoles)
115 };
116
117 // Definition of HANDLE object using Standard_DefineHandle.hxx
118 //DEFINE_STANDARD_HANDLE (ShHealOper_FillHoles, )
119
120
121 #endif