Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/visu.git] / src / VISUGUI / VisuGUI_Selection.cxx
index 5bcf465face56786563e21be085f1cefb845ce6a..371d50a50bf7f028d303132b8cf7b5e644beb78e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
 
 #include "VISU_Actor.h"
 #include "VISU_PrsObject_i.hh"
@@ -49,7 +50,6 @@
 #include "SALOME_ListIteratorOfListIO.hxx"
 
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
 #include "SVTK_Selector.h"
 
 #include "utilities.h"
@@ -263,7 +263,7 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
 
   // Activate Points pane
   myWidgetStack->raiseWidget(myPointsPane);
-  if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule))
+  if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
     aViewWindow->SetSelectionMode(NodeSelection);
   onSelectionEvent();
 
@@ -276,7 +276,7 @@ VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
 
 void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 {
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
   if (!aViewWindow) return;
 
   switch (theId) {
@@ -300,11 +300,10 @@ void VisuGUI_SelectionDlg::onSelectionChange (int theId)
 
 void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
 {
-  if( mySelectionDlg )
-  {
+  if (mySelectionDlg) {
     mySelectionDlg = NULL;
     disconnect(mySelectionMgr,0,0,0);
-    if(SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule)){
+    if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule)) {
       switch(aViewWindow->SelectionMode()){
       case NodeSelection:
       case CellSelection:
@@ -337,10 +336,10 @@ template<class TData> QString getVector(TData* theData, int theId){
 #define ABS(a) (a>=0)?a:-a
 
 void VisuGUI_SelectionDlg::onSelectionEvent() {
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(myModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
   if (!aViewWindow) return;
 
-  switch(aViewWindow->SelectionMode()){
+  switch (aViewWindow->SelectionMode()) {
   case NodeSelection:
   case CellSelection:
   case ActorSelection:
@@ -538,7 +537,7 @@ bool onIdEdit (const QString& theText,
                QLabel* theFieldName)
 {
   SalomeApp_Application* anApp = theModule->getApp();
-  SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theModule);
+  SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
   if (!aViewWindow) return false;
   SVTK_Selector* aSelector = aViewWindow->GetSelector();