Main Page | Class List | Directories | File List | Class Members

gnuplot.hh

00001 /*
00002  *  Simple C++ gnuplot API for use with StarCluster tools.
00003  *  Copyright (C) 2003  StarCluster team
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 Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 
00021 #ifndef GNUPLOT_HH
00022 #define GNUPLOT_HH
00023 
00024 #include <string>
00025 #include <iostream>
00026 #include <vector>
00027 #include "version.h"
00028 
00029 using namespace std;
00030 
00031 
00033 
00037 class gnuplot {
00038 
00039 public:
00041 
00062   bool autoscale;
00064 
00075   int pause;
00077 
00080   bool plot3d;
00082 
00086   string style;
00088 
00106   float time;
00108 
00127   string title;
00129 
00132   string xlabel;
00134 
00137   string ylabel;
00139 
00142   string zlabel;
00144 
00148   gnuplot(const bool = true);
00150 
00154   ~gnuplot();
00156 
00182   gnuplot& flush(const bool = true);
00184 
00205   gnuplot& operator<<(const string);
00207 
00234   gnuplot& operator<<(const double);
00235   gnuplot& operator<<(gnuplot& (*f)(gnuplot&));
00237 
00241   void reset_fp();
00243 
00273   void set_fp(FILE* const, const bool = false);
00275 
00281   void set_graphs(unsigned short);
00283 
00291   void set_log(const string = "");
00293 
00326   void set_multiplot(const unsigned char = 1, const unsigned char = 1);
00328 
00337   void set_multiplot(const string);
00339 
00344   void set_nolog(const string = "");
00346 
00351   void set_nomultiplot();
00353 
00358   void set_output(const string);
00360 
00373   void set_title(const string);
00375 
00381   void set_xlabel(const string);
00383 
00388   void set_xrange(const string);
00390 
00393   void set_ylabel(const string);
00395 
00398   void set_yrange(const string);
00400 
00403   void set_zlabel(const string);
00405 
00408   void set_zrange(const string);
00409 
00410 private:
00411   FILE *fp, *fp_;
00412   unsigned char n, plots[2];
00413   unsigned short graphs, graph, plot;
00414   bool data_only, first_dataset, first_flush, first_number, multiplot, new_plot;
00415   vector<vector<double> > buf;
00416   vector<double> first_buf;
00417   gnuplot(const gnuplot&);
00418   gnuplot& operator=(const gnuplot&);
00419 
00420 };
00421 
00422 
00423 gnuplot& flush(gnuplot&);
00424 
00425 #endif  // GNUPLOT_HH

Generated on Mon Jul 18 15:04:06 2005 for StarCluster by  doxygen 1.4.3