1 #include "Plot2d_ViewManager.h"
2 #include "Plot2d_ViewModel.h"
3 #include "Plot2d_ViewWindow.h"
5 int Plot2d_ViewManager::myMaxId = 0;
7 Plot2d_ViewManager::Plot2d_ViewManager( SUIT_Study* study, SUIT_Desktop* desk )
8 : SUIT_ViewManager( study, desk )
11 Plot2d_Viewer* v = new Plot2d_Viewer();
15 Plot2d_ViewManager::~Plot2d_ViewManager()
19 Plot2d_Viewer* Plot2d_ViewManager::getPlot2dModel() const
21 return (Plot2d_Viewer*)myViewModel;
24 void Plot2d_ViewManager::setViewName( SUIT_ViewWindow* theView )
26 int aPos = myViews.find(theView);
27 theView->setCaption( QString( "Plot2d scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1));
30 bool Plot2d_ViewManager::insertView( SUIT_ViewWindow* theView )
32 bool res = SUIT_ViewManager::insertView( theView );
35 Plot2d_ViewWindow* view = (Plot2d_ViewWindow*)theView;
36 connect( view, SIGNAL( cloneView() ), this, SLOT( onCloneView() ) );
41 void Plot2d_ViewManager::createView()
46 void Plot2d_ViewManager::onCloneView()
48 SUIT_ViewWindow* vw = createViewWindow();
50 Plot2d_ViewWindow *newWnd = 0, *clonedWnd = 0;
51 if( vw && vw->inherits( "Plot2d_ViewWindow" ) )
52 newWnd = ( Plot2d_ViewWindow* )vw;
53 if( sender() && sender()->inherits( "Plot2d_ViewWindow" ) )
54 clonedWnd = ( Plot2d_ViewWindow* )sender();
56 if( newWnd && clonedWnd )
57 emit cloneView( clonedWnd->getViewFrame(), newWnd->getViewFrame() );