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

ART - AdaptiveRayGrid

- doubling the ray resolution now does not create new rays at poles
parent f2255d68
......@@ -75,18 +75,19 @@ void CAdaptiveRayGrid::DoubleRayResolution()
vdThetaDeg = DoubleAngularResolution(vdThetaDeg);
vdPhiDeg = DoubleAngularResolution(vdPhiDeg);
RayMatrix newRayMatrix;
RayMatrix newRayMatrix( NTheta(), RayVector( NPhi() ) );
vpNewRaysOfLastAdaptation.clear();
RayVector::const_iterator iteratorOldRays = Rays().cbegin();
for (int idxTheta = 0; idxTheta < vdThetaDeg.size(); idxTheta++)
{
const bool isNewTheta = (idxTheta % 2) == 1;
newRayMatrix.push_back( RayVector() );
for (int idxPhi = 0; idxPhi < vdPhiDeg.size(); idxPhi++)
{
const bool isNewPhi = (idxPhi % 2) == 1;
RayPtr pRay;
if (isNewTheta || isNewPhi)
if (IsPoleDirection(vdThetaDeg[idxTheta]))
pRay = Matrix()[idxTheta].front();
else if (isNewTheta || isNewPhi)
{
pRay = std::make_shared<CRay>(v3SourcePos, vdThetaDeg[idxTheta], vdPhiDeg[idxPhi]);
vpNewRaysOfLastAdaptation.insert(pRay);
......@@ -94,7 +95,7 @@ void CAdaptiveRayGrid::DoubleRayResolution()
else
pRay = *iteratorOldRays++;
newRayMatrix[idxTheta].push_back(pRay);
newRayMatrix[idxTheta][idxPhi] = pRay;
}
}
SetRayMatrix(newRayMatrix);
......
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