spectrumdoc.h

00001 /* 
00002  * Gnome Chemisty Utils
00003  * spectrumdoc.h
00004  *
00005  * Copyright (C) 2007 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 
00029 namespace gcu
00030 {
00031 
00032 typedef enum {
00033         GCU_SPECTRUM_INFRARED,
00034         GCU_SPECTRUM_RAMAN,
00035         GCU_SPECTRUM_INFRARED_PEAK_TABLE,
00036         GCU_SPECTRUM_INFRARED_INTERFEROGRAM,
00037         GCU_SPECTRUM_INFRARED_TRANSFORMED,
00038         GCU_SPECTRUM_UV_VISIBLE,
00039         GCU_SPECTRUM_NMR,
00040         GCU_SPECTRUM_MASS,
00041         GCU_SPECTRUM_MAX
00042 } SpectrumType;
00043 
00044 typedef enum {
00045         GCU_SPECTRUM_UNIT_CM_1,
00046         GCU_SPECTRUM_UNIT_TRANSMITTANCE,
00047         GCU_SPECTRUM_UNIT_ABSORBANCE,
00048         GCU_SPECTRUM_UNIT_PPM,
00049         GCU_SPECTRUM_NANOMETERS,
00050         GCU_SPECTRUM_MICROMETERS,
00051         GCU_SPECTRUM_UNIT_MAX
00052 } SpectrumUnitType;
00053 
00054 class Application;
00055 class SpectrumView;
00056 
00057 class SpectrumDocument: public Document
00058 {
00059 public:
00063         SpectrumDocument ();
00068         SpectrumDocument (Application *app, SpectrumView *view = NULL);
00069 
00073         ~SpectrumDocument ();
00074 
00082         void Load (char const *uri, char const *mime_type = NULL);
00083 
00084 private:
00085         void LoadJcampDx (char const *data);
00086         void ReadDataLine (char const *data, std::list<double> &l);
00087 
00088 private:
00089         double *x, *y;
00090         unsigned npoints;
00091         double maxx, maxy, minx, miny;
00092         double firstx, lastx, deltax, firsty;
00093         double xfactor, yfactor;
00094 
00095 GCU_PROT_PROP (SpectrumView*, View)
00096 GCU_RO_PROP (bool, Empty)
00097 GCU_RO_PROP (SpectrumType, SpectrumType)
00098 GCU_RO_PROP (SpectrumUnitType, XUnit)
00099 GCU_RO_PROP (SpectrumUnitType, YUnit)
00100 };
00101 
00102 }
00103 
00104 #endif  //      GCU_SPECTRUM_DOC_H

Generated on Thu Dec 20 11:20:46 2007 for The Gnome Chemistry Utils by  doxygen 1.5.4