X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_CalculationCase.cxx;h=509c2c5fb0bb63ffbd4ca5dd173f9d7aa5d15aa0;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=a9be2ccec3fff0d145f76a3fa25eae60711c6ff1;hpb=0e7503b63eeacb2e1ee4c9e88927485364c254b3;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index a9be2cce..509c2c5f 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -91,7 +91,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName ) } } - HYDROData_SequenceOfObjects aGroups = GetGeometryGroups(); + HYDROData_SequenceOfObjects aGroups = GetSplittedGroups(); anIter.Init( aGroups ); for ( ; anIter.More(); anIter.Next() ) @@ -527,6 +527,22 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) c return GetAltitudeForPoint( thePoint, aZone ); } +double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint, + const Handle(HYDROData_Region)& theRegion ) const +{ + double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude(); + + Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint ); + if ( !aZone.IsNull() ) + { + Handle(HYDROData_Region) aRefRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() ); + if ( IsEqual( aRefRegion, theRegion ) ) + aResAltitude = GetAltitudeForPoint( thePoint, aZone ); + } + + return aResAltitude; +} + double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint, const Handle(HYDROData_Zone)& theZone ) const { @@ -613,6 +629,23 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& return aResAltitude; } +NCollection_Sequence HYDROData_CalculationCase::GetAltitudesForPoints( + const NCollection_Sequence& thePoints, + const Handle(HYDROData_Region)& theRegion ) const +{ + NCollection_Sequence aResSeq; + + for ( int i = 1, n = thePoints.Length(); i <= n; ++i ) + { + const gp_XY& thePnt = thePoints.Value( i ); + + double anAltitude = GetAltitudeForPoint( thePnt, theRegion ); + aResSeq.Append( anAltitude ); + } + + return aResSeq; +} + NCollection_Sequence HYDROData_CalculationCase::GetAltitudesForPoints( const NCollection_Sequence& thePoints, const Handle(HYDROData_Zone)& theZone ) const @@ -630,6 +663,17 @@ NCollection_Sequence HYDROData_CalculationCase::GetAltitudesForPoints( return aResSeq; } +Handle(HYDROData_Region) HYDROData_CalculationCase::GetRegionFromPoint( const gp_XY& thePoint ) const +{ + Handle(HYDROData_Region) aResRegion; + + Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint ); + if ( !aZone.IsNull() ) + aResRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() ); + + return aResRegion; +} + Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& thePoint ) const { Handle(HYDROData_Zone) aResZone;