RayGridAdaptation.h 3.21 KB
Newer Older
Philipp Schäfer's avatar
Philipp Schäfer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* ----------------------------------------------------------------
*
*		ITA geometrical acoustics
*		(c) Copyright Institute of Technical Acoustics (ITA)
*		RWTH Aachen University, Germany, 2015-2019
*
* ----------------------------------------------------------------
* 				    ____  __________  _______
*				   //  / //__   ___/ //  _   |
*				  //  /    //  /    //  /_|  |
*				 //  /    //  /    //  ___   |
*				//__/    //__/    //__/   |__|
*
* ----------------------------------------------------------------
*
*/

Philipp Schäfer's avatar
Philipp Schäfer committed
19
20
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
#define IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
Philipp Schäfer's avatar
Philipp Schäfer committed
21
22
23
24
25
26
27
28

#include <ITAPropagationPathSim/AtmosphericRayTracing/RayGrid.h>


namespace ITAPropagationPathSim
{
	namespace AtmosphericRayTracing
	{
Philipp Schäfer's avatar
Philipp Schäfer committed
29
		namespace EigenraySearch
Philipp Schäfer's avatar
Philipp Schäfer committed
30
		{
Philipp Schäfer's avatar
ART    
Philipp Schäfer committed
31
			class CRayResolutionAdapter : private CRayGrid
Philipp Schäfer's avatar
Philipp Schäfer committed
32
33
			{
			private:
34
				std::vector< std::shared_ptr<CRay> > vpNewRaysOfLastAdaptation;
Philipp Schäfer's avatar
Philipp Schäfer committed
35
			public:
Philipp Schäfer's avatar
Philipp Schäfer committed
36
				CRayResolutionAdapter() {}
Philipp Schäfer's avatar
Philipp Schäfer committed
37
38
39
				CRayResolutionAdapter(const CRayGrid& rayGrid) : CRayGrid(rayGrid) {}
				
			public:
Philipp Schäfer's avatar
ART    
Philipp Schäfer committed
40
41
42
				void Reset(const CRayGrid& rayGrid);

				CRayGrid RayGrid() { return *this; }
Philipp Schäfer's avatar
ART    
Philipp Schäfer committed
43
44
				const std::vector< std::shared_ptr<CRay> >& Rays() { return CRayGrid::Rays(); }
				const std::vector< std::shared_ptr<CRay> >& NewRaysOfLastAdaptation() { return vpNewRaysOfLastAdaptation; }
45

Philipp Schäfer's avatar
Philipp Schäfer committed
46
47
48
49
				//! Simple adaptation method: Setting the limits to neighboring rays and shoots additional rays to double the angular resolution of the grid.
				void ZoomIntoRay(const std::shared_ptr<CRay>& pRay);
				//! Advanced adaptation method: Further reduces the angular limits using additional information compared to simple method before doubling the angular resolution.
				void ZoomIntoRay(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold);
Philipp Schäfer's avatar
Philipp Schäfer committed
50
51

			private:
Philipp Schäfer's avatar
Philipp Schäfer committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
				//! Further reduces the limits of the ray grid using additional information on given rays and the receiver position
				/**
				  * If the original ray grid looks like the sketch below where r5 is the ray with minimum distance to the receiver,
				  *	this will decide whether the eigenray is rather above/below and left/right of it. In best case, the number of rays is reduced from 9 to 4.
				  *
				  *		r1--------r2----------r3
				  *		|   c1   /     c2      \
				  *		r4------r5-------------r6
				  *		\  c3   \    c4      /
				  *		r7------r8--------r9
				  *
				  *	Also works for a 1D ray grid (NTheta == 1 or NPhi() == 1)
				  */
				void SetAdvancedRayGridLimits(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold);
				//! By comparing the vector from three rays to the receiver, this decides between which two rays the eigenray is located and returns their indices
				std::vector<int> FindAdvancedRayGridLimits1D(const std::vector< std::shared_ptr<CRay> >& pRays, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold) const;
Philipp Schäfer's avatar
Philipp Schäfer committed
68
				void DoubleRayResolution();
Philipp Schäfer's avatar
RayGrid    
Philipp Schäfer committed
69
				std::vector<double> DoubleAngularResolution(const std::vector<double>& angleVector) const;
Philipp Schäfer's avatar
Philipp Schäfer committed
70
71
72
73
74
			};
		}
	}
}

Philipp Schäfer's avatar
Philipp Schäfer committed
75
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER