X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_ImmersibleZone.cxx;h=e35a1f17329e979055cfc591572cf4c200a839fb;hb=e75504ed446bb0bd2f5bf5649c787fe61adc9710;hp=05a468239cb007a32774d55c2f1cb83ba5eb5df1;hpb=90d1e986c0e567fe8892f11e0532ec6cf40a5b8b;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 05a46823..e35a1f17 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -3,7 +3,7 @@ #include "HYDROData_Bathymetry.h" #include "HYDROData_Document.h" -#include "HYDROData_Polyline.h" +#include "HYDROData_PolylineXY.h" #include @@ -67,7 +67,7 @@ QStringList HYDROData_ImmersibleZone::DumpToPython( MapOfTreatedObjects& theTrea Handle(HYDROData_Bathymetry) aRefBathymetry = GetBathymetry(); setPythonReferenceObject( theTreatedObjects, aResList, aRefBathymetry, "SetBathymetry" ); - Handle(HYDROData_Polyline) aRefPolyline = GetPolyline(); + Handle(HYDROData_PolylineXY) aRefPolyline = GetPolyline(); setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolyline" ); return aResList; @@ -77,14 +77,14 @@ TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const { TopoDS_Shape aResShape = TopoDS_Face(); - Handle(HYDROData_Polyline) aPolyline = GetPolyline(); + Handle(HYDROData_PolylineXY) aPolyline = GetPolyline(); if( !aPolyline.IsNull() ) { - TopoDS_Shape aPolylineShape = aPolyline->GetTopShape(); + TopoDS_Shape aPolylineShape = aPolyline->GetShape(); TopTools_ListOfShape aWiresList; - TopExp_Explorer anExp( aPolylineShape, TopAbs_WIRE ); - if ( !anExp.More() ) { + if ( !aPolylineShape.IsNull() && + aPolylineShape.ShapeType() == TopAbs_WIRE ) { TopoDS_Wire aPolylineWire = TopoDS::Wire( aPolylineShape ); if ( !aPolylineWire.IsNull() ) { BRepBuilderAPI_MakeFace aMakeFace( aPolylineWire, Standard_True ); @@ -94,6 +94,7 @@ TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const } } } else { + TopExp_Explorer anExp( aPolylineShape, TopAbs_WIRE ); for ( ; anExp.More(); anExp.Next() ) { TopoDS_Wire aWire = TopoDS::Wire( anExp.Current() ); aWiresList.Append( aWire ); @@ -140,14 +141,14 @@ QColor HYDROData_ImmersibleZone::DefaultBorderColor() return QColor( Qt::transparent ); } -void HYDROData_ImmersibleZone::SetPolyline( const Handle(HYDROData_Polyline)& thePolyline ) +void HYDROData_ImmersibleZone::SetPolyline( const Handle(HYDROData_PolylineXY)& thePolyline ) { SetReferenceObject( thePolyline, DataTag_Polyline ); } -Handle(HYDROData_Polyline) HYDROData_ImmersibleZone::GetPolyline() const +Handle(HYDROData_PolylineXY) HYDROData_ImmersibleZone::GetPolyline() const { - return Handle(HYDROData_Polyline)::DownCast( + return Handle(HYDROData_PolylineXY)::DownCast( GetReferenceObject( DataTag_Polyline ) ); }