Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / Plot2d / Plot2d_ViewModel.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #if !defined(_PLOT2D_VIEWMODEL_H)
20 #define _PLOT2D_VIEWMODEL_H
21
22 #include "Plot2d.h"
23 #include "SUIT_ViewModel.h"
24
25 class SUIT_ViewWindow;
26 class SUIT_Desktop;
27 class Plot2d_ViewFrame;
28 class Plot2d_Prs;
29 class QString;
30 class QPopupMenu;
31
32 class PLOT2D_EXPORT Plot2d_Viewer: public SUIT_ViewModel
33 {
34   Q_OBJECT
35
36 public:
37   static QString Type() { return "Plot2d"; }
38
39   Plot2d_Viewer(bool theAutoDel = false);
40   ~Plot2d_Viewer();
41
42   virtual void             setViewManager( SUIT_ViewManager* );
43   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
44   virtual QString getType() const { return Type(); }
45   virtual void contextMenuPopup(QPopupMenu*);
46   Plot2d_Prs*  getPrs() const { return myPrs; };
47   void         setPrs(Plot2d_Prs* thePrs);
48   void         update();
49   void         clearPrs();
50   void         setAutoDel(bool theDel);
51
52 protected slots:
53   void onChangeBgColor();
54   void onDumpView();
55   void onShowToolbar();
56   virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
57
58 private:
59   Plot2d_Prs* myPrs;
60   bool        myAutoDel;
61 };
62
63 #endif // !defined(_PLOT2D_VIEWMODEL_H)
64