UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_abstract_wfield.hpp
1 /* u3d_abstract_wfield.hpp */
2 /* $Id: u3d_abstract_wfield.hpp,v 1.1 2008/05/13 12:19:18 sad Exp $ */
3 //------------------------------------------------------------------------------
4 #ifndef __u3d_abstract_wfieldhpp
5 #define __u3d_abstract_wfieldhpp
6 
7 #include <u3d_os.hpp>
8 #include <u3d_raytr_defines.hpp>
9 
10 #include "u3d_rtmod_defines.hpp"
11 
12 //------------------------------------------------------------------------------
13 struct U3dTrace {
14  float *trbody_x;
15  float *trbody_y;
16  float *trbody_z;
17 };
18 
19 //==============================================================================
20 class U3dSignal
21 {
22 public:
23 
24  U3dSignal(U3dWaveletType sid, float freq);
25  virtual ~U3dSignal() {};
26 
28  virtual float getForm(float t);
29 
31  float getLength() { return m_length; };
32 
33  float getT0() { return m_t0; }
34 
36  virtual void setData(float length, float step, int samples_num, float* data) {};
37 
38 protected:
39 
40  U3dWaveletType m_sigType;
41  float m_t0;
42  float m_freq;
43  float m_length;
46 };
47 
48 //==============================================================================
49 class U3dVSPSignal : public U3dSignal
50 {
51 
52 public:
53 
54  U3dVSPSignal(U3dWaveletType sid, float freq);
55  virtual ~U3dVSPSignal();
56 
58  void setData(float length, float step, int samples_num, float* data);
59 
61  float getForm(float t);
62 
64  bool getReady() { return m_ready; }
65 
66 private:
67 
68  bool m_ready;
70  float m_dt;
71  float* m_data;
72  int m_sample_num;
73 };
74 
75 //------------------------------------------------------------------------------
77 {
78 public:
79 
80  U3dAbstractWField(int spn ,
81  U3dObservSys* os ,
82  float tmax ,
83  float dt ,
84  U3dWaveletType signal_type ,
85  float signal_freq ,
86  bool save_rp = false );
87 
88  virtual ~U3dAbstractWField();
89 
91  void addWave(int spn, U3dWaveDynHodo wh);
92 
94  int getRecNum() { return m_recnum; }
95 
97  int getSPN() { return m_spn; }
98 
100  int getTrLen() { return m_trlen; }
101 
103  virtual bool saveAllHods(const char* file_name) = 0;
104 
107  //bool analyseRayCode(U3dCodeAr code, int ciId, int &type);
108 
110  bool addRayPath(U3dWaveHodoCell whc, int rp_id);
111 
113  virtual bool saveAllRays(char* file_name, int pid);
114 
115 protected:
116 
118  static int m_ray_path_id;
119 
121  static double m_max_ampl;
122 
124  bool getHodName(U3dComplexWaveHod hod, char *name);
125 
127  int getSampleNum(double t) { return std::max(0, int(t/m_dt)); }
128 
130  float getSampleTime(int sn) { return sn*m_dt; }
131 
133  void addWHCell(U3dSPHods &sp_hods, U3dWaveHodoCell whi);
134 
135 
136  void recalcShearDirection(double &f, double &az);
137 
138 
139  bool m_ready;
141  float m_dt;
142  float m_tmax;
143  int m_trlen;
146  int m_spn;
147  int m_recnum;
152  U3dSPHodsAr m_sp_hods;
158  struct U3dRayPathSt {
159  int ray_type;
160  U3dRayPath ray_path;
161  };
162 
164 };
165 
166 
167 
173 void mergeRPFiles(const char* const * filenames, int size, const char* resultFileName, int actualNum) throw (std::ios_base::failure,
174  std::logic_error);
175 
176 
181 void deleteRPFiles(const char* const * filenames, int size, int actualNum) throw (std::ios_base::failure);
182 
183 //------------------------------------------------------------------------------
184 #endif /* u3d_abstract_wfield.hpp */
Definition: u3d_abstract_wfield.hpp:20
void setData(float length, float step, int samples_num, float *data)
Definition: u3d_rtmod_defines.hpp:153
U3dSPHodsAr m_sp_hods
Definition: u3d_abstract_wfield.hpp:152
bool addRayPath(U3dWaveHodoCell whc, int rp_id)
float m_tmax
Definition: u3d_abstract_wfield.hpp:142
Definition: u3d_rtmod_defines.hpp:106
int m_trlen
Definition: u3d_abstract_wfield.hpp:143
int getSPN()
Definition: u3d_abstract_wfield.hpp:97
float getSampleTime(int sn)
Definition: u3d_abstract_wfield.hpp:130
float m_length
Definition: u3d_abstract_wfield.hpp:43
U3dTrace * m_traces
Definition: u3d_abstract_wfield.hpp:149
Definition: u3d_abstract_wfield.hpp:49
float m_dt
Definition: u3d_abstract_wfield.hpp:141
float * trbody_x
Definition: u3d_abstract_wfield.hpp:14
int getSampleNum(double t)
Definition: u3d_abstract_wfield.hpp:127
Definition: u3d_abstract_wfield.hpp:13
float m_freq
Definition: u3d_abstract_wfield.hpp:42
virtual void setData(float length, float step, int samples_num, float *data)
Definition: u3d_abstract_wfield.hpp:36
bool m_ready
Definition: u3d_abstract_wfield.hpp:139
float * trbody_y
Definition: u3d_abstract_wfield.hpp:15
static double m_max_ampl
Definition: u3d_abstract_wfield.hpp:121
Definition: u3d_abstract_wfield.hpp:76
int getTrLen()
Definition: u3d_abstract_wfield.hpp:100
static int m_ray_path_id
Definition: u3d_abstract_wfield.hpp:118
U3dSignal * m_signal
Definition: u3d_abstract_wfield.hpp:150
virtual bool saveAllHods(const char *file_name)=0
bool getHodName(U3dComplexWaveHod hod, char *name)
U3dObservSys * m_os
Definition: u3d_abstract_wfield.hpp:145
int m_spn
Definition: u3d_abstract_wfield.hpp:146
int getRecNum()
Definition: u3d_abstract_wfield.hpp:94
bool m_save_rays_paths
Definition: u3d_abstract_wfield.hpp:154
int m_recnum
Definition: u3d_abstract_wfield.hpp:147
Definition: u3d_os.hpp:14
void addWHCell(U3dSPHods &sp_hods, U3dWaveHodoCell whi)
virtual float getForm(float t)
U3dAbstractWField(int spn, U3dObservSys *os, float tmax, float dt, U3dWaveletType signal_type, float signal_freq, bool save_rp=false)
virtual bool saveAllRays(char *file_name, int pid)
Definition: u3d_abstract_wfield.hpp:158
bool getReady()
Definition: u3d_abstract_wfield.hpp:64
float getLength()
Definition: u3d_abstract_wfield.hpp:31
float getForm(float t)
Definition: u3d_rtmod_defines.hpp:146
void addWave(int spn, U3dWaveDynHodo wh)
U3dRayPathSt m_rp_st
Definition: u3d_abstract_wfield.hpp:163
U3dWaveletType m_sigType
Definition: u3d_abstract_wfield.hpp:36
float * trbody_z
Definition: u3d_abstract_wfield.hpp:16