addPage( createPage3() );
myFirstPageState = false;
myDbfState = false;
+ myUpdateViewerState = false;
}
QWizardPage* HYDROGUI_ImportLandCoverMapDlg::createPage1() {
void HYDROGUI_ImportLandCoverMapDlg::onItemSelectionChanged()
{
int aCurIndex = GetCurrentWizardIndex();
- if (aCurIndex == 0)
+ if (aCurIndex == 0 && getViewerState())
emit selectionChanged( getSelectedPolygonNames() );
}
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
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,
bool myFirstPageState;
QVector<QColor> myStrColors;
bool myDbfState;
+
+ bool myUpdateViewerState;
};
#endif
}
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();
}
}
if ( isSelected )
aSelectedNames << aName;
}
+ aPanel->setViewerState(false);
aPanel->setSelectedPolygonNames( aSelectedNames );
+ aPanel->setViewerState(true);
}
}