Salome HOME
22763: [EDF] Shape processing
[modules/geom.git] / src / GEOMImpl / GEOMImpl_HealingDriver.hxx
1 // Copyright (C) 2007-2014  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 //  File   : GEOMImpl_HealingDriver.hxx
23 //  Module : GEOMImpl
24
25 #ifndef _GEOMImpl_HealingDriver_HeaderFile
26 #define _GEOMImpl_HealingDriver_HeaderFile
27
28 #ifndef _TColStd_SequenceOfExtendedString_HeaderFile
29 #include <TColStd_SequenceOfExtendedString.hxx>
30 #endif
31 #ifndef _Standard_TypeMismatch_HeaderFile
32 #include <Standard_TypeMismatch.hxx>
33 #endif
34
35 #ifndef _Standard_HeaderFile
36 #include <Standard.hxx>
37 #endif
38
39 #ifndef _Standard_Macro_HeaderFile
40 #include <Standard_Macro.hxx>
41 #endif
42 #ifndef _Standard_HeaderFile
43 #include <Standard.hxx>
44 #endif
45 #ifndef _Standard_GUID_HeaderFile
46 #include <Standard_GUID.hxx>
47 #endif
48
49 #include <TopoDS_Shape.hxx>
50 #include <TopoDS_Edge.hxx>
51 #include <TColStd_HSequenceOfTransient.hxx>
52
53
54 #ifndef _TFunction_Driver_HeaderFile
55 #include <TFunction_Driver.hxx>
56 #endif
57 #ifndef _TFunction_Logbook_HeaderFile
58 #include <TFunction_Logbook.hxx>
59 #endif
60 #ifndef _Standard_CString_HeaderFile
61 #include <Standard_CString.hxx>
62 #endif
63
64 #include "GEOM_BaseDriver.hxx"
65
66 class GEOMImpl_IHealing;
67 class ShHealOper_Tool;
68 class TopTools_SequenceOfShape;
69
70
71 DEFINE_STANDARD_HANDLE( GEOMImpl_HealingDriver, GEOM_BaseDriver );
72
73 class GEOMImpl_HealingDriver : public GEOM_BaseDriver {
74
75 public:
76
77  // Methods PUBLIC
78   //
79   Standard_EXPORT GEOMImpl_HealingDriver();
80   Standard_EXPORT ~GEOMImpl_HealingDriver() {};
81
82   Standard_EXPORT static const Standard_GUID& GetID();
83
84   Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
85   Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
86   Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const { return Standard_True; }
87
88   Standard_EXPORT static Standard_Boolean AreEdgesC1 (const TopoDS_Edge& E1, const TopoDS_Edge& E2);
89   Standard_EXPORT static void FuseCollinearEdges (const TopoDS_Shape&,
90                                                   const Handle(TColStd_HSequenceOfTransient)&,
91                                                   TopoDS_Shape&);
92   Standard_EXPORT virtual
93   bool GetCreationInformation(std::string&             theOperationName,
94                               std::vector<GEOM_Param>& params);
95
96   // Type management
97   //
98 DEFINE_STANDARD_RTTI( GEOMImpl_HealingDriver )
99
100
101 private:
102   Standard_Boolean ShapeProcess  ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
103   Standard_Boolean SuppressFaces ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
104   void             SuppressFacesRec (const TopTools_SequenceOfShape& theShapesFaces,
105                                      const TopoDS_Shape&             theOriginalShape,
106                                      TopoDS_Shape&                   theOutShape) const;
107   Standard_Boolean CloseContour  ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
108   Standard_Boolean RemoveIntWires( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
109   Standard_Boolean RemoveHoles   ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
110   Standard_Boolean Sew           ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape&, Standard_Boolean ) const;
111   Standard_Boolean RemoveInternalFaces ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
112   Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
113   Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
114   void             LimitTolerance( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
115
116   void             SaveStatistics( const ShHealOper_Tool& healer, bool add=false ) const;
117 };
118
119 #endif