X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ProfileDlg.cxx;h=611e888f23d5589dbecef5ea1ba69e4f91fc435b;hb=8c36538920c44b66924b596a8d2c8a10bab9b7e5;hp=4952ce856ee8d8151e64165914d2bfda6b3d5497;hpb=4cd726b073c12ecc98207ad9b6cca7ffe160c04a;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx index 4952ce85..611e888f 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -37,8 +38,6 @@ #include #include -#include - #include #include #include @@ -57,7 +56,8 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr addLayout(aNameLayout); int anActionFlags = - CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode; + CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode | + CurveCreator_Widget::DisableClosedSection; myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags ); addWidget( myEditorWidget, 3 ); @@ -94,7 +94,7 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr myEditorWidget->setOCCViewer( aViewer ); 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(); @@ -125,6 +125,7 @@ HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg() void HYDROGUI_ProfileDlg::reset() { myEditorWidget->reset(); + myEditorWidget->setActionMode( CurveCreator_Widget::AdditionMode ); } Handle(AIS_InteractiveContext) HYDROGUI_ProfileDlg::getAISContext() @@ -146,6 +147,11 @@ QString HYDROGUI_ProfileDlg::getProfileName() const void HYDROGUI_ProfileDlg::setProfile( CurveCreator_ICurve* theProfile ) { myEditorWidget->setCurve( theProfile ); + + // select the single section by default + QList aSections; + aSections << 0; + myEditorWidget->setSelectedSections( aSections ); } QList HYDROGUI_ProfileDlg::getSelectedSections() @@ -153,11 +159,6 @@ QList HYDROGUI_ProfileDlg::getSelectedSections() return myEditorWidget->getSelectedSections(); } -QList< QPair< int, int > > HYDROGUI_ProfileDlg::getSelectedPoints() -{ - return myEditorWidget->getSelectedPoints(); -} - /** * Redirect the delete action to editor widget */ @@ -174,10 +175,11 @@ bool HYDROGUI_ProfileDlg::deleteEnabled() return myEditorWidget->removeEnabled(); } -void HYDROGUI_ProfileDlg::processStartedSubOperation( QWidget* theWidget ) +void HYDROGUI_ProfileDlg::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 ); @@ -201,7 +203,7 @@ void HYDROGUI_ProfileDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEve OCCViewer_ViewWindow* anOCCViewWindow = dynamic_cast(theViewWindow); if ( anOCCViewWindow && anOCCViewWindow->getViewPort() ) { - gp_Pnt aPnt = GEOMUtils::ConvertClickToPoint( + gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( theEvent->x(), theEvent->y(), anOCCViewWindow->getViewPort()->getView() ); // Show the coordinates