From: smh Date: Fri, 7 May 2004 12:40:54 +0000 (+0000) Subject: Fix on Bug PAL5832 X-Git-Tag: Ecole_Ete_a4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7014fdf5d5ff6b25ca99e39b2054ce57cc3fb4dd;p=modules%2Fvisu.git Fix on Bug PAL5832 - V1_4_1a and current: There are problems with selection data on elements --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index c1d55941..a8e59668 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -687,10 +687,6 @@ bool VisuGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } void VisuGUI::SelectionInfo() { - if (mySelectionDlg) { - mySelectionDlg->close(true); - mySelectionDlg = 0; - } mySelectionDlg = new VisuGUI_SelectionDlg(); mySelectionDlg->show(); } diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index f0677a5a..cacf63f3 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -36,6 +36,7 @@ #include "VISU_PipeLine.hxx" #include "VisuGUI.h" #include "QAD_MessageBox.h" +#include "QAD_RightFrame.h" #include "VTKViewer_ViewFrame.h" #include @@ -61,12 +62,16 @@ using namespace std; extern VisuGUI *visuGUI; - +static QAD_Study* myStudy = NULL; +static VisuGUI_SelectionDlg* mySelectionDlg = NULL; VisuGUI_SelectionDlg::VisuGUI_SelectionDlg() : QDialog( QAD_Application::getDesktop(), 0, false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose) { + if(mySelectionDlg) + mySelectionDlg->close(true); + setCaption( "Data on elements" ); setSizeGripEnabled( TRUE ); @@ -218,11 +223,16 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg() TopLayout->addWidget(aBtnBox, 3, 0); - mySelection = SALOME_Selection::Selection(visuGUI->GetActiveStudy()->getSelection()); + myStudy = visuGUI->GetActiveStudy(); + mySelection = SALOME_Selection::Selection(myStudy->getSelection()); connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent())); + connect(visuGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); + myFl = false; onSelectionChange(0); + + mySelectionDlg = this; } @@ -249,7 +259,9 @@ void VisuGUI_SelectionDlg::onSelectionChange(int theId) { } -void VisuGUI_SelectionDlg::closeEvent(QCloseEvent* theEvent) { +void VisuGUI_SelectionDlg::closeEvent(QCloseEvent* theEvent) { + mySelectionDlg = NULL; + myStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame()->SetSelectionMode( ActorSelection ); QAD_Application::getDesktop()->SetSelectionMode(ActorSelection, true); disconnect(mySelection,0,0,0); QDialog::closeEvent(theEvent); @@ -308,6 +320,8 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex); VISU_Actor* anActor = visuGUI->GetActor(aPrs3d); + if(!anActor) + return; vtkDataSet* aDataSet = anActor->GetMapper()->GetInput(); vtkPointData* aPntData = aDataSet->GetPointData();