Back to index

salome-geom  6.5.0
ShHealOper_Sewing.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:      ShHealOper_Sewing.hxx
00024 // Created:   29.04.04 13:29:10
00025 // Author:    Galina KULIKOVA
00026 //
00027 #ifndef ShHealOper_Sewing_HeaderFile
00028 #define ShHealOper_Sewing_HeaderFile
00029 
00030 #include <MMgt_TShared.hxx>
00031 #include <ShHealOper_Tool.hxx>
00032 #include <TopoDS_Shape.hxx>
00033 #include <TopAbs_ShapeEnum.hxx>
00034 #include <BRepBuilderAPI_Sewing.hxx>
00035 #include <TopoDS_Compound.hxx>
00036 #include <TopTools_MapOfShape.hxx>
00037 #include <TopTools_SequenceOfShape.hxx>
00038 
00040 //Intended for sewing of shapes.
00041 
00042 class ShHealOper_Sewing : public ShHealOper_Tool
00043 {
00044  public:
00045   // ---------- PUBLIC METHODS ----------
00046 
00047   
00048   Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
00049   // Empty constructor
00050   
00051   Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
00052                                      const Standard_Real theTolerance);
00053   //Constructor for initalization by shape and tolerance.
00054 
00055   Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
00056    //Method for initalization by whole shape.
00057   
00058   Standard_EXPORT Standard_Boolean Perform();
00059   //Performs sewing specified whole shape.
00060 
00061   Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
00062   //Performs local sewing specified sub-shapes from whole shape.
00063   
00064   inline void SetFacesMode(const Standard_Boolean theFacesMode )
00065   {
00066     myFacesMode = theFacesMode;
00067   }
00068   //Set mode for sewing faces.(by default true)
00069 
00070   inline Standard_Boolean GetFacesMode( )
00071   {
00072     return myFacesMode;
00073   }
00074   //Get mode for sewing of faces.
00075   
00076    inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
00077   {
00078     myEdgesMode = theEdgesMode;
00079   }
00080   //Set mode for sewing floating edges.(by default false)
00081 
00082   inline Standard_Boolean GetFloatingEdgesMode( )
00083   {
00084     return myEdgesMode;
00085   }
00086   //Get mode for sewing of floating edges.
00087 
00088   inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
00089   {
00090     myNonManifoldMode = theNonManifoldMode;
00091   }
00092   //Set NonManifoldMode mode  for sewing (by default false)
00093 
00094   inline Standard_Boolean GetNonManifoldMode( )
00095   {
00096     return myNonManifoldMode;
00097   }
00098   //Get NonManifoldMode mode for sewing.
00099   
00100   inline void SetTolerance(const Standard_Real theToler)
00101   {
00102     myTolerance = theToler;
00103   }
00104   //set tolerance for sewing.
00105 
00106   inline Standard_Real GetTolerance()
00107   {
00108     return myTolerance;
00109   }
00110   //get tolerance set for sewing.
00111 
00112   inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
00113   {
00114     myHistoryLevel =theHistLevel;
00115   }
00116   //set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
00117   
00118   inline TopAbs_ShapeEnum GetHistoryLevel()
00119   {
00120     return myHistoryLevel;
00121   }
00122   //get specified shape level for keeping history.
00123 
00124  private:
00125   // ---------- PRIVATE METHODS ----------
00126   
00127   Standard_Boolean sewing(const TopTools_SequenceOfShape& theSeqShapes);
00128   Standard_Boolean getShells(const TopoDS_Shape& theSewShape) const;
00129   Standard_Boolean getWires(const TopoDS_Shape& theSewShape) const;
00130   Standard_Boolean getModifications(const TopoDS_Shape& theShape,
00131                                     const Handle(BRepBuilderAPI_Sewing)& theSewing) const;
00132   
00133   Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
00134 
00135   void deleteFreeEdges(const TopoDS_Shape& theSewShape, 
00136                        TopTools_MapOfShape& theMapEdges,
00137                        TopoDS_Compound& theNewComp) const;
00138  private:
00139   // ---------- PRIVATE FIELDS ----------
00140 
00141   Standard_Boolean myNonManifoldMode;
00142   Standard_Boolean myEdgesMode;
00143   Standard_Boolean myFacesMode;
00144   Standard_Real myTolerance;
00145   TopAbs_ShapeEnum myHistoryLevel;
00146  public:
00147 // Declaration of CASCADE RTTI
00148 //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
00149 };
00150 
00151 // Definition of HANDLE object using Standard_DefineHandle.hxx
00152 //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )
00153 
00154 
00155 #endif