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

http://pythonocc.googlecode.com/ · C++ Header · 224 lines · 70 code · 46 blank · 108 comment · 1 complexity · 76ad8cd801dca482d9d20444298166aa MD5 · raw file

  1. // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
  2. //
  3. // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  4. // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  5. //
  6. // This library is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU Lesser General Public
  8. // License as published by the Free Software Foundation; either
  9. // version 2.1 of the License.
  10. //
  11. // This library is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. // Lesser General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Lesser General Public
  17. // License along with this library; if not, write to the Free Software
  18. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. //
  20. // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
  21. //
  22. #ifndef _GEOMAlgo_Tools3D_HeaderFile
  23. #define _GEOMAlgo_Tools3D_HeaderFile
  24. #ifndef _Standard_Boolean_HeaderFile
  25. #include <Standard_Boolean.hxx>
  26. #endif
  27. #ifndef _Standard_Integer_HeaderFile
  28. #include <Standard_Integer.hxx>
  29. #endif
  30. #ifndef _TopAbs_ShapeEnum_HeaderFile
  31. #include <TopAbs_ShapeEnum.hxx>
  32. #endif
  33. #ifndef _TopAbs_State_HeaderFile
  34. #include <TopAbs_State.hxx>
  35. #endif
  36. #ifndef _Standard_Real_HeaderFile
  37. #include <Standard_Real.hxx>
  38. #endif
  39. class TopoDS_Shape;
  40. class IntTools_Context;
  41. class TopoDS_Face;
  42. class TopoDS_Edge;
  43. class TopTools_ListOfShape;
  44. class TopTools_IndexedMapOfShape;
  45. class TopoDS_Solid;
  46. class gp_Pnt;
  47. class TopoDS_Vertex;
  48. class TopTools_IndexedDataMapOfShapeListOfShape;
  49. class NMTTools_ListOfCoupleOfShape;
  50. #ifndef _Standard_HeaderFile
  51. #include <Standard.hxx>
  52. #endif
  53. #ifndef _Standard_Macro_HeaderFile
  54. #include <Standard_Macro.hxx>
  55. #endif
  56. //! Auxiliary tools for Algorithms <br>
  57. class GEOMAlgo_Tools3D {
  58. public:
  59. void* operator new(size_t,void* anAddress)
  60. {
  61. return anAddress;
  62. }
  63. void* operator new(size_t size)
  64. {
  65. return Standard::Allocate(size);
  66. }
  67. void operator delete(void *anAddress)
  68. {
  69. if (anAddress) Standard::Free((Standard_Address&)anAddress);
  70. }
  71. // Methods PUBLIC
  72. //
  73. //! Returns True if the shape theSplit has opposite <br>
  74. //! direction than theShape <br>
  75. //! theContext - cashed geometrical tools <br>
  76. Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,const TopoDS_Shape& theShape,IntTools_Context& theContext) ;
  77. //! Returns True if normal direction of the face <br>
  78. //! theShape is not the same as for the face <br>
  79. //! theSplit <br>
  80. //! theContext - cashed geometrical tools <br>
  81. Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,const TopoDS_Face& theShape,IntTools_Context& theContext) ;
  82. //! Returns True if tangent direction of the edge <br>
  83. //! theEdge is not the same as for the edge <br>
  84. //! theSplit <br>
  85. //! theContext - cashed geometrical tools <br>
  86. Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theEdge,const TopoDS_Edge& theSplit,IntTools_Context& theContext) ;
  87. //! For the couple of faces theF1, theF2 <br>
  88. //! computes sense value <br>
  89. //! Returns 0 if the faces are not sensible <br>
  90. //! Returns 1 if the faces have same sense <br>
  91. //! Returns 2 if the faces have opposite sense <br>
  92. Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,const TopoDS_Face& theF2) ;
  93. //! Makes new face theF2 from surface and wires <br>
  94. //! of the face theF1 <br>
  95. Standard_EXPORT static void CopyFace(const TopoDS_Face& theF1,TopoDS_Face& theF2) ;
  96. //! Makes empty shape theShape of the type theType <br>
  97. Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS_Shape& theShape) ;
  98. //! For the list of faces theLS build block <br>
  99. //! theLSCB in terms of connexity by edges <br>
  100. //! theMapAvoid - set of edges to avoid for <br>
  101. //! the treatment <br>
  102. Standard_EXPORT static void MakeConnexityBlock(const TopTools_ListOfShape& theLS,const TopTools_IndexedMapOfShape& theMapAvoid,TopTools_ListOfShape& theLSCB) ;
  103. //! Computes the 3-D state of the shape theShape <br>
  104. //! toward solid theSolid. <br>
  105. //! theTol - value of precision of computation <br>
  106. //! theContext- cahed geometrical tools <br>
  107. //! Returns 3-D state. <br>
  108. Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
  109. //! Computes the 3-D state of the point thePoint <br>
  110. //! toward solid theSolid. <br>
  111. //! theTol - value of precision of computation <br>
  112. //! theContext- cahed geometrical tools <br>
  113. //! Returns 3-D state. <br>
  114. Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
  115. //! Computes the 3-D state of the vertex theVertex <br>
  116. //! toward solid theSolid. <br>
  117. //! theTol - value of precision of computation <br>
  118. //! theContext- cahed geometrical tools <br>
  119. //! Returns 3-D state. <br>
  120. Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
  121. //! Computes the 3-D state of the edge theEdge <br>
  122. //! toward solid theSolid. <br>
  123. //! theTol - value of precision of computation <br>
  124. //! theContext- cahed geometrical tools <br>
  125. //! Returns 3-D state. <br>
  126. Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ;
  127. //! Computes the 3-D state of the face theFace <br>
  128. //! toward solid theSolid. <br>
  129. //! theTol - value of precision of computation <br>
  130. //! theBounds - set of edges of theFace to avoid <br>
  131. //! theContext- cahed geometrical tools <br>
  132. //! Returns 3-D state. <br>
  133. Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const Standard_Real theTol,const TopTools_IndexedMapOfShape& theBounds,IntTools_Context& theContext) ;
  134. //! Returns True if the face theFace is inside of the <br>
  135. //! couple of faces theFace1, theFace2. <br>
  136. //! The faces theFace, theFace1, theFace2 must <br>
  137. //! share the edge theEdge <br>
  138. Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopoDS_Face& theFace1,const TopoDS_Face& theFace2) ;
  139. //! Returns True if the face theFace is inside of the <br>
  140. //! appropriate couple of faces (from the set theLF) . <br>
  141. //! The faces of the set theLF and theFace must <br>
  142. //! share the edge theEdge <br>
  143. Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopTools_ListOfShape& theLF) ;
  144. //! Returns True if the face theFace is inside the <br>
  145. //! solid theSolid. <br>
  146. //! theMEF - Map Edge/Faces for theSolid <br>
  147. //! theTol - value of precision of computation <br>
  148. //! theContext- cahed geometrical tools <br>
  149. Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,const Standard_Real theTol,IntTools_Context& theContext) ;
  150. //! For the face theFace and its edge theEdge <br>
  151. //! finds the face suitable to produce shell. <br>
  152. //! theLCEF - set of faces to search. All faces <br>
  153. //! from theLCEF must share edge theEdge <br>
  154. Standard_EXPORT static void GetFaceOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,const NMTTools_ListOfCoupleOfShape& theLCEF,TopoDS_Face& theFaceOff) ;
  155. //! For the face theFace gets the edge theEdgeOnF <br>
  156. //! that is the same as theEdge <br>
  157. //! Returns True if such edge exists <br>
  158. //! Returns False if there is no such edge <br>
  159. Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOnF) ;
  160. //! Returns True if the face theFace contains <br>
  161. //! the edge theEdge but with opposite orientation. <br>
  162. //! If the method returns True theEdgeOff is the <br>
  163. //! edge founded <br>
  164. Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOff) ;
  165. protected:
  166. // Methods PROTECTED
  167. //
  168. // Fields PROTECTED
  169. //
  170. private:
  171. // Methods PRIVATE
  172. //
  173. // Fields PRIVATE
  174. //
  175. };
  176. // other Inline functions and methods (like "C++: function call" methods)
  177. //
  178. #endif