]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To extend animation on Gauss Points presentation
authorapo <apo@opencascade.com>
Tue, 6 Dec 2005 11:57:50 +0000 (11:57 +0000)
committerapo <apo@opencascade.com>
Tue, 6 Dec 2005 11:57:50 +0000 (11:57 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_ViewManager_i.cc
src/VISU_I/VISU_View_i.cc

index 36bf2d61cb2191154558d16a4630584b5b753b74..941bf0a05ecd9f1347b962fc1ef61fe40bc4e42c 100644 (file)
@@ -1584,7 +1584,7 @@ void
 VisuGUI::
 OnTimeAnimation()
 {
-  if(!VISU::GetViewWindow())
+  if(!VISU::GetViewWindow(this))
     return;
 
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
@@ -1623,7 +1623,7 @@ void
 VisuGUI::
 OnShowAnimation()
 {
-  if(!VISU::GetViewWindow())
+  if(!VISU::GetViewWindow(this))
     return;
 
   LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
@@ -2541,7 +2541,10 @@ createPopupMenus()
   aRule = "client='VTKViewer' and selcount=1" + aInsideType;
   mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
 
-  aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1 and activeView='VTKViewer'";
+  aRule = "client='ObjectBrowser' and selcount>0";
+  aRule += " and $type in {'VISU::TFIELD'}";
+  aRule += " and nbTimeStamps>1";
+  aRule += " and activeView in {'VTKViewer' 'VVTK'}";
   mgr->setRule( action( VISU_ANIMATION ), aRule, true );
 
   aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
index 8d3703afeea2af3b382426ba45c542101ed4fc05..5faeddb01d08eede95b3940b0b2fc6e03292ae2f 100644 (file)
@@ -916,7 +916,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
 
   myAnimator = new VISU_TimeAnimation (theStudy);
   myAnimator->setSpeed(1);
-  myAnimator->setViewer(VISU::GetViewWindow());
+  myAnimator->setViewer(VISU::GetViewWindow(theModule));
   connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
   connect(myAnimator, SIGNAL(stopped()),                 this, SLOT(onStop()));
 
index b9705365af9eff261461414616355ffe494d0dc6..f382e73011d70ff7ab99d8bfb9f364486e71de34 100644 (file)
@@ -125,11 +125,11 @@ namespace VISU {
 
   struct TCurrentViewEvent: public SALOME_Event
   {
-    const SalomeApp_Application* myApplication;
+    SalomeApp_Application* myApplication;
     typedef VISU::View_ptr TResult;
     TResult myResult;
 
-    TCurrentViewEvent(const SalomeApp_Application* theApplication):
+    TCurrentViewEvent(SalomeApp_Application* theApplication):
       myApplication(theApplication),
       myResult(VISU::View::_nil())
     {}
@@ -138,16 +138,9 @@ namespace VISU {
     void
     Execute()
     {
-      //if (SUIT_ViewManager *aViewManager = myApplication->activeViewManager()) {
-      //  if (aViewManager->getType() == "VTKViewer") {
-      //    if (SUIT_ViewWindow *aViewWindow = aViewManager->getActiveView()) {
-           VISU::View3D_i* pView =
-             new View3D_i ((SalomeApp_Application*)myApplication);
-           if (pView->Create(0))
-             myResult = pView->_this();
-      //    }
-      //  }
-      //}
+      VISU::View3D_i* aView = new View3D_i (myApplication);
+      if (aView->Create(0))
+       myResult = aView->_this();
     }
   };
 
index be9223a3a9c81864b86c9304ccff12fae4320eac..26673aa2e7eb607ee93130625418d0275edb4f05 100644 (file)
@@ -1483,14 +1483,17 @@ namespace VISU {
 
   struct TCreateView3dEvent: public SALOME_Event
   {
+    SalomeApp_Application *myApplication;
     View3D_i * myView3D;
     int        myNew;
 
     typedef SUIT_ViewWindow* TResult;
     TResult myResult;
 
-    TCreateView3dEvent (View3D_i * theView3D,
+    TCreateView3dEvent (SalomeApp_Application *theApplication,
+                       View3D_i * theView3D,
                        const int  theNew):
+      myApplication(theApplication),
       myView3D(theView3D),
       myNew(theNew),
       myResult(NULL)
@@ -1500,35 +1503,41 @@ namespace VISU {
     void
     Execute()
     {
-      if (!myView3D->myApplication)
+      if (!myApplication)
        return;
 
-      SUIT_ViewManager * aViewMgr =
-       myView3D->myApplication->getViewManager(SVTK_Viewer::Type(), false);
-
-      if (aViewMgr) {
-       if (myNew) {
-         myResult = aViewMgr->createViewWindow();
-       } else {
-         myResult = aViewMgr->getActiveView();
+      if(myNew){
+       if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),false)){
+         myResult = aViewManager->createViewWindow();
+         myView3D->myViewManager = aViewManager;
+       }else{
+         if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),true)){
+           myResult = aViewManager->getActiveView();
+           myView3D->myViewManager = aViewManager;
+         }
        }
-      } else {
-       if (myNew) {
-         aViewMgr = myView3D->myApplication->getViewManager(SVTK_Viewer::Type(), true);
-         myResult = aViewMgr->getActiveView();
-       } else {
-         return; // there are no current 3D view
+      }else{
+       if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){
+         if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){
+           if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aView)){
+             myView3D->myViewManager = aViewManager;
+             myResult = aViewManager->getActiveView();
+           }
+         }
+       }else{
+         if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),false)){
+           myView3D->myViewManager = aViewManager;
+           myResult = aViewManager->getActiveView();
+         }
        }
       }
-
-      myView3D->myViewManager = aViewMgr;
     }
   };
 
   Storable* View3D_i::Create (int theNew)
   {
     if (MYDEBUG) MESSAGE("View3D_i::Create");
-    SUIT_ViewWindow* aVW = ProcessEvent(new TCreateView3dEvent(this, theNew));
+    SUIT_ViewWindow* aVW = ProcessEvent(new TCreateView3dEvent(myApplication, this, theNew));
     if (aVW) {
       SetViewWindow(aVW);
       return this;