From e4fbd9e433a3043b135b79165d793e98353f0647 Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 13 Dec 2018 14:33:19 +0300 Subject: [PATCH] lot 13 -- asymmetric digue Signed-off-by: isn --- src/HYDROData/HYDROData_ChannelAltitude.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; -- 2.39.2