From: isn Date: Thu, 13 Dec 2018 11:33:19 +0000 (+0300) Subject: lot 13 -- asymmetric digue X-Git-Tag: SH_V2_2_0~99^2~42^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4fbd9e433a3043b135b79165d793e98353f0647;p=modules%2Fhydro.git lot 13 -- asymmetric digue Signed-off-by: isn --- diff --git a/src/HYDROData/HYDROData_ChannelAltitude.cxx b/src/HYDROData/HYDROData_ChannelAltitude.cxx index b848733c..3714ac6d 100644 --- a/src/HYDROData/HYDROData_ChannelAltitude.cxx +++ b/src/HYDROData/HYDROData_ChannelAltitude.cxx @@ -116,6 +116,10 @@ double HYDROData_ChannelAltitude::GetAltitudeForPoint( const gp_XY& thePoint, // --- See GEOMImpl_ProjectionDriver.cxx + gp_XY LP, RP; + aProfile->GetLeftPoint(LP); + aProfile->GetRightPoint(RP); + TopoDS_Shape aShape = aGuideXY->GetShape(); gp_Pnt P1(thePoint.X(), thePoint.Y(), 0); TopoDS_Shape aPoint = BRepBuilderAPI_MakeVertex(P1).Shape(); @@ -276,6 +280,14 @@ double HYDROData_ChannelAltitude::GetAltitudeForPoint( const gp_XY& thePoint, double distance = aProjXY.Modulus(); //DEBTRACE("distance to guideline " << distance); + gp_Vec2d aProjDir = aProjXY; + gp_Vec2d aProfileDir(LP, RP); + double aSign = 1.0; + if( aProfileDir.Dot(aProjDir) < 0 ) + aSign = -1.0; + + distance *= aSign; + // get delta altitude on section (supposed symmetric) from guideline distance (aParam) double delta = 0; int i1 = 0;