From: isn Date: Thu, 19 Nov 2015 09:35:53 +0000 (+0300) Subject: refs #701 X-Git-Tag: v1.5~16^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f6ba7eb84ba008755704db27a828bb193353f0fe;p=modules%2Fhydro.git refs #701 --- diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx index 134239b8..73ec62d0 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx @@ -47,6 +47,7 @@ HYDROGUI_ImportLandCoverMapDlg::HYDROGUI_ImportLandCoverMapDlg( HYDROGUI_Module* addPage( createPage3() ); myFirstPageState = false; myDbfState = false; + myUpdateViewerState = false; } QWizardPage* HYDROGUI_ImportLandCoverMapDlg::createPage1() { @@ -198,7 +199,7 @@ void HYDROGUI_ImportLandCoverMapDlg::setSelectedPolygonNames( const QStringList& void HYDROGUI_ImportLandCoverMapDlg::onItemSelectionChanged() { int aCurIndex = GetCurrentWizardIndex(); - if (aCurIndex == 0) + if (aCurIndex == 0 && getViewerState()) emit selectionChanged( getSelectedPolygonNames() ); } @@ -421,4 +422,14 @@ bool HYDROGUI_ImportLandCoverMapDlg::getDbfState() const int HYDROGUI_ImportLandCoverMapDlg::GetCurrentWizardIndex() const { return wizard()->currentIndex(); +} + +void HYDROGUI_ImportLandCoverMapDlg::setViewerState(bool theState) +{ + myUpdateViewerState = theState; +} + +bool HYDROGUI_ImportLandCoverMapDlg::getViewerState() const +{ + return myUpdateViewerState; } \ No newline at end of file diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h index 2e7a7c0d..e3c05903 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h @@ -64,6 +64,10 @@ public: bool getDbfState() const; int GetCurrentWizardIndex() const; + void setViewerState(bool theState); + bool getViewerState() const; + + void FillCorrespondenceTable(const QStringList& theFirstColumn, const QStringList& theSecondColumn, const QVector theDefCBIndices, @@ -107,6 +111,8 @@ private: bool myFirstPageState; QVector myStrColors; bool myDbfState; + + bool myUpdateViewerState; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx index 02c6d721..e8797abf 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx @@ -310,16 +310,26 @@ void HYDROGUI_ImportLandCoverMapOp::onSelectionChanged( const QStringList& theSe } if ( !aCtx.IsNull() ) { - foreach ( QString aName, myPolygonName2PrsShape.keys() ) { + bool bSelChanged = false; + foreach ( QString aName, myPolygonName2PrsShape.keys() ) + { Handle(AIS_InteractiveObject) anObject = myPolygonName2PrsShape.value(aName)->getAISObject(); bool isSelected = theSelectedNames.contains( aName ); - if ( ( isSelected && !aCtx->IsSelected( anObject) ) || - ( !isSelected && aCtx->IsSelected( anObject) ) ) + if ( ( isSelected && !aCtx->IsSelected( anObject) ) || ( !isSelected && aCtx->IsSelected( anObject) ) ) + { aCtx->AddOrRemoveSelected( anObject, Standard_False ); + bSelChanged = true; + } } - aCtx->UpdateCurrentViewer(); + + HYDROGUI_ImportLandCoverMapDlg* aPanel = ::qobject_cast( inputPanel() ); + if ( !aPanel ) + return; + + if (bSelChanged && aPanel->getViewerState()) + aCtx->UpdateCurrentViewer(); } } @@ -352,7 +362,9 @@ void HYDROGUI_ImportLandCoverMapOp::onViewerSelectionChanged() if ( isSelected ) aSelectedNames << aName; } + aPanel->setViewerState(false); aPanel->setSelectedPolygonNames( aSelectedNames ); + aPanel->setViewerState(true); } }