]> SALOME platform Git repositories - modules/geom.git/blob - src/ShHealOper/ShHealOper_Sewing.hxx
Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/geom.git] / src / ShHealOper / ShHealOper_Sewing.hxx
1 // File:      ShHealOper_Sewing.hxx
2 // Created:   29.04.04 13:29:10
3 // Author:    Galina KULIKOVA
4 //  < MODULE = KERNEL> <PACKAGE = ShHealOper> : <Shape Healing Operations>
5 //  Copyright (C) 2003  CEA
6 //
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.
11 //
12
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.
17 //
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
21 //
22
23
24 #ifndef ShHealOper_Sewing_HeaderFile
25 #define ShHealOper_Sewing_HeaderFile
26
27 #include <MMgt_TShared.hxx>
28 #include <ShHealOper_Tool.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopAbs_ShapeEnum.hxx>
31 #include <BRepAlgo_Sewing.hxx>
32 #include <TopoDS_Compound.hxx>
33 #include <TopTools_MapOfShape.hxx>
34 #include <TopTools_SequenceOfShape.hxx>
35
36 ///  Class ShHealOper_Sewing
37 //Intended for sewing of shapes.
38
39 class ShHealOper_Sewing : public ShHealOper_Tool
40 {
41  public:
42   // ---------- PUBLIC METHODS ----------
43
44   
45   Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
46   // Empty constructor
47   
48   Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
49                                      const Standard_Real theTolerance);
50   //Constructor for initalization by shape and tolerance.
51
52   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
53    //Method for initalization by whole shape.
54   
55   Standard_EXPORT Standard_Boolean Perform();
56   //Performs sewing specified whole shape.
57
58   Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
59   //Performs local sewing specified sub-shapes from whole shape.
60   
61   inline void SetFacesMode(const Standard_Boolean theFacesMode )
62   {
63     myFacesMode = theFacesMode;
64   }
65   //Set mode for sewing faces.(by default true)
66
67   inline Standard_Boolean GetFacesMode( )
68   {
69     return myFacesMode;
70   }
71   //Get mode for sewing of faces.
72   
73    inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
74   {
75     myEdgesMode = theEdgesMode;
76   }
77   //Set mode for sewing floating edges.(by default false)
78
79   inline Standard_Boolean GetFloatingEdgesMode( )
80   {
81     return myEdgesMode;
82   }
83   //Get mode for sewing of floating edges.
84
85   inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
86   {
87     myNonManifoldMode = theNonManifoldMode;
88   }
89   //Set NonManifoldMode mode  for sewing (by default false)
90
91   inline Standard_Boolean GetNonManifoldMode( )
92   {
93     return myNonManifoldMode;
94   }
95   //Get NonManifoldMode mode for sewing.
96   
97   inline void SetTolerance(const Standard_Real theToler)
98   {
99     myTolerance = theToler;
100   }
101   //set tolerance for sewing.
102
103   inline Standard_Real GetTolerance()
104   {
105     return myTolerance;
106   }
107   //get tolerance set for sewing.
108
109   inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
110   {
111     myHistoryLevel =theHistLevel;
112   }
113   //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
114   
115   inline TopAbs_ShapeEnum GetHistoryLevel()
116   {
117     return myHistoryLevel;
118   }
119   //get specified shape level for keeping history.
120
121  private:
122   // ---------- PRIVATE METHODS ----------
123   
124   Standard_Boolean sewing(const TopTools_SequenceOfShape& theSeqShapes);
125   Standard_Boolean getShells(const TopoDS_Shape& theSewShape) const;
126   Standard_Boolean getWires(const TopoDS_Shape& theSewShape) const;
127   Standard_Boolean getModifications(const TopoDS_Shape& theShape,
128                                     const Handle(BRepAlgo_Sewing)& theSewing) const;
129   
130   Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
131
132   void deleteFreeEdges(const TopoDS_Shape& theSewShape, 
133                        TopTools_MapOfShape& theMapEdges,
134                        TopoDS_Compound& theNewComp) const;
135  private:
136   // ---------- PRIVATE FIELDS ----------
137
138   Standard_Boolean myNonManifoldMode;
139   Standard_Boolean myEdgesMode;
140   Standard_Boolean myFacesMode;
141   Standard_Real myTolerance;
142   TopAbs_ShapeEnum myHistoryLevel;
143  public:
144 // Declaration of CASCADE RTTI
145 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
146 };
147
148 // Definition of HANDLE object using Standard_DefineHandle.hxx
149 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )
150
151
152 #endif