00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 #if !defined(_PLOT2D_VIEWMODEL_H) 00024 #define _PLOT2D_VIEWMODEL_H 00025 00026 #include "Plot2d.h" 00027 #include "SUIT_ViewModel.h" 00028 #include <qwt_plot_item.h> 00029 00030 class SUIT_ViewWindow; 00031 class SUIT_Desktop; 00032 class Plot2d_ViewFrame; 00033 class Plot2d_Prs; 00034 class QString; 00035 class QMenu; 00036 00037 class PLOT2D_EXPORT Plot2d_Viewer: public SUIT_ViewModel 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 static QString Type() { return "Plot2d"; } 00043 00044 Plot2d_Viewer(bool theAutoDel = false); 00045 ~Plot2d_Viewer(); 00046 00047 virtual void setViewManager( SUIT_ViewManager* ); 00048 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop); 00049 virtual QString getType() const { return Type(); } 00050 virtual void contextMenuPopup(QMenu*); 00051 Plot2d_Prs* getPrs() const { return myPrs; }; 00052 void setPrs(Plot2d_Prs* thePrs); 00053 void update(); 00054 void clearPrs(); 00055 void setAutoDel(bool theDel); 00056 00057 signals: 00058 void viewCloned( SUIT_ViewWindow* ); 00059 00060 protected slots: 00061 void onChangeBgColor(); 00062 void onDumpView(); 00063 void onShowToolbar(); 00064 virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ); 00065 virtual void onLegendClicked( QwtPlotItem* ); 00066 00067 private: 00068 Plot2d_Prs* myPrs; 00069 bool myAutoDel; 00070 }; 00071 00072 #endif // !defined(_PLOT2D_VIEWMODEL_H) 00073