1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "HYDROData_Bathymetry.h"
20 #include "HYDROData_Document.h"
21 #include "HYDROData_Tool.h"
22 #include "HYDROData_PolylineXY.h"
27 #include <TDataStd_RealArray.hxx>
28 #include <TDataStd_AsciiString.hxx>
29 #include <TDataStd_Integer.hxx>
36 #include <QStringList>
38 #include <vtkPoints.h>
39 #include <vtkDelaunay2D.h>
40 #include <vtkPolyData.h>
41 #include <vtkSmartPointer.h>
42 #include <vtkIdList.h>
50 #include <OSD_Timer.hxx>
54 #include "HYDRO_trace.hxx"
56 IMPLEMENT_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
57 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
59 //HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0;
60 std::map<int, HYDROData_QuadtreeNode*> HYDROData_Bathymetry::myQuadtrees;
61 std::map<int, vtkPolyData*> HYDROData_Bathymetry::myDelaunay2D;
64 HYDROData_Bathymetry::HYDROData_Bathymetry()
65 : HYDROData_IAltitudeObject()
69 HYDROData_Bathymetry::~HYDROData_Bathymetry()
73 QStringList HYDROData_Bathymetry::DumpToPython( const QString& thePyScriptPath,
74 MapOfTreatedObjects& theTreatedObjects ) const
76 QStringList aResList = dumpObjectCreation( theTreatedObjects );
77 QString aBathymetryName = GetObjPyName();
79 aResList << QString( "%1.SetAltitudesInverted( %2 )" )
80 .arg( aBathymetryName ).arg( IsAltitudesInverted() );
82 TCollection_AsciiString aFilePath = GetFilePath();
83 aResList << QString( "if not(%1.ImportFromFile( \"%2\" )):" )
84 .arg( aBathymetryName ).arg( aFilePath.ToCString() );
85 aResList << QString( " raise ValueError('problem while loading bathymetry')" );
86 aResList << QString( "" );
87 aResList << QString( "%1.Update()" ).arg( aBathymetryName );
88 aResList << QString( "" );
93 void HYDROData_Bathymetry::SetAltitudePoints( const AltitudePoints& thePoints )
95 RemoveAltitudePoints();
97 if ( thePoints.IsEmpty() )
101 Handle(TDataStd_RealArray) aCoordsArray =
102 TDataStd_RealArray::Set( myLab.FindChild( DataTag_AltitudePoints ), 0, thePoints.Length() * 3 - 1 );
104 AltitudePoints::Iterator anIter( thePoints );
105 for ( int i = 0 ; anIter.More(); ++i, anIter.Next() )
107 const AltitudePoint& aPoint = anIter.Value();
109 aCoordsArray->SetValue( i * 3, aPoint.X() );
110 aCoordsArray->SetValue( i * 3 + 1, aPoint.Y() );
111 aCoordsArray->SetValue( i * 3 + 2, aPoint.Z() );
117 HYDROData_Bathymetry::AltitudePoints HYDROData_Bathymetry::GetAltitudePoints(bool IsConvertToGlobal) const
119 AltitudePoints aPoints;
121 TDF_Label aLabel = myLab.FindChild( DataTag_AltitudePoints, false );
122 if ( aLabel.IsNull() )
125 Handle(TDataStd_RealArray) aCoordsArray;
126 if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), aCoordsArray ) )
129 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab );
130 for ( int i = aCoordsArray->Lower(), n = aCoordsArray->Upper(); i <= n; )
135 AltitudePoint aPoint;
136 aPoint.SetX( aCoordsArray->Value( i++ ) );
137 aPoint.SetY( aCoordsArray->Value( i++ ) );
138 aPoint.SetZ( aCoordsArray->Value( i++ ) );
140 if( IsConvertToGlobal )
141 aDoc->Transform( aPoint, false );
142 aPoints.Append( aPoint );
148 HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const
150 TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
153 int labkey = myLab.Tag();
154 //int altkey = aLabel.Tag();
155 //DEBTRACE("GetQuadtreeNodes this labkey altkey "<<this<<" "<<labkey<<" "<<altkey);
156 // if (myQuadtree->isEmpty() )
157 if (myQuadtrees.find(labkey) == myQuadtrees.end())
159 DEBTRACE("GetQuadtreeNodes init " << this << " " << labkey);
160 HYDROData_QuadtreeNode* aQuadtree = new HYDROData_QuadtreeNode(0, 30, 5, 0.);
161 myQuadtrees[labkey] = aQuadtree;
162 TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
166 Handle(TDataStd_RealArray) aCoordsArray;
167 if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
170 Nodes_3D* aListOfNodes = new Nodes_3D();
173 for (int i = aCoordsArray->Lower(), n = aCoordsArray->Upper(); i <= n;)
178 double x = aCoordsArray->Value(i++);
179 double y = aCoordsArray->Value(i++);
180 double z = aCoordsArray->Value(i++);
181 gpi_XYZ* aPoint = new gpi_XYZ(x, y, z, index);
183 aListOfNodes->push_back(aPoint);
185 DEBTRACE(" GetQuadtreeNodes call setNodesAndCompute");
186 aQuadtree->setNodesAndCompute(aListOfNodes);
190 return myQuadtrees[labkey];
193 vtkPolyData* HYDROData_Bathymetry::GetVtkDelaunay2D() const
195 TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
198 int labkey = myLab.Tag();
199 //int altkey = aLabel.Tag();
200 //DEBTRACE("GetVtkDelaunay2D this labkey altkey "<<this<<" "<<labkey<<" "<<altkey);
201 if (myDelaunay2D.find(labkey) == myDelaunay2D.end())
203 DEBTRACE("GetVtkDelaunay2D init " << this << " " << labkey);
205 TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
208 Handle(TDataStd_RealArray) aCoordsArray;
209 if (!aLabel.FindAttribute(TDataStd_RealArray::GetID(), aCoordsArray))
212 vtkPoints *points = vtkPoints::New();
213 points->Allocate(aCoordsArray->Upper() +1);
214 for (int i = aCoordsArray->Lower(), n = aCoordsArray->Upper(); i <= n;)
218 double x = aCoordsArray->Value(i++);
219 double y = aCoordsArray->Value(i++);
220 double z = aCoordsArray->Value(i++);
221 vtkIdType index = points->InsertNextPoint(x, y, z); // same index than in GetQuadtreeNodes
222 //DEBTRACE(" " << index);
224 vtkPolyData* profile = vtkPolyData::New();
225 profile->SetPoints(points);
226 DEBTRACE("Number of Points: "<< points->GetNumberOfPoints());
228 vtkDelaunay2D* delaunay2D = vtkDelaunay2D::New();
229 delaunay2D->SetInputData(profile);
230 delaunay2D->Update();
231 vtkPolyData* data = delaunay2D->GetOutput();
233 myDelaunay2D[labkey] = data;
237 return myDelaunay2D[labkey];
241 void HYDROData_Bathymetry::RemoveAltitudePoints()
243 TDF_Label aLabel = myLab.FindChild( DataTag_AltitudePoints, false );
244 if ( !aLabel.IsNull() )
246 aLabel.ForgetAllAttributes();
251 void interpolateAltitudeForPoints( const gp_XY& thePoint,
252 const HYDROData_Bathymetry::AltitudePoint& theFirstPoint,
253 const HYDROData_Bathymetry::AltitudePoint& theSecPoint,
254 HYDROData_Bathymetry::AltitudePoint& theResPoint,
255 const bool& theIsVertical )
257 double aCoordX = thePoint.X();
258 double aCoordY = thePoint.Y();
262 aCoordX = theFirstPoint.X();
264 if ( !ValuesEquals( theFirstPoint.X(), theSecPoint.X() ) )
266 // Recalculate X coordinate by equation of line from two points
267 aCoordX = ( ( ( thePoint.Y() - theFirstPoint.Y() ) * ( theSecPoint.X() - theFirstPoint.X() ) ) /
268 ( theSecPoint.Y() - theFirstPoint.Y() ) ) + theFirstPoint.X();
273 aCoordY = theFirstPoint.Y();
275 if ( !ValuesEquals( theFirstPoint.Y(), theSecPoint.Y() ) )
277 // Recalculate y by equation of line from two points
278 aCoordY = ( ( ( thePoint.X() - theFirstPoint.X() ) * ( theSecPoint.Y() - theFirstPoint.Y() ) ) /
279 ( theSecPoint.X() - theFirstPoint.X() ) ) + theFirstPoint.Y();
283 theResPoint.SetX( aCoordX );
284 theResPoint.SetY( aCoordY );
286 // Calculate coefficient for interpolation
287 double aLength = Sqrt( Pow( theSecPoint.Y() - theFirstPoint.Y(), 2 ) +
288 Pow( theSecPoint.X() - theFirstPoint.X(), 2 ) );
290 double aInterCoeff = 0;
292 aInterCoeff = ( theSecPoint.Z() - theFirstPoint.Z() ) / aLength;
295 double aNewLength = Sqrt( Pow( theResPoint.Y() - theFirstPoint.Y(), 2 ) +
296 Pow( theResPoint.X() - theFirstPoint.X(), 2 ) );
298 // Calculate interpolated value
299 double aResVal = theFirstPoint.Z() + aInterCoeff * aNewLength;
301 theResPoint.SetZ( aResVal );
304 bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* triangle, double& z)
307 int nbPts = triangle->GetNumberOfIds();
310 DEBTRACE("not a triangle ?");
314 double v[3][3]; // v[i][j] = j coordinate of node i
315 for (int i=0; i<3; i++)
317 s[i] = triangle->GetId(i);
318 delaunay2D->GetPoint(s[i],v[i]);
320 //DEBTRACE("triangle node id: " << s[0] << " " << s[1] << " " << s[2]);
321 //DEBTRACE("triangle node 0: " << v[0][0] << " " << v[0][1] << " " << v[0][2]);
322 //DEBTRACE("triangle node 1: " << v[1][0] << " " << v[1][1] << " " << v[1][2]);
323 //DEBTRACE("triangle node 2: " << v[2][0] << " " << v[2][1] << " " << v[2][2]);
325 // compute barycentric coordinates (https://en.wikipedia.org/wiki/Barycentric_coordinate_system)
326 // det = (y2-y3)(x1-x3)+(x3-x2)(y1-y3)
327 double det = (v[1][1]-v[2][1])*(v[0][0]-v[2][0]) + (v[2][0]-v[1][0])*(v[0][1]-v[2][1]);
330 DEBTRACE("flat triangle ?");
334 // l0 = ((y2-y3)(x -x3)+(x3-x2)(y -y3))/det
335 double l0 = (v[1][1]-v[2][1])*(point.X()-v[2][0]) + (v[2][0]-v[1][0])*(point.Y()-v[2][1]);
338 // l1 = ((y3-y1)(x -x3)+(x1-x3)(y -y3))/det
339 double l1 = (v[2][1]-v[0][1])*(point.X()-v[2][0]) + (v[0][0]-v[2][0])*(point.Y()-v[2][1]);
342 double l2 = 1 -l0 -l1;
343 //DEBTRACE("l0, l1, l2: " << l0 << " " << l1 << " " << l2);
345 if ((l0>=0) and (l0<=1) and (l1>=0) and (l1<=1) and (l2>=0) and (l2<=1))
347 z = l0*v[0][2] + l1*v[1][2] + l2*v[2][2];
353 double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theMethod) const
355 DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << "), interpolation method: " << theMethod);
356 double anInvalidAltitude = GetInvalidAltitude();
357 double aResAltitude = anInvalidAltitude;
359 // --- find the nearest point in the bathymetry cloud, with quadtree
361 HYDROData_QuadtreeNode* aQuadtree = GetQuadtreeNodes();
364 DEBTRACE(" no Quadtree");
368 std::map<double, const gpi_XYZ*> dist2nodes;
369 aQuadtree->NodesAround(thePoint, dist2nodes, aQuadtree->getPrecision());
370 while (dist2nodes.size() == 0)
372 aQuadtree->setPrecision(aQuadtree->getPrecision() *2);
373 DEBTRACE("adjust precision to: " << aQuadtree->getPrecision());
374 aQuadtree->NodesAround(thePoint, dist2nodes, aQuadtree->getPrecision());
376 std::map<double, const gpi_XYZ*>::const_iterator it = dist2nodes.begin();
377 aResAltitude = it->second->Z();
378 int nodeIndex = it->second->getIndex();
379 DEBTRACE(" number of points found: " << dist2nodes.size() << " nearest z: " << aResAltitude << " point index: " << nodeIndex);
381 // --- for coarse bathymetry clouds (when the TELEMAC mesh is more refined than the bathymetry cloud)
382 // interpolation is required.
383 // - get a Delaunay2D mesh on the bathymetry cloud,
384 // - get the triangle containing the point in the Delaunay2D mesh,
385 // - interpolate altitude
387 bool isBathyInterpolRequired = false;
389 isBathyInterpolRequired =true;
390 if (isBathyInterpolRequired)
392 vtkPolyData* aDelaunay2D = GetVtkDelaunay2D();
393 vtkIdList* cells= vtkIdList::New();
395 vtkIdList* points= vtkIdList::New();
396 points->Allocate(64);
397 aDelaunay2D->GetPointCells(nodeIndex, cells);
398 vtkIdType nbCells = cells->GetNumberOfIds();
399 DEBTRACE(" triangles on nearest point: " << nbCells);
400 bool isInside = false;
401 for (int i=0; i<nbCells; i++)
403 aDelaunay2D->GetCellPoints(cells->GetId(i), points);
405 isInside = interpolZtriangle(thePoint, aDelaunay2D, points, z);
409 DEBTRACE(" interpolated z: " << z);
413 if (!isInside) DEBTRACE(" point outside triangles, nearest z kept");
418 void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath )
420 TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
423 TCollection_AsciiString HYDROData_Bathymetry::GetFilePath() const
425 TCollection_AsciiString aRes;
427 TDF_Label aLabel = myLab.FindChild( DataTag_FilePath, false );
428 if ( !aLabel.IsNull() )
430 Handle(TDataStd_AsciiString) anAsciiStr;
431 if ( aLabel.FindAttribute( TDataStd_AsciiString::GetID(), anAsciiStr ) )
432 aRes = anAsciiStr->Get();
438 void HYDROData_Bathymetry::SetAltitudesInverted( const bool theIsInverted,
439 const bool theIsUpdate )
441 bool anIsAltitudesInverted = IsAltitudesInverted();
442 if ( anIsAltitudesInverted == theIsInverted )
445 TDataStd_Integer::Set( myLab.FindChild( DataTag_AltitudesInverted ), (Standard_Integer)theIsInverted );
452 // Update altitude points
453 AltitudePoints anAltitudePoints = GetAltitudePoints();
454 if ( anAltitudePoints.IsEmpty() )
457 AltitudePoints::Iterator anIter( anAltitudePoints );
458 for ( ; anIter.More(); anIter.Next() )
460 AltitudePoint& aPoint = anIter.ChangeValue();
461 aPoint.SetZ( aPoint.Z() * -1 );
464 SetAltitudePoints( anAltitudePoints );
467 bool HYDROData_Bathymetry::IsAltitudesInverted() const
471 TDF_Label aLabel = myLab.FindChild( DataTag_AltitudesInverted, false );
472 if ( !aLabel.IsNull() )
474 Handle(TDataStd_Integer) anIntVal;
475 if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) )
476 aRes = (bool)anIntVal->Get();
482 bool HYDROData_Bathymetry::ImportFromFile( const TCollection_AsciiString& theFileName )
484 // Try to open the file
485 QFile aFile( theFileName.ToCString() );
486 if ( !aFile.exists() || !aFile.open( QIODevice::ReadOnly ) )
491 QString aFileSuf = QFileInfo( aFile ).suffix().toLower();
493 AltitudePoints aPoints;
495 // Try to import the file
496 if ( aFileSuf == "xyz" )
497 aRes = importFromXYZFile( aFile, aPoints );
498 else if ( aFileSuf == "asc" )
499 aRes = importFromASCFile( aFile, aPoints );
505 // Convert from global to local CS
506 Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myLab );
507 AltitudePoints::Iterator anIter( aPoints );
508 for ( ; anIter.More(); anIter.Next() )
510 AltitudePoint& aPoint = anIter.ChangeValue();
511 aDoc->Transform( aPoint, true );
516 // Update file path and altitude points of this Bathymetry
517 SetFilePath( theFileName );
518 SetAltitudePoints( aPoints );
521 return aRes && !aPoints.IsEmpty();
524 bool HYDROData_Bathymetry::importFromXYZFile( QFile& theFile,
525 AltitudePoints& thePoints ) const
527 if ( !theFile.isOpen() )
530 // Strings in file is written as:
531 // 1. X(float) Y(float) Z(float)
532 // 2. X(float) Y(float) Z(float)
540 bool anIsAltitudesInverted = IsAltitudesInverted();
541 while ( !theFile.atEnd() )
543 QString aLine = theFile.readLine().simplified();
544 if ( aLine.isEmpty() )
547 QStringList aValues = aLine.split( ' ', QString::SkipEmptyParts );
548 if ( aValues.length() < 3 )
551 AltitudePoint aPoint;
553 QString anX = aValues.value( 0 );
554 QString anY = aValues.value( 1 );
555 QString aZ = aValues.value( 2 );
557 bool isXOk = false, isYOk = false, isZOk = false;
559 aPoint.SetX( anX.toDouble( &isXOk ) );
560 aPoint.SetY( anY.toDouble( &isYOk ) );
561 aPoint.SetZ( aZ.toDouble( &isZOk ) );
563 if ( !isXOk || !isYOk || !isZOk )
566 if ( HYDROData_Tool::IsNan( aPoint.X() ) || HYDROData_Tool::IsInf( aPoint.X() ) ||
567 HYDROData_Tool::IsNan( aPoint.Y() ) || HYDROData_Tool::IsInf( aPoint.Y() ) ||
568 HYDROData_Tool::IsNan( aPoint.Z() ) || HYDROData_Tool::IsInf( aPoint.Z() ) )
571 // Invert the z value if requested
572 if ( anIsAltitudesInverted )
573 aPoint.SetZ( -aPoint.Z() );
575 thePoints.Append( aPoint );
580 std::ofstream stream( "W:/HYDRO/WORK/log.txt", std::ofstream::out );
581 aTimer.Show( stream );
587 bool HYDROData_Bathymetry::importFromASCFile( QFile& theFile,
588 AltitudePoints& thePoints ) const
590 if ( !theFile.isOpen() )
594 QStringList aStrList;
603 aLine = theFile.readLine().simplified();
604 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
605 if ( aStrList.length() != 2 && aStrList[0].toLower() != "ncols" )
607 aNCols = aStrList[1].toInt();
609 aLine = theFile.readLine().simplified();
610 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
611 if ( aStrList.length() != 2 && aStrList[0].toLower() != "nrows" )
613 aNRows = aStrList[1].toInt();
615 aLine = theFile.readLine().simplified();
616 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
617 if ( aStrList.length() != 2 && aStrList[0].toLower() != "xllcorner" )
619 anXllCorner = aStrList[1].toDouble();
621 aLine = theFile.readLine().simplified();
622 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
623 if ( aStrList.length() != 2 && aStrList[0].toLower() != "yllcorner" )
625 anYllCorner = aStrList[1].toDouble();
627 aLine = theFile.readLine().simplified();
628 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
629 if ( aStrList.length() != 2 && aStrList[0].toLower() != "cellsize" )
631 aCellSize = aStrList[1].toDouble();
633 aLine = theFile.readLine().simplified();
634 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
635 if ( aStrList.length() != 2 && aStrList[0].toLower() != "nodata_value" )
637 aNoDataValue = aStrList[1].toDouble();
639 bool anIsAltitudesInverted = IsAltitudesInverted();
643 while ( !theFile.atEnd() )
645 aLine = theFile.readLine().simplified();
646 aStrList = aLine.split( ' ', QString::SkipEmptyParts );
648 aStrLength = aStrList.length();
649 if ( aStrLength == 0 )
652 if ( aStrLength != aNRows )
655 for (int j = 0; j < aNCols; j++)
657 if (aStrList[j].toDouble() != aNoDataValue)
659 AltitudePoint aPoint;
660 aPoint.SetX(anXllCorner + aCellSize*(j + 0.5));
661 aPoint.SetY(anYllCorner + aCellSize*(aNRows - i + 0.5));
662 aPoint.SetZ(aStrList[j].toDouble());
664 if ( anIsAltitudesInverted )
665 aPoint.SetZ( -aPoint.Z() );
667 thePoints.Append(aPoint);
679 Handle_HYDROData_PolylineXY HYDROData_Bathymetry::CreateBoundaryPolyline() const
681 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
682 Handle_HYDROData_PolylineXY aResult =
683 Handle_HYDROData_PolylineXY::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) );
685 if( aResult.IsNull() )
689 QString aPolylinePref = GetName() + "_Boundary";
690 QString aPolylineName = HYDROData_Tool::GenerateObjectName( aDocument, aPolylinePref );
691 aResult->SetName( aPolylineName );
693 double Xmin = 0.0, Xmax = 0.0, Ymin = 0.0, Ymax = 0.0;
695 AltitudePoints aPoints = GetAltitudePoints();
697 AltitudePoints::Iterator anIter( aPoints );
698 for ( ; anIter.More(); anIter.Next() )
700 const AltitudePoint& aPoint = anIter.Value();
702 double x = aPoint.X(), y = aPoint.Y();
703 if( isFirst || x<Xmin )
705 if( isFirst || x>Xmax )
707 if( isFirst || y<Ymin )
709 if( isFirst || y>Ymax )
714 aResult->AddSection( "bound", HYDROData_IPolyline::SECTION_POLYLINE, true );
715 aResult->AddPoint( 0, HYDROData_IPolyline::Point( Xmin, Ymin ) );
716 aResult->AddPoint( 0, HYDROData_IPolyline::Point( Xmin, Ymax ) );
717 aResult->AddPoint( 0, HYDROData_IPolyline::Point( Xmax, Ymax ) );
718 aResult->AddPoint( 0, HYDROData_IPolyline::Point( Xmax, Ymin ) );
720 aResult->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
727 void HYDROData_Bathymetry::UpdateLocalCS( double theDx, double theDy )
729 gp_XYZ aDelta( theDx, theDy, 0 );
730 AltitudePoints aPoints = GetAltitudePoints();
731 AltitudePoints::Iterator anIter( aPoints );
732 for ( int i = 0 ; anIter.More(); ++i, anIter.Next() )
734 AltitudePoint& aPoint = anIter.ChangeValue();
737 SetAltitudePoints( aPoints );