Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
HYDROData_SequenceOfObjects aRefProfiles = GetProfiles();
- if ( aHydAxis.IsNull() || aRefProfiles.IsEmpty() )
+ if ( aHydAxis.IsNull() || aRefProfiles.Length() < 2 )
return;
bool anIsFirst = true;
continue;
const TopoDS_Shape& aProf3d = aProfile->GetShape3D();
gp_XY aPnt1, aPnt2;
- if ( !aProfile->GetFirstPoint( aPnt1 ) || !aProfile->GetLastPoint( aPnt2 ) )
+ if ( !aProfile->GetLeftPoint( aPnt1 ) || !aProfile->GetRightPoint( aPnt2 ) )
continue;
anArrOfProfiles.SetValue(i,aProfile->GetShape3D());//aProfile->GetTopShape();
anArrOf2DProfiles.SetValue(i,aProfile->GetTopShape());
SetToUpdate( true );
}
-bool HYDROData_Stream::HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
- Standard_Real& outPar ) const
+bool HYDROData_Stream::HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis,
+ const Handle(HYDROData_Profile)& theProfile,
+ const TopoDS_Face& thePlane,
+ Standard_Real& outPar)
{
- Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
- if ( theProfile.IsNull() || aHydAxis.IsNull() )
+ if ( theProfile.IsNull() || theHydAxis.IsNull() )
return false;
- TopoDS_Wire aHydraulicWire = TopoDS::Wire( aHydAxis->GetShape() ); //guide line
+ TopoDS_Wire aHydraulicWire = TopoDS::Wire( theHydAxis->GetShape() ); //guide line
TopoDS_Wire aProfileWire = TopoDS::Wire( theProfile->GetTopShape() );
if ( aHydraulicWire.IsNull() || aProfileWire.IsNull() )
return false;
return false;
}
+bool HYDROData_Stream::HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
+ Standard_Real& outPar ) const
+{
+ Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
+
+ return HasIntersection( aHydAxis, theProfile, thePlane, outPar );
+}
+
bool HYDROData_Stream::AddProfile( const Handle(HYDROData_Profile)& theProfile )
{
if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), aParamsArray ) )
return;
+ if ( aParamsArray->Length() == 1 )
+ {
+ removeParametersArray();
+ return;
+ }
+
TColStd_Array1OfReal aNewArr( aParamsArray->Lower(), aParamsArray->Upper() - 1 );
for ( int i = aParamsArray->Lower(), j = i, k = 0, n = aParamsArray->Upper(); i <= n; ++i, ++k )