Commit 78b33e95 authored by Armin Erraji's avatar Armin Erraji

Added angle culling algorithms for the propagation path simulation.

parent 1d4e1782
......@@ -20,7 +20,10 @@ namespace ITAPropagationPathSim
{
bool ITA_PROPAGATION_PATH_SIM_API ConstructAperturePoints(shared_ptr<const CEmitter> pEmitter, shared_ptr<const CSensor> pSensor, const int iNumberIterations, const vector<CPropagationShapeShared> pPropagationListsIn, vector<CPropagationShapeShared>& pPropagationListsOut);
bool ITA_PROPAGATION_PATH_SIM_API AccumulatedAngleCulling(const float fAngleThreshold, const vector<CPropagationShapeShared> pPropagationTreeIn, vector<CPropagationShapeShared>& pPropagationTreeOut);
//!< Exclude propagation paths with an accumulated diffraction angle that is bigger than the angle threshold.
bool ITA_PROPAGATION_PATH_SIM_API AccumulatedAngleCulling(const float fAngleThreshold, shared_ptr<const CEmitter> pEmitter, const vector<CPropagationShapeShared> pPropagationTreeIn, vector<CPropagationShapeShared>& pPropagationTreeOut);
bool ITA_PROPAGATION_PATH_SIM_API AccumulatedAngleCulling(const float fAngleThreshold, shared_ptr<const CEmitter> pEmitter, shared_ptr<const CSensor> pSensor, const vector<CPropagationShapeShared> pPropagationListsIn, vector<CPropagationShapeShared>& pPropagationListsOut);
}
}
......
......@@ -227,14 +227,14 @@ namespace ITAPropagationPathSim
}
else if (pPropagationShape->iShapeType == CPropagationShape::FACE)
{
auto pPropagationFace = dynamic_pointer_cast<CPropagationFace>(pPropagationShape);
auto pPropagationFace = static_pointer_cast<CPropagationFace>(pPropagationShape);
//Create image vertices only for edges with faces as parents
if (!pPropagationFace->pParent.expired())
{
if (pPropagationFace->pParent.lock()->iShapeType == CPropagationShape::FACE)
{
auto pParentFace = dynamic_pointer_cast<CPropagationFace>(pPropagationFace->pParent.lock());
auto pParentFace = static_pointer_cast<CPropagationFace>(pPropagationFace->pParent.lock());
if (pParentFace->v3ImageEdgeSourceStart != nullptr)
{
......@@ -256,7 +256,7 @@ namespace ITAPropagationPathSim
}
else if (pPropagationFace->pParent.lock()->iShapeType == CPropagationShape::EDGE)
{
auto pParentEdge = dynamic_pointer_cast<CPropagationEdge>(pPropagationFace->pParent.lock());
auto pParentEdge = static_pointer_cast<CPropagationEdge>(pPropagationFace->pParent.lock());
//Calculate image edge source.
//A PointInFrontOfPlane test is not needed, because a backfaceculling with vertices and plane is already done.
......
......@@ -92,10 +92,10 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ApplyEmitter(shared_ptr<
//Construct image edges
ImageConstruction::ConstructImageEdges(m_pEmitter, m_vpPropagationTree);
//Calculate accumulated angle and filter tree
if (m_pAccumulatedAngleThreshold > 0)
//Calculate accumulated angle and angle culling for tree
if (*m_pAccumulatedAngleThreshold > 0)
{
Diffraction::AccumulatedAngleCulling(*m_pAccumulatedAngleThreshold, m_vpPropagationTree, m_vpPropagationTree);
Diffraction::AccumulatedAngleCulling(*m_pAccumulatedAngleThreshold, m_pEmitter,m_vpPropagationTree, m_vpPropagationTree);
}
}
......@@ -131,6 +131,13 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationPath
Reflection::ConstructPointsOfReflection(m_pSensor, m_vpPropagationLists, m_vpPropagationLists);
std::cout << m_vpPropagationLists.size() << " path candidates after points of reflection calculated. Calculation time: " << timeToString(sw.stop()) << endl;
//Calculate accumulated angle and filter lists
if (*m_pAccumulatedAngleThreshold > 0)
{
sw.start();
Diffraction::AccumulatedAngleCulling(*m_pAccumulatedAngleThreshold, m_pEmitter,m_pSensor, m_vpPropagationLists, m_vpPropagationLists);
std::cout << m_vpPropagationLists.size() << " path candidates after angle culling. Calculation time: " << timeToString(sw.stop()) << endl;
}
sw.start();
if (*m_pFilterIntersectedPaths)
......
......@@ -36,7 +36,7 @@ void CPropagationEdge::CopyFrom(const CPropagationEdge & oPropagationEdgeIn)
hEdge = oPropagationEdgeIn.hEdge;
hMainFace = oPropagationEdgeIn.hMainFace;
hOppositeFace = oPropagationEdgeIn.hOppositeFace;
v3EdgeStart = oPropagationEdgeIn.v3EdgeStart;
v3StartVertex = oPropagationEdgeIn.v3StartVertex;
v3EndVertex = oPropagationEdgeIn.v3EndVertex;
v3MainFaceNormal = oPropagationEdgeIn.v3MainFaceNormal;
v3OppositeFaceNormal = oPropagationEdgeIn.v3OppositeFaceNormal;
......
......@@ -86,10 +86,11 @@ int main( int iNumInArgs, char* pcInArgs[] )
const bool bFilterNotVisiblePathsBetweenEdges = false; //Intersection test between edges(expensive)
const bool bFilterNotVisiblePointToEdge = true; //Intersection test between emitter/sensor and edges
const bool bFilterNotVisiblePaths = true; //Intersection test of calculated sub paths
const float fIntersectionTestResolution = 0.001;
const int iNumIterations = 5;//!< Number of iterations for the calculation of the aperture points
const int iMaxDiffractionOrder = 3;
const int fMaxAccumulatedDiffractionAngle = -2*ITAConstants::PI_F;
const int iMaxDiffractionOrder = 5;
const int iMaxReflectionOrder = 2;
const int iMaxCombinedOrder = 5;
......@@ -100,7 +101,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
sw.start();
pPathEngine->Configure(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowRegion, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge,bFilterNotVisiblePaths, iNumIterations);
pPathEngine->Configure(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowRegion, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge,bFilterNotVisiblePaths, iNumIterations,fIntersectionTestResolution,fMaxAccumulatedDiffractionAngle);
cout << "Calculation time configuring filter: " << timeToString(sw.stop()) << endl;
sw.start();
......@@ -150,7 +151,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
oGeoModel.AddPropagationPathVisualization(oPath, sPathName);
}
oPathListVisible.Store("CombinedModelTest_" + sInFile + ".json");
//oPathListVisible.Store("CombinedModelTest_" + sInFile + ".json");
oGeoModel.Store(sSubFolder +"CombinedModelTest_"+ sInFile);
......
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