1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File: ShHealOper_Sewing.hxx
22 // Created: 29.04.04 13:29:10
23 // Author: Galina KULIKOVA
26 #ifndef ShHealOper_Sewing_HeaderFile
27 #define ShHealOper_Sewing_HeaderFile
29 #include <MMgt_TShared.hxx>
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>
38 /// Class ShHealOper_Sewing
39 //Intended for sewing of shapes.
41 class ShHealOper_Sewing : public ShHealOper_Tool
44 // ---------- PUBLIC METHODS ----------
47 Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
50 Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
51 const Standard_Real theTolerance);
52 //Constructor for initalization by shape and tolerance.
54 Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
55 //Method for initalization by whole shape.
57 Standard_EXPORT Standard_Boolean Perform();
58 //Performs sewing specified whole shape.
60 Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
61 //Performs local sewing specified sub-shapes from whole shape.
63 inline void SetFacesMode(const Standard_Boolean theFacesMode )
65 myFacesMode = theFacesMode;
67 //Set mode for sewing faces.(by default true)
69 inline Standard_Boolean GetFacesMode( )
73 //Get mode for sewing of faces.
75 inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
77 myEdgesMode = theEdgesMode;
79 //Set mode for sewing floating edges.(by default false)
81 inline Standard_Boolean GetFloatingEdgesMode( )
85 //Get mode for sewing of floating edges.
87 inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
89 myNonManifoldMode = theNonManifoldMode;
91 //Set NonManifoldMode mode for sewing (by default false)
93 inline Standard_Boolean GetNonManifoldMode( )
95 return myNonManifoldMode;
97 //Get NonManifoldMode mode for sewing.
99 inline void SetTolerance(const Standard_Real theToler)
101 myTolerance = theToler;
103 //set tolerance for sewing.
105 inline Standard_Real GetTolerance()
109 //get tolerance set for sewing.
111 inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
113 myHistoryLevel =theHistLevel;
115 //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
117 inline TopAbs_ShapeEnum GetHistoryLevel()
119 return myHistoryLevel;
121 //get specified shape level for keeping history.
124 // ---------- PRIVATE METHODS ----------
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;
132 Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
134 void deleteFreeEdges(const TopoDS_Shape& theSewShape,
135 TopTools_MapOfShape& theMapEdges,
136 TopoDS_Compound& theNewComp) const;
138 // ---------- PRIVATE FIELDS ----------
140 Standard_Boolean myNonManifoldMode;
141 Standard_Boolean myEdgesMode;
142 Standard_Boolean myFacesMode;
143 Standard_Real myTolerance;
144 TopAbs_ShapeEnum myHistoryLevel;
146 // Declaration of CASCADE RTTI
147 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
150 // Definition of HANDLE object using Standard_DefineHandle.hxx
151 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )