BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
shiftModel2D.h
Go to the documentation of this file.
1 #ifndef BALL_NMR_SHIFTMODEL2D_H
2 #define BALL_NMR_SHIFTMODEL2D_H
3 
4 #ifndef BALL_NMR_SHIFTMODULE_H
5 # include <BALL/NMR/shiftModule.h>
6 #endif
7 
8 #ifndef BALL_NMR_SPECTRUM_H
9  #include <BALL/NMR/spectrum.h>
10 #endif
11 
12 #include <vector>
13 
14 namespace BALL
15 {
20  : public ShiftModule
21  {
22  public:
23 
25 
26 
29 
31  HSQC_NH = 1,
33  COSY_HH, // ist noch nicht implementiert!!! muesste ueber 2 Bindungslaengen spin = 1/2 pruefen....
34  COSY_CH, //
37  TOCSY_NH
38  };
39 
41 
44 
47  ShiftModel2D();
48 
53  ShiftModel2D(const String& filename,SPECTRUM_TYPE st, bool compute_shifts=true);
54 
59  ShiftModel2D(const String& filename,SPECTRUM_TYPE st, Vector2 origin, Vector2 dimension, Vector2 spacing, bool compute_shifts=true);
60 
63  ShiftModel2D(const ShiftModel2D& model);
64 
67  virtual ~ShiftModel2D();
68 
71  void clear();
72 
74 
77 
80  void setFilename(const String& filename)
82 
85  const String& getFilename() const
86  {
87  return parameters_.getFilename();
88  };
89 
92  const Parameters& getParameters() const
93  {
94  return parameters_;
95  };
96 
99  const std::vector<Peak2D>& getPeaks() const
100  {
101  return peaks_;
102  };
103 
106  void setPeaks(std::vector<Peak2D> peaks)
107  {
108  peaks_ = peaks;
109  };
110 
113  const Vector2& getOrigin() const
114  {
115  return origin_;
116  };
117 
120  void setOrigin(const Vector2& origin)
121  {
122  origin_ = origin;
123  };
124 
127  const Vector2& getDimension() const
128  {
129  return dimension_;
130  };
131 
134  void setDimension(const Vector2& dimension)
135  {
136  dimension_ = dimension;
137  }
138 
141  const Vector2& getSpacing() const
142  {
143  return spacing_;
144  };
145 
146 
149  void setSystem( System* system)
150  {
151  system_ = system;
152  };
153 
156  const System* getSystem() const
157  {
158  return system_;
159  };
160 
161 
162  void operator >> (Spectrum2D& spectrum);
163 
165 
168 
171  bool isValid() const;
172 
173 
175 
178 
181  bool start();
182 
185  bool finish();
186 
189  Processor::Result operator () (Composite& composite);
191 
192  protected:
193 
194  /*_ Initialize the model from the parameter file.
195  This method assumes that object has a valid parameter file assigned.
196  It sets {\tt valid_} to <b> true </b> if it could create a shift model
197  from the contents of the parameter file.
198  */
199  bool init_()
200  throw(Exception::FileNotFound);
201 
202  void createPeak_(Atom* proton, Atom* atom, float peakwidth_proton, float peakwidth_atom);
203  /*_ The spectrum peaks
204  * */
205  std::vector<Peak2D> peaks_;
206 
207  /*_ The origin of the data
208  */
209  Vector2 origin_;
210 
211  /*_ Dimension of the data
212  */
213  Vector2 dimension_;
214 
215  /*_ spacing of the data
216  */
217  Vector2 spacing_;
218 
219  /*_ spectrum type
220  * */
222 
223  /*_ The parameters object ?? Why do we need them??? evtl durch String filename ersetzten
224  */
225  Parameters parameters_;
226 
227  /*_ pointer to the system
228  */
229  System* system_;
230 
231  /*_ The validity flag.
232  Set to <b> true </b> if the object was initialized correctly.
233  */
234  bool valid_;
235 
237  bool compute_shifts_;
238 
239  };
240 
241  std::ostream& operator << (std::ostream& os, const BALL::ShiftModel2D& shiftmodel);
242 
243 } // namespace BALL
244 
245 #endif // BALL_NMR_SHIFTMODEL2D_H
void setDimension(const Vector2 &dimension)
Definition: shiftModel2D.h:134
#define BALL_CREATE(name)
Definition: create.h:62
const Vector2 & getSpacing() const
Definition: shiftModel2D.h:141
const System * getSystem() const
Definition: shiftModel2D.h:156
std::istream & operator>>(std::istream &is, TRegularData1D< ValueType > &grid)
Input operator.
void setSystem(System *system)
Definition: shiftModel2D.h:149
const String & getFilename() const
Definition: shiftModel2D.h:85
const Vector2 & getOrigin() const
Definition: shiftModel2D.h:113
void setPeaks(std::vector< Peak2D > peaks)
Definition: shiftModel2D.h:106
const std::vector< Peak2D > & getPeaks() const
Definition: shiftModel2D.h:99
void setOrigin(const Vector2 &origin)
Definition: shiftModel2D.h:120
const Parameters & getParameters() const
Definition: shiftModel2D.h:92
#define BALL_EXPORT
Definition: COMMON/global.h:50
const Vector2 & getDimension() const
Definition: shiftModel2D.h:127