UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vel2dmod.hpp
1 // vel2dmod.hpp
2 // $Id: vel2dmod.hpp,v 1.25 2008/04/09 08:52:33 sasha Exp $
3 //-----------------------------------------------------------------------------
4 #ifndef __2dModelH
5 #define __2dModelH
6 
7 #include "vel2dmod_global.hpp"
8 #include "grid2d.hpp"
9 #include "os.hpp"
10 #include "vel2dmod_service.hpp"
11 
12 
13 //==============================================================================
14 class Grid2d;
15 
16 
17 
18 //==============================================================================
20 {
21  public:
22 
23  Vel2dModel();
24 
26  Vel2dModel(double *x, double *z, double *ang, double *vp, double *vs,
27  double *pkz, double *skz,double *den,
28  double *an_kp, double *an_ks, double *R, int n,
29  double xMin, double xMax, double zMin, double zMax,
30  double mod_x, double mod_y, double mod_az, int approx_type = 0, double grid_cell_size = RT_GRIDSIZE);
31 
33  Vel2dModel(BodyInfoAr& bodyInfo, double xMin, double xMax, double zMin, double zMax,
34  double mod_x, double mod_y, double mod_az, int approx_type = 0);
35 
37 
38  virtual ~Vel2dModel();
39 
41  int getApproxType() {
42  return m_approx_type;
43  }
44 
46  void AddGridPtr(Grid2d *gridPtr);
47 
48  void CheckModelStatus();
49 
51  int DefineBody(double x, double z);
52 
55  int ExactDefineBody(double x, double z);
56 
59  int ExactDefineBound(double x, double z, double eps=DEFINE_BOUND_EPS, bool cry=true);
60 
61  int GetBoundNum(double x, double z); //??????????
62 
64  double GetVel(double x, double z, WAVE_TYPE vPS, int bodyNum=-1);
65 
66  double GetVel(double x, double z, WAVE_TYPE vPS, double angle, int bodyNum=-1);
67 
69  void GetVelGr(double x, double z, double &vk, double &vka, WAVE_TYPE wt);
70 
71  double GetVelMax(WAVE_TYPE wt);
72 
74  double AnyBound(int bNum, double x, bool &flag, double z=-1);
75 
77  bool GetParams(double x, double z, double &vP, double &vS, double &den, double &anKP, double &anKS, double &R);
78  bool GetParams(double x, double z, double &vP, double &vS, double &den) {
79  double anKP, anKS, R;
80  return GetParams(x, z, vP, vS, den, anKP, anKS, R);
81  }
82  bool GetParams2(double x, double z, double &vPx, double &vPz, double &vSx, double &vSz, double &den, double &R);
83 
85  bool BoundInt(int bNum, double x1, double z1, double x2, double z2, double &ix, double &iz,
86  double &iAngle, double &curvity, bool ANY=false);
87 
89  bool IsOuterBound(int bNum);
90 
91  /*
92  void ReplaceCurve(int cNum, int num, double *xx, double *zz, double rc, double sp);
93  void ReplaceCurve(int cNum, double rc, double sp, double *xx, double *zz,
94  double *dx, double *dz, double *curv, bool *flag, int nn);
95  */
96 
97  int GetSegNum(int bn, int n);
98  int GetSegNum(int bn, double x, double z);
99 
101  bool GetLegitimValues(int bn, bool st_end, double &zmin, double &zmax);
102 
106  void RebuildModel(int bn, double *x, double *z, bool *flag, int num, double rc=-1, double sp=-1, bool *im_flag=NULL);
107 
108  void GenerateGrid(double step=-1);
109  void RegenerateGrid(double xmn, double zmn, double xmx, double zmx);
110  double GetGridCellSize();
111 
112  void AddWellInfo(ObservSys *os);
113  bool GetMod1dFlag();
114 
115  bool IsInsideOfModelArea(double x, double z);
116  void CleanOS();
117  void SetModelXYAZ(double m_x, double m_y, double m_az);
118  void GetModelXYAZ(double &m_x, double &m_y, double &m_az);
119 
121  virtual bool RemoveBound(int boundN);
122 
124  virtual bool AddBound(double *x, double *z, bool *flag, int p_num, double rc=-1, double sp=-1);
125 
127  bool CombineBounds(Bound *top_b, Bound *bot_b);
128 
130  Bound* SplitBounds(Bound *bound, double z);
131 
133  void TestModelEntity();
134 
135  bool checkInside(double x, double z);
136 
137  bool belongPerimeter(double x, double z);
138 
142  char modelName[16];
143  bool ready;
146  double xMin, xMax, zMin, zMax;
148  bool grid_defined;
149 
150  virtual void SetPBLimits(int n, double lmin, double lmax)
151  {n=0; lmin=0; lmax=0;};
152  virtual void SetPBComment(int n, const char* str)
153  {n=0; if (0x0 == str) return;};
154  virtual void SetPBValue(int n, double val)
155  {n=0; val=0;};
156  virtual void AddPBValue(int n, double val)
157  {n=0; val=0;};
159  double GetModelAz() { return modelAZ; };
160  void GetModelXY(double &x, double &y) { x=modelX; y=modelY; };
162  bool LineInt(int bNum, double p, double coord1,double coord2,bool finiteFlag,
163  bool xzFlag, double &result);
164 
166  bool ExportToTextFiles(const char *files_path);
167 
168 protected:
169 
170  bool PrepareModel();
171  void DefineBoundPos();
176  bool TestLine(int bNum, double p, double coord1, double coord2, bool finiteFlag, bool xzFlag);
177 
178  void RebuildOuterBound(int bn, double x0, double z0, double x1, double z1, bool st_end);
179  void BoundsSegmentation();
180 
181  bool Model1dFlag;
182 
185 
186  double modelAZ, modelX, modelY;
187 };
188 
189 
190 //-----------------------------------------------------------------------------
191 #endif
Class, describing bodies bound.
Definition: vel2dmod_service.hpp:23
virtual bool RemoveBound(int boundN)
bool ready
Definition: vel2dmod.hpp:143
void DefineBoundPos()
void RebuildModel(int bn, double *x, double *z, bool *flag, int num, double rc=-1, double sp=-1, bool *im_flag=NULL)
Definition: vel2dmod.hpp:19
int ExactDefineBound(double x, double z, double eps=DEFINE_BOUND_EPS, bool cry=true)
virtual void AddPBValue(int n, double val)
Definition: vel2dmod.hpp:156
bool BoundInt(int bNum, double x1, double z1, double x2, double z2, double &ix, double &iz, double &iAngle, double &curvity, bool ANY=false)
bool GetLegitimValues(int bn, bool st_end, double &zmin, double &zmax)
double GetVel(double x, double z, WAVE_TYPE vPS, int bodyNum=-1)
bool IsOuterBound(int bNum)
double AnyBound(int bNum, double x, bool &flag, double z=-1)
Bound * SplitBounds(Bound *bound, double z)
double GetModelAz()
Definition: vel2dmod.hpp:159
void AddGridPtr(Grid2d *gridPtr)
int ExactDefineBody(double x, double z)
BodiesAr Bodies
Definition: vel2dmod.hpp:139
virtual void SetPBValue(int n, double val)
Definition: vel2dmod.hpp:154
int getApproxType()
Definition: vel2dmod.hpp:41
double xMin
Definition: vel2dmod.hpp:146
bool ExportToTextFiles(const char *files_path)
Observation system class.
Definition: os.hpp:13
void GetVelGr(double x, double z, double &vk, double &vka, WAVE_TYPE wt)
int m_approx_type
Definition: vel2dmod.hpp:184
Grid2d * pGrid
Definition: vel2dmod.hpp:147
void GetModelXY(double &x, double &y)
Definition: vel2dmod.hpp:160
Definition: grid2d.hpp:39
bool GetParams(double x, double z, double &vP, double &vS, double &den, double &anKP, double &anKS, double &R)
bool CombineBounds(Bound *top_b, Bound *bot_b)
bool LineInt(int bNum, double p, double coord1, double coord2, bool finiteFlag, bool xzFlag, double &result)
virtual void SetPBComment(int n, const char *str)
Definition: vel2dmod.hpp:152
Definition: objectar.hpp:17
int DefineBody(double x, double z)
virtual bool AddBound(double *x, double *z, bool *flag, int p_num, double rc=-1, double sp=-1)
BoundsAr Bounds
Definition: vel2dmod.hpp:140
void TestModelEntity()
bool PrepareModel()