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
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.
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.
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
24 #ifndef ShHealOper_Sewing_HeaderFile
25 #define ShHealOper_Sewing_HeaderFile
27 #include <MMgt_TShared.hxx>
28 #include <ShHealOper_Tool.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopAbs_ShapeEnum.hxx>
31 #include <Standard_Version.hxx>
32 #ifdef OCC_VERSION_MAINTENANCE
33 #if (OCC_VERSION_MAJOR >= 5 && OCC_VERSION_MINOR >= 2 && OCC_VERSION_MAINTENANCE >= 4) || (OCC_VERSION_MAJOR >= 6)
34 #include <BRepBuilderAPI_Sewing.hxx>
37 #include <BRepAlgo_Sewing.hxx>
40 #include <BRepAlgo_Sewing.hxx>
43 #include <TopoDS_Compound.hxx>
44 #include <TopTools_MapOfShape.hxx>
45 #include <TopTools_SequenceOfShape.hxx>
47 /// Class ShHealOper_Sewing
48 //Intended for sewing of shapes.
50 class ShHealOper_Sewing : public ShHealOper_Tool
53 // ---------- PUBLIC METHODS ----------
56 Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
59 Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
60 const Standard_Real theTolerance);
61 //Constructor for initalization by shape and tolerance.
63 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
64 //Method for initalization by whole shape.
66 Standard_EXPORT Standard_Boolean Perform();
67 //Performs sewing specified whole shape.
69 Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
70 //Performs local sewing specified sub-shapes from whole shape.
72 inline void SetFacesMode(const Standard_Boolean theFacesMode )
74 myFacesMode = theFacesMode;
76 //Set mode for sewing faces.(by default true)
78 inline Standard_Boolean GetFacesMode( )
82 //Get mode for sewing of faces.
84 inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
86 myEdgesMode = theEdgesMode;
88 //Set mode for sewing floating edges.(by default false)
90 inline Standard_Boolean GetFloatingEdgesMode( )
94 //Get mode for sewing of floating edges.
96 inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
98 myNonManifoldMode = theNonManifoldMode;
100 //Set NonManifoldMode mode for sewing (by default false)
102 inline Standard_Boolean GetNonManifoldMode( )
104 return myNonManifoldMode;
106 //Get NonManifoldMode mode for sewing.
108 inline void SetTolerance(const Standard_Real theToler)
110 myTolerance = theToler;
112 //set tolerance for sewing.
114 inline Standard_Real GetTolerance()
118 //get tolerance set for sewing.
120 inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
122 myHistoryLevel =theHistLevel;
124 //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
126 inline TopAbs_ShapeEnum GetHistoryLevel()
128 return myHistoryLevel;
130 //get specified shape level for keeping history.
133 // ---------- PRIVATE METHODS ----------
135 Standard_Boolean sewing(const TopTools_SequenceOfShape& theSeqShapes);
136 Standard_Boolean getShells(const TopoDS_Shape& theSewShape) const;
137 Standard_Boolean getWires(const TopoDS_Shape& theSewShape) const;
138 Standard_Boolean getModifications(const TopoDS_Shape& theShape,
140 const Handle(BRepBuilderAPI_Sewing)&
142 const Handle(BRepAlgo_Sewing)&
146 Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
148 void deleteFreeEdges(const TopoDS_Shape& theSewShape,
149 TopTools_MapOfShape& theMapEdges,
150 TopoDS_Compound& theNewComp) const;
152 // ---------- PRIVATE FIELDS ----------
154 Standard_Boolean myNonManifoldMode;
155 Standard_Boolean myEdgesMode;
156 Standard_Boolean myFacesMode;
157 Standard_Real myTolerance;
158 TopAbs_ShapeEnum myHistoryLevel;
160 // Declaration of CASCADE RTTI
161 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
164 // Definition of HANDLE object using Standard_DefineHandle.hxx
165 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )