Plot.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Plot.hpp 2492 2010-12-10 17:10:20Z pben $"
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_PLOT_H
00028 #define VPLOT_PLOT_H
00029 
00030 #include <string>
00031 
00032 #include "TextStyle.hpp"
00033 #include "StrokeStyle.hpp"
00034 #include "BorderLayout.hpp"
00035 #include "Frame.hpp"
00036 
00037 #include "Axis.hpp"
00038 #include "AxisStyle.hpp"
00039 #include "SeriesList.hpp"
00040 
00041 using namespace std;
00042 using namespace vdraw;
00043 
00044 namespace vplot
00045 {
00050   class Plot
00051   {
00052     public:
00054       Plot();
00055 
00057       ~Plot() 
00058       {
00059       }
00060 
00061       /*
00062        * Public methods
00063        */
00064 
00066       inline void setXAxis(double min, double max, double gap=0) 
00067       { minx=min; width=max-min; xgap=gap; fixedXaxis = true;}
00069       inline void setYAxis(double min, double max, double gap=0) 
00070       { miny=min; height=max-min; ygap=gap; fixedYaxis = true; }
00072       inline void setXLabel(const char* str) { xlabel = std::string(str); }
00074       inline void setXLabel(const std::string& str) { xlabel = std::string(str); }
00076       inline void setYLabel(const char* str) { ylabel = std::string(str); }
00078       inline void setYLabel(const std::string& str) { ylabel = std::string(str); }
00079 
00081       Frame getPlotArea(Frame& frame)
00082       {
00083         return getPlotArea(&frame);
00084       }
00085 
00087       Frame getPlotArea(Frame* frame);
00088 
00090       void drawAxis(Frame& frame)
00091       {
00092         drawAxis(&frame);
00093       }
00094 
00096       void drawAxis(Frame* frame);
00097 
00098       /* 
00099        * Settings / options
00100        */
00101 
00103       TextStyle label_style;
00104 
00106       AxisStyle axis_top;
00107 
00109       AxisStyle axis_bottom;
00110 
00112       AxisStyle axis_left;
00113 
00115       AxisStyle axis_right;
00116 
00117 
00118     protected:
00120       std::string xlabel;
00121 
00123       bool fixedYaxis;
00124  
00126       bool fixedXaxis;
00127 
00129       std::string ylabel;
00130 
00132       double minx;
00133 
00135       double width;
00136 
00138       double xgap;
00139 
00141       double miny;
00142 
00144       double height;
00145 
00147       double ygap;
00148 
00155       void drawLegend(Frame* frame, SeriesList* sl, unsigned int columns = 1)
00156       {
00157         sl->drawLegend(*frame, 10, columns);
00158       }
00159   };
00160 
00161 }
00162 
00163 #endif

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