X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_PolylineDlg.cxx;h=abbd6ae4850f1c7f001de1df568cbb0b18dd33aa;hb=a1431f03eac1d1aed4203d0568d987c41ce939b3;hp=52087532823dc23305f6f3f65816ea7b7d54523a;hpb=fbebf54af40fc3ccb0a655efd24668010dc816e4;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx index 52087532..abbd6ae4 100755 --- a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx @@ -24,7 +24,9 @@ #include "HYDROGUI_Module.h" #include -#include +#include + +#include #include #include @@ -35,7 +37,7 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS : HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL) { QHBoxLayout* aNameLayout = new QHBoxLayout(); - QLabel* aNameLabel = new QLabel(tr("CURVE_NAME_TLT"), this); + QLabel* aNameLabel = new QLabel(tr("POLYLINE_NAME_TLT"), this); aNameLayout->addWidget(aNameLabel); myName = new QLineEdit(this); aNameLayout->addWidget(myName); @@ -43,7 +45,6 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS addLayout(aNameLayout); myEditorWidget = new CurveCreator_Widget( this, NULL ); - myEditorWidget->setInstantSketchingEnabled( true ); addWidget( myEditorWidget, 3 ); myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); @@ -54,7 +55,7 @@ HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QS anAddElementLayout->setSpacing( 5 ); connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); - connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) ); + connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*, bool) ), this, SLOT( processStartedSubOperation(QWidget*, bool) ) ); connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) ); myAddElementBox->hide(); @@ -64,10 +65,16 @@ HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg() { } -void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget ) +void HYDROGUI_PolylineDlg::setOCCViewer( OCCViewer_Viewer* theViewer ) +{ + myEditorWidget->setOCCViewer( theViewer ); +} + +void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget, bool theIsEdit ) { myEditorWidget->setEnabled( false ); + myAddElementBox->setTitle( theIsEdit ? tr( "EDIT_ELEMENT" ) : tr( "ADD_ELEMENT" ) ); QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); anAddElementLayout->addWidget( theWidget ); @@ -100,7 +107,7 @@ QString HYDROGUI_PolylineDlg::getPolylineName() const return myName->text(); } -void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve ) +void HYDROGUI_PolylineDlg::setCurve( CurveCreator_ICurve* theCurve ) { myEditorWidget->setCurve( theCurve ); } @@ -110,7 +117,18 @@ QList HYDROGUI_PolylineDlg::getSelectedSections() return myEditorWidget->getSelectedSections(); } -QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints() +/** + * Redirect the delete action to editor widget + */ +void HYDROGUI_PolylineDlg::deleteSelected() +{ + myEditorWidget->removeSelected(); +} + +/** + * Checks whether there are some to delete + */ +bool HYDROGUI_PolylineDlg::deleteEnabled() { - return myEditorWidget->getSelectedPoints(); + return myEditorWidget->removeEnabled(); }