+ TopoDS_Shape aHydraulicShape = theHydAxis->GetShape();
+ if ( aHydraulicShape.IsNull() ||
+ aHydraulicShape.ShapeType() != TopAbs_WIRE ||
+ BRep_Tool::IsClosed( aHydraulicShape ) )
+ return false; // The polyline must be a single not closed wire
+
+ return true;
+}
+
+TopoDS_Shape getShapeFromGroup( const HYDROData_SequenceOfObjects& theGroups,
+ const int theGroupId )
+{
+ TopoDS_Shape aResShape;
+ if ( theGroups.Length() != 4 )
+ return aResShape;
+
+ Handle(HYDROData_ShapesGroup) aGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( theGroups.Value( theGroupId ) );
+ if ( aGroup.IsNull() )
+ return aResShape;
+
+ TopTools_SequenceOfShape aGroupShapes;
+ aGroup->GetShapes( aGroupShapes );
+
+ if ( !aGroupShapes.IsEmpty() )
+ aResShape = aGroupShapes.First();
+
+ return aResShape;
+}
+
+TopoDS_Shape HYDROData_Stream::GetLeftShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 1 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetRightShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 2 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetInletShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 3 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetOutletShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 4 );
+}
+
+QColor HYDROData_Stream::getDefaultFillingColor() const
+{
+ return DefaultFillingColor();
+}
+
+QColor HYDROData_Stream::getDefaultBorderColor() const
+{
+ return DefaultBorderColor();
+}
+
+bool HYDROData_Stream::SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis )
+{
+ if ( !IsValidAsAxis( theAxis ) )
+ return false;
+
+ Handle(HYDROData_PolylineXY) aPrevAxis = GetHydraulicAxis();
+ if ( IsEqual( aPrevAxis, theAxis ) )
+ return true;