X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ExportSinusXOp.cxx;h=6d33a7b7c4a3e90e0c3a236fc257b50345325137;hb=298c1759f9b1d4a7dc316742b7a13008eb4234e1;hp=ea53a0c6deec6ce203a07793e55f23524cbb1527;hpb=786ceeeb7107f76992252451e58eef819ffec8ad;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx index ea53a0c6..6d33a7b7 100644 --- a/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx @@ -25,7 +25,17 @@ #include #include #include +#include +#include +#include "HYDROGUI_Module.h" +#include +#include +#include +#include + +#include +#include HYDROGUI_ExportSinusXOp::HYDROGUI_ExportSinusXOp( HYDROGUI_Module* theModule ) : HYDROGUI_Operation( theModule ) @@ -49,41 +59,23 @@ void HYDROGUI_ExportSinusXOp::startOperation() HYDROGUI_InputPanel* HYDROGUI_ExportSinusXOp::createInputPanel() const { HYDROGUI_ExportSinusXDlg* aPanel = new HYDROGUI_ExportSinusXDlg( module(), getName() ); - connect( aPanel, SIGNAL( IncludeItems() ), SLOT( onIncludeItems() ) ); - connect( aPanel, SIGNAL( ExcludeItems() ), SLOT( onExcludeItems() ) ); + connect( aPanel, SIGNAL( ExportItems() ), SLOT( onExportItems() ) ); return aPanel; } -void HYDROGUI_ExportSinusXOp::onIncludeItems() +void HYDROGUI_ExportSinusXOp::onExportItems() { + QString aFilter( tr("SINUSX_FILTER") ); HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast( inputPanel() ); if ( !aPanel ) return; - - HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() ); - HYDROData_SequenceOfObjects aSelectedItems; - - if ( aSeq.IsEmpty()) - return; - - for( int i = 1; i <= aSeq.Length(); i++ ) + if (!aPanel->GetSelectedEntities().IsEmpty()) { - Handle_HYDROData_Entity anEnt = aSeq.Value( i ); - if (anEnt->IsKind( STANDARD_TYPE( HYDROData_Bathymetry)) || - anEnt->IsKind( STANDARD_TYPE( HYDROData_PolylineXY)) || - anEnt->IsKind( STANDARD_TYPE( HYDROData_Profile)) ) - aSelectedItems.Append(anEnt); + //Export selected items to SX file + QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), "", aFilter, tr( "EXPORT_SINUSX" ), false ); + HYDROData_SinusX anExporter; + anExporter.Export(aFileName, aPanel->GetSelectedEntities()); } - - aPanel->addItems( aSelectedItems ); - -} - -void HYDROGUI_ExportSinusXOp::onExcludeItems() -{ - HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast( inputPanel() ); - if ( !aPanel ) - return; - aPanel->RemoveItems( ); - + else + SUIT_MessageBox::warning(module()->getApp()->desktop(), tr( "EXPORT_SINUSX" ), tr( "NO_ENTITIES_TO_EXPORT")); }