Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Peaks.h
Go to the documentation of this file.
1 
14 #ifndef __KOME_OBJECTS_PEAKS_H__
15 #define __KOME_OBJECTS_PEAKS_H__
16 
17 
18 #include <string>
19 #include <vector>
20 
21 // soft cache DataPoints
22 #ifdef ENABLE_MASSPP_PARALLEL_TBB_MODE
23 #define DATAPOINTS_SOFT_CACHE_TBB
24 #endif // ENABLE_MASSPP_PARALLEL_TBB_MODE
25 
26 namespace kome {
27  namespace objects {
28 
29  class PeakElement;
30 
35  class DATA_OBJECTS_CLASS Peaks : public kome::core::XYData {
36  public:
41  Peaks();
42 
48  Peaks( const Peaks& peaks );
49 
54  virtual ~Peaks();
55 
56  public:
63  Peaks& operator=( const Peaks& other );
64 
65  protected:
67  std::vector< PeakElement* > m_peaks;
68 
70  std::string m_title;
71 
73  std::vector< short > m_charges;
74 
76  double m_precursor;
77 
79  std::string m_dataFile;
80 
81 // @date 2011.03.03 <Mod> M.Aihara ->
82 // soft cache DataPoints
83 #ifdef DATAPOINTS_SOFT_CACHE_TBB
84 
86 #endif // DATAPOINTS_SOFT_CACHE_TBB
87 // <Mod> M.Aihara
88 
89  public:
96  int issueId( PeakElement* peakElement );
97 
104  PeakElement* getPeakById( int id );
105 
110  void clearCharge();
111 
117  void addCharge( const short charge );
118 
124  unsigned int getNumberOfCharges();
125 
132  short getCharge( const unsigned int index );
133 
139  void setPrecursor( const double precursor );
140 
146  double getPrecursor();
147 
148  public:
153  void calcArea();
154 
160  void setDataPoints( kome::core::XYData& xyData );
161 
162  public:
170  PeakElement* createPeak( const double x, const double y );
171 
178  PeakElement* getPeak( const unsigned int index );
179 
180  public:
185  void sort();
186 
187  protected:
192  void arrangePeaks();
193 
194  protected:
201  virtual bool onLoadData( boost::function< int ( void*, int ) > readFun );
202 
209  virtual bool onSaveData( boost::function< int ( void*, int ) > writeFun );
210 
211  protected:
216  virtual void onClearPoints();
217 
224  virtual void onAddPoint( const double x, const double y );
225 
233  virtual void onInsertPoint( const unsigned int index, const double x, const double y );
234 
240  virtual void onDeletePoint( const unsigned int index );
241 
247  virtual unsigned int onGetLength();
248 
255  virtual double onGetX( const unsigned int index );
256 
263  virtual double onGetY( const unsigned int index );
264 
270  virtual void onReserve( const unsigned int num );
271 
272  protected:
280  static bool lessPeakX( PeakElement* p0, PeakElement* p1 );
281 
289  static bool lessPeakY( PeakElement* p0, PeakElement* p1 );
290  };
291  }
292 }
293 
294 #endif // __KOME_OBJECTS_PEAKS_H__
abstraction class of two dimention coordinate data
Definition: XYData.h:34
data points data of profile management class
Definition: DataPoints.h:25
std::string m_dataFile
Definition: Peaks.h:79
std::vector< short > m_charges
Definition: Peaks.h:73
std::string m_title
Definition: Peaks.h:70
std::vector< PeakElement * > m_peaks
Definition: Peaks.h:67
double m_precursor
Definition: Peaks.h:76
peaks information class
Definition: Peaks.h:35