Version: 9.12.0
ShHealOper_Sewing.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, 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_Sewing.hxx
24 // Created: 29.04.04 13:29:10
25 // Author: Galina KULIKOVA
26 //
27 #ifndef ShHealOper_Sewing_HeaderFile
28 #define ShHealOper_Sewing_HeaderFile
29 
30 #include <ShHealOper_Tool.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <TopAbs_ShapeEnum.hxx>
33 #include <BRepBuilderAPI_Sewing.hxx>
34 #include <TopoDS_Compound.hxx>
35 #include <TopTools_MapOfShape.hxx>
36 #include <TopTools_SequenceOfShape.hxx>
37 
39 //Intended for sewing of shapes.
40 
42 {
43  public:
44  // ---------- PUBLIC METHODS ----------
45 
46 
47  Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
48  // Empty constructor
49 
50  Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
51  const Standard_Real theTolerance);
52  //Constructor for initialization by shape and tolerance.
53 
54  Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
55  //Method for initialization by whole shape.
56 
57  Standard_EXPORT Standard_Boolean Perform();
58  //Performs sewing specified whole shape.
59 
60  Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
61  //Performs local sewing specified sub-shapes from whole shape.
62 
63  inline void SetFacesMode(const Standard_Boolean theFacesMode )
64  {
65  myFacesMode = theFacesMode;
66  }
67  //Set mode for sewing faces.(by default true)
68 
69  inline Standard_Boolean GetFacesMode( )
70  {
71  return myFacesMode;
72  }
73  //Get mode for sewing of faces.
74 
75  inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
76  {
77  myEdgesMode = theEdgesMode;
78  }
79  //Set mode for sewing floating edges.(by default false)
80 
81  inline Standard_Boolean GetFloatingEdgesMode( )
82  {
83  return myEdgesMode;
84  }
85  //Get mode for sewing of floating edges.
86 
87  inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
88  {
89  myNonManifoldMode = theNonManifoldMode;
90  }
91  //Set NonManifoldMode mode for sewing (by default false)
92 
93  inline Standard_Boolean GetNonManifoldMode( )
94  {
95  return myNonManifoldMode;
96  }
97  //Get NonManifoldMode mode for sewing.
98 
99  inline void SetTolerance(const Standard_Real theToler)
100  {
101  myTolerance = theToler;
102  }
103  //set tolerance for sewing.
104 
105  inline Standard_Real GetTolerance()
106  {
107  return myTolerance;
108  }
109  //get tolerance set for sewing.
110 
111  inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
112  {
113  myHistoryLevel =theHistLevel;
114  }
115  //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
116 
117  inline TopAbs_ShapeEnum GetHistoryLevel()
118  {
119  return myHistoryLevel;
120  }
121  //get specified shape level for keeping history.
122 
123  private:
124  // ---------- PRIVATE METHODS ----------
125 
126  Standard_Boolean sewing(const TopTools_SequenceOfShape& theSeqShapes);
127  Standard_Boolean getShells(const TopoDS_Shape& theSewShape) const;
128  Standard_Boolean getWires(const TopoDS_Shape& theSewShape) const;
129  Standard_Boolean getModifications(const TopoDS_Shape& theShape,
130  const Handle(BRepBuilderAPI_Sewing)& theSewing) const;
131 
132  Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
133 
134  void deleteFreeEdges(const TopoDS_Shape& theSewShape,
135  TopTools_MapOfShape& theMapEdges,
136  TopoDS_Compound& theNewComp) const;
137  private:
138  // ---------- PRIVATE FIELDS ----------
139 
140  Standard_Boolean myNonManifoldMode;
141  Standard_Boolean myEdgesMode;
142  Standard_Boolean myFacesMode;
143  Standard_Real myTolerance;
144  TopAbs_ShapeEnum myHistoryLevel;
145  public:
146 // Declaration of CASCADE RTTI
147 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
148 };
149 
150 // Definition of HANDLE object using Standard_DefineHandle.hxx
151 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )
152 
153 
154 #endif
Class ShHealOper_Sewing.
Definition: ShHealOper_Sewing.hxx:42
void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode)
Definition: ShHealOper_Sewing.hxx:75
Standard_Boolean GetFloatingEdgesMode()
Definition: ShHealOper_Sewing.hxx:81
void SetFacesMode(const Standard_Boolean theFacesMode)
Definition: ShHealOper_Sewing.hxx:63
Standard_Boolean myNonManifoldMode
Definition: ShHealOper_Sewing.hxx:140
void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode)
Definition: ShHealOper_Sewing.hxx:87
Standard_Real myTolerance
Definition: ShHealOper_Sewing.hxx:143
TopAbs_ShapeEnum GetHistoryLevel()
Definition: ShHealOper_Sewing.hxx:117
Standard_Boolean GetFacesMode()
Definition: ShHealOper_Sewing.hxx:69
Standard_Boolean getWires(const TopoDS_Shape &theSewShape) const
Definition: ShHealOper_Sewing.cxx:189
Standard_Real GetTolerance()
Definition: ShHealOper_Sewing.hxx:105
Standard_Boolean myFacesMode
Definition: ShHealOper_Sewing.hxx:142
void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
Definition: ShHealOper_Sewing.hxx:111
void deleteFreeEdges(const TopoDS_Shape &theSewShape, TopTools_MapOfShape &theMapEdges, TopoDS_Compound &theNewComp) const
Definition: ShHealOper_Sewing.cxx:275
Standard_Boolean myEdgesMode
Definition: ShHealOper_Sewing.hxx:141
Standard_Boolean sewing(const TopTools_SequenceOfShape &theSeqShapes)
Definition: ShHealOper_Sewing.cxx:105
TopAbs_ShapeEnum myHistoryLevel
Definition: ShHealOper_Sewing.hxx:144
Standard_Boolean GetNonManifoldMode()
Definition: ShHealOper_Sewing.hxx:93
void SetTolerance(const Standard_Real theToler)
Definition: ShHealOper_Sewing.hxx:99
virtual Standard_EXPORT void Init(const TopoDS_Shape &theShape)
Definition: ShHealOper_Sewing.cxx:71
Standard_Boolean getModifications(const TopoDS_Shape &theShape, const Handle(BRepBuilderAPI_Sewing)&theSewing) const
Definition: ShHealOper_Sewing.cxx:240
Standard_Boolean getShells(const TopoDS_Shape &theSewShape) const
Definition: ShHealOper_Sewing.cxx:160
Standard_EXPORT ShHealOper_Sewing()
Definition: ShHealOper_Sewing.hxx:47
Standard_Boolean isSewed(const TopoDS_Shape &theShape) const
Definition: ShHealOper_Sewing.cxx:263
Standard_EXPORT Standard_Boolean Perform()
Definition: ShHealOper_Sewing.cxx:85
Definition: ShHealOper_Tool.hxx:45
Handle(ShapeBuild_ReShape) Context()
Definition: ShHealOper_Tool.hxx:85