Salome HOME
merge master
[modules/hydro.git] / src / HYDROData / HYDROData_SinusX.cxx
index 86a5b1518e092ef95e35b6753b4cd1037093f376..3927c0a348a1d9e2c7b833d1ffc074d5268298b9 100644 (file)
@@ -1,8 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
@@ -37,6 +33,7 @@
 #include <QString>
 #include <QStringList>
 #include <QTextStream>
+#include <QColor>
 
 HYDROData_SinusX::HYDROData_SinusX( ) 
 {
@@ -151,6 +148,7 @@ void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollec
       aPolyXY->SetName(GetName(myCurveBlocks[i].myName + "_polyXY"));
       aProfileUZ->SetName(GetName(myCurveBlocks[i].myName + "_profileUZ"));
       aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile"));
+      aPolyXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor());
       theEntities.Append(aPolyXY);
       theEntities.Append(aProfileUZ);
       theEntities.Append(aProfile);
@@ -341,17 +339,17 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Hand
     Handle_HYDROData_Entity anEnt = theEntities.Value(i);
     if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Bathymetry) ))
     {
-       Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
-       HYDROData_Bathymetry::AltitudePoints anXYZPoints = aBathy->GetAltitudePoints();
-       //Write to stream
-       aTextStream << "B S\n";
-       aTextStream << "CN " << aBathy->GetName() << "\n";
-       aTextStream << "CP 0 0\n";
-       aTextStream << "CP 0\n";
-       for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
-         aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)  
-                     << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)  
-                     << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n"; 
+      Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
+      HYDROData_Bathymetry::AltitudePoints anXYZPoints = aBathy->GetAltitudePoints(true);
+      //Write to stream
+      aTextStream << "B S\n";
+      aTextStream << "CN " << aBathy->GetName() << "\n";
+      aTextStream << "CP 0 0\n";
+      aTextStream << "CP 0\n";
+      for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
+        aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)  
+                    << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)  
+                    << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n"; 
     }
     else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ))
     {
@@ -363,7 +361,7 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Hand
         bool IsSpline = false;
         if (aPolyXY->GetSectionType(j) == HYDROData_PolylineXY::SECTION_SPLINE)
           IsSpline = true;
-        HYDROData_PolylineXY::PointsList anXYPoints = aPolyXY->GetPoints(j);
+        HYDROData_PolylineXY::PointsList anXYPoints = aPolyXY->GetPoints(j, true);
         //Write to stream
         aTextStream << "B N\n";
         aTextStream << "CN " << aPolyXY->GetName() << "\n";