createSpectrumProcessor.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: createSpectrumProcessor.h,v 1.26 2005/12/23 17:01:55 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_NMR_CREATESPECTRUMPROCESSOR_H
00008 #define BALL_NMR_CREATESPECTRUMPROCESSOR_H
00009 
00010 #ifndef BALL_NMR_PEAK_H
00011 # include <BALL/NMR/peak.h>
00012 #endif
00013 
00014 #ifndef BALL_NMR_PEAKLIST_H
00015 # include <BALL/NMR/peakList.h>
00016 #endif
00017 
00018 #ifndef BALL_KERNEL_ATOM_H
00019 # include <BALL/KERNEL/atom.h>
00020 #endif
00021 
00022 #ifndef BALL_DATATYPE_REGULARDATA1D_H
00023 # include <BALL/DATATYPE/regularData1D.h>
00024 #endif
00025 
00026 #ifndef BALL_KERNEL_EXPRESSION_H
00027 # include <BALL/KERNEL/expression.h>
00028 #endif
00029 
00030 #ifndef BALL_DATATYPE_STRINGHASHSET_H
00031 # include <BALL/DATATYPE/stringHashSet.h>
00032 #endif
00033 
00034 #ifndef BALL_NMR_SHIFTMODULE_H
00035 # include <BALL/NMR/shiftModule.h>
00036 #endif
00037 
00038 namespace BALL 
00039 {
00040   class Atom;
00041 
00047   class BALL_EXPORT CreateSpectrumProcessor
00048     : public ShiftModule
00049   {
00050     public:
00051     
00055     
00057     static const String IGNORE_SECTION_NAME;
00058 
00060     static const String AVERAGE_SECTION_NAME;
00061     
00063 
00066 
00074     CreateSpectrumProcessor()
00075       throw(Exception::FileNotFound, Exception::ParseError);
00076     
00079     virtual ~CreateSpectrumProcessor();
00080     
00082 
00085 
00094     virtual void init();
00095 
00104     virtual void init(const String& filename)
00105       throw(Exception::ParseError, Exception::FileNotFound);
00106 
00109     virtual bool start() 
00110       ;
00111 
00114     virtual Processor::Result operator () (Composite& atom)
00115       ;
00116     
00119     const PeakList1D& getPeakList() const;
00120     
00122 
00125     
00127     void setWidth(float width)
00128       ;
00129 
00131     float getWidth() const
00132       ;
00133 
00135     void setAtomAveraging(bool flag = true)
00136       ;
00137       
00139     bool getAtomAveraging() const
00140       ;
00141       
00143     void setAtomIgnoring(bool flag = true)
00144       ;
00145 
00147     bool getAtomIgnoring() const
00148       ;
00149 
00151     void setExpression(const String& expression)
00152       ;
00153 
00154     const String& getExpression() const
00155       ;
00156 
00158 
00159     protected:
00160 
00161     PeakList1D              peaklist_;
00162     StringHashSet           ignore_atoms_;
00163     vector<String>          equivalency_residues_;
00164     vector<vector<String> > equivalency_atoms_;
00165     float width_;
00166     bool  use_averaging_;
00167     bool  use_ignore_table_;
00168     Expression expression_;
00169   };
00170 
00185   BALL_EXPORT const RegularData1D& operator << (RegularData1D& data, const PeakList1D& peak_list) ;
00186   
00187 } //namespace BALL
00188    
00189 #endif // BALL_NMR_CREATESPECTRUMPROCESSOR_H