UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zqb_abstr_trace.hpp
1 /* zqb_abstr_trace.hpp */
2 /* $Id: zqb_abstr_trace.hpp,v 1.11 2009/02/02 09:03:30 vlad Exp $ */
3 #ifndef __zqb_abstr_trace_hpp
4 #define __zqb_abstr_trace_hpp
5 
6 #include <stdlib.h> /* just for NULL */
7 
8 
14 {
15 public:/* data */
16 
17  int m_nSamples;
18  int m_iActual[2];
19  float m_fDt;
20  float m_fT0;
22 public:/* methods */
23 
25  ZqbAbstrTrace (int samples,
26  float dt = 1.0, float t0 = 0.0,
27  const int actual[2] = NULL);
28 
30  ZqbAbstrTrace (const ZqbAbstrTrace& atr);
31 
33  virtual ~ZqbAbstrTrace ();
34 
35 
38 
40  virtual void assign (int samples,
41  float dt = 1.0, float t0 = 0.0,
42  const int actual[2] = NULL);
43 
45  virtual void setAllActual ();
46 
48  virtual int time2sample (float t) const;
49 
51  virtual float sample2time (int i) const;
52 
54  virtual float toTime (float fSampleIndex) const;
55 
57  virtual float fromTime (float fTime) const;
58 
60  virtual bool operator== (const ZqbAbstrTrace& atr) const;
61 
63  bool operator!= (const ZqbAbstrTrace& atr) const {
64  return !operator==(atr);
65  };
66 
67 
70  virtual float sample (const float* trace, float t,
71  int order = 1) const;
72 
74  void getTimes (double t[2]) const {
75  if(NULL != t) {
76  t[0] = sample2time(0);
77  t[1] = sample2time(m_nSamples-1);
78  }
79  }
80 
81 private:
82 
85  float interp1 (const float* trace, float t) const;
86 
89  float interp2 (const float* trace, float t) const;
90 
93  float interp3 (const float* trace, float t) const;
94 
95 };
96 
97 
98 #endif /* zqb_abstr_trace.hpp */
ZqbAbstrTrace(int samples, float dt=1.0, float t0=0.0, const int actual[2]=NULL)
float m_fDt
Definition: zqb_abstr_trace.hpp:19
void getTimes(double t[2]) const
Definition: zqb_abstr_trace.hpp:74
virtual void assign(int samples, float dt=1.0, float t0=0.0, const int actual[2]=NULL)
virtual float sample(const float *trace, float t, int order=1) const
virtual float fromTime(float fTime) const
Definition: zqb_abstr_trace.hpp:13
int m_iActual[2]
Definition: zqb_abstr_trace.hpp:18
virtual ~ZqbAbstrTrace()
virtual float toTime(float fSampleIndex) const
virtual int time2sample(float t) const
float m_fT0
Definition: zqb_abstr_trace.hpp:20
bool operator!=(const ZqbAbstrTrace &atr) const
Definition: zqb_abstr_trace.hpp:63
virtual float sample2time(int i) const
ZqbAbstrTrace & operator=(const ZqbAbstrTrace &atr)
virtual void setAllActual()
virtual bool operator==(const ZqbAbstrTrace &atr) const
int m_nSamples
Definition: zqb_abstr_trace.hpp:17