LinePlot.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: LinePlot.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002 
00004 
00005 //============================================================================
00006 //
00007 //  This file is part of GPSTk, the GPS Toolkit.
00008 //
00009 //  The GPSTk is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU Lesser General Public License as published
00011 //  by the Free Software Foundation; either version 2.1 of the License, or
00012 //  any later version.
00013 //
00014 //  The GPSTk is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //  GNU Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with GPSTk; if not, write to the Free Software Foundation,
00021 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //  
00023 //  Copyright 2004, The University of Texas at Austin
00024 //
00025 //============================================================================
00026 
00027 #ifndef VPLOT_LINEPLOT_H
00028 #define VPLOT_LINEPLOT_H
00029 
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033 #include <sstream>
00034 #include <iomanip>
00035 #include <math.h>
00036 #include <cmath>
00037 #include <limits.h>
00038 #include <algorithm>
00039 
00040 #include "Frame.hpp"
00041 #include "StrokeStyle.hpp"
00042 #include "Path.hpp"
00043 #include "BorderLayout.hpp"
00044 #include "HLayout.hpp"
00045 
00046 #include "Plot.hpp"
00047 #include "SeriesList.hpp"
00048 
00049 using namespace std;
00050 using namespace vdraw;
00051 
00052 namespace vplot
00053 {
00061   class LinePlot : public Plot
00062   {
00063     public:
00067       LinePlot(unsigned int iidx=0) : Plot()
00068       {
00069         init(iidx);
00070       }
00071 
00073       ~LinePlot()
00074       {
00075       }
00076 
00078       void init(unsigned int issidx);
00079 
00081       StrokeStyle pickNextSS(void);
00082 
00084       StrokeStyle pickNextSS(int idx);
00085 
00087       inline void addSeries(string label, vector<pair<double,double> >& series)
00088       {
00089         addSeries(label,series,pickNextSS());
00090       }
00091 
00093       inline void addSeries(string label, vector<pair<double,double> >& series, StrokeStyle ss)
00094       {
00095         sl.addSeries(label,series,ss);
00096       }
00097 
00099       inline void draw(Frame& frame, int dir)
00100       {
00101         draw(&frame,dir);
00102       }
00103 
00105       void draw(Frame *frame, int dir);
00106 
00108       inline void drawPlot(Frame& frame)
00109       {
00110         drawPlot(&frame);
00111       }
00112 
00114       void drawPlot(Frame* frame);
00115 
00122       inline void drawKey(Frame& frame, unsigned int columns = 1)
00123       {
00124         drawKey(&frame,columns);
00125       }
00126 
00133       inline void drawKey(Frame* frame, unsigned int columns = 1)
00134       {
00135         drawLegend(frame,&sl, columns);
00136       }
00137 
00138     protected:
00139 
00140 
00141     private:
00142 
00144       SeriesList sl;
00145 
00147       unsigned int ssidx;
00148       unsigned int issidx;
00149 
00151       std::vector<Color> cvec;
00152 
00154       std::vector<StrokeStyle::dashLengthList> dvec;
00155 
00156   };
00157 
00158 }
00159 
00160 #endif

Generated on Tue May 22 03:30:59 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1