Back to index

salome-geom  6.5.0
ShHealOper_FillHoles.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:      ShHealOper_FillHoles.hxx
00024 // Created:   26.04.04 17:15:10
00025 // Author:    Galina KULIKOVA
00026 //
00027 #ifndef ShHealOper_FillHoles_HeaderFile
00028 #define ShHealOper_FillHoles_HeaderFile
00029 
00030 #include <MMgt_TShared.hxx>
00031 #include <TopoDS_Shape.hxx>
00032 #include <TopTools_SequenceOfShape.hxx>
00033 #include <TopoDS_Wire.hxx>
00034 #include <TColGeom2d_HArray1OfCurve.hxx>
00035 #include <Geom_Surface.hxx>
00036 #include <TColStd_HArray1OfInteger.hxx>
00037 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
00038 #include <ShHealOper_Tool.hxx>
00039 #include <TopTools_HSequenceOfShape.hxx>
00040 #include <TopTools_IndexedMapOfShape.hxx>
00041 
00043 //Intended for filling holes.
00044 
00045 class ShHealOper_FillHoles : public ShHealOper_Tool
00046 {
00047  public:
00048   // ---------- PUBLIC METHODS ----------
00049 
00050   Standard_EXPORT ShHealOper_FillHoles ();
00051   // Empty constructor initializes class by default parameters.
00052   
00053   Standard_EXPORT ShHealOper_FillHoles (const TopoDS_Shape& theShape);
00054 
00055   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
00056   //Method for initalization by whole shape.
00057   
00058   Standard_EXPORT void InitParameters(Standard_Integer theDegree = 3,//3(2)
00059                                  Standard_Integer theNbPtsOnCur =5,//3,
00060                                  Standard_Integer theNbIter = 12,//3
00061                                  Standard_Real theTol3d = 0.0001,//0.001,
00062                                  Standard_Real theTol2d = 1.e-5,
00063                                  Standard_Real theTolAng = 0.01,
00064                                  Standard_Real theTolCrv = 0.01,
00065                                  Standard_Integer theMaxDeg = 8,
00066                                  Standard_Integer theMaxSeg =9);
00067   //Initialization of the parameters for creation of the surface by GeomPlate.
00068 
00069   Standard_EXPORT Standard_Boolean Fill();
00070   //Fill all holes detectected as free boundaries.
00071   
00072    Standard_EXPORT Standard_Boolean Fill(const TopTools_SequenceOfShape& theFillShapes);
00073   //Fill hole specified by wires or edges.
00074 
00075 
00076  private:
00077   // ---------- PRIVATE METHODS ----------
00078   
00079   Standard_Boolean prepareWires(const TopTools_SequenceOfShape& theFillShapes,
00080                                 Handle(TopTools_HSequenceOfShape)& theSeqWires);
00081 
00082   Handle(Geom_Surface) buildSurface(const TopoDS_Wire& theWire,
00083                                     Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
00084                                     Handle(TColStd_HArray1OfInteger)& theOrders,
00085                                     Handle(TColStd_HArray1OfInteger)& theSenses);
00086   
00087   Standard_Boolean addFace(const Handle(Geom_Surface)& theSurf,
00088                            const TopoDS_Wire& theWire,
00089                            const Handle(TColGeom2d_HArray1OfCurve)& theCurves2d,
00090                            const Handle(TColStd_HArray1OfInteger)& theOrders,
00091                            const Handle(TColStd_HArray1OfInteger)& theSenses);
00092 
00093   void getResShape(const TopoDS_Shape& theAddShape,
00094                    const TopTools_IndexedMapOfShape& aMapParent,
00095                    const Standard_Boolean theHasShell);
00096  private:
00097   // ---------- PRIVATE FIELDS ----------
00098 
00099   TopTools_IndexedDataMapOfShapeListOfShape myEdgeShells;
00100   
00101   TopTools_IndexedDataMapOfShapeListOfShape myEdgeComps;
00102   TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaces;
00103   Standard_Integer myNbPtsOnCur;
00104   Standard_Integer myNbIter;
00105   Standard_Integer myDegree;
00106   Standard_Real myTol2d;
00107   Standard_Real  myTol3d;
00108   Standard_Real myTolAng;
00109   Standard_Real myTolCrv;
00110   Standard_Integer  myMaxDeg;
00111   Standard_Integer myMaxSeg;
00112  public:
00113 // Declaration of CASCADE RTTI
00114 //DEFINE_STANDARD_RTTI (ShHealOper_FillHoles)
00115 };
00116 
00117 // Definition of HANDLE object using Standard_DefineHandle.hxx
00118 //DEFINE_STANDARD_HANDLE (ShHealOper_FillHoles, )
00119 
00120 
00121 #endif