From: isn Date: Tue, 23 Jun 2015 07:41:13 +0000 (+0300) Subject: refs #598 X-Git-Tag: v1.4.2~35^2~4^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=666fcb40f86255ff9e203d54493eee8b6cf7276c;p=modules%2Fhydro.git refs #598 refs #595 --- diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx index f1fb2ed3..02483407 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx @@ -82,23 +82,28 @@ void HYDROGUI_ExportFileOp::startOperation() else { QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), "", aFilter, tr( "EXPORT_POLYLINE" ), false ); - SHPHandle hSHPHandle; - if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty()) + if (!aFileName.isEmpty()) { - hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC ); - for (int i = 1; i <= aPolyXYSeq.Size(); i++) - WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i)); + SHPHandle hSHPHandle; + if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty()) + { + hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC ); + for (int i = 1; i <= aPolyXYSeq.Size(); i++) + WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i)); + } + else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty()) + { + hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ ); + for (int i = 1; i <= aPoly3DSeq.Size(); i++) + WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i)); + } + SHPClose( hSHPHandle ); + commit(); } - else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty()) - { - hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ ); - for (int i = 1; i <= aPoly3DSeq.Size(); i++) - WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i)); - } - SHPClose( hSHPHandle ); + else + abort(); } - commit(); } void HYDROGUI_ExportFileOp::WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly ) diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index ab66dc7f..f8e4a527 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -2222,6 +2222,13 @@ file cannot be correctly imported for an Obstacle definition. + + HYDROGUI_ExportFileOp + + EXPORT_POLYLINE + Export polyline + + HYDROGUI_GeoreferencementDlg