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_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