Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Examples

plotdlg.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Marco * 00003 * marco@robot * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 00022 00023 00024 #ifndef _PLOT_H_ 00025 #define _PLOT_H_ 00026 00027 class _PlotDlg 00028 { 00029 private: 00030 int items; 00031 public: 00032 virtual int getBuffersize()=0; 00033 virtual void show(int)=0; 00034 virtual void plot()=0; 00035 virtual void hide(int)=0; 00036 virtual void setStart(int)=0; 00037 virtual void setEnd(int)=0; 00038 virtual QStringList getNames()=0; 00039 virtual ~_PlotDlg(){}; 00040 }; 00041 00042 #endif 00043 00044 #ifndef _PLOTDLG_H_ 00045 #define _PLOTDLG_H_ 00046 00047 00048 #include "gnuplot.h" 00049 #include "gnuplotdlg.h" 00050 00052 00055 template <class T> class PlotDlg : public _PlotDlg 00056 { 00057 public: 00058 Gnuplot<T> * gg; 00059 typename Gnuplot<T>::nameslist names; 00060 00061 GnuplotDlg *p; 00062 00063 PlotDlg(Gnuplot<T>* g){ 00064 gg=g; 00065 names=gg->getNames(); 00066 00067 p = new GnuplotDlg(this); 00068 p->show(); 00069 }; 00070 00072 int getBuffersize(){ 00073 return gg->getBuffersize(); 00074 }; 00075 00077 QStringList getNames(){ 00078 QStringList list; 00079 for(typename Gnuplot<T>::nameslist::iterator i=names.begin();i!=names.end();++i) 00080 list+=(QString)(*i); 00081 return list; 00082 } 00083 00085 void plot(){ 00086 gg->plot(); 00087 }; 00088 00090 void show(int n){ 00091 typename Gnuplot<T>::nameslist::iterator i; 00092 i=names.begin(); 00093 for(int a=0;a<n;a++,i++) 00094 ; 00095 gg->show(*i); 00096 }; 00097 00099 void hide(int n){ 00100 typename Gnuplot<T>::nameslist::iterator i; 00101 i=names.begin(); 00102 for(int a=0;a<n;a++,i++) 00103 ; 00104 gg->hide(*i); 00105 }; 00106 00108 void setStart(int n){ 00109 gg->setStart(n); 00110 }; 00111 00113 void setEnd(int n){ 00114 gg->setEnd(n); 00115 }; 00116 00117 }; 00118 #endif

Generated on Wed Apr 6 10:22:15 2005 for Gnuplot by doxygen 1.3.8