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

ART - CRay

- moved most definitions to cpp file
parent 0827cd5f
......@@ -35,6 +35,15 @@ namespace ITAPropagationPathSim
{
namespace AtmosphericRayTracing
{
//class ITA_PROPAGATION_PATH_SIM_API RayElement {
//public:
// VistaVector3D position;
// VistaVector3D wavefrontNormal;
// double timeStamp;
// RayElement(const VistaVector3D& r, const VistaVector3D& n, const double& time) : position(r), wavefrontNormal(n), timeStamp(time) {}
//};
class ITA_PROPAGATION_PATH_SIM_API CRay
{
......@@ -45,21 +54,8 @@ namespace ITAPropagationPathSim
std::vector<unsigned int> iReflectionIndices;
public:
CRay(VistaVector3D v3SourcePos, double thetaDeg, double phiDeg)
{
const double thetaRad = thetaDeg * M_PI / 180;
const double phiRad = phiDeg * M_PI / 180;
const double cosTheta = cos(thetaRad);
auto v3Direction = VistaVector3D(cosTheta*cos(phiRad), cosTheta*sin(phiRad), sin(thetaRad));
CRay(v3SourcePos, v3Direction);
}
CRay(VistaVector3D v3SourcePos, VistaVector3D v3Direction)
{
v3SamplingPoints.push_back(v3SourcePos);
v3WavefrontNormals.push_back(v3Direction.GetNormalized());
dTimeStamps.push_back(0);
}
virtual ~CRay() {}
CRay(const VistaVector3D& v3SourcePos, const double& thetaDeg, const double& phiDeg);
CRay(const VistaVector3D& v3SourcePos, const VistaVector3D& v3Direction);
public:
#pragma region Get Functions
......@@ -80,21 +76,11 @@ namespace ITAPropagationPathSim
unsigned int ReflectionOrder() const { return iReflectionIndices.size(); }
#pragma endregion
bool SameDirection(const CRay& other) const { return InitialDirection() == other.InitialDirection(); }
bool IsReflectionIdx(const unsigned int& idx) const { return std::find(iReflectionIndices.begin(), iReflectionIndices.end(), idx) != iReflectionIndices.end(); }
void Append(const VistaVector3D& point, const VistaVector3D& wavefrontNormal, const double& timeStamp)
{
v3SamplingPoints.push_back(point);
v3WavefrontNormals.push_back(wavefrontNormal);
dTimeStamps.push_back(timeStamp);
}
void AppendReflection(const VistaVector3D& point, const VistaVector3D& wavefrontNormal, const double& timeStamp)
{
Append(point, wavefrontNormal, timeStamp);
iReflectionIndices.push_back(NumPoints()-1);
}
void Append(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp);
void AppendReflection(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp);
bool SameDirection(const CRay& other) const;
bool IsReflectionIdx(const unsigned int& idx) const;
};
}
}
......
#include <ITAPropagationPathSim/AtmosphericRayTracing/Rays.h>
// ITA includes
// STD
//#include <cmath>
using namespace ITAPropagationPathSim::AtmosphericRayTracing;
CRay::CRay(const VistaVector3D& v3SourcePos, const double& thetaDeg, const double& phiDeg)
{
const double thetaRad = thetaDeg * M_PI / 180;
const double phiRad = phiDeg * M_PI / 180;
const double cosTheta = std::cos(thetaRad);
auto v3Direction = VistaVector3D(cosTheta * std::cos(phiRad), cosTheta * std::sin(phiRad), std::sin(thetaRad));
CRay(v3SourcePos, v3Direction);
}
CRay::CRay(const VistaVector3D& v3SourcePos, const VistaVector3D& v3Direction)
{
v3SamplingPoints.push_back(v3SourcePos);
v3WavefrontNormals.push_back(v3Direction.GetNormalized());
dTimeStamps.push_back(0);
}
void CRay::Append(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp)
{
v3SamplingPoints.push_back(position);
v3WavefrontNormals.push_back(wavefrontNormal);
dTimeStamps.push_back(timeStamp);
}
void CRay::AppendReflection(const VistaVector3D& position, const VistaVector3D& wavefrontNormal, const double& timeStamp)
{
Append(position, wavefrontNormal, timeStamp);
iReflectionIndices.push_back(NumPoints() - 1);
}
bool CRay::SameDirection(const CRay& other) const
{
return InitialDirection() == other.InitialDirection();
}
bool CRay::IsReflectionIdx(const unsigned int& idx) const
{
return std::find(iReflectionIndices.begin(), iReflectionIndices.end(), idx) != iReflectionIndices.end();
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ set( RelativeSourceGroup "Source Files\\ITAPropagationPathSim\\AtmosphericRayTra
set( SubDirs ODESolver Simulation EigenraySearch)
set( DirFiles
Rays.cpp
RayGrid.cpp
)
......
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