]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
View activation bug
authorvsv <vsv@opencascade.com>
Fri, 24 Jun 2005 10:23:22 +0000 (10:23 +0000)
committervsv <vsv@opencascade.com>
Fri, 24 Jun 2005 10:23:22 +0000 (10:23 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h

index f4824a13b00de70e02e690bd69d9ff0f317951c0..8e9a45f807d3671ea35a87ede902058d08155fed 100644 (file)
@@ -878,8 +878,9 @@ OnEraseAll()
 
 void VisuGUI::ChangeRepresentation (VISU::PresentationType theType)
 {
-  SVTK_ViewWindow* vw = GetViewWindow();
-  if (!vw) return;
+  SUIT_ViewWindow* aView = GetActiveView(this, VTKViewer_Viewer::Type());
+  if (!aView) return;
+  SVTK_ViewWindow* vw  = (SVTK_ViewWindow*) aView;
 
   Handle(SALOME_InteractiveObject) anIO;
   CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
index d48e9fc1a2f9965def09e2a3ae31355b4b36f287..5be5ef5b288594a7cd2f8556c04c938706a4bd73 100644 (file)
@@ -318,6 +318,24 @@ namespace VISU
     return NULL;
   }
 
+
+  //************************************************************
+  SUIT_ViewWindow* GetActiveView(const SalomeApp_Module* theModule, QString theType)
+  {
+    if(SalomeApp_Application* anApp = theModule->getApp()){
+      if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){
+       if (!theType.isNull()) {
+         if (aViewManager->getType() != theType)
+           return 0;
+       }
+       return aViewManager->getActiveView();
+      }
+    }
+    return 0;
+  }
+
+
+  //************************************************************
   SVTK_ViewWindow*
   GetViewWindow()
   {
index 91034aeb9601e5e0faf78d72a3fda0333f4d96e3..e02b91d4dd950670fad7377fb1c64b75d700a337 100644 (file)
@@ -40,6 +40,7 @@
 #include CORBA_SERVER_HEADER(MED_Gen)
 
 class SUIT_Desktop;
+class SUIT_ViewWindow;
 class VISU_Actor;
 class SVTK_ViewWindow;
 class SPlot2d_Viewer;
@@ -67,8 +68,11 @@ namespace VISU{
   VISU::Storable::TRestoringMap        getMapOfValue(_PTR(SObject) theSObject);
   QString                              getValue(SALOMEDS::SObject_var theSObject, QString theKey);
   QString                              getValue(_PTR(SObject) theSObject, QString theKey);
+
   SVTK_ViewWindow*                     GetViewWindow(const SalomeApp_Module* theModule, const bool theCreate = false );
   SVTK_ViewWindow*                     GetViewWindow();
+  SUIT_ViewWindow*                     GetActiveView(const SalomeApp_Module* theModule, QString theType = QString::null);
+
   VISU_Actor*                          PublishInView(const SalomeApp_Module* theModule,
                                                     VISU::Prs3d_i* thePrs);
   VISU_Actor*                          UpdateViewer(const SalomeApp_Module* theModule,