VisuGUI::
OnTimeAnimation()
{
- if(!VISU::GetViewWindow())
+ if(!VISU::GetViewWindow(this))
return;
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
VisuGUI::
OnShowAnimation()
{
- if(!VISU::GetViewWindow())
+ if(!VISU::GetViewWindow(this))
return;
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
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'}";
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()));
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())
{}
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();
}
};
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)
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;