X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_SinusX.cxx;h=3927c0a348a1d9e2c7b833d1ffc074d5268298b9;hb=cde2ec476486fcd7c9b7b38ce814c648d73e7fd3;hp=c24905b1bd55500d8d2dc41e522d1e349d52f1a5;hpb=27b1abdc88719c5bce7a8d2f49612cd155e80d21;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_SinusX.cxx b/src/HYDROData/HYDROData_SinusX.cxx index c24905b1..3927c0a3 100644 --- a/src/HYDROData/HYDROData_SinusX.cxx +++ b/src/HYDROData/HYDROData_SinusX.cxx @@ -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 #include #include +#include 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& theEntities) +bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence& theEntities) { if ( theFilePath.isEmpty() ) { @@ -330,7 +328,7 @@ bool HYDROData_SinusX::Export(const QString& theFilePath, NCollection_Sequence& theEntities) +void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence& theEntities) { QTextStream aTextStream(&theFile); aTextStream << "C Generated by HYDRO Module\n"; @@ -341,17 +339,17 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, NCollection_SequenceIsKind( 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_SequenceGetSectionType(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";