00001 #pragma ident "$Id: LinePlot.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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