Salome HOME
merge master
[modules/hydro.git] / src / HYDROData / HYDROData_SinusX.cxx
index c24905b1bd55500d8d2dc41e522d1e349d52f1a5..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);
@@ -304,7 +302,7 @@ bool HYDROData_SinusX::Parse(QFile& theFile)
 
 }
 
-bool HYDROData_SinusX::Export(const QString& theFilePath, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
 {
   if ( theFilePath.isEmpty() )
   { 
@@ -330,7 +328,7 @@ bool HYDROData_SinusX::Export(const QString& theFilePath, NCollection_Sequence<H
 
 }
 
-void HYDROData_SinusX::HydroToSX(QFile& theFile, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
 {
   QTextStream aTextStream(&theFile);
   aTextStream << "C  Generated by HYDRO Module\n";
@@ -341,17 +339,17 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, NCollection_Sequence<Handle_HYD
     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, NCollection_Sequence<Handle_HYD
         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";