]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_StreamLinearInterpolation.cxx
Salome HOME
lot 11 : another way to build 2d-face based on intermediate profiles only + additiona...
[modules/hydro.git] / src / HYDROData / HYDROData_StreamLinearInterpolation.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "HYDROData_StreamLinearInterpolation.h"
24 #include <HYDROData_Profile.h>
25 #include <HYDROData_ProfileUZ.h>
26
27 #include <gp_Lin2d.hxx>
28 #include <BRepAdaptor_Curve.hxx>
29 #include <HYDROData_ShapesTool.h>
30 #include <GCPnts_UniformAbscissa.hxx>
31 #include <Geom2dAPI_InterCurveCurve.hxx>
32 #include <Geom2d_Line.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TopoDS.hxx>
35 #include <HYDROData_Tool.h>
36 #include <GCE2d_MakeLine.hxx>
37 #include <TopoDS_Iterator.hxx>
38 #include <TopExp_Explorer.hxx>
39 #include <BRepAlgo.hxx>
40 #include <Geom2dAdaptor_Curve.hxx>
41 #include <assert.h>
42 #include <vector>
43 #include <map>
44 #include <set>
45 #include <BRepBuilderAPI_MakeEdge2d.hxx>
46 #include <BRepBuilderAPI_MakeEdge.hxx>
47 #include <BRep_Tool.hxx>
48 #include <BRepBuilderAPI_MakeWire.hxx>
49 #include <TopoDS_Face.hxx>
50 #include <gp_Pln.hxx>
51 #include <BRepBuilderAPI_MakeFace.hxx>
52 #include <gp.hxx>
53 #include <gp_Ax2.hxx>
54 #include <Geom_Plane.hxx>
55 #include <TopoDS_Wire.hxx>
56 #include <BRepLib.hxx>
57
58 static std::vector<gp_Pnt2d> GetProfileUZPoints(const Handle(HYDROData_Profile)& theProfile)
59 {
60   Handle(HYDROData_ProfileUZ) aProfileUZ = theProfile->GetProfileUZ( false );
61   HYDROData_ProfileUZ::PointsList aSectPointsList = aProfileUZ->GetPoints();
62   std::vector<gp_Pnt2d> points;
63   points.reserve(aSectPointsList.Size());
64   for ( int i = 1; i <= aSectPointsList.Size(); i++ )
65   {
66     const HYDROData_ProfileUZ::Point& aSectPoint = aSectPointsList(i);
67     points.push_back( gp_Pnt2d(aSectPoint.X(), aSectPoint.Y()));
68   }
69   return points;
70 }
71
72 static void GetMaxDist(const std::vector<gp_Pnt2d>& PNTS, 
73   double& dmax, 
74   double& dmax2,
75   int& imax)
76 {
77   dmax = 0;
78   dmax2 = 0; 
79   imax = -1;
80   std::vector<double> dist;
81   dist.reserve(PNTS.size()-1);
82   for (int i=0; i<PNTS.size()-1; i++)
83   {
84     //dist.push_back(PNTS[i].Distance(PNTS[i+1])); //via distance between p1/p2 
85     dist.push_back(std::abs(PNTS[i].X()-PNTS[i+1].X())); //via U-diff of p1/p2
86   }
87   for (int i=0; i<dist.size(); i++)
88   {
89     double d = dist[i];
90     if (d > dmax)
91     {
92       dmax = d;
93       imax = i;
94     }
95   }
96   for (int i=0; i<dist.size(); i++)
97   {
98     double d = dist[i];
99     if (d > dmax2 && d < dmax)
100       dmax2 = d;
101   }
102 }
103
104 static void InsertPoints(std::vector<gp_Pnt2d>& points, int nbpoints)
105 {
106   points.reserve(points.size() + nbpoints);
107   while (nbpoints)
108   {
109     double dmax=0, dmax2=0;
110     int imax=-1;
111     GetMaxDist(points, dmax, dmax2, imax);
112     int nbPins = 0;
113     if (dmax2 != 0)
114       nbPins = floor(dmax/dmax2);
115     else
116       nbPins = nbpoints; //one segment, put all points here
117     //insert nbPins points in [imax, imax+1] segment
118     gp_Pnt2d p1 = points[imax];
119     gp_Pnt2d p2 = points[imax+1];
120     double X0 = p1.X();
121     double Y0 = p1.Y();
122     double X1 = p2.X();
123     double Y1 = p2.Y();
124     for (int i=0;i<nbPins;i++)
125     {
126       double t = ((double)i+1)/((double)nbPins+1);
127       double Xp = X0 + (X1-X0)*t;
128       double Yp = Y0 + (Y1-Y0)*t;
129       gp_Pnt2d P(Xp, Yp);
130       points.insert(points.begin() + imax + 1, P);
131     }
132     nbpoints-=nbPins;
133   }
134 }
135
136 static void PolyToCurve2d(const Handle(HYDROData_PolylineXY)& poly, Handle(Geom2d_Curve)& c2d)
137 {
138   if (poly.IsNull())
139     return;
140   TopoDS_Shape sh = poly->GetShape();
141   if (sh.ShapeType() == TopAbs_COMPOUND)
142   {
143     TopoDS_Iterator it(sh);
144     if (it.More())
145       sh = it.Value();
146   }
147     
148   if (sh.IsNull())
149     return;
150
151   TopoDS_Edge ee;
152   if (sh.ShapeType() == TopAbs_EDGE)
153     ee = TopoDS::Edge(sh);
154   else if (sh.ShapeType() == TopAbs_WIRE)
155     ee = BRepAlgo::ConcatenateWireC0(TopoDS::Wire(sh)); //convert to bspline
156  
157   if (ee.IsNull())
158     return;
159
160   BRepAdaptor_Curve Ad(ee);
161
162   c2d = HYDROData_Tool::BRepAdaptorTo2DCurve(Ad);
163 }
164
165 static void InterProfilesAndHAX(const HYDROData_SequenceOfObjects& profiles, 
166   const Handle(Geom2d_Curve)& Hax2d, 
167   std::map<double, Handle(HYDROData_Profile)>& profToInterParam,
168   std::vector<std::string>* warnings)
169 {
170   for (int i=1;i<=profiles.Size();i++)
171   {
172     Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast(profiles(i)); 
173     gp_XY LP, RP;
174     aProfile->GetLeftPoint( LP, true, true );
175     aProfile->GetRightPoint( RP, true, true );
176     gp_Pnt2d P1(LP), P2(RP);
177     double d = P2.Distance(P1);
178     if (d < gp::Resolution())
179     {
180       if (warnings)
181         warnings->push_back(aProfile->GetName().toStdString() + " is skipped: Left and Right points is the same");
182       continue;
183     }
184     Handle(Geom2d_Line) lin2d = new Geom2d_Line(P1,gp_Dir2d(P2.XY()-P1.XY()));
185
186     Geom2dAdaptor_Curve linAd(lin2d, 0, d);
187     Geom2dAdaptor_Curve haxAd(Hax2d);
188     Geom2dInt_GInter isec( linAd, haxAd, 1.0e-6, 1.0e-6);
189     if (!isec.IsDone())
190     {
191       if (warnings)
192         warnings->push_back(aProfile->GetName().toStdString() + " is skipped: intersection between hydraulic axis & profile is failed");
193       continue;
194     }
195     if (isec.NbPoints() == 0)
196     {
197       if (warnings)
198         warnings->push_back(aProfile->GetName().toStdString() + " is skipped: no intersection between hydraulic axis & profile");
199       continue; 
200     }
201     if (isec.NbPoints() > 1)
202     {
203       if (warnings)
204         warnings->push_back(aProfile->GetName().toStdString() + " is skipped; intersection between hydraulic axis & profile produces more than 1 point");
205       continue; 
206     }
207     double param = isec.Point(1).ParamOnSecond();
208     profToInterParam[param] = aProfile;
209   }
210 }
211
212 static bool EquidParamsOnHAX(const Handle(Geom2d_Curve)& Hax2d, double step, double fp, double lp, std::set<double>& params)
213 {
214   Geom2dAdaptor_Curve ad(Hax2d);
215   GCPnts_UniformAbscissa GUA(ad, step, fp, lp);
216   if (!GUA.IsDone())
217     return false;
218
219   for(int i = 1; i<= GUA.NbPoints(); i++)
220     params.insert(GUA.Parameter(i));
221
222   return true;
223 }
224
225 static void GetPointsOnBanks(const std::vector<double>& gua_params,
226   const Handle(Geom2d_Curve)& Hax2d,
227   const Handle(Geom2d_Curve)& LB2d, 
228   const Handle(Geom2d_Curve)& RB2d,
229   std::map<double, std::pair<IntRes2d_IntersectionPoint, IntRes2d_IntersectionPoint>>& parToBankPoints,  
230   std::vector<std::string>* warnings,
231   const std::map<double, std::pair<Handle(HYDROData_Profile), Handle(HYDROData_Profile)>>* intermParamToProfPair)
232
233   for(int i = 0; i < gua_params.size(); i++)
234   {
235     double par = gua_params[i];
236     gp_Pnt2d p;
237     gp_Vec2d v;
238     Hax2d->D1(par, p, v); //if non-diff?
239     gp_Pnt2d outpLB, outpRB; 
240           
241     gp_Dir2d n2d(v.X(), v.Y()); //ignore Z (Z==0)
242     n2d.Rotate(M_PI/2);
243     //nLine2d is an orthogonal line to hydr. axis
244     gp_Pnt2d p2d(gp_Pnt2d(p.X(), p.Y()));
245     Handle(Geom2d_Line) nLine2d = new Geom2d_Line(p2d, n2d);
246     //intersect nLine2d with banks
247     Geom2dAPI_InterCurveCurve intL(LB2d, nLine2d);
248     Geom2dAPI_InterCurveCurve intR(RB2d, nLine2d);
249
250     if (warnings && intL.NbPoints()==0 )
251     {
252       std::string coord = (QString::number(p2d.X()) + ", "+QString::number(p2d.Y())).toStdString();
253       if (intermParamToProfPair && intermParamToProfPair->count(par) != 0)
254       {
255         std::string fpn = intermParamToProfPair->at(par).first->GetName().toStdString();
256         std::string spn = intermParamToProfPair->at(par).second->GetName().toStdString();
257         warnings->push_back("no intersection between intermediate profile (point on h.axis:("+ 
258           coord +"), located between " + fpn + " & " + spn + ") and left bank found; skipped");
259       }
260       else
261         warnings->push_back("no intersection between intermediate profile (point on h.axis:("+ coord +")) and left bank found; skipped");
262     }
263
264     if (warnings && intR.NbPoints()==0)
265     {
266       std::string coord = (QString::number(p2d.X()) + ", "+QString::number(p2d.Y())).toStdString();
267       if (intermParamToProfPair && intermParamToProfPair->count(par) != 0)
268       {
269         std::string fpn = intermParamToProfPair->at(par).first->GetName().toStdString();
270         std::string spn = intermParamToProfPair->at(par).second->GetName().toStdString();
271         warnings->push_back("no intersection between intermediate profile (point on h.axis:("+ 
272           coord +"), located between " + fpn + " & " + spn + ") and right bank found; skipped");
273       }
274       else
275         warnings->push_back("no intersection between intermediate profile (point on h.axis:("+ coord +")) and right bank found; skipped");
276     }
277
278     if ( intL.NbPoints()==0 || intR.NbPoints()==0)
279       continue;
280
281     IntRes2d_IntersectionPoint aNearSolL, aNearSolR;
282     double min_sq_dist = Precision::Infinite();
283     for (int j=1;j<=intL.NbPoints();j++)
284     {
285       double sq_dist = p2d.SquareDistance(intL.Point(j));
286       if (min_sq_dist > sq_dist)
287       {
288         min_sq_dist = sq_dist;
289         //aNearSolL = intL.Point(j);
290         aNearSolL = intL.Intersector().Point(j);
291       }
292     }
293     min_sq_dist = Precision::Infinite();
294     for (int j=1;j<=intR.NbPoints();j++)
295     {
296       double sq_dist = p2d.SquareDistance(intR.Point(j));
297       if (min_sq_dist > sq_dist)
298       {
299         min_sq_dist = sq_dist;
300         //aNearSolR = intR.Point(j);
301         aNearSolR =  intR.Intersector().Point(j);
302       }
303     }
304
305     std::pair<IntRes2d_IntersectionPoint, IntRes2d_IntersectionPoint> int_pair(aNearSolL, aNearSolR);
306     parToBankPoints[par]=int_pair;
307   }
308 }
309
310
311 void BuildFace(const std::map<double, std::pair<IntRes2d_IntersectionPoint, IntRes2d_IntersectionPoint>>& parToBankPoints, 
312   const Handle(Geom2d_Curve)& LB2d,
313   const Handle(Geom2d_Curve)& RB2d,
314   HYDROData_Stream::PrsDefinition& prsDef)
315 {
316   prsDef.myPrs3D.Nullify();
317   prsDef.myPrs2D.Nullify();
318   prsDef.myLeftBank.Nullify();   
319   prsDef.myRightBank.Nullify();  
320   prsDef.myInlet.Nullify();     
321   prsDef.myOutlet.Nullify();  
322
323   double lb_1, lb_2, rb_1, rb_2;
324   lb_1 = parToBankPoints.begin()->second.first.ParamOnFirst();
325   rb_1 = parToBankPoints.begin()->second.second.ParamOnFirst();
326
327   lb_2 = parToBankPoints.rbegin()->second.first.ParamOnFirst();
328   rb_2 = parToBankPoints.rbegin()->second.second.ParamOnFirst();
329
330   //stat = GetItersectionParam(F_prof, LB2d, lb_1) && GetItersectionParam(F_prof, RB2d, rb_1)
331   //  && GetItersectionParam(S_prof, LB2d, lb_2) && GetItersectionParam(S_prof, RB2d, rb_2);
332   
333   BRepBuilderAPI_MakeEdge2d LEM(LB2d, lb_1, lb_2);
334   if (!LEM.IsDone())
335     return;
336   BRepBuilderAPI_MakeEdge2d REM(RB2d, rb_1, rb_2);
337   if (!REM.IsDone())
338     return;
339   TopoDS_Edge LBE = LEM.Edge();
340   TopoDS_Edge RBE = REM.Edge();
341   if (LBE.IsNull() || RBE.IsNull())
342     return;
343   BRepBuilderAPI_MakeEdge PFEM(BRep_Tool::Pnt(LEM.Vertex1()), BRep_Tool::Pnt(REM.Vertex1()));
344   BRepBuilderAPI_MakeEdge PLEM(BRep_Tool::Pnt(LEM.Vertex2()), BRep_Tool::Pnt(REM.Vertex2()));
345   if (!PFEM.IsDone())
346     return;
347   if (!PLEM.IsDone())
348     return;
349   TopoDS_Edge FProfE = PFEM.Edge();
350   TopoDS_Edge SProfE = PLEM.Edge();
351   BRepBuilderAPI_MakeWire WM(FProfE, LBE, SProfE, RBE);
352   if (WM.IsDone())
353   {
354     TopoDS_Wire W = WM.Wire();
355     BRepLib::BuildCurves3d(W);
356     BRepBuilderAPI_MakeFace FM(Geom_Plane(gp::XOY()).Pln(), WM.Wire()); 
357     if (FM.IsDone())
358     {
359       prsDef.myPrs2D = FM.Face();
360       prsDef.myLeftBank = LBE;
361       prsDef.myRightBank = RBE;
362       prsDef.myInlet = FProfE;
363       prsDef.myOutlet = SProfE;
364     }
365   }  
366 }
367
368 void HYDROData_StreamLinearInterpolation::Perform(const HYDROData_SequenceOfObjects& profiles,
369   int pointsToInsert,
370   double stepOnHA, 
371   const Handle(HYDROData_PolylineXY)& hax,  
372   const Handle(HYDROData_PolylineXY)& LB, 
373   const Handle(HYDROData_PolylineXY)& RB,
374   HYDROData_Bathymetry::AltitudePoints& outBathypoints,
375   bool buildPresentationShapes,
376   bool estimateWarnOnly,
377   HYDROData_Stream::PrsDefinition& prsDef,
378   std::vector<std::string>* warnings)
379 {
380   //intersect profiles with given hydr.axis
381   if (hax.IsNull() || LB.IsNull() || RB.IsNull())
382     return;
383
384   Handle(Geom2d_Curve) Hax2d;
385   PolyToCurve2d(hax, Hax2d);
386   if (hax->IsClosed() || Hax2d->IsClosed()) //can't be closed
387   {
388     if (warnings)
389       warnings->push_back(hax->GetName().toStdString() + " is closed; abort");
390     return;
391   }
392
393   std::map<double, Handle(HYDROData_Profile)> InterParamToProf;
394   //profToInterParam is output param map: profile to intersection param on hydr.axis
395   InterProfilesAndHAX(profiles, Hax2d, InterParamToProf, warnings);
396   //
397   std::vector<std::vector<gp_Pnt2d>> profilesPoints;
398   profilesPoints.reserve(InterParamToProf.size());
399   int maxNbPoints = 0;
400   
401   //for (int i=1;i<=InterParamToProf.Extent();i++)
402   for( std::map<double, Handle(HYDROData_Profile)>::iterator it = InterParamToProf.begin(); it != InterParamToProf.end(); ++it )
403   {
404     //ordered by param on hydr axis
405     Handle(HYDROData_Profile) aProfile = it->second; 
406     const std::vector<gp_Pnt2d>& profile_points = GetProfileUZPoints(aProfile);
407     profilesPoints.push_back(profile_points);
408     if (profile_points.size() > maxNbPoints)
409       maxNbPoints = profile_points.size();
410   }
411   std::set<double> paramsOnHAX;
412
413   if (InterParamToProf.size() <= 1)
414   {
415     if (warnings)
416       warnings->push_back("Insufficient count of correct input profiles; abort");
417     return;
418   }
419
420   EquidParamsOnHAX(Hax2d, stepOnHA, InterParamToProf.begin()->first, 
421     InterParamToProf.rbegin()->first, paramsOnHAX);
422
423   //prepare ParamsPerSegm - number of interm.profiles for profile_points
424   std::vector<std::vector<double>> ParamsPerSegm;
425   std::set<double>::iterator it_params_hax = paramsOnHAX.begin();
426   std::map<double, Handle(HYDROData_Profile)>::iterator it_p = InterParamToProf.begin();
427   //
428   std::map<double, std::pair<Handle(HYDROData_Profile), Handle(HYDROData_Profile)>> intermParamToProfPair; //for warnings only
429   //
430   it_p++; 
431   ParamsPerSegm.resize(profilesPoints.size()-1);
432   for( int k=0; it_p != InterParamToProf.end(); )
433   {
434     if (*it_params_hax < it_p->first)
435     {
436       double val = *it_params_hax;
437       ParamsPerSegm[k].push_back(val);
438       it_params_hax++;
439
440       it_p--;
441       const Handle(HYDROData_Profile)& cp = it_p->second;
442       it_p++;
443       const Handle(HYDROData_Profile)& np = it_p->second;
444       std::pair<Handle(HYDROData_Profile), Handle(HYDROData_Profile)> profPair(cp, np);
445       intermParamToProfPair[val] = profPair;
446     }
447     else
448     {
449       it_p++;
450       k++;
451     }
452   }
453   ParamsPerSegm.back().push_back(*paramsOnHAX.rbegin());
454   //
455   std::map<double, std::pair<IntRes2d_IntersectionPoint, IntRes2d_IntersectionPoint>> parToBankPoints;
456   std::vector<double> paramHAXVec;
457   paramHAXVec.reserve(paramsOnHAX.size());
458   for( std::set<double>::iterator it = paramsOnHAX.begin(); it != paramsOnHAX.end(); ++it )
459     paramHAXVec.push_back(*it);
460   //
461   Handle(Geom2d_Curve) LB2d, RB2d;
462   PolyToCurve2d(LB, LB2d);
463   PolyToCurve2d(RB, RB2d);
464   GetPointsOnBanks( paramHAXVec, Hax2d, LB2d, RB2d, parToBankPoints, warnings, &intermParamToProfPair);
465
466   if (buildPresentationShapes)
467   {
468     //parToBankPoints.begin()->second.;
469     //double lp1 = parToBankPoints.rbegin()->first;
470
471     //Handle(HYDROData_Profile) F_prof = InterParamToProf.begin()->second;
472     //Handle(HYDROData_Profile) S_prof = InterParamToProf.rbegin()->second;
473     BuildFace(parToBankPoints, LB2d, RB2d, prsDef);
474   }
475   //
476
477   if (estimateWarnOnly)
478     return;
479
480   maxNbPoints = Max(pointsToInsert, maxNbPoints);
481
482   //insert points to profiles
483   for (int i=0;i<profilesPoints.size();i++)
484   {
485     int nbPointsToInsert = maxNbPoints - profilesPoints[i].size();
486     //insert nbPointsToInsert points to current profile
487     InsertPoints(profilesPoints[i], nbPointsToInsert);
488   }
489
490   for (int i=0;i<profilesPoints.size()-1;i++)
491   {
492     const std::vector<gp_Pnt2d>& prof1 = profilesPoints[i];
493     const std::vector<gp_Pnt2d>& prof2 = profilesPoints[i+1];
494     std::vector<std::vector<gp_Pnt2d>> IntermProf;
495
496     std::map<int, double> indToParam; //index of im.profile to param on hax. ()
497     for (int j=0;j<ParamsPerSegm[i].size();j++)
498     {
499       double param = ParamsPerSegm[i][j];
500       if (parToBankPoints.count(param) > 0) //not intersected with banks; skip this
501         indToParam[j]=param;
502     }
503     int NbIntermProf = indToParam.size();
504     IntermProf.resize(NbIntermProf);
505
506     for (int l=0;l<NbIntermProf;l++)
507       IntermProf[l].resize(prof1.size());
508     //calc interm. between prof1 & prof2
509     assert (prof1.size() == prof2.size());
510     for (int j=0;j<prof1.size();j++)
511     {
512       gp_Pnt2d P1 = prof1[j];
513       gp_Pnt2d P2 = prof2[j];
514       double X0 = P1.X();
515       double Y0 = P1.Y();
516       double X1 = P2.X();
517       double Y1 = P2.Y();
518       std::map<int, double>::iterator it = indToParam.begin();
519       for ( int m=0; it != indToParam.end(); it++, m++ )
520       {
521         int ind = it->first;
522         double t = ((double)ind+1)/((double)NbIntermProf+1);
523         double Xp = X0 + (X1-X0)*t;
524         double Yp = Y0 + (Y1-Y0)*t;
525         gp_Pnt2d P(Xp, Yp);
526         IntermProf[m][j] = P;
527       }
528     }
529     std::map<int, double>::iterator it = indToParam.begin();
530     for ( int m=0; it != indToParam.end(); it++, m++ )
531     {
532       const std::vector<gp_Pnt2d>& im_prof = IntermProf[m];
533       double param = it->second;
534       const std::pair<IntRes2d_IntersectionPoint, IntRes2d_IntersectionPoint>& BB = parToBankPoints[param]; //param is included in map; no checks
535       gp_Pnt2d LP = BB.first.Value();
536       gp_Pnt2d RP = BB.second.Value();
537       HYDROData_ProfileUZ::PointsList pl;
538       for (int k=0;k<im_prof.size();k++)
539         pl.Append(im_prof[k].XY());
540       HYDROData_Profile::ProfilePoints profile_points3d = HYDROData_Profile::CalculateProfilePoints(pl, LP.XY(), RP.XY());
541       for (int k=1;k<=profile_points3d.Length();k++)
542       {
543         HYDROData_Bathymetry::AltitudePoint AP(profile_points3d(k).X(), profile_points3d(k).Y(), profile_points3d(k).Z());
544         outBathypoints.push_back(AP);
545       }
546     }
547   }
548   //outBathy->SetAltitudePoints(bathypoints);
549 }
550
551
552