]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix on Bug PAL5832 Ecole_Ete_a4
authorsmh <smh@opencascade.com>
Fri, 7 May 2004 12:40:54 +0000 (12:40 +0000)
committersmh <smh@opencascade.com>
Fri, 7 May 2004 12:40:54 +0000 (12:40 +0000)
 - V1_4_1a and current: There are problems with selection data on elements

src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Selection.cxx

index c1d55941a45e7272e115cd289c288ca0f393fe79..a8e596684c4e34793251588d26210fc13a9def1f 100644 (file)
@@ -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();
 }
index f0677a5a165d8374bdcf703729f0dc13585ada1c..cacf63f3a33bd280b0feb893e30107e956078c36 100644 (file)
@@ -36,6 +36,7 @@
 #include "VISU_PipeLine.hxx"
 #include "VisuGUI.h"
 #include "QAD_MessageBox.h"
+#include "QAD_RightFrame.h"
 #include "VTKViewer_ViewFrame.h"
 
 #include <TColStd_MapOfInteger.hxx>
 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();