X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_PolylineDlg.cxx;h=52087532823dc23305f6f3f65816ea7b7d54523a;hb=de7cf9bb0a7a41d6487013c87f4a54d0664cd303;hp=4cd9b8d624e0989c6d548de3eaeba9267c67582f;hpb=ed25fab026dbb34e7bb7f5198bf54c9c20135f3f;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx index 4cd9b8d6..52087532 100755 --- a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx @@ -21,9 +21,12 @@ // #include "HYDROGUI_PolylineDlg.h" + +#include "HYDROGUI_Module.h" #include #include +#include #include #include #include @@ -39,16 +42,50 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS addLayout(aNameLayout); - myEditorWidget = - new CurveCreator_Widget( this, NULL); + myEditorWidget = new CurveCreator_Widget( this, NULL ); + myEditorWidget->setInstantSketchingEnabled( true ); + addWidget( myEditorWidget, 3 ); + + myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); + addWidget( myAddElementBox, 2 ); + + QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox ); + anAddElementLayout->setMargin( 0 ); + anAddElementLayout->setSpacing( 5 ); - 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*) ) ); + + myAddElementBox->hide(); } HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg() { } +void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( false ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->addWidget( theWidget ); + + theWidget->show(); + myAddElementBox->show(); +} + +void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( true ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->removeWidget( theWidget ); + + theWidget->hide(); + myAddElementBox->hide(); +} + void HYDROGUI_PolylineDlg::reset() { } @@ -67,3 +104,13 @@ void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve ) { myEditorWidget->setCurve( theCurve ); } + +QList HYDROGUI_PolylineDlg::getSelectedSections() +{ + return myEditorWidget->getSelectedSections(); +} + +QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints() +{ + return myEditorWidget->getSelectedPoints(); +}