spectrumview.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GCU_SPECTRUM_VIEW_H
00024 #define GCU_SPECTRUM_VIEW_H
00025
00026 #include "macros.h"
00027 #ifdef GOFFICE_HAS_GLOBAL_HEADER
00028 # include <goffice/goffice.h>
00029 #else
00030 # include <goffice/graph/gog-series.h>
00031 #endif
00032 #include <gtk/gtkwidget.h>
00033
00035 namespace gcu
00036 {
00037
00038 class SpectrumDocument;
00039
00044 class SpectrumView
00045 {
00046 public:
00048
00053 SpectrumView (SpectrumDocument *pDoc);
00054
00056
00059 virtual ~SpectrumView ();
00060
00069 void SetAxisBounds (GogAxisType target, double min, double max, bool inverted);
00070
00077 void SetAxisLabel (GogAxisType target, char const *unit);
00078
00085 void ShowAxis (GogAxisType target, bool show);
00086
00093 void InvertAxis (GogAxisType target, bool inverted);
00094
00102 void Render (cairo_t *cr, double width, double height);
00103
00107 void OnMinChanged ();
00108
00112 void OnMaxChanged ();
00113
00117 void OnXRangeChanged ();
00118
00123 GogSeries *NewSeries (bool new_plot);
00124
00135 void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const;
00136
00137 private:
00138 GtkSpinButton *xminbtn, *xmaxbtn;
00139 GtkRange *xrange;
00140 gulong minsgn, maxsgn, xrangesgn;
00141 double xmin, xmax, xstep;
00142
00146 GCU_RO_PROP (SpectrumDocument *, Doc)
00150 GCU_RO_PROP (GtkWidget *, Widget)
00154 GCU_RO_PROP (GtkWidget *, OptionBox)
00158 GCU_RO_PROP (GogSeries *, Series)
00159 };
00160
00161 }
00162
00163 #endif // GCU_SPECTRUM_VIEW_H