2 #include "HYDROData_ShapesTool.h"
4 #include <BRep_Tool.hxx>
8 #include <Precision.hxx>
12 #include <TopoDS_Shape.hxx>
13 #include <TopoDS_Vertex.hxx>
15 #include <TopTools_SequenceOfShape.hxx>
17 #include <TopExp_Explorer.hxx>
19 void HYDROData_ShapesTool::ExploreShapeToShapes( const TopoDS_Shape& theInShape,
20 const TopAbs_ShapeEnum& theExpType,
21 TopTools_SequenceOfShape& theOutShapes )
25 if ( theInShape.IsNull() )
28 TopExp_Explorer anExp( theInShape, theExpType );
29 for ( ; anExp.More(); anExp.Next() )
31 TopoDS_Shape anExpShape = anExp.Current();
32 theOutShapes.Append( anExpShape );
36 bool HYDROData_ShapesTool::IsVerticesEquals( const TopoDS_Vertex& theFirstVert,
37 const TopoDS_Vertex& theSecondVert )
39 gp_Pnt aFirstPoint = BRep_Tool::Pnt( theFirstVert );
40 gp_Pnt aSecondPoint = BRep_Tool::Pnt( theSecondVert );
41 return aFirstPoint.IsEqual( aSecondPoint, Precision::Confusion() );
44 bool HYDROData_ShapesTool::IsEdgesEquals( const TopoDS_Edge& theFirstEdge,
45 const TopoDS_Edge& theSecondEdge )
47 TopoDS_Vertex aFFirstVert, aFLastVert, aSFirstVert, aSLastVert;
48 TopExp::Vertices( theFirstEdge, aFFirstVert, aFLastVert );
49 TopExp::Vertices( theSecondEdge, aSFirstVert, aSLastVert );
50 return IsVerticesEquals( aFFirstVert, aSFirstVert ) &&
51 IsVerticesEquals( aFLastVert, aSLastVert );