BALL
1.4.1
|
00001 #ifndef BALL_NMR_SHIFTMODEL2D_H 00002 #define BALL_NMR_SHIFTMODEL2D_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 #include <vector> 00013 00014 namespace BALL 00015 { 00019 class BALL_EXPORT ShiftModel2D 00020 : public ShiftModule 00021 { 00022 public: 00023 00024 BALL_CREATE(ShiftModel2D) 00025 00026 00029 00030 enum SPECTRUM_TYPE{ 00031 HSQC_NH = 1, 00032 HSQC_CH, 00033 COSY_HH, // ist noch nicht implementiert!!! muesste ueber 2 Bindungslaengen spin = 1/2 pruefen.... 00034 COSY_CH, // 00035 TOCSY_HH, 00036 TOCSY_CH, 00037 TOCSY_NH 00038 }; 00039 00041 00044 00047 ShiftModel2D(); 00048 00053 ShiftModel2D(const String& filename,SPECTRUM_TYPE st, bool compute_shifts=true); 00054 00059 ShiftModel2D(const String& filename,SPECTRUM_TYPE st, Vector2 origin, Vector2 dimension, Vector2 spacing, bool compute_shifts=true); 00060 00063 ShiftModel2D(const ShiftModel2D& model); 00064 00067 virtual ~ShiftModel2D(); 00068 00071 void clear(); 00072 00074 00077 00080 void setFilename(const String& filename) 00081 throw(Exception::FileNotFound); 00082 00085 const String& getFilename() const 00086 { 00087 return parameters_.getFilename(); 00088 }; 00089 00092 const Parameters& getParameters() const 00093 { 00094 return parameters_; 00095 }; 00096 00099 const std::vector<Peak2D>& getPeaks() const 00100 { 00101 return peaks_; 00102 }; 00103 00106 void setPeaks(std::vector<Peak2D> peaks) 00107 { 00108 peaks_ = peaks; 00109 }; 00110 00113 const Vector2& getOrigin() const 00114 { 00115 return origin_; 00116 }; 00117 00120 void setOrigin(const Vector2& origin) 00121 { 00122 origin_ = origin; 00123 }; 00124 00127 const Vector2& getDimension() const 00128 { 00129 return dimension_; 00130 }; 00131 00134 void setDimension(const Vector2& dimension) 00135 { 00136 dimension_ = dimension; 00137 } 00138 00141 const Vector2& getSpacing() const 00142 { 00143 return spacing_; 00144 }; 00145 00146 00149 void setSystem( System* system) 00150 { 00151 system_ = system; 00152 }; 00153 00156 const System* getSystem() const 00157 { 00158 return system_; 00159 }; 00160 00161 00162 void operator >> (Spectrum2D& spectrum); 00163 00165 00168 00171 bool isValid() const; 00172 00173 00175 00178 00181 bool start(); 00182 00185 bool finish(); 00186 00189 Processor::Result operator () (Composite& composite); 00191 00192 protected: 00193 00194 /*_ Initialize the model from the parameter file. 00195 This method assumes that object has a valid parameter file assigned. 00196 It sets {\tt valid_} to <b> true </b> if it could create a shift model 00197 from the contents of the parameter file. 00198 */ 00199 bool init_() 00200 throw(Exception::FileNotFound); 00201 00202 void createPeak_(Atom* proton, Atom* atom, float peakwidth_proton, float peakwidth_atom); 00203 /*_ The spectrum peaks 00204 * */ 00205 std::vector<Peak2D> peaks_; 00206 00207 /*_ The origin of the data 00208 */ 00209 Vector2 origin_; 00210 00211 /*_ Dimension of the data 00212 */ 00213 Vector2 dimension_; 00214 00215 /*_ spacing of the data 00216 */ 00217 Vector2 spacing_; 00218 00219 /*_ spectrum type 00220 * */ 00221 SPECTRUM_TYPE type_; 00222 00223 /*_ The parameters object ?? Why do we need them??? evtl durch String filename ersetzten 00224 */ 00225 Parameters parameters_; 00226 00227 /*_ pointer to the system 00228 */ 00229 System* system_; 00230 00231 /*_ The validity flag. 00232 Set to <b> true </b> if the object was initialized correctly. 00233 */ 00234 bool valid_; 00235 00237 bool compute_shifts_; 00238 00239 }; 00240 00241 std::ostream& operator << (std::ostream& os, const BALL::ShiftModel2D& shiftmodel); 00242 00243 } // namespace BALL 00244 00245 #endif // BALL_NMR_SHIFTMODEL2D_H