The Gnome Chemistry Utils
0.13.7
|
00001 /* 00002 * Gnome Chemisty Utils 00003 * spectrumview.h 00004 * 00005 * Copyright (C) 2007-2012 Jean Bréfort <jean.brefort@normalesup.org> 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 3 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #ifndef GCU_SPECTRUM_VIEW_H 00024 #define GCU_SPECTRUM_VIEW_H 00025 00026 #include <gcu/macros.h> 00027 00029 namespace gcugtk 00030 { 00031 00032 class SpectrumDocument; 00033 00038 class SpectrumView 00039 { 00040 friend class SpectrumViewPrivate; 00041 public: 00043 00048 SpectrumView (SpectrumDocument *pDoc); 00049 00051 00054 virtual ~SpectrumView (); 00055 00064 void SetAxisBounds (GogAxisType target, double min, double max, bool inverted); 00065 00072 void SetAxisLabel (GogAxisType target, char const *unit); 00073 00080 void ShowAxis (GogAxisType target, bool show); 00081 00088 void InvertAxis (GogAxisType target, bool inverted); 00089 00097 void Render (cairo_t *cr, double width, double height); 00098 00102 void OnMinChanged (); 00103 00107 void OnYMinChanged (); 00108 00112 void OnMaxChanged (); 00113 00117 void OnYMaxChanged (); 00118 00122 void OnXRangeChanged (); 00123 00127 void OnYRangeChanged (); 00128 00133 GogSeries *NewSeries (bool new_plot); 00134 00145 void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const; 00146 00152 void AddToOptionBox (GtkWidget *w); 00153 00158 void DestroyExtraWidget (); 00159 00160 private: 00161 GtkSpinButton *xminbtn, *xmaxbtn, *yminbtn, *ymaxbtn; 00162 GtkRange *xrange, *yrange; 00163 gulong minsgn, maxsgn, yminsgn, ymaxsgn, xrangesgn, yrangesgn; 00164 double xmin, xmax, xstep, ymin, ymax, ystep; 00165 GtkWidget *m_ExtraWidget; 00166 00170 GCU_RO_PROP (SpectrumDocument *, Doc) 00174 GCU_RO_PROP (GtkWidget *, Widget) 00178 GCU_RO_PROP (GtkWidget *, OptionBox) 00182 GCU_RO_PROP (GogSeries *, Series) 00186 GCU_RO_PROP (int, Width) 00190 GCU_RO_PROP (int, Height) 00191 }; 00192 00193 } 00194 00195 #endif // GCU_SPECTRUM_VIEW_H