]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #701
authorisn <isn@opencascade.com>
Thu, 19 Nov 2015 09:35:53 +0000 (12:35 +0300)
committerisn <isn@opencascade.com>
Thu, 19 Nov 2015 09:35:53 +0000 (12:35 +0300)
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.h
src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx

index 134239b8282cdccd24e5258fff55a6f45c1913c6..73ec62d09b77e16247f9eb42b095dd8d78fbbfbf 100644 (file)
@@ -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
index 2e7a7c0d08c9754a8c1c59ffe412a09d16bf366e..e3c05903c96ed0efa14ba23efe1475793677594d 100644 (file)
@@ -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<int> theDefCBIndices,
@@ -107,6 +111,8 @@ private:
   bool                  myFirstPageState;
   QVector<QColor>       myStrColors;
   bool                  myDbfState;
+
+  bool                  myUpdateViewerState;
 };
 
 #endif
index 02c6d721c4532921a6d71455be11e37046ce1cf8..e8797abf390d31fac2ad239f10ec94fb69003e01 100644 (file)
@@ -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<HYDROGUI_ImportLandCoverMapDlg*>( 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);
   }
 }