Salome HOME
Fix for problem: numbers of isolines functionality work incorrect.
[modules/gui.git] / src / Plot2d / Plot2d_ViewManager.cxx
1 #include "Plot2d_ViewManager.h"
2 #include "Plot2d_ViewModel.h"
3
4 int Plot2d_ViewManager::myMaxId = 0;
5
6 Plot2d_ViewManager::Plot2d_ViewManager( SUIT_Study* study, SUIT_Desktop* desk ) 
7 : SUIT_ViewManager( study, desk )
8 {
9   myId = ++myMaxId;
10   setViewModel( new Plot2d_Viewer() );
11 }
12
13 Plot2d_ViewManager::~Plot2d_ViewManager()
14 {
15 }
16
17 void Plot2d_ViewManager::setViewName( SUIT_ViewWindow* theView )
18 {
19   int aPos = myViews.find(theView);
20   theView->setCaption( QString( "Plot2d scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1));
21 }
22
23 bool Plot2d_ViewManager::insertView( SUIT_ViewWindow* theView )
24 {
25   bool res = SUIT_ViewManager::insertView( theView );
26   if ( res )
27   {
28     Plot2d_ViewWindow* view = (Plot2d_ViewWindow*)theView;
29     connect( view, SIGNAL( cloneView() ), this, SLOT( createView() ) );
30   }
31   return res;
32 }
33
34 void Plot2d_ViewManager::createView()
35 {
36   createViewWindow();
37 }