UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rt_shooter.hpp
1 // rtShooter.H
2 // $Id: rt_shooter.hpp,v 1.8 2008/08/18 08:18:56 sasha Exp $
3 //---------------------------------------------------------------------
4 #ifndef __rtShooterH
5 #define __rtShooterH
6 
7 #include <math.h>
8 #include <zm/ZmProgress.H>
9 #include "ray_tracing.hpp"
10 #include <mth/u2d_box.hpp>
11 
12 //---------------------------------------------------------------------
13 // Структуры для хранения результатов вычислений // Структура для хранения информации о лучах попавших в сейсмоприемники struct RecInfo { int recNum; // номер приемника double recAmpl; // амплитуда в приемнике double recT; // время прихода луча в приемник //double recF; // угол падения луча на границу double recAngle; // угол под которым луч попал в приемник double dr; // растояние от точки пересечения луча и скважины до приемника double sx; // координаты точки на границе, откуда луч пришел в приемник double sz; // double iA; // касательная к границе в точке отражения/преломления double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
14 
15 
16 // Структура для хранения информации о лучах попавших в сейсмоприемникиstruct RecInfo { int recNum; // номер приемника double recAmpl; // амплитуда в приемнике double recT; // время прихода луча в приемник //double recF; // угол падения луча на границу double recAngle; // угол под которым луч попал в приемник double dr; // растояние от точки пересечения луча и скважины до приемника double sx; // координаты точки на границе, откуда луч пришел в приемник double sz; // double iA; // касательная к границе в точке отражения/преломления double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
17 struct RecInfo
18 {
19  int recNum; // номер приемника
20  double recAmpl; // амплитуда в приемнике
21  double recT; // время прихода луча в приемник
22  //double recF; // угол падения луча на границу double recAngle; // угол под которым луч попал в приемник double dr; // растояние от точки пересечения луча и скважины до приемника double sx; // координаты точки на границе, откуда луч пришел в приемник double sz; // double iA; // касательная к границе в точке отражения/преломления double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
23  double recAngle; // угол под которым луч попал в приемник
24  double dr; // растояние от точки пересечения луча и скважины до приемника double sx; // координаты точки на границе, откуда луч пришел в приемник double sz; // double iA; // касательная к границе в точке отражения/преломления double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
25 
26  double sx; // координаты точки на границе, откуда луч пришел в приемник
27  double sz; //
28 
29  double iA; // касательная к границе в точке отражения/преломления double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
30  double inF; // угол падения на границу double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
31  double outF; // угол отражения/преломления double startAngle;// угол выхода луча из источника }; //-------------------- // ВАРИАНТ 1 (единица хранения - точка на границе) // Структура для хранения информации об обстреляных границах struct BShootRes { int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
32  double startAngle;// угол выхода луча из источника
33 };
34 
35 //--------------------
36 // ВАРИАНТ 1 (единица хранения - точка на границе)
37 // Структура для хранения информации об обстреляных границах
38 struct BShootRes
39 {
40  int bodyNum; // Номер тела из которого пришел луч int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
41  int boundNum; // Номер границы, которую пересек луч double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
42  double stAngle; // Начальный угол луча double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
43  double iAngle; // Угол подкоторым луч "воткнулся" в границу double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
44  double ix; // Координата точки пересечения луча и границы тела double iz; // -- double it; // Время по лучу на момент пересечения }; /// LS code structure struct LSCode { int_ar *bNum; int_ar *rtr; int_ar *vPS; }; typedef BShootRes* pBShootRes; typedef objects_ar<pBShootRes> BSootResAr; typedef objects_ar<RecInfo*> RecInfoAr; //-------------------- // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы // между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
45  double iz; // --
46  double it; // Время по лучу на момент пересечения
47 };
48 
50 struct LSCode
51 {
52  int_ar *bNum;
53  int_ar *rtr;
54  int_ar *vPS;
55 };
56 
57 
58 typedef BShootRes* pBShootRes;
61 
62 //--------------------
63 // ВАРИАНТ 2 (единица хранения - линейный источник - часть обстрелянной границы// между зонами тени) // Структура для хранения информации об одном линейном источнике struct LSInfo { double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
64 // между зонами тени)
65 // Структура для хранения информации об одном линейном источнике
66 struct LSInfo
67 {
68  double_ar stAngle; // Начальный угол луча double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
69  double_ar x; // Координата точки пересечения луча и границы double_ar z; // -- double_ar t; // Время по лучу до пересечения double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
70  double_ar z; // --
71  double_ar t; // Время по лучу до пересечения
72  double_ar f; // Угол входа луча в границу double_ar iA; // Угол касательной к границе в точке пересечения LSInfo* StartLS; // pointer to start linear source int_ar StNode; // number of node which (x, z) point was obtained from }; // Структура содержещая информацию о нескольких линейных источниках struct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
73  double_ar iA; // Угол касательной к границе в точке пересечения
74  LSInfo* StartLS; // pointer to start linear source
75  int_ar StNode; // number of node which (x, z) point was obtained from
76 };
77 
78 
79 // Структура содержещая информацию о нескольких линейных источникахstruct LSList { objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
80 struct LSList
81 {
82  objects_ar<LSInfo*> LSInfos; // список линейных источников int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
83  int_ar wType; // тип падающей волны int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
84  int_ar bNum; // Номер границы, на которой лежит источник int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
85  int_ar segNum; // Номер сегмента данной границы }; //================ new structs based on U2dRayPoint ================== struct LSpoint { U2dRayPoint RP; double iA; double startAngle; }; typedef vector<LSpoint> LSpointsAr; //typedef vector<LSpoint> startLSpAr; struct LSource { LSpointsAr LSpoints; LSource *startLS; LSpointsAr startLSps; int boundId; }; struct LSlist { objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
86 };
87 
88 //================ new structs based on U2dRayPoint ==================
89 struct LSpoint
90 {
91  U2dRayPoint RP;
92  double iA;
93  double startAngle;
94 };
95 
96 typedef vector<LSpoint> LSpointsAr;
97 //typedef vector<LSpoint> startLSpAr;
98 
99 struct LSource
100 {
101  LSpointsAr LSpoints;
102  LSource *startLS;
103  LSpointsAr startLSps;
104  int boundId;
105 };
106 
107 struct LSlist
108 {
109  objects_ar<LSource*> LSources; // список линейных источников int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
110  int_ar wType; // тип падающей волны int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
111  int_ar segNum; // Номер сегмента данной границы }; //=================================================================== // Cтруктура для хранения точек лучей struct RayPath { float_ar x; float_ar z; }; struct WavePath { objects_ar<RayPath*> rPath; }; struct RTParams { int rtr; WAVE_TYPE wt0; WAVE_TYPE wt1; CodeAr rCode; int_ar *bNums; }; struct LSPoint { double x, z; double t, f; double iA; double startAngle; }; //===================================================================== //--------------------------------------------------------------------- // Объект для обстрела модели лучами class RayShooter : public RayTracing { public: RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL); ~RayShooter(); void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum, double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum); void Shooter2(double stAngle, double endAngle, int &num, double *recT, double *recAmpl, double *recAngle, double *recF, int *recNum); void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT); // Wave path calculating (described in rtPath.C) ----------------------------- void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); //double angleStep1=10, double angleStep2=10; void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.); bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode); // Compare LS from recievers and SP LS void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos); // Massive shooting (described in mShooter.C) --------------------------------- void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1); void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1); //======== New method instead of MShooterUP and MShooterDOWNNew============================================== void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);////changed bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);////////Changed //============================================================================================================ void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE); void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc); void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos); //=========================== new methods==================================================== bool firstLsPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &big_angle, int ns_bnum, bool &stop_pressed_flag); void exactFirstPoint(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, int &bn1, bool &stop_pressed_flag); bool sourceShooter(double spX, double spZ, double &startF, double &stepF, CodeAr rCode, int_ar *bNums, WAVE_TYPE wT, LSlist *resLS, int ns_bnum, bool &stop_pressed_flag); //============================================================================================ // Data import/export --------------------------------------------------------- void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1); void SaveLS(dbItem dbiLSList, double spX, double spZ, double eps, LSList *ls, LSCode *lsc=NULL); void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum); void LoadLSList(LSList *LSLst, CodeAr rCode); void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS); bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS); void DeleteLSList(dbItem dbiModelList); // Progress bars -------------------------------------------------------------- void SetPBars(Progress *PB1, Progress *PB2); Progress *PBar1; /**< Progress indicator object or NULL */ Progress *PBar2; /**< Progress indicator object or NULL */ void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1); // debug //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); protected: void clean_LS(LSList *&_list); // Определяет начало активной зоны скважины с точностью eps void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z, double first_x, double first_z, double angleStep2, double eps); // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num, double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps); // true - если приемник с номером rec_num находится в теле с номером bNum bool CheckRec(int rec_num, int bNum); // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
112 };
113 //===================================================================
114 
115 // Cтруктура для хранения точек лучей
116 struct RayPath
117 {
118  float_ar x;
119  float_ar z;
120 };
121 
122 struct WavePath
123 {
124  objects_ar<RayPath*> rPath;
125 };
126 
127 
128 struct RTParams
129 {
130  int rtr;
131  WAVE_TYPE wt0;
132  WAVE_TYPE wt1;
133  CodeAr rCode;
134  int_ar *bNums;
135 
136 };
137 
138 struct LSPoint
139 {
140  double x, z;
141  double t, f;
142  double iA;
143  double startAngle;
144 };
145 
146 
147 
148 //=====================================================================
149 //---------------------------------------------------------------------
150 // Объект для обстрела модели лучами
151 class RayShooter : public RayTracing
152 {
153 public:
154 
155  RayShooter(Vel2dModelLDB *VelMod2d, ObservSys *OSys=NULL);
156  ~RayShooter();
157 
158  void Shooter(double stAngle, double endAngle, int target, double fStep, int &rNum,
159  double *rT, double *rAmpl, double *rAngle, double *recF, int *recNum);
160  void Shooter2(double stAngle, double endAngle, int &num, double *recT,
161  double *recAmpl, double *recAngle, double *recF, int *recNum);
162 
163  void GetWATimes(WAVE_TYPE wT, double *recX, double *recZ, int n, double *recT);
164 
165  // Wave path calculating (described in rtPath.C) -----------------------------
166  void GetWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.);
167  //double angleStep1=10, double angleStep2=10;
168 
169  void GetDirectWavePath(CodeAr rCode, WavePath *wp, bool &good_path_flag, bool &stop_pressed_flag, double dl=10., double den=10.);
170 
171  bool TestRayPath(RayInfo *ray, int_ar *boundN, CodeAr rCode);
172 
173  // Compare LS from recievers and SP LS
174  void CompLS(LSList *recLS, LSList *spLS, RecInfoAr &recInfos);
175 
176 
177  // Massive shooting (described in mShooter.C) ---------------------------------
178  void MShooterSP(WAVE_TYPE wT, LSList *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1);
179  void MShooterSPNew(WAVE_TYPE wT, LSlist *resLS, bool &stop_pressed_flag, double sx = -1., double sz = -1., int ns_bnum=-1);
180 
181  void MShooterUP(WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1);
182  void MShooterDOWN(WAVE_TYPE wT, bool rt, LSList *inLS, LSList *outLS, bool &stop_pressed_flag); //, int tbn=-1);
183 
184  //======== New method instead of MShooterUP and MShooterDOWNNew==============================================
185  void MShooterUniversal(WAVE_TYPE wT, bool rt, LSlist *inLS, LSlist *outLS, bool &stop_pressed_flag, bool WellShoot, int tbn, RTParams &rtp);
186  bool WellTransform(WAVE_TYPE wT, LSlist *outLS, LSlist *inLS, RecInfoAr &recInfos, bool rt, RTParams rtp);
187 
188  //============================================================================================================
189 
190 
191  void MShooterREC(int n1=-1, int n2=-1, WAVE_TYPE wt=PRESSURE);
192 
193  void stop_MShooter(bool &stop_pressed_flag, LSInfo *&lsDesc);
194  void stop_MShooterUP(bool &stop_pressed_flag, RecInfoAr &recInfos);
195 
196  //=========================== new methods====================================================
197  bool firstLsPoint(double spX, double spZ,
198  double &startF, double &stepF,
199  CodeAr rCode, int_ar *bNums,
200  int &bn1,
201  bool &big_angle,
202  int ns_bnum,
203  bool &stop_pressed_flag);
204 
205  void exactFirstPoint(double spX, double spZ,
206  double &startF, double &stepF,
207  CodeAr rCode, int_ar *bNums,
208  int &bn1,
209  bool &stop_pressed_flag);
210 
211  bool sourceShooter(double spX, double spZ,
212  double &startF, double &stepF,
213  CodeAr rCode,
214  int_ar *bNums,
215  WAVE_TYPE wT,
216  LSlist *resLS,
217  int ns_bnum,
218  bool &stop_pressed_flag);
219 
220  //============================================================================================
221 
222  // Data import/export ---------------------------------------------------------
223  void SaveHod(RecInfoAr recInfos, double spX, double spZ, int fbLine=-1, int pmLine=-1);
224 
225  void SaveLS(dbItem dbiLSList, double spX, double spZ,
226  double eps, LSList *ls, LSCode *lsc=NULL);
227 
228  void LoadLS(dbItem dbiLSList, LSInfo *ls, double &spX, double &spZ, WAVE_TYPE &wt, double &eps, int &bNum);
229 
230  void LoadLSList(LSList *LSLst, CodeAr rCode);
231 
232  void SaveRecLS(int recNum, WAVE_TYPE wt, int bodyNum, double eps, LSList *recLS);
233 
234  bool LoadRecLS(int recNum, WAVE_TYPE wt, int bNum, LSList *recLS);
235 
236  void DeleteLSList(dbItem dbiModelList);
237 
238  // Progress bars --------------------------------------------------------------
239  void SetPBars(Progress *PB1, Progress *PB2);
240 
246  void LSShooterUP(WavePath *wp, WAVE_TYPE wT, bool rt, LSList *ls, RecInfoAr &recInfos, bool &stop_pressed_flag, int tbn=-1);
247 
248  // debug
249  //bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2);
250  //bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl,
251  // double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2);
252 protected:
253 
254  void clean_LS(LSList *&_list);
255 
256  // Определяет начало активной зоны скважины с точностью eps
257  void GetActiveZoneStart(CodeAr rCode, int_ar *bNums, double &tmp_f, double &start_x, double &start_z,
258  double first_x, double first_z, double angleStep2, double eps);
259 
260  // Рассчет прямого луча, попадающего в приемник с номером rec_num, по координатам двух точек (x0,z0) и (x1,z1) на скважине
261  void OneDirectShoot(double x0, double z0, double x1, double z1, double base_angle, int rec_num,
262  double &result_x, double &result_z, double &result_angle, double &result_f, double &time, double eps);
263 
264  // true - если приемник с номером rec_num находится в теле с номером bNum
265  bool CheckRec(int rec_num, int bNum);
266 
267  // Находит в теле с номером bodyNum приемник, ближайший к точке last_z на скважине void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count); private: // Massive shooting (described in mShooterService.C) --------------------------------- bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn); bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn); bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL); void GetLSP(LSInfo *ls, LSPoint &lsp, int n); void SetLSP(LSInfo *ls, LSPoint lsp, int n); void AddLSP(LSInfo *ls, LSPoint lsp, double stF); void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp); /* ====================== For mshooter only ====================== */ bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2); bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot); bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r); bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1); bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS); bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ); /* Universal method for mshooter and ls_shooter */ bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl, double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2); /* =============================================================== */ int CompareParams(double f1, double f2, double t1, double t2); bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs); bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag); void stop_process(WavePath *&wp, bool &good_path_flag); ///////////////////////////////////////////////////////////////////////////////////////////////// //=========== Universal methods based on u2dPoint methods===================================== int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ); bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS, double *recX, double *recZ, RecInfoAr &recInfos); bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot); bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot); bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot); bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r); /* For ls_shooter methods */ bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2); bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1); void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp); bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN); //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo); bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS); void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc); }; #endif
268  void GetNearestRecNum(int bodyNum, double last_x, double last_z, int &first_rec, int &count);
269 
270 private:
271 
272  // Massive shooting (described in mShooterService.C) ---------------------------------
273  bool ShootLSRay(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn);
274  bool MShooterDownStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn);
275  bool MShooterDownFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp,
276  LSPoint &ilsp, double &stF, double &dL);
277 
278  void GetLSP(LSInfo *ls, LSPoint &lsp, int n);
279  void SetLSP(LSInfo *ls, LSPoint lsp, int n);
280  void AddLSP(LSInfo *ls, LSPoint lsp, double stF);
281  void LSPCopy(LSPoint source_lsp, LSPoint &rec_lsp);
282 
283 
284 
285 
286  /* ====================== For mshooter only ====================== */
287  bool GetNextPoint(int bn, LSPoint lsp1, double dl, LSPoint &lsp2);
288 
289  bool MShooterUnivFP(LSInfo *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSPoint &lsp, LSPoint &ilsp, double &stF, double &dL, bool WellShoot);
290 
291 
292  bool ShootLSRayUniv(RTParams rtp, LSPoint lsp, LSPoint &ilsp, double &stF, int &bn, bool WellShoot);
293  bool MShooterUnivStN(LSInfo *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot);
294  bool NextNodeNum(LSInfo *lsDesc, LSPoint lsp, int &r);
295  bool ShadowSearch(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint &lsp, LSPoint &ilsp, int stBNum, int bn, int &bn1);
296  bool DoublePointShooter(RTParams rtp, LSPoint lsp0, LSPoint ilsp0, LSPoint lsp1, LSPoint ilsp1, LSInfo *InterLS, int bn, int startBN);
297  bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSInfo *InterLS);
298  bool DoudleTransform(RTParams rtp, LSList *inLS, int lsnum, LSInfo *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo);
299  bool RecordShooter(RTParams rtp, LSList *inLS, int LSNum, vector<int> &res_id, LSPoint lsp0, LSPoint lsp1, LSInfo *stLS, double *recX, double *recZ);
300 
301  /* Universal method for mshooter and ls_shooter */
302  bool GetNextPoint(int bn, double x1, double z1, double f1, double iA1, double oT1, double stA1, double dl,
303  double &x2, double &z2, double &f2, double &iA2, double &oT2, double &stA2);
304  /* =============================================================== */
305 
306 
307 
308  int CompareParams(double f1, double f2, double t1, double t2);
309  bool CheckNextLSPoint(double x1,double z1,double x2,double z2,int bNum,double &xs,double &zs);
310 
311  bool CheckUpGoingRay(RayInfo *ray, int bn, bool flag);
312 
313  void stop_process(WavePath *&wp, bool &good_path_flag);
314 
316  //=========== Universal methods based on u2dPoint methods=====================================
317 
318  int BoxRec(U2dBox *uBox, vector<int> &res_id, double *recX, double *recZ);
319  bool RecordShooter(RTParams rtp, vector<int> &res_id, LSpoint lsp0, LSpoint lsp1, LSpoint ilsp0, LSpoint ilsp1, LSource *stLS,
320  double *recX, double *recZ, RecInfoAr &recInfos);
321 
322  bool ShootLSRayUniv(RTParams rtp, LSpoint lsp, LSpoint &ilsp, double &stF, int &bn, bool WellShoot);
323  bool MShooterUnivStN(LSource *LS, int stBN, RTParams rtp, int &stN, int &bn, bool WellShoot);
324  bool MShooterUnivFP(LSource *LS, int &num, int &bNum, int stBNum, RTParams rtp, LSpoint &lsp, LSpoint &ilsp, double &stF, double &dL, bool WellShoot);
325 
326  bool NextNodeNum(LSource *lsDesc, LSpoint lsp, int &r);
327 
328  /* For ls_shooter methods */
329  bool GetNextPoint(int bn, LSpoint lsp1, double dl, LSpoint &lsp2);
330 
331  bool ShadowSearch(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint &lsp, LSpoint &ilsp, int stBNum, int bn, int &bn1);
332 
333  void AddLSPoint(LSource *ls, LSpoint lsp, int bndId, LSpoint stLSp);
334 
335  bool DoublePointShooter(RTParams rtp, LSpoint lsp0, LSpoint ilsp0, LSpoint lsp1, LSpoint ilsp1, LSource *InterLS, int bn, int startBN);
336  //bool DoudleTransform(RTParams rtp, LSlist *inLS, int lsnum, LSource *WellLS, int fst, int snd, double recZ, double recX, RecInfo *rInfo);
337  bool HalfAngleShooter(double spX, double spZ, double startF, double stepF, CodeAr rCode, int_ar *bNums, bool raySave, LSource *InterLS);
338 
339 
340  void stop_MShooter(bool &stop_pressed_flag, LSource *&lsDesc);
341 
342 
343 };
344 
345 
346 #endif
Definition: rt_shooter.hpp:80
Definition: rt_shooter.hpp:99
Ray tracing class.
Definition: ray_tracing.hpp:24
Definition: rt_shooter.hpp:107
Definition: rt_shooter.hpp:128
Definition: rt_shooter.hpp:89
Ray data storage sturcture.
Definition: rt_storage.hpp:74
LS code structure.
Definition: rt_shooter.hpp:50
Definition: Progress.hpp:16
Definition: objectar.hpp:57
Progress * PBar2
Definition: rt_shooter.hpp:242
Observation system class.
Definition: os.hpp:13
Definition: rt_shooter.hpp:116
Definition: rt_shooter.hpp:38
Definition: vel2dmod_ldb.hpp:16
Definition: rays.H:81
Definition: rt_shooter.hpp:66
Definition: u2d_box.hpp:8
Definition: rt_shooter.hpp:17
Definition: objectar.hpp:55
Definition: objectar.hpp:56
Definition: rt_shooter.hpp:122
Definition: objectar.hpp:17
Progress * PBar1
Definition: rt_shooter.hpp:241
Definition: u2d_point.hpp:156
Definition: dbnamedefs.h:85
Definition: rt_shooter.hpp:138
Definition: rt_shooter.hpp:151