From 276aa6427a0c01795c3243d07ba6390dce30cd1e Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 6 Dec 2005 11:57:50 +0000 Subject: [PATCH] To extend animation on Gauss Points presentation --- src/VISUGUI/VisuGUI.cxx | 9 +++-- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 2 +- src/VISU_I/VISU_ViewManager_i.cc | 17 +++------- src/VISU_I/VISU_View_i.cc | 47 ++++++++++++++++----------- 4 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 36bf2d61..941bf0a0 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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'}"; diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index 8d3703af..5faeddb0 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -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())); diff --git a/src/VISU_I/VISU_ViewManager_i.cc b/src/VISU_I/VISU_ViewManager_i.cc index b9705365..f382e730 100644 --- a/src/VISU_I/VISU_ViewManager_i.cc +++ b/src/VISU_I/VISU_ViewManager_i.cc @@ -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(); } }; diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index be9223a3..26673aa2 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -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(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; -- 2.39.2