Salome HOME
c689a8ea27764ab9ddae412fbbd2f794df76a566
[modules/hydro.git] / src / HYDROData / HYDROData_ShapesTool.h
1
2 #ifndef HYDROData_ShapesTool_HeaderFile
3 #define HYDROData_ShapesTool_HeaderFile
4
5 #include "HYDROData.h"
6
7 #include <TopAbs_ShapeEnum.hxx>
8
9 class TopoDS_Shape;
10 class TopoDS_Vertex;
11 class TopoDS_Edge;
12 class TopTools_SequenceOfShape;
13 class TopTools_ListOfShape;
14
15 class HYDRODATA_EXPORT HYDROData_ShapesTool {
16
17 public:
18
19   /**
20    * \brief Explore the incoming shape to shapes with given type.
21    * \param theInShape object to explore
22    * \param theExpType type to explore
23    * \param theOutShapes[out] list of result shapes if any
24    */
25   static void                           ExploreShapeToShapes( const TopoDS_Shape&       theInShape,
26                                                               const TopAbs_ShapeEnum&   theExpType,
27                                                               TopTools_SequenceOfShape& theOutShapes );
28
29   /**
30    * \brief Gets the first and last vertex from shape. Shape can be an Edge or Wire.
31    * \param theInShape object to explore
32    * \param theFirstVertex[out] first shape vertex
33    * \param theLastVertex[out] last shape vertex
34    * \return true if shape is of correct type
35    */
36   static bool                           Vertices( const TopoDS_Shape& theInShape,
37                                                   TopoDS_Vertex&      theFirstVertex,
38                                                   TopoDS_Vertex&      theLastVertex,
39                                                   const bool          theIsCumOri = false );
40
41   /**
42    * \brief Compare two vertices on coordinates equation.
43    * \param theFirstVert first vertex
44    * \param theSecondVert second vertex
45    * \param theIs2D flag indicating the 2D equation (ie. z coord will be ignored)
46    * \return \c true if cooredinates of vertices is equals
47    */
48   static bool                           IsVerticesEquals( const TopoDS_Vertex& theFirstVert,
49                                                           const TopoDS_Vertex& theSecondVert,
50                                                           const bool           theIs2D = false  );
51
52   /**
53    * \brief Compare two edges on points coordinates equation.
54    * \param theFirstVert first edge
55    * \param theSecondVert second edge
56    * \param theIs2D flag indicating the 2D equation (ie. z coord will be ignored)
57    * \return \c true if coordinates of all points of given edges is equals
58    */
59   static bool                           IsEdgesEquals( const TopoDS_Edge& theFirstEdge,
60                                                        const TopoDS_Edge& theSecondEdge,
61                                                        const bool         theIs2D = false );
62
63   /**
64    * \brief Adds the sequence of shapes to other sequence.
65    * \param theShapes sequence to which the shapes will be added
66    * \param theShapesToAdd sequence from which the shapes will be extracted
67    */
68   static void                           AddShapes( TopTools_SequenceOfShape&       theShapes,
69                                                    const TopTools_SequenceOfShape& theShapesToAdd );
70
71   /**
72    * \brief Adds the list of shapes to the sequence.
73    * \param theShapes sequence to which the shapes will be added
74    * \param theShapesToAdd list from which the shapes will be extracted
75    */
76   static void                           AddShapes( TopTools_SequenceOfShape&   theShapes,
77                                                    const TopTools_ListOfShape& theShapesToAdd );
78
79   /**
80    * \brief Adds the sequence of shapes to the list.
81    * \param theShapes list to which the shapes will be added
82    * \param theShapesToAdd sequence from which the shapes will be extracted
83    */
84   static void                           AddShapes( TopTools_ListOfShape&           theShapes,
85                                                    const TopTools_SequenceOfShape& theShapesToAdd );
86
87   /**
88    * \brief Adds the list of shapes to other list.
89    * \param theShapes list to which the shapes will be added
90    * \param theShapesToAdd list from which the shapes will be extracted
91    */
92   static void                           AddShapes( TopTools_ListOfShape&       theShapes,
93                                                    const TopTools_ListOfShape& theShapesToAdd );
94 };
95
96
97 #endif
98
99