Commit 5dc24f4a authored by Philipp Schäfer's avatar Philipp Schäfer

ART - RayToPropagationPath

- moved function definitions to cpp file
parent 616b87fb
......@@ -21,9 +21,6 @@
#include <ITAPropagationPathSim/Definitions.h>
// Vista includes
#include <VistaBase/VistaVector3D.h>
// ITA includes
#include <ITAPropagationPathSim/AtmosphericRayTracing/Rays.h>
#include <ITAGeo/Base.h>
......@@ -38,56 +35,9 @@ namespace ITAPropagationPathSim
{
namespace Utils
{
ITA_PROPAGATION_PATH_SIM_API inline ITAGeo::CPropagationPath ToPropagationPath(const CRay& ray)
{
ITAGeo::CPropagationPath propagationPath;
propagationPath.reserve(ray.size());
VistaVector3D position, wavefrontNormal;
propagationPath.push_back(std::make_shared<ITAGeo::CEmitterInhomogeneous>(ray.SourcePoint(), ray.InitialDirection()));
for (int idx = 1; idx < ray.size(); idx++)
{
position = ray[idx].position;
wavefrontNormal = ray[idx].wavefrontNormal;
if (position[Vista::Z] < 0)
{
position[Vista::Z] = -position[Vista::Z];
wavefrontNormal[Vista::Z] = -wavefrontNormal[Vista::Z];
}
if (idx == ray.size() - 1)
{
auto pReceiver = std::make_shared<ITAGeo::CSensorInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
pReceiver->dSpreadingLoss = ray.SpreadingLoss();
propagationPath.push_back(pReceiver);
}
else if (ray.IsReflectionIdx(idx))
{
auto anchor = std::make_shared<ITAGeo::CSpecularReflectionInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
anchor->v3FaceNormal = VistaVector3D(0, 0, 1);
propagationPath.push_back(anchor);
}
else
propagationPath.push_back(std::make_shared<ITAGeo::CInhomogeneity>(position, wavefrontNormal, ray[idx].timeStamp));
}
return propagationPath;
};
ITA_PROPAGATION_PATH_SIM_API inline ITAGeo::CPropagationPathList ToPropagationPath(const std::vector<std::shared_ptr<CRay>>& vpRays)
{
ITAGeo::CPropagationPathList propagationPathList;
propagationPathList.reserve(vpRays.size());
for each (std::shared_ptr<CRay> pRay in vpRays)
{
if (!pRay)
continue;
propagationPathList.push_back(ToPropagationPath(*pRay));
}
ITA_PROPAGATION_PATH_SIM_API ITAGeo::CPropagationPath ToPropagationPath(const CRay& ray);
return propagationPathList;
};
ITA_PROPAGATION_PATH_SIM_API ITAGeo::CPropagationPathList ToPropagationPath(const std::vector<std::shared_ptr<CRay>>& vpRays);
}
}
}
......
#include <ITAPropagationPathSim/AtmosphericRayTracing/Utils/RayToPropagationPath.h>
// Vista includes
#include <VistaBase/VistaVector3D.h>
using namespace ITAPropagationPathSim::AtmosphericRayTracing;
ITAGeo::CPropagationPath Utils::ToPropagationPath(const CRay& ray)
{
ITAGeo::CPropagationPath propagationPath;
propagationPath.reserve(ray.size());
VistaVector3D position, wavefrontNormal;
propagationPath.push_back(std::make_shared<ITAGeo::CEmitterInhomogeneous>(ray.SourcePoint(), ray.InitialDirection()));
for (int idx = 1; idx < ray.size(); idx++)
{
position = ray[idx].position;
wavefrontNormal = ray[idx].wavefrontNormal;
if (position[Vista::Z] < 0)
{
position[Vista::Z] = -position[Vista::Z];
wavefrontNormal[Vista::Z] = -wavefrontNormal[Vista::Z];
}
if (idx == ray.size() - 1)
{
auto pReceiver = std::make_shared<ITAGeo::CSensorInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
pReceiver->dSpreadingLoss = ray.SpreadingLoss();
propagationPath.push_back(pReceiver);
}
else if (ray.IsReflectionIdx(idx))
{
auto anchor = std::make_shared<ITAGeo::CSpecularReflectionInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
anchor->v3FaceNormal = VistaVector3D(0, 0, 1);
propagationPath.push_back(anchor);
}
else
propagationPath.push_back(std::make_shared<ITAGeo::CInhomogeneity>(position, wavefrontNormal, ray[idx].timeStamp));
}
return propagationPath;
}
ITAGeo::CPropagationPathList Utils::ToPropagationPath(const std::vector<std::shared_ptr<CRay>>& vpRays)
{
ITAGeo::CPropagationPathList propagationPathList;
propagationPathList.reserve(vpRays.size());
for each (std::shared_ptr<CRay> pRay in vpRays)
{
if (!pRay)
continue;
propagationPathList.push_back(ToPropagationPath(*pRay));
}
return propagationPathList;
}
# $Id:$
set( RelativeDir "src/ITAPropagationPathSim/AtmosphericRayTracing/Utils" )
set( RelativeSourceGroup "Source Files\\ITAPropagationPathSim\\AtmosphericRayTracing\\Utils" )
set( DirFiles
RayToPropagationPath.cpp
)
set( DirFiles_SourceGroup "${RelativeSourceGroup}" )
set( LocalSourceGroupFiles )
foreach( File ${DirFiles} )
list( APPEND LocalSourceGroupFiles "${RelativeDir}/${File}" )
list( APPEND ProjectSources "${RelativeDir}/${File}" )
endforeach()
source_group( ${DirFiles_SourceGroup} FILES ${LocalSourceGroupFiles} )
......@@ -3,7 +3,7 @@
set( RelativeDir "src/ITAPropagationPathSim/AtmosphericRayTracing" )
set( RelativeSourceGroup "Source Files\\ITAPropagationPathSim\\AtmosphericRayTracing" )
set( SubDirs ODESolver Simulation EigenraySearch)
set( SubDirs ODESolver Simulation EigenraySearch Utils)
set( DirFiles
Rays.cpp
......
Markdown is supported
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