BALL  1.4.1
shiftModel1D.h
Go to the documentation of this file.
00001 #ifndef BALL_NMR_SHIFTMODEL1D_H
00002 #define BALL_NMR_SHIFTMODEL1D_H
00003 
00004 #ifndef BALL_NMR_SHIFTMODULE_H
00005 # include <BALL/NMR/shiftModule.h>
00006 #endif
00007 
00008 #ifndef BALL_NMR_SPECTRUM_H
00009   #include <BALL/NMR/spectrum.h>
00010 #endif
00011 
00012 
00013 namespace BALL 
00014 {
00018   class BALL_EXPORT ShiftModel1D 
00019     : public ShiftModule  
00020   { 
00021     
00022     public:
00023     BALL_CREATE(ShiftModel1D)
00024     
00025     
00028 
00029     enum SPECTRUM_TYPE{
00030       H = 1, 
00031       N,
00032       C,
00033       H_ON_BACKBONE,
00034       N_BACKBONE,
00035       C_BACKBONE
00036     };
00037 
00039 
00042     
00045     ShiftModel1D(); 
00046 
00051     ShiftModel1D(const String& filename,SPECTRUM_TYPE st, bool compute_shifts=true);
00052         
00057     ShiftModel1D(const String& filename,SPECTRUM_TYPE st, double origin, double dimension, double spacing, bool compute_shifts=true);
00058   
00061     ShiftModel1D(const ShiftModel1D& model);
00062 
00065     virtual ~ShiftModel1D();
00066     
00069     void clear();
00070 
00072 
00075     
00078     void setFilename(const String& filename)
00079       throw(Exception::FileNotFound);
00080 
00083     const String& getFilename() const
00084     {
00085       return parameters_.getFilename();
00086     };
00087     
00090     const Parameters& getParameters() const
00091     {
00092       return parameters_;
00093     };
00094 
00097     const std::vector<Peak1D>& getPeaks() const
00098     {
00099       return peaks_;
00100     };
00101     
00104     void setPeaks(std::vector<Peak1D> peaks)  
00105     {
00106       peaks_ = peaks;
00107     };
00108       
00109     
00112     const double& getOrigin() const
00113     {
00114       return origin_;
00115     };
00116     
00119     void setOrigin(const double& origin) 
00120     {
00121       origin_ = origin;
00122     };
00123  
00126     const double& getDimension() const
00127     { 
00128       return dimension_;
00129     };
00130 
00133     void setDimension(  const double& dimension) 
00134     { 
00135       dimension_ = dimension; 
00136     }
00137 
00140     const double getSpacing() const
00141     {
00142       return spacing_;
00143     };
00144 
00147     void setSystem( System* system)
00148     {
00149       system_ = system;
00150     };
00151   
00154     const System* getSystem() const
00155     {
00156       return system_;
00157     };
00158     
00159 
00160     void operator >> (Spectrum1D& spectrum);
00161 
00163 
00166       
00169     bool isValid() const;
00170 
00172 
00175 
00178     bool start();
00179 
00182     bool finish();
00183 
00186     Processor::Result operator () (Composite& composite);
00188 
00189   protected:  
00190 
00191       
00192     /*_ Initialize the model from the parameter file.
00193         This method assumes that object has a valid parameter file assigned.
00194         It sets {\tt valid_} to <b>  true </b> if it could create a shift model 
00195         from the contents of the parameter file.
00196     */
00197     bool init_()
00198       throw(Exception::FileNotFound);
00199 
00200     /*_ The spectrum peaks
00201      * */
00202     std::vector<Peak1D> peaks_; 
00203     
00204     /*_ The origin of the data
00205     */
00206     double             origin_; 
00207     
00208     /*_ Dimension of the data
00209     */
00210     double             dimension_;  
00211     
00212     /*_ spacing of the data
00213      */
00214     double             spacing_;
00215       
00216     /*_  spectrum type
00217      * */
00218     SPECTRUM_TYPE       type_;
00219     
00220     /*_ The parameters object ??  Why do we need them???  evtl durch String filename ersetzten
00221     */
00222     Parameters        parameters_;
00223 
00224     /*_ pointer to the system
00225      */
00226     System*           system_;
00227     
00228     /*_ The validity flag.
00229         Set to <b>  true </b> if the object was initialized correctly.
00230     */
00231     bool valid_;
00232 
00234     bool compute_shifts_;
00235 
00236     bool hasType_(Atom* a, SPECTRUM_TYPE type);
00237 
00238   }; // end of class
00239 
00240 } // namespace BALL
00241 
00242 #endif // BALL_NMR_SHIFTMODEL1D_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines