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 <BRepAlgo_Sewing.hxx>
32 #include <TopoDS_Compound.hxx>
33 #include <TopTools_MapOfShape.hxx>
34 #include <TopTools_SequenceOfShape.hxx>
36 /// Class ShHealOper_Sewing
37 //Intended for sewing of shapes.
39 class ShHealOper_Sewing : public ShHealOper_Tool
42 // ---------- PUBLIC METHODS ----------
45 Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
48 Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
49 const Standard_Real theTolerance);
50 //Constructor for initalization by shape and tolerance.
52 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
53 //Method for initalization by whole shape.
55 Standard_EXPORT Standard_Boolean Perform();
56 //Performs sewing specified whole shape.
58 Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
59 //Performs local sewing specified sub-shapes from whole shape.
61 inline void SetFacesMode(const Standard_Boolean theFacesMode )
63 myFacesMode = theFacesMode;
65 //Set mode for sewing faces.(by default true)
67 inline Standard_Boolean GetFacesMode( )
71 //Get mode for sewing of faces.
73 inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
75 myEdgesMode = theEdgesMode;
77 //Set mode for sewing floating edges.(by default false)
79 inline Standard_Boolean GetFloatingEdgesMode( )
83 //Get mode for sewing of floating edges.
85 inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
87 myNonManifoldMode = theNonManifoldMode;
89 //Set NonManifoldMode mode for sewing (by default false)
91 inline Standard_Boolean GetNonManifoldMode( )
93 return myNonManifoldMode;
95 //Get NonManifoldMode mode for sewing.
97 inline void SetTolerance(const Standard_Real theToler)
99 myTolerance = theToler;
101 //set tolerance for sewing.
103 inline Standard_Real GetTolerance()
107 //get tolerance set for sewing.
109 inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
111 myHistoryLevel =theHistLevel;
113 //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
115 inline TopAbs_ShapeEnum GetHistoryLevel()
117 return myHistoryLevel;
119 //get specified shape level for keeping history.
122 // ---------- PRIVATE METHODS ----------
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;
130 Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
132 void deleteFreeEdges(const TopoDS_Shape& theSewShape,
133 TopTools_MapOfShape& theMapEdges,
134 TopoDS_Compound& theNewComp) const;
136 // ---------- PRIVATE FIELDS ----------
138 Standard_Boolean myNonManifoldMode;
139 Standard_Boolean myEdgesMode;
140 Standard_Boolean myFacesMode;
141 Standard_Real myTolerance;
142 TopAbs_ShapeEnum myHistoryLevel;
144 // Declaration of CASCADE RTTI
145 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
148 // Definition of HANDLE object using Standard_DefineHandle.hxx
149 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )