spectrumdoc.h

00001 /* 
00002  * Gnome Chemisty Utils
00003  * spectrumdoc.h
00004  *
00005  * Copyright (C) 2007-2008 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 2 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_DOC_H
00024 #define GCU_SPECTRUM_DOC_H
00025 
00026 #include "document.h"
00027 #include "macros.h"
00028 #include "printable.h"
00029 #include <complex>
00030 
00031 namespace gcu
00032 {
00033 
00034 typedef enum {
00035         GCU_SPECTRUM_INFRARED,
00036         GCU_SPECTRUM_RAMAN,
00037         GCU_SPECTRUM_INFRARED_PEAK_TABLE,
00038         GCU_SPECTRUM_INFRARED_INTERFEROGRAM,
00039         GCU_SPECTRUM_INFRARED_TRANSFORMED,
00040         GCU_SPECTRUM_UV_VISIBLE,
00041         GCU_SPECTRUM_NMR,
00042         GCU_SPECTRUM_MASS,
00043         GCU_SPECTRUM_MAX
00044 } SpectrumType;
00045 
00046 typedef enum {
00047         GCU_SPECTRUM_UNIT_CM_1,
00048         GCU_SPECTRUM_UNIT_TRANSMITTANCE,
00049         GCU_SPECTRUM_UNIT_ABSORBANCE,
00050         GCU_SPECTRUM_UNIT_PPM,
00051         GCU_SPECTRUM_NANOMETERS,
00052         GCU_SPECTRUM_MICROMETERS,
00053         GCU_SPECTRUM_UNIT_MAX
00054 } SpectrumUnitType;
00055 
00056 class Application;
00057 class SpectrumView;
00058 
00059 class SpectrumDocument: public Document, public Printable
00060 {
00061 public:
00065         SpectrumDocument ();
00070         SpectrumDocument (Application *app, SpectrumView *view = NULL);
00071 
00075         ~SpectrumDocument ();
00076 
00084         void Load (char const *uri, char const *mime_type = NULL);
00085 
00086 private:
00087         void LoadJcampDx (char const *data);
00088         void ReadDataLine (char const *data, std::list<double> &l);
00089         void DoPrint (GtkPrintOperation *print, GtkPrintContext *context);
00090         GtkWindow *GetGtkWindow ();
00091 
00092 private:
00093         double *x, *y;
00094         std::complex<double> *z;
00095         unsigned npoints;
00096         double maxx, maxy, minx, miny;
00097         double firstx, lastx, deltax, firsty;
00098         double xfactor, yfactor;
00099 
00100 GCU_PROT_PROP (SpectrumView*, View)
00101 GCU_RO_PROP (bool, Empty)
00102 GCU_RO_PROP (SpectrumType, SpectrumType)
00103 GCU_RO_PROP (SpectrumUnitType, XUnit)
00104 GCU_RO_PROP (SpectrumUnitType, YUnit)
00105 };
00106 
00107 }
00108 
00109 #endif  //      GCU_SPECTRUM_DOC_H

Generated on Tue Mar 18 16:06:03 2008 for The Gnome Chemistry Utils by  doxygen 1.5.5