Commit 31172913 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ART

- added semi colons behind inline functions
parent 726d36fe
......@@ -60,7 +60,7 @@ namespace ITAPropagationPathSim
CRayGrid(const RayMatrix& rayMatrix, const std::vector<double>& thetaDeg, const std::vector<double>& phiDeg, const bool circularPhi = false);
void UpdateDependentRayContainers();
protected:
inline CRayGrid(bool circularPhi = false) : bCircularPhi(circularPhi) {}
inline CRayGrid(bool circularPhi = false) : bCircularPhi(circularPhi) {};
//! Creates new rays using the angles of initial directions and inserts them into the ray matrix
void InitRays();
public:
......@@ -95,24 +95,24 @@ namespace ITAPropagationPathSim
bool HasPoleDirection(const std::shared_ptr<CRay>& pRay) const;
public:
//! Returns true if the phi angles are defined circular (covering a full circle)
inline bool IsCircular() const { return bCircularPhi; }
inline bool IsCircular() const { return bCircularPhi; };
bool IsEmpty() const;
bool Is2D() const;
bool Contains(const std::shared_ptr<CRay>& pRay) const;
//---GET Functions---
protected:
inline const std::vector<std::shared_ptr<CRay>>& Rays() const { return vpRays; }
inline const RayMatrix& Matrix() const { return vvpRayMatrix; }
inline const std::vector<std::shared_ptr<CRay>>& Rays() const { return vpRays; };
inline const RayMatrix& Matrix() const { return vvpRayMatrix; };
public:
inline const std::vector<double>& ThetaDeg() const { return vdThetaDeg; }
inline const std::vector<double>& PhiDeg() const { return vdPhiDeg; }
inline int NTheta() const { return vdThetaDeg.size(); }
inline int NPhi() const { return vdPhiDeg.size(); }
inline int NRays() const { return vpRays.size(); }
inline const VistaVector3D& SourcePosition() const { return v3SourcePos; }
inline const std::set<std::shared_ptr<CRay>>& UniqueRays() const { return vpUniqueRays; }
inline const std::shared_ptr<CRay>& At(int idxTheta, int idxPhi) const { return vvpRayMatrix[idxTheta][idxPhi]; }
inline const std::vector<double>& ThetaDeg() const { return vdThetaDeg; };
inline const std::vector<double>& PhiDeg() const { return vdPhiDeg; };
inline int NTheta() const { return vdThetaDeg.size(); };
inline int NPhi() const { return vdPhiDeg.size(); };
inline int NRays() const { return vpRays.size(); };
inline const VistaVector3D& SourcePosition() const { return v3SourcePos; };
inline const std::set<std::shared_ptr<CRay>>& UniqueRays() const { return vpUniqueRays; };
inline const std::shared_ptr<CRay>& At(int idxTheta, int idxPhi) const { return vvpRayMatrix[idxTheta][idxPhi]; };
//! Calculates and returns an approximation for the surface area of the wavefront at given time by spanning triangles between rays
double WavefrontSurface(const double& time) const;
......
......@@ -40,14 +40,14 @@ namespace ITAPropagationPathSim
VistaVector3D wavefrontNormal;
double timeStamp;
inline CRayElement() {}
inline CRayElement(const VistaVector3D& r, const VistaVector3D& n, const double& time) : position(r), wavefrontNormal(n), timeStamp(time) {}
inline CRayElement() {};
inline CRayElement(const VistaVector3D& r, const VistaVector3D& n, const double& time) : position(r), wavefrontNormal(n), timeStamp(time) {};
//! Does a linear interpolation from this element to the given one using a factor [0.0 1.0] and returns the new element.
CRayElement Interpolate(const CRayElement& target, const float fFraction) const;
};
//! Compares the timestamps of given CRayElements using the < operator
inline bool operator<(const CRayElement& lhs, const CRayElement& rhs) { return lhs.timeStamp < rhs.timeStamp; }
inline bool operator<(const CRayElement& lhs, const CRayElement& rhs) { return lhs.timeStamp < rhs.timeStamp; };
class ITA_PROPAGATION_PATH_SIM_API CRayReceiverData {
public:
......@@ -56,8 +56,8 @@ namespace ITAPropagationPathSim
int reflectionOrder;
VistaVector3D posMinDist;
inline CRayReceiverData() : idxMinDist(-1), distance(-1), reflectionOrder(-1), posMinDist(VistaVector3D()) {}
inline CRayReceiverData(int iMin, float dMin, int reflOrder, const VistaVector3D& rMin = VistaVector3D()) : idxMinDist(iMin), distance(dMin), reflectionOrder(reflOrder), posMinDist(rMin) {}
inline CRayReceiverData() : idxMinDist(-1), distance(-1), reflectionOrder(-1), posMinDist(VistaVector3D()) {};
inline CRayReceiverData(int iMin, float dMin, int reflOrder, const VistaVector3D& rMin = VistaVector3D()) : idxMinDist(iMin), distance(dMin), reflectionOrder(reflOrder), posMinDist(rMin) {};
};
class ITA_PROPAGATION_PATH_SIM_API CRay : public std::vector<CRayElement>
......@@ -78,29 +78,29 @@ namespace ITAPropagationPathSim
public:
#pragma region Get Functions
const std::vector<int>& ReflectionIndices() const { return iReflectionIndices; }
const std::vector<int>& ReflectionIndices() const { return iReflectionIndices; };
int NumPoints() const { return size(); }
const VistaVector3D& SourcePoint() const { return front().position; }
const VistaVector3D& InitialDirection() const { return front().wavefrontNormal; }
inline int NumPoints() const { return size(); }
inline const VistaVector3D& SourcePoint() const { return front().position; };
inline const VistaVector3D& InitialDirection() const { return front().wavefrontNormal; };
const VistaVector3D& LastPoint() const { return back().position; }
const VistaVector3D& LastWavefrontNormal() const { return back().wavefrontNormal; }
const double& LastTimeStamp() const { return back().timeStamp; }
inline const VistaVector3D& LastPoint() const { return back().position; };
inline const VistaVector3D& LastWavefrontNormal() const { return back().wavefrontNormal; };
inline const double& LastTimeStamp() const { return back().timeStamp; };
int ReflectionOrder() const { return iReflectionIndices.size(); }
inline int ReflectionOrder() const { return iReflectionIndices.size(); };
//! Returns the reflection order of the ray element with given index
int ReflectionOrder(const int idx) const;
//! Returns the spreading loss at end point of receiver. If this has not been calculated yet, this returns -1.
inline double SpreadingLoss() const { return dSpreadingLoss; }
inline double SpreadingLoss() const { return dSpreadingLoss; };
#pragma endregion
//! Appends a new element with position, wavefront normal and timestamp to the ray
void Append(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp);
//! Appends a new element to the ray and adds its index to iReflectionIndices
void AppendReflection(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp);
inline void SetSpreadingLoss(const double& spreadingLoss) { dSpreadingLoss = spreadingLoss; }
inline void SetSpreadingLoss(const double& spreadingLoss) { dSpreadingLoss = spreadingLoss; };
//! Returns true, if both rays have the same initial direction
bool SameDirection(const CRay& other) const;
......
......@@ -8,7 +8,7 @@ using namespace ITAPropagationPathSim::AtmosphericRayTracing;
using namespace ITAPropagationPathSim::AtmosphericRayTracing::EigenraySearch;
#pragma region CONSTRUCTOR / INITIATION
inline EigenraySearch::CAdaptiveRayGrid::CAdaptiveRayGrid(const CRayGrid& rayGrid) : CRayGrid(rayGrid)
EigenraySearch::CAdaptiveRayGrid::CAdaptiveRayGrid(const CRayGrid& rayGrid) : CRayGrid(rayGrid)
{
if (rayGrid.UniqueRays().size() <= 1)
ITA_EXCEPT_INVALID_PARAMETER("Ray Grid must atleast contain 2 unique rays");
......
......@@ -163,14 +163,14 @@ inline float DeterminantCofactor(const float matrix[][3], const int idx1, const
else
cofactor = -(-matrix[(idx1 + 1) % 3][(idx2 + 1) % 3] * matrix[(idx1 + 2) % 3][(idx2 + 2) % 3] + matrix[(idx1 + 1) % 3][(idx2 + 2) % 3] * matrix[(idx1 + 2) % 3][(idx2 + 1) % 3]);
return cofactor;
}
};
inline float Determinant(const float matrix[][3])
{
const float x = matrix[0][0] * DeterminantCofactor(matrix, 0, 0);
const float y = matrix[0][1] * DeterminantCofactor(matrix, 0, 1);
const float z = matrix[0][2] * DeterminantCofactor(matrix, 0, 2);
return x + y + z;
}
};
inline double SurfaceAreaOfRayTriangle(const std::vector<std::shared_ptr<CRay>>& rays, const double& time)
{
VistaVector3D p0 = rays[0]->AtTime(time).position;
......@@ -186,7 +186,7 @@ inline double SurfaceAreaOfRayTriangle(const std::vector<std::shared_ptr<CRay>>&
const float detZX = Determinant(matrixZX);
return 0.5 * std::sqrtf(detXY * detXY + detYZ * detYZ + detZX * detZX);
}
};
//---CLASS METHODS ---
//--------------------
......@@ -374,7 +374,7 @@ bool CRayGrid::HasPoleDirection(const std::shared_ptr<CRay>& pRay) const
return abs(n0[Vista::X]) < FLT_EPSILON && abs(n0[Vista::Y]) < FLT_EPSILON; //x- and y- component are zero
}
inline bool CRayGrid::IsEmpty() const
bool CRayGrid::IsEmpty() const
{
return NTheta() == 0 || NPhi() == 0;
}
......@@ -384,7 +384,7 @@ bool CRayGrid::Is2D() const
return NTheta() > 1 && NPhi() > 1;
}
inline bool CRayGrid::Contains(const std::shared_ptr<CRay>& pRay) const
bool CRayGrid::Contains(const std::shared_ptr<CRay>& pRay) const
{
return std::find(vpRays.cbegin(), vpRays.cend(), pRay) != vpRays.cend();
}
......
......@@ -164,7 +164,7 @@ inline VistaVector3D ClosestPointOnLineSegmentToReceiver(const VistaVector3D& se
const float dP1R = (segmentP1 - receiverPoint).GetLength();
const float dP2R = (segmentP2 - receiverPoint).GetLength();
return dP1R <= dP2R ? segmentP1 : segmentP2; // Return point of segment with minimum distance
}
};
void CRay::InterpolateToRealMinimumPosition(const VistaVector3D& receiverPos)
{
int& iMinReceiverDistance = mReceiverDistanceMap[&receiverPos].idxMinDist;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment