From 8a7ea2f8613a246ad3c0d93676090cce942532d0 Mon Sep 17 00:00:00 2001 From: isn Date: Mon, 1 Apr 2019 20:02:43 +0300 Subject: [PATCH] 3D presentation for lin.interp. stream --- .../HYDROData_StreamLinearInterpolation.cxx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/HYDROData/HYDROData_StreamLinearInterpolation.cxx b/src/HYDROData/HYDROData_StreamLinearInterpolation.cxx index b731c088..6c701618 100644 --- a/src/HYDROData/HYDROData_StreamLinearInterpolation.cxx +++ b/src/HYDROData/HYDROData_StreamLinearInterpolation.cxx @@ -54,6 +54,9 @@ #include #include #include +#include +#include +#include static std::vector GetProfileUZPoints(const Handle(HYDROData_Profile)& theProfile) { @@ -487,6 +490,14 @@ void HYDROData_StreamLinearInterpolation::Perform(const HYDROData_SequenceOfObje InsertPoints(profilesPoints[i], nbPointsToInsert); } + TopoDS_Compound cmp2d; + if ( buildPresentationShapes) + { + BRep_Builder().MakeCompound(cmp2d); + BRep_Builder().Add(cmp2d, prsDef.myLeftBank); + BRep_Builder().Add(cmp2d, prsDef.myRightBank); + } + for (int i=0;i& prof1 = profilesPoints[i]; @@ -543,8 +554,26 @@ void HYDROData_StreamLinearInterpolation::Perform(const HYDROData_SequenceOfObje HYDROData_Bathymetry::AltitudePoint AP(profile_points3d(k).X(), profile_points3d(k).Y(), profile_points3d(k).Z()); outBathypoints.push_back(AP); } + if (buildPresentationShapes) + { + if (m==0 || i == profilesPoints.size()-2 && param == indToParam.rbegin()->second) //if last prof1/prof2 segment => take a last profile too + { + BRepLib_MakePolygon PM; + for (int k=1;k<=profile_points3d.Length();k++) + PM.Add(gp_Pnt(profile_points3d(k))); + if (PM.IsDone()) + { + const TopoDS_Wire& resW = PM.Wire(); + BRep_Builder().Add(cmp2d, resW); + } + } + } } } + if (buildPresentationShapes) + { + prsDef.myPrs3D = cmp2d; + } //outBathy->SetAltitudePoints(bathypoints); } -- 2.39.2