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

ART - Simulation Engine

- added semi colons to inline methods
parent 7a4d5345
......@@ -154,7 +154,6 @@ EigenraySearch::RayPtr EigenraySearch::CAdaptiveWorker::Run(const ITAGeo::CStrat
PostProcessEigenray(atmosphere);
return pMinDistanceRay;
//TODO: Postprocessing: Calculate spreading loss factor
}
......
......@@ -24,14 +24,17 @@ class CWorker
const IExternalWatcher& rExternalWatcher; //!< Reference to externally defined abort criterion.
CAdaptiveSolver solver;
public:
CWorker(std::shared_ptr<CRay> ray, const Settings& simSettings, const IExternalWatcher& externalWatcher) :
pRay(ray), rExternalWatcher(externalWatcher), solver(CAdaptiveSolver(simSettings)) {}
CWorker(std::shared_ptr<CRay> ray, const Settings& simSettings, const IExternalWatcher& externalWatcher)
: pRay(ray)
, rExternalWatcher(externalWatcher)
, solver( CAdaptiveSolver(simSettings) )
{};
private:
bool GroundReflectionOccured(const double& rz1, const double& rz2) const
{
return signbit(rz1) != signbit(rz2);
}
};
void InterpolateToReflectionPoint(const VistaVector3D& r1, const VistaVector3D& r2, const double& dt, VistaVector3D& rReflection, double& dtReflection)
{
const VistaVector3D dr = r2 - r1;
......@@ -39,7 +42,7 @@ class CWorker
rReflection = r1 + dr * portion;
dtReflection = dt * portion;
}
};
void ExtendRayByOnePeriod()
{
const std::vector<int>& iReflectionIndices = pRay->ReflectionIndices();
......@@ -48,7 +51,7 @@ class CWorker
if (reflectionOrder < 2)
ITA_EXCEPT_INVALID_PARAMETER("Cannot extend a ray with a reflection order below 2.");
const int idxStartReflection = iReflectionIndices[reflectionOrder-2];
const int idxStartReflection = iReflectionIndices[reflectionOrder - 2];
const int idxEndReflection = iReflectionIndices[reflectionOrder - 1];
double tOffset = pRay->at(idxEndReflection).timeStamp - pRay->at(idxStartReflection).timeStamp;
......@@ -76,12 +79,12 @@ class CWorker
n[Vista::Z] = -n[Vista::Z];
pRay->AppendReflection(r, n, t);
rExternalWatcher.ProcessRay(pRay);
}
};
void ExtendRayPeriodically()
{
while (!rExternalWatcher.AbortRequested(pRay))
while ( !rExternalWatcher.AbortRequested(pRay) )
ExtendRayByOnePeriod();
}
};
void CalculateRay(const ITAGeo::CStratifiedAtmosphere& atmosphere)
{
VistaVector3D r = pRay->LastPoint();
......@@ -107,7 +110,7 @@ class CWorker
pRay->AppendReflection(rGround, n, time + dtGround);
rExternalWatcher.ProcessRay(pRay);
if ( rExternalWatcher.AbortRequested(pRay) )
if (rExternalWatcher.AbortRequested(pRay))
return;
if (pRay->ReflectionOrder() >= 2) //Ray is periodic
......@@ -119,17 +122,17 @@ class CWorker
r = rNew;
s = sNew;
time += dt;
time += dt;
pRay->Append(r, n, time);
rExternalWatcher.ProcessRay(pRay);
}
}
};
public:
void TraceRay(const ITAGeo::CStratifiedAtmosphere& atmosphere)
{
CalculateRay(atmosphere);
rExternalWatcher.FinalizeRay(pRay);
}
};
};
}}}
......
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