PageRenderTime 32ms CodeModel.GetById 11ms app.highlight 16ms RepoModel.GetById 1ms app.codeStats 0ms

/src/contrib/geom-5.1.2.7/inc_pythonocc/ShHealOper_Sewing.hxx

http://pythonocc.googlecode.com/
C++ Header | 154 lines | 78 code | 29 blank | 47 comment | 0 complexity | 8146156f08c31d562615b2b0ddde5978 MD5 | raw file
  1// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  2// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  3// 
  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.
  8// 
  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.
 13//
 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
 17//
 18// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 19//
 20//
 21// File:      ShHealOper_Sewing.hxx
 22// Created:   29.04.04 13:29:10
 23// Author:    Galina KULIKOVA
 24
 25
 26#ifndef ShHealOper_Sewing_HeaderFile
 27#define ShHealOper_Sewing_HeaderFile
 28
 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>
 37
 38//  Class ShHealOper_Sewing
 39
 40//!Intended for sewing of shapes.
 41class ShHealOper_Sewing : public ShHealOper_Tool
 42{
 43 public:
 44  // ---------- PUBLIC METHODS ----------
 45
 46  //! Empty constructor
 47  Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
 48  
 49  //!Constructor for initalization by shape and tolerance.
 50  Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
 51                                     const Standard_Real theTolerance);
 52  
 53  //!Method for initalization by whole shape.
 54  Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
 55   
 56  //!Performs sewing specified whole shape.
 57  Standard_EXPORT Standard_Boolean Perform();
 58
 59  //!Performs local sewing specified sub-shapes from whole shape.
 60  Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
 61  
 62  //!Set mode for sewing faces.(by default true)
 63  inline void SetFacesMode(const Standard_Boolean theFacesMode )
 64  {
 65	myFacesMode = theFacesMode;
 66  }
 67  
 68  //!Get mode for sewing of faces.
 69  inline Standard_Boolean GetFacesMode( )
 70  {
 71	return myFacesMode;
 72  }
 73
 74   //!Set mode for sewing floating edges.(by default false)
 75   inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
 76  {
 77	myEdgesMode = theEdgesMode;
 78  }
 79  
 80  //!Get mode for sewing of floating edges.
 81  inline Standard_Boolean GetFloatingEdgesMode( )
 82  {
 83	return myEdgesMode;
 84  }
 85  
 86  //!Set NonManifoldMode mode  for sewing (by default false)
 87  inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
 88  {
 89	myNonManifoldMode = theNonManifoldMode;
 90  }
 91  
 92  //!Get NonManifoldMode mode for sewing.
 93  inline Standard_Boolean GetNonManifoldMode( )
 94  {
 95	return myNonManifoldMode;
 96  }
 97  
 98  //!set tolerance for sewing.
 99  inline void SetTolerance(const Standard_Real theToler)
100  {
101	myTolerance = theToler;
102  }
103  
104  //!get tolerance set for sewing.
105  inline Standard_Real GetTolerance()
106  {
107	return myTolerance;
108  }
109  
110  //!set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
111  inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
112  {
113	myHistoryLevel =theHistLevel;
114  }
115  
116  //!get specified shape level for keeping history.
117  inline TopAbs_ShapeEnum GetHistoryLevel()
118  {
119	return myHistoryLevel;
120  }
121  
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