From: isn Date: Mon, 1 Apr 2019 17:02:43 +0000 (+0300) Subject: 3D presentation for lin.interp. stream X-Git-Tag: SH_V2_2_0~99^2~26^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a7ea2f8613a246ad3c0d93676090cce942532d0;p=modules%2Fhydro.git 3D presentation for lin.interp. stream --- 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); }