From 592703d3b78be8f7f5deca3a61a54e4ddc9792ba Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Thu, 11 Feb 2016 11:40:30 +0100 Subject: [PATCH] =?utf8?q?garder=20les=20noms=20tels=20que=20=C3=A0=20l'im?= =?utf8?q?port=20SinusX?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/HYDROData/HYDROData_SinusX.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/HYDROData/HYDROData_SinusX.cxx b/src/HYDROData/HYDROData_SinusX.cxx index c7f7701e..4b9dc6f4 100644 --- a/src/HYDROData/HYDROData_SinusX.cxx +++ b/src/HYDROData/HYDROData_SinusX.cxx @@ -131,7 +131,7 @@ void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollec } aBath->SetAltitudePoints(aAPoints); - aBath->SetName(GetName(myCurveBlocks[i].myName + "_bath")); + aBath->SetName(GetName(myCurveBlocks[i].myName)); theEntities.Append(aBath); } if (myCurveBlocks[i].myType == 1 || myCurveBlocks[i].myType == 3) // XYZ curve or isocontour @@ -153,9 +153,9 @@ void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollec aProfileUZ->CalculateAndAddPoints(aPoints, aPolyXY); Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) ); aProfile->SetParametricPoints(aProfileUZ->GetPoints()); - aPolyXY->SetName(GetName(myCurveBlocks[i].myName + "_polyXY")); - aProfileUZ->SetName(GetName(myCurveBlocks[i].myName + "_profileUZ")); - aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile")); + aPolyXY->SetName(GetName(myCurveBlocks[i].myName)); + aProfileUZ->SetName(GetName(myCurveBlocks[i].myName)); + aProfile->SetName(GetName(myCurveBlocks[i].myName)); aPolyXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor()); theEntities.Append(aPolyXY); theEntities.Append(aProfileUZ); @@ -187,7 +187,7 @@ void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollec aProfile->SetRightPoint(gp_XY(xr, yr)); aProfile->Update(); } - aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile")); + aProfile->SetName(GetName(myCurveBlocks[i].myName)); theEntities.Append(aProfile); } } @@ -204,7 +204,7 @@ void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollec aProfile->GetProfileUZ()->SetSectionType(0, myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE); aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false); aProfile->SetProfilePoints(aPointList); - aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile")); + aProfile->SetName(GetName(myCurveBlocks[i].myName)); theEntities.Append(aProfile); } } @@ -273,7 +273,9 @@ bool HYDROData_SinusX::Parse(QFile& theFile) if (aBList[0] == "CN") { for (int i = 1; i < aBList.size(); i++) - Name += aBList[i] + "_"; + Name += aBList[i] + "_"; + if (Name.size() <= 1) + Name = "noname_"; Name.remove(Name.size() - 1, 1); aCurveBlockInfo.myName = Name; } -- 2.39.2