]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #585: draft version of GUI for polylines operations
authorasl <asl@opencascade.com>
Thu, 18 Jun 2015 06:03:43 +0000 (09:03 +0300)
committerasl <asl@opencascade.com>
Thu, 18 Jun 2015 06:03:43 +0000 (09:03 +0300)
13 files changed:
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ObjListBox.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ObjListBox.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h [new file with mode: 0644]

index 5a463d1c1a6f828c7c865b1850e3c67c4e92e5ce..091f8ca393240da7f66da96a3e4dec4bbc3e702f 100644 (file)
@@ -40,6 +40,8 @@ set(PROJECT_HEADERS
     HYDROGUI_InputPanel.h
     HYDROGUI_LocalCSDlg.h
     HYDROGUI_LocalCSOp.h
+    HYDROGUI_MergePolylinesDlg.h
+    HYDROGUI_MergePolylinesOp.h
     HYDROGUI_Module.h
     HYDROGUI_NameValidator.h
     HYDROGUI_ObjSelector.h
@@ -72,6 +74,8 @@ set(PROJECT_HEADERS
     HYDROGUI_ShapeBathymetry.h
     HYDROGUI_ShapeImage.h
     HYDROGUI_ShowHideOp.h
+    HYDROGUI_SplitPolylinesDlg.h
+    HYDROGUI_SplitPolylinesOp.h
     HYDROGUI_StreamDlg.h
     HYDROGUI_StreamOp.h
     HYDROGUI_LineEditDoubleValidator.h
@@ -120,6 +124,7 @@ set(PROJECT_HEADERS
     HYDROGUI_RiverBottomOp.h
     HYDROGUI_ViewerDlg.h
     HYDROGUI_ObjComboBox.h
+    HYDROGUI_ObjListBox.h
     HYDROGUI_RecognizeContoursDlg.h
     HYDROGUI_RecognizeContoursOp.h
 )
@@ -164,6 +169,8 @@ set(PROJECT_SOURCES
     HYDROGUI_InputPanel.cxx
     HYDROGUI_LocalCSDlg.cxx
     HYDROGUI_LocalCSOp.cxx
+    HYDROGUI_MergePolylinesDlg.cxx
+    HYDROGUI_MergePolylinesOp.cxx
     HYDROGUI_Module.cxx
     HYDROGUI_NameValidator.cxx
     HYDROGUI_ObjSelector.cxx
@@ -203,6 +210,8 @@ set(PROJECT_SOURCES
     HYDROGUI_StricklerTableOp.cxx
        HYDROGUI_LandCoverDlg.cxx
        HYDROGUI_LandCoverOp.cxx
+    HYDROGUI_SplitPolylinesDlg.cxx
+    HYDROGUI_SplitPolylinesOp.cxx
     HYDROGUI_SubmersibleOp.cxx
     HYDROGUI_Tool.cxx
     HYDROGUI_TwoImagesDlg.cxx
@@ -245,6 +254,7 @@ set(PROJECT_SOURCES
     HYDROGUI_RiverBottomOp.cxx
     HYDROGUI_ViewerDlg.cxx
     HYDROGUI_ObjComboBox.cxx
+    HYDROGUI_ObjListBox.cxx
     HYDROGUI_RecognizeContoursDlg.cxx
     HYDROGUI_RecognizeContoursOp.cxx
 )
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx b/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx
new file mode 100644 (file)
index 0000000..39bbcc1
--- /dev/null
@@ -0,0 +1,55 @@
+// 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_MergePolylinesDlg.h>
+#include <HYDROGUI_ObjListBox.h>
+#include <QFrame>
+#include <QGridLayout>
+
+HYDROGUI_MergePolylinesDlg::HYDROGUI_MergePolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+  QFrame* aFrame = new QFrame( mainFrame() );
+  addWidget( aFrame, 1 );
+
+  QGridLayout* aLayout = new QGridLayout( aFrame );
+  aLayout->setMargin( 5 );
+  aLayout->setSpacing( 5 );
+
+  myList = new HYDROGUI_ObjListBox( theModule, tr( "POLYLINES" ), KIND_POLYLINEXY, mainFrame() );
+  aLayout->addWidget( myList, 0, 0 );
+}
+
+HYDROGUI_MergePolylinesDlg::~HYDROGUI_MergePolylinesDlg()
+{
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_MergePolylinesDlg::selectedPolylines() const
+{
+  return myList->selectedObjects();
+}
+
+void HYDROGUI_MergePolylinesDlg::setSelectedPolylines( const HYDROData_SequenceOfObjects& theObjects )
+{
+  return myList->setSelectedObjects( theObjects );
+}
+
+void HYDROGUI_MergePolylinesDlg::setPolylinesFromSelection()
+{
+  return myList->setObjectsFromSelection();
+}
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h b/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h
new file mode 100644 (file)
index 0000000..874f022
--- /dev/null
@@ -0,0 +1,43 @@
+// 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_MergePolylinesDlg_H
+#define HYDROGUI_MergePolylinesDlg_H
+
+#include <HYDROGUI_InputPanel.h>
+#include <HYDROData_Entity.h>
+
+class HYDROGUI_ObjListBox;
+
+class HYDROGUI_MergePolylinesDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_MergePolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_MergePolylinesDlg();
+
+  HYDROData_SequenceOfObjects selectedPolylines() const;
+  void                        setSelectedPolylines( const HYDROData_SequenceOfObjects& );
+  void                        setPolylinesFromSelection();
+
+private:
+  HYDROGUI_ObjListBox* myList;
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx
new file mode 100644 (file)
index 0000000..dd1c271
--- /dev/null
@@ -0,0 +1,60 @@
+// 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_MergePolylinesOp.h>
+#include <HYDROGUI_MergePolylinesDlg.h>
+
+HYDROGUI_MergePolylinesOp::HYDROGUI_MergePolylinesOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "MERGE_POLYLINES" ) );
+}
+
+HYDROGUI_MergePolylinesOp::~HYDROGUI_MergePolylinesOp()
+{
+}
+
+void HYDROGUI_MergePolylinesOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  //TODO
+}
+
+HYDROGUI_InputPanel* HYDROGUI_MergePolylinesOp::createInputPanel() const
+{
+  return new HYDROGUI_MergePolylinesDlg( module(), getName() );
+}
+
+bool HYDROGUI_MergePolylinesOp::processApply( int& theUpdateFlags,
+                                              QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
+{
+  /* TODO:
+  HYDROGUI_LocalCSDlg* aPanel = ::qobject_cast<HYDROGUI_LocalCSDlg*>( inputPanel() );
+  if ( !aPanel )
+    return false;
+
+  double aLX = aPanel->GetLocalX();
+  double aLY = aPanel->GetLocalY();
+  doc()->SetLocalCS( aLX, aLY );
+
+  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  */
+  return true;
+}
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesOp.h b/src/HYDROGUI/HYDROGUI_MergePolylinesOp.h
new file mode 100644 (file)
index 0000000..b934883
--- /dev/null
@@ -0,0 +1,41 @@
+// 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_MergePolylinesOp_H
+#define HYDROGUI_MergePolylinesOp_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_MergePolylinesOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_MergePolylinesOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_MergePolylinesOp();
+
+protected:
+  virtual void startOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx
new file mode 100644 (file)
index 0000000..513e08a
--- /dev/null
@@ -0,0 +1,133 @@
+// 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_ObjListBox.h>
+#include <HYDROGUI_ObjComboBox.h>
+#include <HYDROGUI_Tool.h>
+#include <QGridLayout>
+#include <QListWidget>
+#include <QLabel>
+#include <QPushButton>
+
+HYDROGUI_ObjListBox::HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle, const ObjectKind& theType, QWidget* theParent )
+: QWidget( theParent ),
+  myType( theType ),
+  myModule( theModule ),
+  myFilter( 0 )
+{
+  QGridLayout* aBase = new QGridLayout( this );
+  aBase->setMargin( 0 );
+
+  QPushButton* anInclude = new QPushButton( tr( "INCLUDE" ), this );
+  QPushButton* anExclude = new QPushButton( tr( "EXCLUDE" ), this );
+
+  aBase->addWidget( anInclude, 0, 0 );
+  aBase->addWidget( anExclude, 0, 1 );
+  if( !theTitle.isEmpty() )
+    aBase->addWidget( new QLabel( theTitle, this ), 1, 0 );
+  aBase->addWidget( myList = new QListWidget( this ), 1, 1, 1, 2 );
+  aBase->setColumnStretch( 0, 0 );
+  aBase->setColumnStretch( 1, 0 );
+  aBase->setColumnStretch( 2, 1 );
+
+  myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+  myList->setSelectionMode( QListWidget::ExtendedSelection );
+
+  connect( anInclude, SIGNAL( clicked() ), this, SLOT( OnInclude() ) );
+  connect( anExclude, SIGNAL( clicked() ), this, SLOT( OnExclude() ) );
+}
+
+HYDROGUI_ObjListBox::~HYDROGUI_ObjListBox()
+{
+}
+
+HYDROGUI_Module* HYDROGUI_ObjListBox::module() const
+{
+    return myModule;
+}
+
+ObjectKind HYDROGUI_ObjListBox::objectType() const
+{
+    return myType;
+}
+
+HYDROGUI_ObjComboBoxFilter* HYDROGUI_ObjListBox::objectFilter() const
+{
+    return myFilter;
+}
+
+void HYDROGUI_ObjListBox::setObjectFilter( HYDROGUI_ObjComboBoxFilter* filter )
+{
+    myFilter = filter;
+}
+
+void HYDROGUI_ObjListBox::reset()
+{
+  myList->clear();
+  mySelection.Clear();
+}
+
+void HYDROGUI_ObjListBox::setSelectedObjects( const HYDROData_SequenceOfObjects& theObjects )
+{
+  reset();
+  Append( theObjects );
+}
+
+void HYDROGUI_ObjListBox::setObjectsFromSelection()
+{
+  setSelectedObjects( HYDROGUI_Tool::GetSelectedObjects( module() ) );
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_ObjListBox::selectedObjects() const
+{
+  return mySelection;
+}
+
+void HYDROGUI_ObjListBox::OnInclude()
+{
+  Append( HYDROGUI_Tool::GetSelectedObjects( module() ) );
+}
+
+void HYDROGUI_ObjListBox::OnExclude()
+{
+  QList<QListWidgetItem*> aSelection = myList->selectedItems();
+  foreach( QListWidgetItem* anItem, aSelection )
+  {
+    int anIndex = myList->row( anItem );
+    myList->takeItem( anIndex );
+    mySelection.Remove( anIndex, anIndex );
+  }
+}
+
+void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects )
+{
+  for( int i=theObjects.Lower(), n=theObjects.Upper(); i<=n; i++ )
+  {
+    Handle( HYDROData_Entity ) anObject = theObjects.Value( i );
+    bool isOK = !anObject.IsNull() && anObject->GetKind()==myType;
+    if( myFilter && isOK )
+      isOK = myFilter->isOk( anObject );
+
+    if( isOK )
+    {
+      QString aName = anObject->GetName();
+      myList->addItem( aName );
+      mySelection.Append( anObject );
+    }
+  }
+}
diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.h b/src/HYDROGUI/HYDROGUI_ObjListBox.h
new file mode 100644 (file)
index 0000000..a31cf26
--- /dev/null
@@ -0,0 +1,64 @@
+// 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_OBJLISTBOX_H
+#define HYDROGUI_OBJLISTBOX_H
+
+#include <HYDROData_Entity.h>
+#include <QWidget>
+
+class HYDROGUI_Module;
+class HYDROGUI_ObjComboBoxFilter;
+class QListWidget;
+
+class HYDROGUI_ObjListBox : public QWidget
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle,
+                       const ObjectKind& = KIND_UNKNOWN, QWidget* = 0 );
+  virtual ~HYDROGUI_ObjListBox();
+
+  HYDROGUI_Module*            module() const;
+  ObjectKind                  objectType() const;
+
+  HYDROGUI_ObjComboBoxFilter* objectFilter() const;
+  void                        setObjectFilter( HYDROGUI_ObjComboBoxFilter* );
+
+  HYDROData_SequenceOfObjects selectedObjects() const;
+  void                        setSelectedObjects( const HYDROData_SequenceOfObjects& );
+  void                        setObjectsFromSelection();
+  void                        reset();
+
+private slots:
+  void OnInclude();
+  void OnExclude();
+
+private:
+  void Append( const HYDROData_SequenceOfObjects& );
+
+private:
+  ObjectKind                  myType;
+  QListWidget*                myList;
+  HYDROGUI_Module*            myModule;
+  HYDROGUI_ObjComboBoxFilter* myFilter;
+  HYDROData_SequenceOfObjects mySelection;
+};
+
+#endif
index 3ebae5722f6977aa998ab7459a26809c074aa901..b3bebbf017cfa1435104bd53c1a5fb989ec4bf4e 100644 (file)
@@ -62,6 +62,8 @@
 #include "HYDROGUI_StricklerTableOp.h"
 #include "HYDROGUI_DuplicateOp.h"
 #include "HYDROGUI_LandCoverOp.h"
+#include "HYDROGUI_MergePolylinesOp.h"
+#include "HYDROGUI_SplitPolylinesOp.h"
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Obstacle.h>
@@ -257,6 +259,8 @@ void HYDROGUI_Module::createMenus()
   createMenu( CutImagesId, aHydroId, -1, -1 );
   createMenu( SplitImageId, aHydroId, -1, -1 );
   createMenu( separator(), aHydroId );
+  createMenu( SplitPolylinesId, aHydroId, -1, -1 );
+  createMenu( MergePolylinesId, aHydroId, -1, -1 );
 }
 
 void HYDROGUI_Module::createPopups()
@@ -579,6 +583,12 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case SubmersibleId:
     anOp = new HYDROGUI_SubmersibleOp( aModule );
     break;
+  case SplitPolylinesId:
+    anOp = new HYDROGUI_SplitPolylinesOp( aModule );
+    break;
+  case MergePolylinesId:
+    anOp = new HYDROGUI_MergePolylinesOp( aModule );
+    break;
   }
 
   if( !anOp )
index 2669cae2c688749c6f47b0a557f1826a75a454cb..cb90dd25564c2e3c2093b3d9c0d2ef8b4a227482 100644 (file)
@@ -118,7 +118,10 @@ enum OperationId
   DuplicateStricklerTableId,
 
   CreateLandCoverId,
-  EditLandCoverId
+  EditLandCoverId,
+
+  SplitPolylinesId,
+  MergePolylinesId,
 };
 
 #endif
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx
new file mode 100644 (file)
index 0000000..47b5213
--- /dev/null
@@ -0,0 +1,37 @@
+// 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_SplitPolylinesDlg.h>
+#include <QFrame>
+#include <QGridLayout>
+
+HYDROGUI_SplitPolylinesDlg::HYDROGUI_SplitPolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+  QFrame* aFrame = new QFrame( mainFrame() );
+  addWidget( aFrame, 1 );
+
+  QGridLayout* aLayout = new QGridLayout( aFrame );
+  aLayout->setMargin( 5 );
+  aLayout->setSpacing( 5 );
+}
+
+HYDROGUI_SplitPolylinesDlg::~HYDROGUI_SplitPolylinesDlg()
+{
+}
+
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h b/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h
new file mode 100644 (file)
index 0000000..3dca4fb
--- /dev/null
@@ -0,0 +1,33 @@
+// 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_SplitPolylinesDlg_H
+#define HYDROGUI_SplitPolylinesDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class HYDROGUI_SplitPolylinesDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_SplitPolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_SplitPolylinesDlg();
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx
new file mode 100644 (file)
index 0000000..233e79a
--- /dev/null
@@ -0,0 +1,60 @@
+// 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_SplitPolylinesOp.h>
+#include <HYDROGUI_SplitPolylinesDlg.h>
+
+HYDROGUI_SplitPolylinesOp::HYDROGUI_SplitPolylinesOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "SPLIT_POLYLINES" ) );
+}
+
+HYDROGUI_SplitPolylinesOp::~HYDROGUI_SplitPolylinesOp()
+{
+}
+
+void HYDROGUI_SplitPolylinesOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  //TODO
+}
+
+HYDROGUI_InputPanel* HYDROGUI_SplitPolylinesOp::createInputPanel() const
+{
+  return new HYDROGUI_SplitPolylinesDlg( module(), getName() );
+}
+
+bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags,
+                                              QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
+{
+  /*TODO:
+  HYDROGUI_LocalCSDlg* aPanel = ::qobject_cast<HYDROGUI_LocalCSDlg*>( inputPanel() );
+  if ( !aPanel )
+    return false;
+
+  double aLX = aPanel->GetLocalX();
+  double aLY = aPanel->GetLocalY();
+  doc()->SetLocalCS( aLX, aLY );
+
+  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  */
+  return true;
+}
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h
new file mode 100644 (file)
index 0000000..e2454a5
--- /dev/null
@@ -0,0 +1,41 @@
+// 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_SplitPolylinesOp_H
+#define HYDROGUI_SplitPolylinesOp_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_SplitPolylinesOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_SplitPolylinesOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_SplitPolylinesOp();
+
+protected:
+  virtual void startOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
+};
+
+#endif