Salome HOME
29.01.2014. Workaround eliminating.
[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 Translate the shape to the given distance.
65    * \param theShape shape to translate
66    * \param theDx X vector component
67    * \param theDy Y vector component
68    * \param theDz Z vector component
69    * \return result translated shape
70    */
71   static TopoDS_Shape                   Translated( const TopoDS_Shape& theShape,
72                                                     const double        theDx,
73                                                     const double        theDy,
74                                                     const double        theDz );
75
76   /**
77    * \brief Adds the sequence of shapes to other sequence.
78    * \param theShapes sequence to which the shapes will be added
79    * \param theShapesToAdd sequence from which the shapes will be extracted
80    */
81   static void                           AddShapes( TopTools_SequenceOfShape&       theShapes,
82                                                    const TopTools_SequenceOfShape& theShapesToAdd );
83
84   /**
85    * \brief Adds the list of shapes to the sequence.
86    * \param theShapes sequence to which the shapes will be added
87    * \param theShapesToAdd list from which the shapes will be extracted
88    */
89   static void                           AddShapes( TopTools_SequenceOfShape&   theShapes,
90                                                    const TopTools_ListOfShape& theShapesToAdd );
91
92   /**
93    * \brief Adds the sequence of shapes to the list.
94    * \param theShapes list to which the shapes will be added
95    * \param theShapesToAdd sequence from which the shapes will be extracted
96    */
97   static void                           AddShapes( TopTools_ListOfShape&           theShapes,
98                                                    const TopTools_SequenceOfShape& theShapesToAdd );
99
100   /**
101    * \brief Adds the list of shapes to other list.
102    * \param theShapes list to which the shapes will be added
103    * \param theShapesToAdd list from which the shapes will be extracted
104    */
105   static void                           AddShapes( TopTools_ListOfShape&       theShapes,
106                                                    const TopTools_ListOfShape& theShapesToAdd );
107
108
109   /**
110    * \brief Explode and dump the shape to the stream.
111    */
112   static void                           DumpShapeSubShapes( std::ostream&           theStream,
113                                                             const char*             theTitle,
114                                                             const TopoDS_Shape&     theShape,
115                                                             const TopAbs_ShapeEnum& theExpType );
116
117   /**
118    * \brief Dump the shapes sequence to the stream.
119    */
120   static void                           DumpSequenceOfShapes( std::ostream&                   theStream,
121                                                               const TopTools_SequenceOfShape& theShapes );
122 };
123
124
125 #endif
126
127