Salome HOME
patch for install error on Linux
[modules/hydro.git] / src / HYDROData / HYDROData_DTM.cxx
index bdbac0cb3c9b6d8280907a2a491dd7bce96c1d6b..78313e369503e30f90e024bd559b9a567ebd7d00 100644 (file)
@@ -49,6 +49,7 @@
 #include <ShapeAnalysis_Wire.hxx>
 #include <BRepAlgo_NormalProjection.hxx>
 
+#include <BRepBuilderAPI_MakePolygon.hxx>
 
 
 IMPLEMENT_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry )
@@ -158,7 +159,7 @@ void HYDROData_DTM::SetSpatialStep( double theSpatialStep )
 
 void HYDROData_DTM::PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W )
 {
-  BRepLib_MakeWire WM;
+  /*BRepLib_MakeWire WM;
   if (pnts.empty())
     return;
   for (int i = 0; i < pnts.size() - 1; i++)
@@ -167,8 +168,13 @@ void HYDROData_DTM::PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W )
     gp_Pnt p2(pnts[i+1].X, pnts[i+1].Y, pnts[i+1].Z);    
     WM.Add(BRepLib_MakeEdge(p1, p2).Edge()); 
   }
-  if (WM.IsDone())
-    W = WM.Wire();
+  if (WM.IsDone())*/
+  
+  BRepBuilderAPI_MakePolygon PM;
+  for (int i = 0; i < pnts.size(); i++)
+    PM.Add(gp_Pnt(pnts[i].X, pnts[i].Y, pnts[i].Z));
+  
+  W = PM.Wire();
 }
 
 TopTools_IndexedMapOfOrientedShape HYDROData_DTM::Create3DShape(const AltitudePoints& left,