HYDROGUI_ImportImageOp.h
HYDROGUI_ImportPolylineOp.h
HYDROGUI_ImportSinusXOp.h
+ HYDROGUI_ExportSinusXOp.h
+ HYDROGUI_ExportSinusXDlg.h
HYDROGUI_InputPanel.h
HYDROGUI_LocalCSDlg.h
HYDROGUI_LocalCSOp.h
HYDROGUI_ImportImageOp.cxx
HYDROGUI_ImportPolylineOp.cxx
HYDROGUI_ImportSinusXOp.cxx
+ HYDROGUI_ExportSinusXOp.cxx
+ HYDROGUI_ExportSinusXDlg.cxx
HYDROGUI_InputPanel.cxx
HYDROGUI_LocalCSDlg.cxx
HYDROGUI_LocalCSOp.cxx
--- /dev/null
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_ExportSinusXDlg.h>
+#include <HYDROGUI_Module.h>
+#include <QtxDoubleSpinBox.h>
+#include <QLayout>
+#include <QLabel>
+#include <QStackedWidget>
+#include <QPushButton>
+#include "HYDROGUI_Module.h"
+#include <CAM_Application.h>
+#include <SUIT_Desktop.h>
+#include <QListWidget.h>
+
+
+HYDROGUI_ExportSinusXDlg::HYDROGUI_ExportSinusXDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle, false )
+{
+ QFrame* aFrame = new QFrame( mainFrame() );
+ addWidget( aFrame, 1 );
+
+ QGridLayout* aLayout = new QGridLayout( aFrame );
+ aLayout->setMargin( 5 );
+ aLayout->setSpacing( 5 );
+
+ myQListW = new QListWidget(mainFrame());
+
+ myQListW->setSelectionMode(QAbstractItemView::ExtendedSelection);
+ aLayout->addWidget(myQListW, 0, 0, 1, 2);
+
+ myIncludeBtn = new QPushButton( tr( "INCLUDE" ) );
+ myExcludeBtn = new QPushButton( tr( "EXCLUDE" ) );
+ aLayout->addWidget(myIncludeBtn, 1, 0 );
+ aLayout->addWidget(myExcludeBtn, 1, 1 );
+
+ myExport = new QPushButton( tr( "EXPORT" ) );
+
+ QHBoxLayout* aBtnsLayout = qobject_cast<QHBoxLayout*>(buttonFrame()->layout());
+ aBtnsLayout->addWidget( myExport, 0 );
+ aBtnsLayout->addWidget( myCancel, 0 );
+ aBtnsLayout->addStretch( 1 );
+ aBtnsLayout->addWidget( myHelp, 0 );
+
+ //TODO connect
+ //connect( myExport, SIGNAL( clicked() ), SLOT( onExport() ) );
+ connect( myIncludeBtn, SIGNAL( clicked() ), SIGNAL( IncludeItems() ) );
+ connect( myExcludeBtn, SIGNAL( clicked() ), SIGNAL( ExcludeItems() ) );
+
+ myEnt2WIMap.clear();
+
+}
+
+HYDROGUI_ExportSinusXDlg::~HYDROGUI_ExportSinusXDlg()
+{
+}
+
+void HYDROGUI_ExportSinusXDlg::addItems(const HYDROData_SequenceOfObjects& theSelectedItems)
+{
+ for (int i = 1; i <= theSelectedItems.Size(); i++)
+ {
+ QString anEntName = theSelectedItems.Value(i)->GetName();
+ if (!myEnt2WIMap.contains(anEntName))
+ {
+ QListWidgetItem* aWI = new QListWidgetItem();
+ aWI->setText(anEntName);
+ myEnt2WIMap[anEntName] = aWI; ///TODO free this map
+ myQListW->addItem(aWI);
+ }
+ }
+ myQListW->update();
+}
+
+void HYDROGUI_ExportSinusXDlg::RemoveItems()
+{
+ for (int i = 0; i < myQListW->selectedItems().size(); i++)
+ {
+ QListWidgetItem* anItem = myQListW->selectedItems()[i];
+ QMap<QString, QListWidgetItem*>::iterator aMapIt;
+ for (aMapIt = myEnt2WIMap.begin(); aMapIt != myEnt2WIMap.end(); ++aMapIt)
+ if (aMapIt.value() == anItem)
+ {
+ aMapIt = myEnt2WIMap.erase(aMapIt);
+ delete anItem;
+ //myQListW->takeItem(anItem);
+ }
+ else
+ ++aMapIt;
+ }
+ myQListW->update();
+}
+
--- /dev/null
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_ExportSinusXDlg_H
+#define HYDROGUI_ExportSinusXDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+#include <HYDROData_Entity.h>
+#include <QMap>
+
+class QtxDoubleSpinBox;
+class QStackedWidget;
+class QPushButton;
+class QListWidget;
+class QListWidgetItem;
+
+
+class HYDROGUI_ExportSinusXDlg : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ExportSinusXDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ virtual ~HYDROGUI_ExportSinusXDlg();
+ void addItems(const HYDROData_SequenceOfObjects& theSelectedItems);
+ void RemoveItems();
+
+signals:
+ void IncludeItems();
+ void ExcludeItems();
+
+private:
+
+ QPushButton* myExport;
+ QPushButton* myIncludeBtn;
+ QPushButton* myExcludeBtn;
+ QListWidget* myQListW;
+ QMap<QString, QListWidgetItem*> myEnt2WIMap;
+
+};
+
+#endif
--- /dev/null
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_ExportSinusXOp.h>
+#include <HYDROGUI_ExportSinusXDlg.h>
+#include <HYDROData_Document.h>
+#include <HYDROGUI_UpdateFlags.h>
+#include <HYDROGUI_Tool.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_PolylineXY.h>
+#include <HYDROData_Profile.h>
+#include <HYDROData_Entity.h>
+
+
+HYDROGUI_ExportSinusXOp::HYDROGUI_ExportSinusXOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+ setName( tr( "EXPORT_SINUSX" ) );
+}
+
+HYDROGUI_ExportSinusXOp::~HYDROGUI_ExportSinusXOp()
+{
+}
+
+void HYDROGUI_ExportSinusXOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast<HYDROGUI_ExportSinusXDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+}
+
+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() ) );
+ return aPanel;
+}
+
+void HYDROGUI_ExportSinusXOp::onIncludeItems()
+{
+ HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast<HYDROGUI_ExportSinusXDlg*>( 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++ )
+ {
+ 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);
+ }
+
+ aPanel->addItems( aSelectedItems );
+
+}
+
+void HYDROGUI_ExportSinusXOp::onExcludeItems()
+{
+ HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast<HYDROGUI_ExportSinusXDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+ aPanel->RemoveItems( );
+
+}
--- /dev/null
+// 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
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_EXPORTSINUSXOP_H
+#define HYDROGUI_EXPORTSINUSXOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_ExportSinusXOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ExportSinusXOp( HYDROGUI_Module* theModule );
+ virtual ~HYDROGUI_ExportSinusXOp();
+
+protected:
+ virtual void startOperation();
+
+ virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+protected slots:
+ void onIncludeItems();
+ void onExcludeItems();
+
+};
+
+#endif
#include "HYDROGUI_StricklerTableOp.h"
#include "HYDROGUI_DuplicateOp.h"
#include "HYDROGUI_LandCoverOp.h"
+#include "HYDROGUI_ExportSinusXOp.h"
#include <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
createAction( ImportPolylineId, "IMPORT_POLYLINE", "IMPORT_POLYLINE_ICO" );
createAction( ImportSinusXId, "IMPORT_SINUSX", "IMPORT_SINUSX_ICO" );
+ createAction( ExportSinusXId, "EXPORT_SINUSX", "EXPORT_LANDCOVER_ICO" );
createAction( CreatePolylineId, "CREATE_POLYLINE", "CREATE_POLYLINE_ICO" );
createAction( EditPolylineId, "EDIT_POLYLINE", "EDIT_POLYLINE_ICO" );
createMenu( ImportImageId, aHydroId, -1, -1 );
createMenu( ImportPolylineId, aHydroId, -1, -1 );
createMenu( ImportSinusXId, aHydroId, -1, -1 );
+ createMenu( ExportSinusXId, aHydroId, -1, -1 );
createMenu( ImportBathymetryId, aHydroId, -1, -1 );
createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 );
createTool( ImportImageId, aToolBar );
createTool( ImportPolylineId, aToolBar );
createTool( ImportSinusXId, aToolBar );
+ createTool( ExportSinusXId, aToolBar );
+
createTool( ImportBathymetryId, aToolBar );
createTool( CreatePolylineId, aToolBar );
createTool( CreatePolyline3DId, aToolBar );
case ImportSinusXId:
anOp = new HYDROGUI_ImportSinusXOp( aModule );
break;
+ case ExportSinusXId:
+ anOp = new HYDROGUI_ExportSinusXOp( aModule );
+ break;
case ObserveImageId:
anOp = new HYDROGUI_ObserveImageOp( aModule );
break;
SubmersibleId,
ImportPolylineId,
ImportSinusXId,
+ ExportSinusXId,
+
ExportPolylineId,
<source>DSK_IMPORT_SINUSX</source>
<translation>Import from SinusX</translation>
</message>
+ <message>
+ <source>DSK_EXPORT_SINUSX</source>
+ <translation>Export to SinusX</translation>
+ </message>
<message>
<source>DSK_LOAD_VISUAL_STATE</source>
<translation>Load visual state</translation>
<source>MEN_IMPORT_SINUSX</source>
<translation>Import from SinusX</translation>
</message>
+ <message>
+ <source>MEN_EXPORT_SINUSX</source>
+ <translation>Export to SinusX</translation>
+ </message>
<message>
<source>MEN_LOAD_VISUAL_STATE</source>
<translation>Load visual state</translation>
<source>STB_IMPORT_SINUSX</source>
<translation>Import from SinusX</translation>
</message>
+ <message>
+ <source>STB_EXPORT_SINUSX</source>
+ <translation>Export to SinusX</translation>
+ </message>
<message>
<source>STB_LOAD_VISUAL_STATE</source>
<translation>Load visual state</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_ExportSinusXOp</name>
+ <message>
+ <source>EXPORT_SINUSX</source>
+ <translation>Export to SinusX</translation>
+ </message>
+ <message>
+ <source>SINUSX_FILTER</source>
+ <translation>SinusX Files (*.sx)</translation>
+ </message>
+ <message>
+ <source>NO_ONE_ENTITY_EXPORTED</source>
+ <translation>Entities cant be write</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_GeoreferencementDlg</name>