/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. #ifndef ShHealOper_Sewing_HeaderFile
  25. #define ShHealOper_Sewing_HeaderFile
  26. #include <MMgt_TShared.hxx>
  27. #include <ShHealOper_Tool.hxx>
  28. #include <TopoDS_Shape.hxx>
  29. #include <TopAbs_ShapeEnum.hxx>
  30. #include <BRepBuilderAPI_Sewing.hxx>
  31. #include <TopoDS_Compound.hxx>
  32. #include <TopTools_MapOfShape.hxx>
  33. #include <TopTools_SequenceOfShape.hxx>
  34. // Class ShHealOper_Sewing
  35. //!Intended for sewing of shapes.
  36. class ShHealOper_Sewing : public ShHealOper_Tool
  37. {
  38. public:
  39. // ---------- PUBLIC METHODS ----------
  40. //! Empty constructor
  41. Standard_EXPORT ShHealOper_Sewing () : ShHealOper_Tool() {}
  42. //!Constructor for initalization by shape and tolerance.
  43. Standard_EXPORT ShHealOper_Sewing (const TopoDS_Shape& theShape,
  44. const Standard_Real theTolerance);
  45. //!Method for initalization by whole shape.
  46. Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
  47. //!Performs sewing specified whole shape.
  48. Standard_EXPORT Standard_Boolean Perform();
  49. //!Performs local sewing specified sub-shapes from whole shape.
  50. Standard_EXPORT Standard_Boolean Perform(const TopTools_SequenceOfShape& theSeqShapes);
  51. //!Set mode for sewing faces.(by default true)
  52. inline void SetFacesMode(const Standard_Boolean theFacesMode )
  53. {
  54. myFacesMode = theFacesMode;
  55. }
  56. //!Get mode for sewing of faces.
  57. inline Standard_Boolean GetFacesMode( )
  58. {
  59. return myFacesMode;
  60. }
  61. //!Set mode for sewing floating edges.(by default false)
  62. inline void SetFloatingEdgesMode(const Standard_Boolean theEdgesMode )
  63. {
  64. myEdgesMode = theEdgesMode;
  65. }
  66. //!Get mode for sewing of floating edges.
  67. inline Standard_Boolean GetFloatingEdgesMode( )
  68. {
  69. return myEdgesMode;
  70. }
  71. //!Set NonManifoldMode mode for sewing (by default false)
  72. inline void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode )
  73. {
  74. myNonManifoldMode = theNonManifoldMode;
  75. }
  76. //!Get NonManifoldMode mode for sewing.
  77. inline Standard_Boolean GetNonManifoldMode( )
  78. {
  79. return myNonManifoldMode;
  80. }
  81. //!set tolerance for sewing.
  82. inline void SetTolerance(const Standard_Real theToler)
  83. {
  84. myTolerance = theToler;
  85. }
  86. //!get tolerance set for sewing.
  87. inline Standard_Real GetTolerance()
  88. {
  89. return myTolerance;
  90. }
  91. //!set shape level (default TopAbs_FACE) for keeping modifications of the shapes.
  92. inline void SetHistoryLevel(TopAbs_ShapeEnum theHistLevel)
  93. {
  94. myHistoryLevel =theHistLevel;
  95. }
  96. //!get specified shape level for keeping history.
  97. inline TopAbs_ShapeEnum GetHistoryLevel()
  98. {
  99. return myHistoryLevel;
  100. }
  101. private:
  102. // ---------- PRIVATE METHODS ----------
  103. Standard_Boolean sewing(const TopTools_SequenceOfShape& theSeqShapes);
  104. Standard_Boolean getShells(const TopoDS_Shape& theSewShape) const;
  105. Standard_Boolean getWires(const TopoDS_Shape& theSewShape) const;
  106. Standard_Boolean getModifications(const TopoDS_Shape& theShape,
  107. const Handle(BRepBuilderAPI_Sewing)& theSewing) const;
  108. Standard_Boolean isSewed(const TopoDS_Shape& theShape) const;
  109. void deleteFreeEdges(const TopoDS_Shape& theSewShape,
  110. TopTools_MapOfShape& theMapEdges,
  111. TopoDS_Compound& theNewComp) const;
  112. private:
  113. // ---------- PRIVATE FIELDS ----------
  114. Standard_Boolean myNonManifoldMode;
  115. Standard_Boolean myEdgesMode;
  116. Standard_Boolean myFacesMode;
  117. Standard_Real myTolerance;
  118. TopAbs_ShapeEnum myHistoryLevel;
  119. public:
  120. // Declaration of CASCADE RTTI
  121. //DEFINE_STANDARD_RTTI (ShHealOper_Sewing)
  122. };
  123. // Definition of HANDLE object using Standard_DefineHandle.hxx
  124. //DEFINE_STANDARD_HANDLE (ShHealOper_Sewing, )
  125. #endif