Salome HOME
Modify creation of curves: 1) using QDockWidget instead of QDialog; 2) selection...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_PolylineDlg.cxx
index 4cd9b8d624e0989c6d548de3eaeba9267c67582f..40a831d80db3cab3a7a59f1fe96dfed29b8fc29d 100755 (executable)
@@ -21,6 +21,8 @@
 //
 
 #include "HYDROGUI_PolylineDlg.h"
+
+#include "HYDROGUI_Module.h"
 #include <CurveCreator_Widget.h>
 #include <CurveCreator_Curve.hxx>
 
@@ -40,15 +42,31 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS
   addLayout(aNameLayout);
 
   myEditorWidget =
-    new CurveCreator_Widget( this, NULL);
+    new CurveCreator_Widget( this, NULL );
 
   addWidget( myEditorWidget );
+
+  connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
+  connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
+  connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
 }
 
 HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
 {
 }
 
+void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget )
+{
+  myEditorWidget->setEnabled( false );
+  activateWidget( theWidget );
+}
+
+void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+  myEditorWidget->setEnabled( true );
+  activateWidget( 0 );
+}
+
 void HYDROGUI_PolylineDlg::reset()
 {
 }
@@ -67,3 +85,13 @@ void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve )
 {
   myEditorWidget->setCurve( theCurve );
 }
+
+QList<int> HYDROGUI_PolylineDlg::getSelectedSections()
+{
+  return myEditorWidget->getSelectedSections();
+}
+
+QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints()
+{
+  return myEditorWidget->getSelectedPoints();
+}