2 #ifndef HYDROData_ShapesTool_HeaderFile
3 #define HYDROData_ShapesTool_HeaderFile
7 #include <TopAbs_ShapeEnum.hxx>
12 class TopTools_SequenceOfShape;
13 class TopTools_ListOfShape;
15 class HYDRODATA_EXPORT HYDROData_ShapesTool {
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
25 static void ExploreShapeToShapes( const TopoDS_Shape& theInShape,
26 const TopAbs_ShapeEnum& theExpType,
27 TopTools_SequenceOfShape& theOutShapes );
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
36 static bool Vertices( const TopoDS_Shape& theInShape,
37 TopoDS_Vertex& theFirstVertex,
38 TopoDS_Vertex& theLastVertex,
39 const bool theIsCumOri = false );
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
48 static bool IsVerticesEquals( const TopoDS_Vertex& theFirstVert,
49 const TopoDS_Vertex& theSecondVert,
50 const bool theIs2D = false );
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
59 static bool IsEdgesEquals( const TopoDS_Edge& theFirstEdge,
60 const TopoDS_Edge& theSecondEdge,
61 const bool theIs2D = false );
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
71 static TopoDS_Shape Translated( const TopoDS_Shape& theShape,
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
81 static void AddShapes( TopTools_SequenceOfShape& theShapes,
82 const TopTools_SequenceOfShape& theShapesToAdd );
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
89 static void AddShapes( TopTools_SequenceOfShape& theShapes,
90 const TopTools_ListOfShape& theShapesToAdd );
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
97 static void AddShapes( TopTools_ListOfShape& theShapes,
98 const TopTools_SequenceOfShape& theShapesToAdd );
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
105 static void AddShapes( TopTools_ListOfShape& theShapes,
106 const TopTools_ListOfShape& theShapesToAdd );
110 * \brief Explode and dump the shape to the stream.
112 static void DumpShapeSubShapes( std::ostream& theStream,
113 const char* theTitle,
114 const TopoDS_Shape& theShape,
115 const TopAbs_ShapeEnum& theExpType );
118 * \brief Dump the shapes sequence to the stream.
120 static void DumpSequenceOfShapes( std::ostream& theStream,
121 const TopTools_SequenceOfShape& theShapes );