Salome HOME
INT PAL 0052775: Any dialogue with the selector raises an exception for second viewer
authorimn <imn@opencascade.com>
Tue, 9 Jun 2015 09:28:15 +0000 (12:28 +0300)
committerimn <imn@opencascade.com>
Tue, 9 Jun 2015 09:28:15 +0000 (12:28 +0300)
56 files changed:
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h
src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx
src/SMESHGUI/SMESHGUI_CopyMeshDlg.h
src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePatternDlg.h
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx
src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.h
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.h
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx
src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.h
src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx
src/SMESHGUI/SMESHGUI_GroupOpDlg.h
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h
src/SMESHGUI/SMESHGUI_MergeDlg.cxx
src/SMESHGUI/SMESHGUI_MergeDlg.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.h
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.h
src/SMESHGUI/SMESHGUI_PreviewDlg.cxx
src/SMESHGUI/SMESHGUI_PreviewDlg.h
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.h
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.h
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.h
src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx
src/SMESHGUI/SMESHGUI_SingleEditDlg.h
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h

index 5db6d9e10f3524814875f95bf975f2c5a7e454aa..2093128590cd08e47ec259cf4c3bad0451544b80 100644 (file)
@@ -2264,6 +2264,26 @@ void SMESHGUI::EmitSignalVisibilityChanged()
   emit SignalVisibilityChanged();
 }
 
   emit SignalVisibilityChanged();
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void SMESHGUI::EmitSignalCloseView()
+{
+  emit SignalCloseView();
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void SMESHGUI::EmitSignalActivatedViewManager()
+{
+  emit SignalActivatedViewManager();
+}
+
 //=============================================================================
 /*!
  *
 //=============================================================================
 /*!
  *
@@ -4883,6 +4903,7 @@ void SMESHGUI::onViewManagerActivated( SUIT_ViewManager* mgr )
       SUIT_ViewWindow *sf = aViews[i];
       connectView( sf );
     }
       SUIT_ViewWindow *sf = aViews[i];
       connectView( sf );
     }
+    EmitSignalActivatedViewManager();
   }
 }
 
   }
 }
 
@@ -6823,6 +6844,7 @@ void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
   //Crear all Plot2d Viewers if need.
   SMESH::ClearPlot2Viewers(pview);
 #endif
   //Crear all Plot2d Viewers if need.
   SMESH::ClearPlot2Viewers(pview);
 #endif
+  EmitSignalCloseView();
 }
 
 void SMESHGUI::message( const QString& msg )
 }
 
 void SMESHGUI::message( const QString& msg )
index 2f8dfdc0f7375d5e39f133aa707f65e1bfe8a05d..9d35781b0869358f563bfb2404cb5ea25595cbb4 100644 (file)
@@ -133,6 +133,8 @@ public :
   void                            EmitSignalStudyFrameChanged();
   void                            EmitSignalCloseAllDialogs();
   void                            EmitSignalVisibilityChanged();
   void                            EmitSignalStudyFrameChanged();
   void                            EmitSignalCloseAllDialogs();
   void                            EmitSignalVisibilityChanged();
+  void                            EmitSignalCloseView();
+  void                            EmitSignalActivatedViewManager();
 
   virtual void                    contextMenuPopup( const QString&, QMenu*, QString& );
   virtual void                    createPreferences();
 
   virtual void                    contextMenuPopup( const QString&, QMenu*, QString& );
   virtual void                    createPreferences();
@@ -175,6 +177,8 @@ signals:
   void                            SignalStudyFrameChanged();
   void                            SignalCloseAllDialogs();
   void                            SignalVisibilityChanged();
   void                            SignalStudyFrameChanged();
   void                            SignalCloseAllDialogs();
   void                            SignalVisibilityChanged();
+  void                            SignalCloseView();
+  void                            SignalActivatedViewManager();
 
 protected:
   void                            createSMESHAction( const int,
 
 protected:
   void                            createSMESHAction( const int,
index 35bc44b9b1d4c1fd02c4b5251c1d6c837f558693..44cba417c84887f55bb10c98755ca80dc2c491db 100644 (file)
@@ -515,10 +515,13 @@ void SMESHGUI_AddMeshElementDlg::Init()
   connect(SelectButtonC1A1,SIGNAL(clicked()),                     SLOT(SetEditCurrentArgument()));
   connect(LineEditC1A1,    SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(mySMESHGUI,      SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
   connect(SelectButtonC1A1,SIGNAL(clicked()),                     SLOT(SetEditCurrentArgument()));
   connect(LineEditC1A1,    SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(mySMESHGUI,      SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
+
   connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
   /* to close dialog if study frame change */
   connect(mySMESHGUI,      SIGNAL(SignalStudyFrameChanged()),     SLOT(reject()));
   connect(mySelectionMgr,  SIGNAL(currentSelectionChanged()),     SLOT(SelectionIntoArgument()));
   /* to close dialog if study frame change */
   connect(mySMESHGUI,      SIGNAL(SignalStudyFrameChanged()),     SLOT(reject()));
-  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),       SLOT(reject()));    
+  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),       SLOT(reject()));
+  connect(mySMESHGUI,      SIGNAL(SignalActivatedViewManager()),  SLOT(onOpenView()));
+  connect(mySMESHGUI,      SIGNAL(SignalCloseView()),             SLOT(onCloseView()));
 
   if (Reverse)
     connect(Reverse,       SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
 
   if (Reverse)
     connect(Reverse,       SIGNAL(stateChanged(int)),             SLOT(CheckBox(int)));
@@ -942,9 +945,15 @@ void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
 {
-  if (GroupConstructors->isEnabled())
-    return;
-  ActivateThisDialog();
+  if ( !GroupConstructors->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector && !mySimulation) {
+      mySelector = aViewWindow->GetSelector();
+      mySimulation = new SMESH::TElementSimulation(
+        dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    }
+    ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -979,7 +988,7 @@ void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
 }
 
 //=================================================================================
 }
 
 //=================================================================================
-// function : isValid
+// function : onDiameterChanged()
 // purpose  :
 //=================================================================================
 void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
 // purpose  :
 //=================================================================================
 void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
@@ -987,7 +996,37 @@ void SMESHGUI_AddMeshElementDlg::onDiameterChanged(){
 }
 
 //=================================================================================
 }
 
 //=================================================================================
-// function : isValid
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_AddMeshElementDlg::onOpenView()
+{
+  if ( mySelector && mySimulation ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySimulation = new SMESH::TElementSimulation(
+      dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_AddMeshElementDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+  delete mySimulation;
+  mySimulation = 0;
+}
+
+//=================================================================================
+// function : isValid()
 // purpose  :
 //=================================================================================
 bool SMESHGUI_AddMeshElementDlg::isValid()
 // purpose  :
 //=================================================================================
 bool SMESHGUI_AddMeshElementDlg::isValid()
index 41a4d8516ee563d974478f7f21eb452a982879bb..9b19e3b064b984bb46385c5b78cf678cdd78689e 100644 (file)
@@ -130,6 +130,8 @@ private slots:
   void                        ActivateThisDialog();
   void                        CheckBox( int );
   void                        onTextChange( const QString& );
   void                        ActivateThisDialog();
   void                        CheckBox( int );
   void                        onTextChange( const QString& );
+  void                        onOpenView();
+  void                        onCloseView();
 };
 
 #endif // SMESHGUI_ADDMESHELEMENTDLG_H
 };
 
 #endif // SMESHGUI_ADDMESHELEMENTDLG_H
index 6ee198e7bfacdf3623648e9201478dab831a37fe..10ada7bd0ea411ace73d0b83007d37c9a0a09549 100644 (file)
@@ -650,6 +650,8 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
   connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
   connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()), SLOT(onCloseView()));
 
   myCurrentLineEdit = myCornerNodes;
 
 
   myCurrentLineEdit = myCornerNodes;
 
@@ -844,6 +846,35 @@ void SMESHGUI_AddQuadraticElementDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_AddQuadraticElementDlg::onOpenView()
+{
+  if ( mySelector && mySimulation ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySimulation = new SMESH::TElementSimulationQuad(
+      dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_AddQuadraticElementDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+  delete mySimulation;
+  mySimulation = 0;
+}
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -1157,12 +1188,17 @@ void SMESHGUI_AddQuadraticElementDlg::ActivateThisDialog()
 // function : enterEvent()
 // purpose  :
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
-
 void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
 {
 void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
 {
-  if (GroupConstructors->isEnabled())
-    return;
-  ActivateThisDialog();
+  if ( !GroupConstructors->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector && !mySimulation) {
+      mySelector = aViewWindow->GetSelector();
+      mySimulation = new SMESH::TElementSimulationQuad(
+        dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    }
+    ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index 1aee0dc9eae9490cfd408b7be7561bc5a5931353..7a36de47b8048c1cb06693acf0cfed35ba7e3c14 100644 (file)
@@ -142,6 +142,8 @@ private slots:
   void                        SelectionIntoArgument();
   void                        DeactivateActiveDialog();
   void                        ActivateThisDialog();
   void                        SelectionIntoArgument();
   void                        DeactivateActiveDialog();
   void                        ActivateThisDialog();
+  void                        onOpenView();
+  void                        onCloseView();
 };
 
 #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H
 };
 
 #endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H
index 1c8d4dbdc73d3b0803009ea0e62ed67a7da0b8b1..5da5ff109b67ac350b4e13a7969f07c005de999e 100644 (file)
@@ -234,6 +234,10 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
           this,           SLOT   (SelectionIntoArgument()));
   connect(mySMESHGUI,     SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
           this,           SLOT   (reject()));
           this,           SLOT   (SelectionIntoArgument()));
   connect(mySMESHGUI,     SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
           this,           SLOT   (reject()));
+  connect(mySMESHGUI,     SIGNAL (SignalActivatedViewManager()),
+          this,           SLOT   (onOpenView()));
+  connect(mySMESHGUI,     SIGNAL (SignalCloseView()),
+          this,           SLOT   (onCloseView()));
 
   connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
           this,               SLOT  (onTextChange(const QString&)));
 
   connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
           this,               SLOT  (onTextChange(const QString&)));
@@ -381,6 +385,31 @@ void SMESHGUI_CopyMeshDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_CopyMeshDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_CopyMeshDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -602,16 +631,21 @@ void SMESHGUI_CopyMeshDlg::ActivateThisDialog()
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
+
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
 void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
 void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*)
 {
-  if (!ConstructorsBox->isEnabled())
+  if ( !ConstructorsBox->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector ) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 }
-
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index 730d5e637d8db49f296c6f27ddf52db93b8916d5..54347e18ad4e8f8caf1af04946c4c4846f0ddfaf 100644 (file)
@@ -125,6 +125,8 @@ private slots:
   void                   onTextChange( const QString& );
   void                   onSelectIdSource( bool );
   void                   setFilters();
   void                   onTextChange( const QString& );
   void                   onSelectIdSource( bool );
   void                   setFilters();
+  void                   onOpenView();
+  void                   onCloseView();
 };
 
 #endif // SMESHGUI_CopyMeshDLG_H
 };
 
 #endif // SMESHGUI_CopyMeshDLG_H
index a39a62ed01c10296ea14e30c0d3be66d2ab3d71b..f0aa90dcbf79bd2f9c5768024b7b697d13e38a64 100755 (executable)
@@ -105,9 +105,6 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI*   theModule,
 
   aDlgLay->setStretchFactor( aMainFrame, 1 );
 
 
   aDlgLay->setStretchFactor( aMainFrame, 1 );
 
-  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
-    mySelector = aViewWindow->GetSelector();
-
   myHelpFileName = "pattern_mapping_page.html";
 
   Init( theType );
   myHelpFileName = "pattern_mapping_page.html";
 
   Init( theType );
index 18cec4286ca7a0952e581d944306b29f6cfebb3d..840f09cfb062bdcca875a27733d02050aa7d1930 100755 (executable)
@@ -115,7 +115,6 @@ private:
   QCheckBox*               myProjectChk;
 
   SMESHGUI*                mySMESHGUI;
   QCheckBox*               myProjectChk;
 
   SMESHGUI*                mySMESHGUI;
-  SVTK_Selector*           mySelector;
   LightApp_SelectionMgr*   mySelectionMgr;
   int                      myType;
 
   LightApp_SelectionMgr*   mySelectionMgr;
   int                      myType;
 
index f4050368807cdd51a4f4dd4afdcb6194672f3b6a..bdbb2d95da478b1c3b6f1a179cdec60f7013fe8e 100644 (file)
@@ -353,8 +353,9 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
   /* to close dialog if study change */
   connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
   /* to close dialog if study change */
-  connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
-  
+  connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),      this, SLOT( reject() ) );
+  connect( mySMESHGUI, SIGNAL ( SignalActivatedViewManager() ), this, SLOT( onOpenView() ) );
+  connect( mySMESHGUI, SIGNAL ( SignalCloseView() ),            this, SLOT( onCloseView() ) );
   ConstructorsClicked(0);
   SelectionIntoArgument();
 }
   ConstructorsClicked(0);
   SelectionIntoArgument();
 }
@@ -613,6 +614,36 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::onOpenView()
+{
+  if ( mySelector && mySimulation ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySimulation = new SMESH::TPolySimulation(
+      dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+  delete mySimulation;
+  mySimulation = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -1027,16 +1058,21 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ActivateThisDialog()
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
-
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e)
+void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent (QEvent*)
 {
 {
-  if ( ConstructorsBox->isEnabled() )
-    return;  
-  ActivateThisDialog();
+  if ( !ConstructorsBox->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector && !mySimulation) {
+      mySelector = aViewWindow->GetSelector();
+      mySimulation = new SMESH::TPolySimulation(
+        dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+    }
+    ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index b213344d38e0ccd5f454d195091d2ccc9a23ed65..85343ee0f2d845436f8f092b5095950a09dc1f1f 100644 (file)
@@ -138,6 +138,8 @@ private slots:
   void                     ActivateThisDialog();
   void                     onTextChange( const QString& );
   void                     onListSelectionChanged();
   void                     ActivateThisDialog();
   void                     onTextChange( const QString& );
   void                     onListSelectionChanged();
+  void                     onOpenView();
+  void                     onCloseView();
 };
 
 #endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
 };
 
 #endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
index 488fddd219cc9e0d4ec288845b6327cd9de18d98..53b2cbf48824146d3d824ba2cc55d9df6993bbaa 100644 (file)
@@ -309,6 +309,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
   connect(BasePointGrp,       SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument()));
 
   connect(mySMESHGUI,  SIGNAL(SignalCloseAllDialogs()),        SLOT(reject()));
   connect(BasePointGrp,       SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument()));
 
   connect(mySMESHGUI,  SIGNAL(SignalCloseAllDialogs()),        SLOT(reject()));
+  connect(mySMESHGUI,  SIGNAL(SignalActivatedViewManager()),   SLOT(onOpenView()));
+  connect(mySMESHGUI,  SIGNAL(SignalCloseView()),              SLOT(onCloseView()));
   connect(mySMESHGUI,  SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   SLOT(SelectionIntoArgument()));
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this,    SLOT(toDisplaySimulation()));
   connect(mySMESHGUI,  SIGNAL(SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   SLOT(SelectionIntoArgument()));
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this,    SLOT(toDisplaySimulation()));
@@ -587,6 +589,31 @@ void SMESHGUI_ExtrusionAlongPathDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ExtrusionAlongPathDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ExtrusionAlongPathDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=======================================================================
 // function : onTextChange()
 // purpose  :
 //=======================================================================
 // function : onTextChange()
 // purpose  :
@@ -865,12 +892,17 @@ void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
 
 //=================================================================================
 // function : enterEvent()
 
 //=================================================================================
 // function : enterEvent()
-// purpose  : Mouse enter event
+// purpose  :
 //=================================================================================
 void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
 {
-  if (!GroupButtons->isEnabled())
+  if ( !GroupButtons->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 199c8752eb67e3e02fc3688d72cf4771eb8ce5dd..0a5f150e2c3609fd9b7096c51c1c3074075a5e6f 100644 (file)
@@ -140,6 +140,8 @@ private slots:
   void                      onTextChange( const QString& );
   void                      OnAngleAdded();
   void                      OnAngleRemoved();
   void                      onTextChange( const QString& );
   void                      OnAngleAdded();
   void                      OnAngleRemoved();
+  void                      onOpenView();
+  void                      onCloseView();
 };
 
 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H
 };
 
 #endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H
index 0a7901267b630e6cb8e1900e3a7fbda257f10be7..5a62c1de60021b8662d8efd89a7445c0e9f5a4eb 100644 (file)
@@ -777,7 +777,9 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   connect(SelectorWdg,          SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
   connect(SelectorWdg,          SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
   /* to close dialog if study change */
   connect(SelectorWdg,          SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
   connect(SelectorWdg,          SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,           SIGNAL(SignalCloseAllDialogs()),   this, SLOT(reject()));
+  connect(mySMESHGUI,           SIGNAL(SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI,           SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI,           SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
 
   connect(SpinBox_Dx,      SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
   connect(SpinBox_Dy,      SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
 
   connect(SpinBox_Dx,      SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
   connect(SpinBox_Dy,      SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@@ -1119,6 +1121,31 @@ void SMESHGUI_ExtrusionDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ExtrusionDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ExtrusionDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -1240,12 +1267,17 @@ void SMESHGUI_ExtrusionDlg::ActivateThisDialog()
 
 //=================================================================================
 // function : enterEvent()
 
 //=================================================================================
 // function : enterEvent()
-// purpose  : Mouse enter event
+// purpose  :
 //=================================================================================
 void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
 {
-  if (!GroupButtons->isEnabled())
+  if ( !GroupButtons->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index 80eaeacfa258f37d374621094b95706a89f54c14..64173209f852b3ce76e2734ce5c4b5afa220ec3f 100644 (file)
@@ -203,6 +203,9 @@ private slots:
   void                            SelectionIntoArgument();
   void                            DeactivateActiveDialog();
   void                            ActivateThisDialog();
   void                            SelectionIntoArgument();
   void                            DeactivateActiveDialog();
   void                            ActivateThisDialog();
+  void                            onOpenView();
+  void                            onCloseView();
+
 };
 
 #endif // SMESHGUI_EXTRUSIONDLG_H
 };
 
 #endif // SMESHGUI_EXTRUSIONDLG_H
index 4e39b5da5d9a2acd1f9e31e84768304598a6248e..e84876d44c3f15bd6042b930059bff3e390d552c 100755 (executable)
@@ -2925,6 +2925,8 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes, const bool setInViewe
 
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
 
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
   
   updateMainButtons();
   updateSelection();
   
   updateMainButtons();
   updateSelection();
@@ -3010,6 +3012,29 @@ void SMESHGUI_FilterDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_FilterDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_FilterDlg::onCloseView()
+{
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : onHelp()
 // purpose  :
 //=================================================================================
 // function : onHelp()
 // purpose  :
index 55d854c17162dc532f8a2c16d9d09d2ce4c79b9b..50dabdaa192be632bd58c655239e0adbbeb86827 100755 (executable)
@@ -255,6 +255,8 @@ private slots:
   void                      onCriterionChanged( const int, const int );
   void                      onThresholdChanged( const int, const int );
   void                      onCurrentChanged( int, int );
   void                      onCriterionChanged( const int, const int );
   void                      onThresholdChanged( const int, const int );
   void                      onCurrentChanged( int, int );
+  void                      onOpenView();
+  void                      onCloseView();
 
 private:
 
 
 private:
 
index c5a4e447ab3aabe3dfd9c20329e818fd992f5525..fc4304500cff44a28641f5505dc693f87b504b31 100644 (file)
@@ -238,6 +238,7 @@ SMESHGUI_FindElemByPointOp::SMESHGUI_FindElemByPointOp()
   :SMESHGUI_SelectionOp()
 {
   mySimulation = 0;
   :SMESHGUI_SelectionOp()
 {
   mySimulation = 0;
+  mySMESHGUI = 0;
   myDlg = new SMESHGUI_FindElemByPointDlg;
   myHelpFileName = "find_element_by_point_page.html";
 
   myDlg = new SMESHGUI_FindElemByPointDlg;
   myHelpFileName = "find_element_by_point_page.html";
 
@@ -279,7 +280,10 @@ void SMESHGUI_FindElemByPointOp::startOperation()
 {
   // init simulation with a current View
   if ( mySimulation ) delete mySimulation;
 {
   // init simulation with a current View
   if ( mySimulation ) delete mySimulation;
-  mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() ));
+  mySMESHGUI = getSMESHGUI();
+  mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
   vtkProperty* aProp = vtkProperty::New();
   aProp->SetRepresentationToWireframe();
   aProp->SetColor(250, 0, 250);
   vtkProperty* aProp = vtkProperty::New();
   aProp->SetRepresentationToWireframe();
   aProp->SetColor(250, 0, 250);
@@ -309,10 +313,37 @@ void SMESHGUI_FindElemByPointOp::stopOperation()
     delete mySimulation;
     mySimulation = 0;
   }
     delete mySimulation;
     mySimulation = 0;
   }
+  disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
   selectionMgr()->removeFilter( myFilter );
   SMESHGUI_SelectionOp::stopOperation();
 }
 
   selectionMgr()->removeFilter( myFilter );
   SMESHGUI_SelectionOp::stopOperation();
 }
 
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer opened
+ */
+//=================================================================================
+void SMESHGUI_FindElemByPointOp::onOpenView()
+{
+  if ( mySimulation ) {
+    mySimulation->SetVisibility(false);
+  }
+  else {
+    mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
+  }
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer closed
+ */
+//=================================================================================
+void SMESHGUI_FindElemByPointOp::onCloseView()
+{
+  delete mySimulation;
+  mySimulation = 0;
+}
 //================================================================================
 /*!
  * \brief hilight found selected elements
 //================================================================================
 /*!
  * \brief hilight found selected elements
@@ -503,7 +534,8 @@ void SMESHGUI_FindElemByPointOp::redisplayPreview()
   myPreview->nodesXYZ[0].x = myDlg->myX->GetValue();
   myPreview->nodesXYZ[0].y = myDlg->myY->GetValue();
   myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
   myPreview->nodesXYZ[0].x = myDlg->myX->GetValue();
   myPreview->nodesXYZ[0].y = myDlg->myY->GetValue();
   myPreview->nodesXYZ[0].z = myDlg->myZ->GetValue();
-
+  if (!mySimulation)
+    mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
   mySimulation->SetData(&myPreview.in());
 }
 
   mySimulation->SetData(&myPreview.in());
 }
 
index 7ec86a2ea3ac382045ca643b4111fc75d4a85191..a3418e8ec5d0b5b0dcda3d238b9d501d5f022986 100644 (file)
@@ -68,11 +68,14 @@ private slots:
   void                           onElemSelected();
   void                           onElemTypeChange(int);
   void                           redisplayPreview();
   void                           onElemSelected();
   void                           onElemTypeChange(int);
   void                           redisplayPreview();
+  void                           onOpenView();
+  void                           onCloseView();
 
 private:
   SMESHGUI_FindElemByPointDlg*     myDlg;
 
   SUIT_SelectionFilter*            myFilter;
 
 private:
   SMESHGUI_FindElemByPointDlg*     myDlg;
 
   SUIT_SelectionFilter*            myFilter;
+  SMESHGUI*                        mySMESHGUI;
   SMESHGUI_MeshEditPreview*        mySimulation; // to show point coordinates
   SMESH::SMESH_IDSource_var        myMeshOrPart;
   SMESH::MeshPreviewStruct_var     myPreview;
   SMESHGUI_MeshEditPreview*        mySimulation; // to show point coordinates
   SMESH::SMESH_IDSource_var        myMeshOrPart;
   SMESH::MeshPreviewStruct_var     myPreview;
index c0dcd49d338459546727b1266f03784931eac334..6176934a633b33b2b9339140e5b37a31a733d777 100644 (file)
@@ -462,7 +462,8 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
   connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),  this, SLOT(onObjectSelectionChanged()));
   connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()),      this, SLOT(onVisibilityChanged()));
-
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()),   this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),              this, SLOT(onCloseView()));
   rb1->setChecked(true); // VSR !!!
   onGrpTypeChanged(0); // VSR!!!
 
   rb1->setChecked(true); // VSR !!!
   onGrpTypeChanged(0); // VSR!!!
 
@@ -2248,6 +2249,32 @@ void SMESHGUI_GroupDlg::reject()
   if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
 }
 
   if ( myFilterDlg ) myFilterDlg->UnRegisterFilters();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : onHelp()
 // purpose  :
 //=================================================================================
 // function : onHelp()
 // purpose  :
@@ -2289,6 +2316,10 @@ void SMESHGUI_GroupDlg::onDeactivate()
 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
 void SMESHGUI_GroupDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     mySMESHGUI->EmitSignalDeactivateDialog();
     setEnabled(true);
     mySelectionMode = grpNoSelection;
     mySMESHGUI->EmitSignalDeactivateDialog();
     setEnabled(true);
     mySelectionMode = grpNoSelection;
index 6e9aa992c9d611c804223ee60ab7dc8b86637da1..8819d24f0be6b22ac4aa4b4b6b5c5858e4c2f1fb 100644 (file)
@@ -120,6 +120,9 @@ private slots:
   void                          onPublishShapeByMeshDlg( SUIT_Operation* );
   void                          onCloseShapeByMeshDlg( SUIT_Operation* );
 
   void                          onPublishShapeByMeshDlg( SUIT_Operation* );
   void                          onCloseShapeByMeshDlg( SUIT_Operation* );
 
+  void                          onOpenView();
+  void                          onCloseView();
+
 private:
   void                          initDialog( bool );
   void                          init( SMESH::SMESH_Mesh_ptr );
 private:
   void                          initDialog( bool );
   void                          init( SMESH::SMESH_Mesh_ptr );
index bfcf3189502170562df58bd22adcedb98fdf9983..69077f967f5ef8ec291f55ad8706943d2ef6b401 100644 (file)
@@ -225,6 +225,8 @@ void SMESHGUI_GroupOpDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView()));
 
   // set selection mode
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
 
   // set selection mode
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@@ -331,6 +333,32 @@ void SMESHGUI_GroupOpDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupOpDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_GroupOpDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
 /*!
   \brief SLOT called when "Help" button pressed shows "Help" page
 */
 /*!
   \brief SLOT called when "Help" button pressed shows "Help" page
 */
@@ -459,8 +487,12 @@ void SMESHGUI_GroupOpDlg::enterEvent(QEvent*)
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
 {
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
-  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+  SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+  if ( aViewWindow ) {
     aViewWindow->SetSelectionMode(ActorSelection);
     aViewWindow->SetSelectionMode(ActorSelection);
+    if (!mySelector)
+      mySelector = aViewWindow->GetSelector();
+  }
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
 }
 
   mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
 }
 
@@ -496,7 +528,7 @@ void SMESHGUI_GroupOpDlg::setName( const QString& theName )
 }
 
 /*!
 }
 
 /*!
-  \brief Provides reaction on \93F1\94 button pressing
+  \brief Provides reaction on ï¿½F1� button pressing
   \param e  key press event
 */
 void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e )
   \param e  key press event
 */
 void SMESHGUI_GroupOpDlg::keyPressEvent( QKeyEvent* e )
index 4acb86821b703b45665217594cdd4ee2d6c79500..6f6b70175f49c3402cf7cca13d1464c57057719c 100644 (file)
@@ -105,6 +105,9 @@ private slots:
 
   void                      onDeactivate();
 
 
   void                      onDeactivate();
 
+  void                      onOpenView();
+  void                      onCloseView();
+
 private:
   QWidget*                  createButtonFrame( QWidget* );
   QWidget*                  createMainFrame  ( QWidget* );
 private:
   QWidget*                  createButtonFrame( QWidget* );
   QWidget*                  createMainFrame  ( QWidget* );
index f67581cff16c54d3c5608a9b732b70915e76070f..3b8ffef6514829c822f274c022c9d3f8eb0ea98a 100644 (file)
@@ -346,6 +346,7 @@ void SMESHGUI_MakeNodeAtPointDlg::ConstructorsClicked (int constructorId)
 SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
 {
   mySimulation = 0;
 SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
 {
   mySimulation = 0;
+  mySMESHGUI = 0;
   myDlg = new SMESHGUI_MakeNodeAtPointDlg;
   myFilter = 0;
   myHelpFileName = "mesh_through_point_page.html";
   myDlg = new SMESHGUI_MakeNodeAtPointDlg;
   myFilter = 0;
   myHelpFileName = "mesh_through_point_page.html";
@@ -395,7 +396,10 @@ void SMESHGUI_MakeNodeAtPointOp::startOperation()
 
   // init simulation with a current View
   if ( mySimulation ) delete mySimulation;
 
   // init simulation with a current View
   if ( mySimulation ) delete mySimulation;
-  mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() ));
+  mySMESHGUI = getSMESHGUI();
+  mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
   vtkProperty* aProp = vtkProperty::New();
   aProp->SetRepresentationToWireframe();
   aProp->SetColor(250, 0, 250);
   vtkProperty* aProp = vtkProperty::New();
   aProp->SetRepresentationToWireframe();
   aProp->SetColor(250, 0, 250);
@@ -463,12 +467,19 @@ int SMESHGUI_MakeNodeAtPointOp::GetConstructorId()
 void SMESHGUI_MakeNodeAtPointOp::stopOperation()
 {
   myNoPreview = true;
 void SMESHGUI_MakeNodeAtPointOp::stopOperation()
 {
   myNoPreview = true;
-  mySimulation->SetVisibility(false);
+  if ( mySimulation )
+  {
+    mySimulation->SetVisibility(false);
+    delete mySimulation;
+    mySimulation = 0;
+  }
   if ( myMeshActor ) {
     myMeshActor->SetPointRepresentation(false);
     SMESH::RepaintCurrentView();
     myMeshActor = 0;
   }
   if ( myMeshActor ) {
     myMeshActor->SetPointRepresentation(false);
     SMESH::RepaintCurrentView();
     myMeshActor = 0;
   }
+  disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
   selectionMgr()->removeFilter( myFilter );
   SMESHGUI_SelectionOp::stopOperation();
 }
   selectionMgr()->removeFilter( myFilter );
   SMESHGUI_SelectionOp::stopOperation();
 }
@@ -787,7 +798,8 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
     aMeshPreviewStruct->elementConnectivities.length(1);
     aMeshPreviewStruct->elementConnectivities[0] = 0;
   }
     aMeshPreviewStruct->elementConnectivities.length(1);
     aMeshPreviewStruct->elementConnectivities[0] = 0;
   }
-
+  if (!mySimulation)
+    mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
   // display data
   if ( aMeshPreviewStruct.operator->() )
   {
   // display data
   if ( aMeshPreviewStruct.operator->() )
   {
@@ -801,6 +813,33 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview()
   myNoPreview = false;
 }
 
   myNoPreview = false;
 }
 
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer opened
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onOpenView()
+{
+  if ( mySimulation ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
+  }
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer closed
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onCloseView()
+{
+  delete mySimulation;
+  mySimulation = 0;
+}
+
 //================================================================================
 /*!
  * \brief SLOT called when the node id is manually changed
 //================================================================================
 /*!
  * \brief SLOT called when the node id is manually changed
index 5af0a815ba8cf91c596a9dd1bf1468ad5f98c288..805f9505ec3a43e5e9a79dc75c853c74bcd34d22 100644 (file)
@@ -73,6 +73,8 @@ private slots:
   void                           onTextChange( const QString& );
   void                           onUpdateDestination();
   void                           onDestCoordChanged();
   void                           onTextChange( const QString& );
   void                           onUpdateDestination();
   void                           onDestCoordChanged();
+  void                           onOpenView();
+  void                           onCloseView();
 
 private:
   int                           GetConstructorId();
 
 private:
   int                           GetConstructorId();
@@ -81,6 +83,7 @@ private:
 
   SUIT_SelectionFilter*         myFilter;
   int                           myMeshOldDisplayMode;
 
   SUIT_SelectionFilter*         myFilter;
   int                           myMeshOldDisplayMode;
+  SMESHGUI*                     mySMESHGUI;
   SMESHGUI_MeshEditPreview*     mySimulation;
   SMESH_Actor*                  myMeshActor;
   bool                          myNoPreview;
   SMESHGUI_MeshEditPreview*     mySimulation;
   SMESH_Actor*                  myMeshActor;
   bool                          myNoPreview;
index 08fca6b6ae197f2e969ad1998e2113ffc5b0eb09..1a37b7760fc0cbfbb9d5260d0b5f9cc8d5afd30f 100644 (file)
@@ -570,7 +570,8 @@ void SMESHGUI_MergeDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
-
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this,  SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
   // Init Mesh field from selection
   SelectionIntoArgument();
 
   // Init Mesh field from selection
   SelectionIntoArgument();
 
@@ -721,6 +722,31 @@ void SMESHGUI_MergeDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MergeDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MergeDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -1246,10 +1272,15 @@ void SMESHGUI_MergeDlg::ActivateThisDialog()
 // function : enterEvent()
 // purpose  :
 //=================================================================================
 // function : enterEvent()
 // purpose  :
 //=================================================================================
-void SMESHGUI_MergeDlg::enterEvent(QEvent*)
+void SMESHGUI_MergeDlg::enterEvent (QEvent*)
 {
 {
-  if (!GroupConstructors->isEnabled())
+  if ( !GroupConstructors->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index 1e5ad080d65845bbe84ce1ef2223d9a545d444b4..b003b3842f42006ad215816093742e201d3497f7 100644 (file)
@@ -171,6 +171,8 @@ protected slots:
   void                      DeactivateActiveDialog();
   void                      ActivateThisDialog();
   void                      onTypeChanged(int);
   void                      DeactivateActiveDialog();
   void                      ActivateThisDialog();
   void                      onTypeChanged(int);
+  void                      onOpenView();
+  void                      onCloseView();
 };
 
 #endif // SMESHGUI_MergeDlg_H
 };
 
 #endif // SMESHGUI_MergeDlg_H
index 11a84fdae5e91b30534ac6cb7dc18e92341f3123..dd4d753377e5abe513a2ca41257535fde408d23f 100755 (executable)
@@ -391,6 +391,8 @@ void SMESHGUI_MeshPatternDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT( onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT( onCloseView()));
 
   myTypeGrp->button(Type_2d)->setChecked(true);
   onTypeChanged(Type_2d);
 
   myTypeGrp->button(Type_2d)->setChecked(true);
   onTypeChanged(Type_2d);
@@ -558,6 +560,32 @@ void SMESHGUI_MeshPatternDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MeshPatternDlg::onOpenView()
+{
+  if(!mySelector) {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+    activateSelection();
+    connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MeshPatternDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
+
 //=================================================================================
 // function : onHelp()
 // purpose  :
 //=================================================================================
 // function : onHelp()
 // purpose  :
@@ -715,8 +743,13 @@ void SMESHGUI_MeshPatternDlg::enterEvent (QEvent*)
   if (myIsCreateDlgOpen)
     return;
 
   if (myIsCreateDlgOpen)
     return;
 
-  if (myReverseChk->isChecked())
+  if (myReverseChk->isChecked()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     displayPreview();
     displayPreview();
+  }
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
   activateSelection();
   mySMESHGUI->EmitSignalDeactivateDialog();
   setEnabled(true);
   activateSelection();
index b3f81fd1b60625ba45b4520f9de1fa129ab0378c..5b656f726cdb8543f32958ab6bcacb74ff06ce50 100755 (executable)
@@ -98,6 +98,8 @@ private slots:
   void                                onCloseCreationDlg();
   void                                onTextChanged( const QString& );
   void                                onNodeChanged( int );
   void                                onCloseCreationDlg();
   void                                onTextChanged( const QString& );
   void                                onNodeChanged( int );
+  void                                onOpenView();
+  void                                onCloseView();
 
 private:
   QWidget*                            createButtonFrame( QWidget* );
 
 private:
   QWidget*                            createButtonFrame( QWidget* );
index 7498047feedc8099c9b0c744b6e6ab4463e89fde..f123ea17ea7ccf412e128ea3c31e095fe446fd6a 100755 (executable)
@@ -397,6 +397,8 @@ void SMESHGUI_MultiEditDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT( onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT( onCloseView()));
 
   // dialog controls
   connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn()  ));
 
   // dialog controls
   connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn()  ));
@@ -476,6 +478,30 @@ void SMESHGUI_MultiEditDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MultiEditDlg::onOpenView()
+{
+  if(!mySelector) {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MultiEditDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
+
 //=================================================================================
 // function : onHelp()
 // purpose  :
 //=================================================================================
 // function : onHelp()
 // purpose  :
@@ -588,6 +614,10 @@ void SMESHGUI_MultiEditDlg::onDeactivate()
 void SMESHGUI_MultiEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
 void SMESHGUI_MultiEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     mySMESHGUI->EmitSignalDeactivateDialog();
     setEnabled(true);
     setSelectionMode();
     mySMESHGUI->EmitSignalDeactivateDialog();
     setEnabled(true);
     setSelectionMode();
index 1b4a8ffa930c8051a997c3c889fba742a9d4d594..2f92d6b00dfdc4d125cc0f22b2c30d47ede6e881 100755 (executable)
@@ -102,6 +102,8 @@ protected slots:
   virtual void              onToAllChk();
   void                      onFilterAccepted();
   virtual void              on3d2dChanged(int);
   virtual void              onToAllChk();
   void                      onFilterAccepted();
   virtual void              on3d2dChanged(int);
+  void                      onOpenView();
+  void                      onCloseView();
 
   SMESH::NumericalFunctor_ptr getNumericalFunctor();
 
 
   SMESH::NumericalFunctor_ptr getNumericalFunctor();
 
index 69bdb257e5ef71194835e7b50b4b2f256b29f86e..e163699d4fc9921378360e394f3f1a8ad23c6dc0 100644 (file)
@@ -382,8 +382,9 @@ void SMESHGUI_NodesDlg::Init()
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
   /* to close dialog if study frame change */
   connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( reject() ) );
   connect( mySMESHGUI,     SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
   /* to close dialog if study frame change */
   connect( mySMESHGUI,     SIGNAL( SignalStudyFrameChanged() ),      SLOT( reject() ) );
-  connect(mySMESHGUI,      SIGNAL(SignalCloseAllDialogs()),          SLOT(reject()));
-
+  connect( mySMESHGUI,     SIGNAL( SignalCloseAllDialogs() ),        SLOT( reject() ) );
+  connect( mySMESHGUI,     SIGNAL( SignalActivatedViewManager() ),   SLOT( onOpenView() ) );
+  connect( mySMESHGUI,     SIGNAL( SignalCloseView() ),              SLOT( onCloseView() ) );
   // set selection mode
   SMESH::SetPointRepresentation( true );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
   // set selection mode
   SMESH::SetPointRepresentation( true );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
@@ -402,7 +403,6 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
     double vx = SpinBox_X->GetValue();
     double vy = SpinBox_Y->GetValue();
     double vz = SpinBox_Z->GetValue();
     double vx = SpinBox_X->GetValue();
     double vy = SpinBox_Y->GetValue();
     double vz = SpinBox_Z->GetValue();
-
     mySimulation->SetPosition( vx, vy, vz );
   }
 }
     mySimulation->SetPosition( vx, vy, vz );
   }
 }
@@ -547,7 +547,6 @@ void SMESHGUI_NodesDlg::reject()
   disconnect( mySelectionMgr, 0, this, 0 );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
     aViewWindow->SetSelectionMode( ActorSelection );
   disconnect( mySelectionMgr, 0, this, 0 );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
     aViewWindow->SetSelectionMode( ActorSelection );
-
   mySimulation->SetVisibility( false );
   SMESH::SetPointRepresentation( false );
   mySMESHGUI->ResetState();
   mySimulation->SetVisibility( false );
   SMESH::SetPointRepresentation( false );
   mySMESHGUI->ResetState();
@@ -555,6 +554,36 @@ void SMESHGUI_NodesDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_NodesDlg::onOpenView()
+{
+  if ( mySelector && mySimulation ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    mySelector = aViewWindow->GetSelector();
+    mySimulation = new SMESH::TNodeSimulation(aViewWindow);
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_NodesDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+  delete mySimulation;
+  mySimulation = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -644,8 +673,14 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument()
 //=================================================================================
 void SMESHGUI_NodesDlg::enterEvent( QEvent* )
 {
 //=================================================================================
 void SMESHGUI_NodesDlg::enterEvent( QEvent* )
 {
-  if ( !GroupConstructors->isEnabled() )
+  if ( !GroupConstructors->isEnabled() ) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector && !mySimulation) {
+      mySelector = aViewWindow->GetSelector();
+      mySimulation = new SMESH::TNodeSimulation(aViewWindow);
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -678,7 +713,6 @@ void SMESHGUI_NodesDlg::ActivateThisDialog()
   SMESH::SetPointRepresentation( true );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
     aViewWindow->SetSelectionMode( NodeSelection );
   SMESH::SetPointRepresentation( true );
   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
     aViewWindow->SetSelectionMode( NodeSelection );
-
   SelectionIntoArgument();
 }
 
   SelectionIntoArgument();
 }
 
index dca335a00a733e550711673a754df17b8a01b734..5843d3bf1087edf2156d0924d1c61a1e799ee7f7 100644 (file)
@@ -117,6 +117,8 @@ private slots:
   void                    ActivateThisDialog();
   void                    SelectionIntoArgument();
   void                    ValueChangedInSpinBox( double );
   void                    ActivateThisDialog();
   void                    SelectionIntoArgument();
   void                    ValueChangedInSpinBox( double );
+  void                    onOpenView();
+  void                    onCloseView();
 };
 
 #endif // SMESHGUI_NODESDLG_H
 };
 
 #endif // SMESHGUI_NODESDLG_H
index 7710d161bcc0193ac82e0fa2b4ac782e2bf8ac31..d466dedf32efe535dd17667d2ca2420039641735 100644 (file)
@@ -50,6 +50,8 @@ SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
   myIsApplyAndClose( false )
 {
   mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
   myIsApplyAndClose( false )
 {
   mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -66,7 +68,7 @@ SMESHGUI_PreviewDlg::~SMESHGUI_PreviewDlg()
 // purpose  : Show preview in the viewer
 //=================================================================================
 void SMESHGUI_PreviewDlg::showPreview(){
 // purpose  : Show preview in the viewer
 //=================================================================================
 void SMESHGUI_PreviewDlg::showPreview(){
-  if(mySimulation)
+  if(mySimulation && mySimulation->GetActor())
     mySimulation->SetVisibility(true);
 }
 
     mySimulation->SetVisibility(true);
 }
 
@@ -75,7 +77,7 @@ void SMESHGUI_PreviewDlg::showPreview(){
 // purpose  : Hide preview in the viewer
 //=================================================================================
 void SMESHGUI_PreviewDlg::hidePreview(){
 // purpose  : Hide preview in the viewer
 //=================================================================================
 void SMESHGUI_PreviewDlg::hidePreview(){
-  if(mySimulation)
+  if(mySimulation && mySimulation->GetActor())
     mySimulation->SetVisibility(false);
 }
 
     mySimulation->SetVisibility(false);
 }
 
@@ -87,7 +89,6 @@ void SMESHGUI_PreviewDlg::connectPreviewControl(){
   connect(myPreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool)));
 }
 
   connect(myPreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool)));
 }
 
-
 //=================================================================================
 // function : toDisplaySimulation
 // purpose  : 
 //=================================================================================
 // function : toDisplaySimulation
 // purpose  : 
@@ -124,7 +125,27 @@ bool SMESHGUI_PreviewDlg::isApplyAndClose() const
   return myIsApplyAndClose;
 }
 
   return myIsApplyAndClose;
 }
 
+//=================================================================================
+// function : onCloseView()
+// purpose  : SLOT called when close view
+//=================================================================================
+void SMESHGUI_PreviewDlg::onCloseView()
+{
+  if ( mySimulation && mySimulation->GetActor())
+    mySimulation->SetVisibility(false);
+  delete mySimulation;
+  mySimulation=0;
+}
 
 
+//=================================================================================
+// function : onOpenView()
+// purpose  : SLOT called when open view
+//=================================================================================
+void SMESHGUI_PreviewDlg::onOpenView()
+{
+  if ( !mySimulation)
+    mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
+}
 //=================================================================================
 // class    : SMESHGUI_SMESHGUI_MultiPreviewDlg()
 // purpose  :
 //=================================================================================
 // class    : SMESHGUI_SMESHGUI_MultiPreviewDlg()
 // purpose  :
@@ -134,6 +155,8 @@ SMESHGUI_MultiPreviewDlg::SMESHGUI_MultiPreviewDlg( SMESHGUI* theModule ) :
   QDialog( SMESH::GetDesktop( theModule ) ),
   myIsApplyAndClose( false )
 {
   QDialog( SMESH::GetDesktop( theModule ) ),
   myIsApplyAndClose( false )
 {
+  mySimulationList.clear();
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()), this, SLOT(onCloseView()));
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -152,7 +175,8 @@ SMESHGUI_MultiPreviewDlg::~SMESHGUI_MultiPreviewDlg()
 void SMESHGUI_MultiPreviewDlg::showPreview()
 {
   for ( int i = 0; i < mySimulationList.count(); i++ )
 void SMESHGUI_MultiPreviewDlg::showPreview()
 {
   for ( int i = 0; i < mySimulationList.count(); i++ )
-    mySimulationList[i]->SetVisibility( true );
+    if(mySimulationList[i] && mySimulationList[i]->GetActor())
+      mySimulationList[i]->SetVisibility( true );
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -162,7 +186,8 @@ void SMESHGUI_MultiPreviewDlg::showPreview()
 void SMESHGUI_MultiPreviewDlg::hidePreview()
 {
   for ( int i = 0; i < mySimulationList.count(); i++ )
 void SMESHGUI_MultiPreviewDlg::hidePreview()
 {
   for ( int i = 0; i < mySimulationList.count(); i++ )
-    mySimulationList[i]->SetVisibility( false );
+    if(mySimulationList[i] && mySimulationList[i]->GetActor())
+      mySimulationList[i]->SetVisibility( false );
 }
 
 //=================================================================================
 }
 
 //=================================================================================
@@ -174,7 +199,6 @@ void SMESHGUI_MultiPreviewDlg::connectPreviewControl()
   connect( myPreviewCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( onDisplaySimulation( bool ) ) );
 }
 
   connect( myPreviewCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( onDisplaySimulation( bool ) ) );
 }
 
-
 //=================================================================================
 // function : toDisplaySimulation
 // purpose  : 
 //=================================================================================
 // function : toDisplaySimulation
 // purpose  : 
@@ -227,3 +251,13 @@ void SMESHGUI_MultiPreviewDlg::setSimulationPreview( QList<SMESH::MeshPreviewStr
     mySimulationList[i]->SetData( theMeshPreviewStruct[i].operator->() );
   }
 }
     mySimulationList[i]->SetData( theMeshPreviewStruct[i].operator->() );
   }
 }
+
+//=================================================================================
+// function : onCloseView()
+// purpose  : SLOT called when close view
+//=================================================================================
+void SMESHGUI_MultiPreviewDlg::onCloseView()
+{
+  qDeleteAll( mySimulationList );
+  mySimulationList.clear();
+}
index ce53b63bf4786b034b86ba020b7cc64ecc2d7ad5..32a277a6575e84b82d6b1ef78239c72550215173 100644 (file)
@@ -58,8 +58,9 @@ protected:
 
 protected slots:
  void                      toDisplaySimulation();
 
 protected slots:
  void                      toDisplaySimulation();
+ void                      onCloseView();
+ void                      onOpenView();
  virtual void              onDisplaySimulation( bool );
  virtual void              onDisplaySimulation( bool );
-
   
 protected:
   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */  
   
 protected:
   SMESHGUI*                 mySMESHGUI;              /* Current SMESHGUI object */  
@@ -87,6 +88,7 @@ protected:
 
 protected slots:
  void                      toDisplaySimulation();
 
 protected slots:
  void                      toDisplaySimulation();
+ void                      onCloseView();
  virtual void              onDisplaySimulation( bool );
 
   
  virtual void              onDisplaySimulation( bool );
 
   
index 9164ac57bcb0997c2c60e6b0dee2c2ce265dcef6..577f6017921fd4236204e71850cd17c3cec55db9 100644 (file)
@@ -204,7 +204,9 @@ void SMESHGUI_RemoveElementsDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
 
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
 
@@ -277,6 +279,28 @@ void SMESHGUI_RemoveElementsDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RemoveElementsDlg::onOpenView()
+{
+  if(!mySelector) {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RemoveElementsDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -458,8 +482,13 @@ void SMESHGUI_RemoveElementsDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
 {
 //=================================================================================
 void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
 {
-  if (!GroupConstructors->isEnabled())
+  if (!GroupConstructors->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index dc20265f5c48262f29bdb1aa0f52ceb7e83e0674..2a614c09b9a0352b525e19b7db1a84da74cea63f 100644 (file)
@@ -106,6 +106,8 @@ private slots:
   void                   DeactivateActiveDialog();
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
   void                   DeactivateActiveDialog();
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
   void                   updateButtons();
 };
   void                   setFilters();
   void                   updateButtons();
 };
index 5fb9290fa4c0b8ebb57a5977bcc0ee0085477abf..d8f40a41c9cd80e354393037b362dc1587cc4223 100644 (file)
@@ -204,7 +204,9 @@ void SMESHGUI_RemoveNodesDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
   
   connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
           SLOT(onTextChange(const QString&)));
   
@@ -283,6 +285,32 @@ void SMESHGUI_RemoveNodesDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RemoveNodesDlg::onOpenView()
+{
+  if ( mySelector) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RemoveNodesDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -459,8 +487,13 @@ void SMESHGUI_RemoveNodesDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
 {
 //=================================================================================
 void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
 {
-  if (!GroupConstructors->isEnabled())
+  if (!GroupConstructors->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index bee7971f5e75e68c8672d31812a4c37bcc227197..19efac9ddb8597ea99f295661e052e81f6990b45 100644 (file)
@@ -106,6 +106,8 @@ private slots:
   void                   DeactivateActiveDialog();
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
   void                   DeactivateActiveDialog();
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
   void                   updateButtons();
 };
   void                   setFilters();
   void                   updateButtons();
 };
index a62c7bfc87becdd59c902a6fb7a1a2c6abd03475..a91586798c0e9c657c4a93ec1a657a1502757fb9 100644 (file)
@@ -296,7 +296,9 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
   /* to close dialog if study change */
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this, SLOT(toDisplaySimulation()));
   connect(SelectorWdg,    SIGNAL(selectionChanged()), this, SLOT(CheckIsEnable()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI,       SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI,       SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
 
   connect(GroupAngle,        SIGNAL(buttonClicked(int)),   this, SLOT(toDisplaySimulation()));
   connect(SpinBox_Angle,     SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
 
   connect(GroupAngle,        SIGNAL(buttonClicked(int)),   this, SLOT(toDisplaySimulation()));
   connect(SpinBox_Angle,     SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@@ -517,6 +519,32 @@ void SMESHGUI_RevolutionDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RevolutionDlg::onOpenView()
+{
+  if ( mySelector ) {
+    mySimulation->SetVisibility(false);
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RevolutionDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -690,8 +718,13 @@ void SMESHGUI_RevolutionDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
 {
-  if (!GroupButtons->isEnabled())
+  if (!GroupButtons->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index 3f85e932cc5b0804792843740c65db7b830844b7..ec29fc93072b2f2823da5ef47c584887532ec603 100644 (file)
@@ -151,6 +151,8 @@ private slots:
   void                      onAngleTextChange( const QString& );
   void                      onSelectVectorMenu( QAction* );
   void                      onSelectVectorButton();
   void                      onAngleTextChange( const QString& );
   void                      onSelectVectorMenu( QAction* );
   void                      onSelectVectorButton();
+  void                      onOpenView();
+  void                      onCloseView();
 };
 
 #endif // SMESHGUI_REVOLUTIONDLG_H
 };
 
 #endif // SMESHGUI_REVOLUTIONDLG_H
index 4f24ff6db95352eeb1b9adf87dbb13c84d30697d..5f3443ed51986016174633573bda45e48ac2d6cb 100644 (file)
@@ -309,7 +309,9 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI,       SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI,       SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
@@ -560,6 +562,32 @@ void SMESHGUI_RotationDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RotationDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_RotationDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -912,8 +940,13 @@ void SMESHGUI_RotationDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_RotationDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_RotationDlg::enterEvent (QEvent*)
 {
-  if (!GroupConstructors->isEnabled())
+  if (!GroupConstructors->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index f6e84eca5df697e8423e3ea79638b840d6a7b21b..8b4be67e662d8e5c492f25c109eee76d81708f66 100644 (file)
@@ -148,6 +148,8 @@ private slots:
   void                   onSelectMesh( bool );
   void                   onVectorChanged();
   void                   onActionClicked( int );
   void                   onSelectMesh( bool );
   void                   onVectorChanged();
   void                   onActionClicked( int );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
 };
 
   void                   setFilters();
 };
 
index df0989317ec2d6a9d0339e1ae721d6de35b19182..1e712f0a348148f80ff5c8ed8100e4de4835c852 100644 (file)
@@ -308,7 +308,10 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
+
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
@@ -605,6 +608,31 @@ void SMESHGUI_ScaleDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ScaleDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_ScaleDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -944,8 +972,13 @@ void SMESHGUI_ScaleDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
 {
-  if (!ConstructorsBox->isEnabled())
+  if (!ConstructorsBox->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 63162323976ccef600337dcf690760328d1d8827..a7a15d6ba98b4b6519679364bcd0c7ada3d26208 100644 (file)
@@ -144,6 +144,8 @@ private slots:
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
   void                   onActionClicked( int );
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
   void                   onActionClicked( int );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
 };
 
   void                   setFilters();
 };
 
index d739c83a28860ee511705aef5011fb650e679e44..19b8a1d5c349c77fd4d6613821879878da342090 100644 (file)
@@ -272,7 +272,9 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
 
   connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
   connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
 
   connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
   connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
@@ -551,6 +553,31 @@ void SMESHGUI_SewingDlg::ClickOnOk()
     reject();
 }
 
     reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SewingDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SewingDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : reject()
 // purpose  :
 //=================================================================================
 // function : reject()
 // purpose  :
@@ -676,7 +703,6 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText)
             isEvenOneExists = true;
       }
       
             isEvenOneExists = true;
       }
       
-
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
         aViewWindow->highlight( myActor->getIO(), true, true );
       mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
       if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
         aViewWindow->highlight( myActor->getIO(), true, true );
@@ -741,7 +767,6 @@ void SMESHGUI_SewingDlg::SelectionIntoArgument (bool isSelectionChanged)
 
   // get selected elements/nodes
   int aNbUnits = 0;
 
   // get selected elements/nodes
   int aNbUnits = 0;
-
   if (GetConstructorId() != 3 ||
       (myEditCurrentArgument != LineEdit1 && myEditCurrentArgument != LineEdit4)) {
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
   if (GetConstructorId() != 3 ||
       (myEditCurrentArgument != LineEdit1 && myEditCurrentArgument != LineEdit4)) {
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
@@ -869,8 +894,13 @@ void SMESHGUI_SewingDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
 {
 //=================================================================================
 void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
 {
-  if (!ConstructorsBox->isEnabled())
+  if (!ConstructorsBox->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=================================================================================
 }
 
 //=================================================================================
index 257852be056d37eb9d5a78f0a6d32c48ed911723..3d2b91f363ad3c3408ce27c4c99b17c562c2378a 100644 (file)
@@ -129,6 +129,8 @@ private slots:
   void                    DeactivateActiveDialog();
   void                    ActivateThisDialog();
   void                    onTextChange( const QString& );
   void                    DeactivateActiveDialog();
   void                    ActivateThisDialog();
   void                    onTextChange( const QString& );
+  void                    onOpenView();
+  void                    onCloseView();
 };
 
 #endif // SMESHGUI_SEWINGDLG_H
 };
 
 #endif // SMESHGUI_SEWINGDLG_H
index c1fafd68e9bbd227750c16881f6b961bdfb24c27..2ed7c02719bf82987fb8ede32372bde5956f88ff 100755 (executable)
@@ -223,6 +223,8 @@ void SMESHGUI_SingleEditDlg::Init()
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),            SLOT(onCloseView()));
   connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
 
   myOkBtn->setEnabled(false);
   connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
 
   myOkBtn->setEnabled(false);
@@ -444,6 +446,29 @@ void SMESHGUI_SingleEditDlg::onDeactivate()
   setEnabled(false);
 }
 
   setEnabled(false);
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SingleEditDlg::onOpenView()
+{
+  if ( !mySelector ) {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    mySMESHGUI->EmitSignalDeactivateDialog();
+    setEnabled(true);
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SingleEditDlg::onCloseView()
+{
+  onDeactivate();
+  mySelector = 0;
+}
+
 //=======================================================================
 // name    : enterEvent()
 // Purpose : Event filter
 //=======================================================================
 // name    : enterEvent()
 // Purpose : Event filter
@@ -452,8 +477,12 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*)
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
 {
   if (!isEnabled()) {
     mySMESHGUI->EmitSignalDeactivateDialog();
-    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow) {
       aViewWindow->SetSelectionMode(EdgeOfCellSelection);
       aViewWindow->SetSelectionMode(EdgeOfCellSelection);
+      if (!mySelector)
+        mySelector = aViewWindow->GetSelector();
+    }
     setEnabled(true);
   }
 }
     setEnabled(true);
   }
 }
index 564e0d711ec5242071d610745157e8d8c0171583..e9299eecba33b692366bef7e3c9ace8f3bdf1347 100755 (executable)
@@ -70,6 +70,11 @@ protected slots:
   void                    onSelectionDone();
   void                    onTextChange( const QString& );
 
   void                    onSelectionDone();
   void                    onTextChange( const QString& );
 
+private slots:
+  void                    onOpenView();
+  void                    onCloseView();
+
+
 protected:
   void                    enterEvent( QEvent* );
   void                    keyPressEvent( QKeyEvent* );
 protected:
   void                    enterEvent( QEvent* );
   void                    keyPressEvent( QKeyEvent* );
index c16c64379720e3696c73971c8d5db4e42a62aa08..bf7057ddccf29e0fd52ddeceb213b622112f62e6 100644 (file)
@@ -284,7 +284,9 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),
            SLOT(onTextChange(const QString&)));
   connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),
            SLOT(onTextChange(const QString&)));
   connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
@@ -444,6 +446,31 @@ void SMESHGUI_SmoothingDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SmoothingDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SmoothingDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -701,8 +728,13 @@ void SMESHGUI_SmoothingDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_SmoothingDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_SmoothingDlg::enterEvent (QEvent*)
 {
-  if (!GroupConstructors->isEnabled())
+  if (!GroupConstructors->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 0722395f47557fec2eb51b9e2376fdee7be6114d..875f4fa1b96417dbe103ad237e4d9618e13fd5cd 100644 (file)
@@ -125,6 +125,7 @@ private:
 protected slots:
   virtual void           reject();
 
 protected slots:
   virtual void           reject();
 
+
 private slots:
   void                   ClickOnOk();
   bool                   ClickOnApply();
 private slots:
   void                   ClickOnOk();
   bool                   ClickOnApply();
@@ -135,6 +136,8 @@ private slots:
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
   void                   ActivateThisDialog();
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setElemFilters();
   void                   setNodeFilters();
 };
   void                   setElemFilters();
   void                   setNodeFilters();
 };
index 407389010f9e55ff872a5bc45231824415b6ee8f..b913ce179d604df43291d23fca34ef627140fa9b 100644 (file)
@@ -312,7 +312,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   connect(mySMESHGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),      this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),      this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI, SIGNAL(SignalCloseView()),            this, SLOT(onCloseView()));
+
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                 SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),            SLOT(onActionClicked(int)));
   connect(LineEditElements, SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
   connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                 SLOT(onSelectMesh(bool)));
   connect(ActionGroup,      SIGNAL(buttonClicked(int)),            SLOT(onActionClicked(int)));
@@ -619,6 +622,31 @@ void SMESHGUI_SymmetryDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SymmetryDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_SymmetryDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -968,8 +996,13 @@ void SMESHGUI_SymmetryDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
 {
-  if (!ConstructorsBox->isEnabled())
+  if (!ConstructorsBox->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index a65ed7f45f63c352e0dabfdc7efd0261f6cddfa3..1727b59f3714735491a7b3ff8c310664ac21eae2 100644 (file)
@@ -139,7 +139,7 @@ private:
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
 protected slots:
   virtual void           onDisplaySimulation( bool );
   virtual void           reject();
-   
+
 private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
 private slots:
   void                   ConstructorsClicked( int );
   void                   ClickOnOk();
@@ -153,6 +153,8 @@ private slots:
   void                   onSelectMesh( bool );
   void                   onVectorChanged();
   void                   onActionClicked( int );
   void                   onSelectMesh( bool );
   void                   onVectorChanged();
   void                   onActionClicked( int );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
 };
 
   void                   setFilters();
 };
 
index 86d1caa508b1daf3e834fb6646c81860f843386b..bd5db98e7b3d7d4e30e993464663efab27d5d0a8 100644 (file)
@@ -313,10 +313,13 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) :
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),   this, SLOT(SelectionIntoArgument()));
   /* to close dialog if study change */
-  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
-  connect(LineEditElements, SIGNAL(textChanged(const QString&)),    SLOT(onTextChange(const QString&)));
-  connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                  SLOT(onSelectMesh(bool)));
-  connect(ActionGroup,      SIGNAL(buttonClicked(int)),             SLOT(onActionClicked(int)));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseAllDialogs()),      this, SLOT(reject()));
+  connect(mySMESHGUI,       SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+  connect(mySMESHGUI,       SIGNAL (SignalCloseView()),            this, SLOT(onCloseView()));
+
+  connect(LineEditElements, SIGNAL(textChanged(const QString&)),         SLOT(onTextChange(const QString&)));
+  connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                       SLOT(onSelectMesh(bool)));
+  connect(ActionGroup,      SIGNAL(buttonClicked(int)),                  SLOT(onActionClicked(int)));
 
   connect(SpinBox1_1,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
   connect(SpinBox1_2,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
 
   connect(SpinBox1_1,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
   connect(SpinBox1_2,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
@@ -628,6 +631,31 @@ void SMESHGUI_TranslationDlg::reject()
   QDialog::reject();
 }
 
   QDialog::reject();
 }
 
+//=================================================================================
+// function : onOpenView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_TranslationDlg::onOpenView()
+{
+  if ( mySelector ) {
+    SMESH::SetPointRepresentation(false);
+  }
+  else {
+    mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+    ActivateThisDialog();
+  }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  :
+//=================================================================================
+void SMESHGUI_TranslationDlg::onCloseView()
+{
+  DeactivateActiveDialog();
+  mySelector = 0;
+}
+
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
 //=================================================================================
 // function : ClickOnHelp()
 // purpose  :
@@ -689,7 +717,6 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText)
         myNbOkElements++;
       }
     }
         myNbOkElements++;
       }
     }
-
     mySelector->AddOrRemoveIndex( anIO, newIndices, false );
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
       aViewWindow->highlight( anIO, true, true );
     mySelector->AddOrRemoveIndex( anIO, newIndices, false );
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
       aViewWindow->highlight( anIO, true, true );
@@ -805,7 +832,6 @@ void SMESHGUI_TranslationDlg::SelectionIntoArgument()
       anActor = SMESH::FindActorByEntry(IO->getEntry());
     if (!anActor && !CheckBoxMesh->isChecked())
       return;
       anActor = SMESH::FindActorByEntry(IO->getEntry());
     if (!anActor && !CheckBoxMesh->isChecked())
       return;
-
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
     if (aNbUnits != 1)
       return;
     aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
     if (aNbUnits != 1)
       return;
@@ -933,8 +959,13 @@ void SMESHGUI_TranslationDlg::ActivateThisDialog()
 //=================================================================================
 void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
 {
 //=================================================================================
 void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
 {
-  if (!ConstructorsBox->isEnabled())
+  if (!ConstructorsBox->isEnabled()) {
+    SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+    if ( aViewWindow && !mySelector) {
+      mySelector = aViewWindow->GetSelector();
+    }
     ActivateThisDialog();
     ActivateThisDialog();
+  }
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 46ff4610d9817bd2c2240ec04c1e8c7a731a5c2d..f625c61f4929ff89472c3b5fd4e20bcbd413c321 100644 (file)
@@ -146,7 +146,10 @@ private slots:
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
   void                   onActionClicked( int );
   void                   onTextChange( const QString& );
   void                   onSelectMesh( bool );
   void                   onActionClicked( int );
+  void                   onOpenView();
+  void                   onCloseView();
   void                   setFilters();
   void                   setFilters();
+
 };
 
 #endif // SMESHGUI_TRANSLATIONDLG_H
 };
 
 #endif // SMESHGUI_TRANSLATIONDLG_H