Commit cf201fc8 authored by Armin Erraji's avatar Armin Erraji

Added member variable to choose the number of iterations for the calculation...

Added member variable to choose the number of iterations for the calculation of the aperture points.
parent bf52a580
......@@ -18,7 +18,7 @@ namespace ITAPropagationPathSim
namespace Diffraction
{
bool ITA_PROPAGATION_PATH_SIM_API ConstructAperturePoints(shared_ptr<const CEmitter> pEmitter, shared_ptr<const CSensor> pSensor, const vector<CPropagationShapeShared> pPropagationListsIn, vector<CPropagationShapeShared>& pPropagationListsOut);
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);
}
}
......
......@@ -23,10 +23,15 @@ namespace ITAPropagationPathSim
//Constructor
CPathEngine();
void ConfigureFilter(const bool bFilterNotNeighbouredEdges = false , const bool bFilterIlluminatedRegionDiffraction = false ,
const bool bFilterEdgeToEdgeIntersectedPaths = false, const bool bFilterEmitterToEdgeIntersectedPaths = false,
const bool bFilterSensorToEdgeIntersectedPaths = false, const bool bFilterIntersectedPaths = false,
const float fIntersectionTestResolution = 0.001f, const float fAccumulatedAngleThreshold = -1.0f);
void Configure(const bool bFilterNotNeighbouredEdges = false, const bool bFilterIlluminatedRegionDiffraction = false,
const bool bFilterEdgeToEdgeIntersectedPaths = false,
const bool bFilterEmitterToEdgeIntersectedPaths = false,
const bool bFilterSensorToEdgeIntersectedPaths = false,
const bool bFilterIntersectedPaths = false,
const int iNumberIterationApexCalculation = 5,
const float fIntersectionTestResolution = 0.001f,
const float fAccumulatedAngleThreshold = -1.0f);
void InitializePathEnvironment(shared_ptr<const Halfedge::CMeshModelList> pMeshModelList);
......@@ -60,8 +65,9 @@ namespace ITAPropagationPathSim
unique_ptr<const bool> m_pFilterIntersectedPaths; //!< Boolean pointer for for filtering paths if intersection occurs
unique_ptr<const float> m_pIntersectionTestResolution; //!< Resolution for intersection test
unique_ptr <const float> m_pAccumulatedAngleThreshold; //!< Threshold for the accumulated diffraction angle
unique_ptr <const size_t> m_pNumberIterationApexCalc; //!< Number of iterations for the calculation of the aperture points
void CreateVisibilityMap();
bool CanPointIlluminateFace(const VistaVector3D & v3Point, const string & sMeshModelName, CITAMesh::FaceHandle hFace);
bool CanPointIlluminateEdge(const VistaVector3D & v3Point, CPropagationEdgeShared & pPropagationEdge, const bool& bTestIntersection = false);
......
......@@ -3,7 +3,7 @@
using namespace std;
using namespace ITAGeo;
bool ITAPropagationPathSim::CombinedModel::Diffraction::ConstructAperturePoints(shared_ptr<const CEmitter> pEmitter, shared_ptr<const CSensor> pSensor, const vector<CPropagationShapeShared> pPropagationListsIn, vector<CPropagationShapeShared>& pPropagationListsOut)
bool ITAPropagationPathSim::CombinedModel::Diffraction::ConstructAperturePoints(shared_ptr<const CEmitter> pEmitter, shared_ptr<const CSensor> pSensor, const int iNumberIterations, const vector<CPropagationShapeShared> pPropagationListsIn, vector<CPropagationShapeShared>& pPropagationListsOut)
{
pPropagationListsOut.clear();
......@@ -123,10 +123,8 @@ bool ITAPropagationPathSim::CombinedModel::Diffraction::ConstructAperturePoints(
//Add the (maybe imaged) receiver to the differences vector
vpVertexDiff.push_back(make_unique<VistaVector3D>(*v3LastFromVertex - v3SensorPosition));
//Iterative a given number of times to get the exact position of the diffraction apertures
const size_t iNumIterations = 5;
for(size_t iCurrentIteration = 0; iCurrentIteration< iNumIterations; iCurrentIteration++)
for(size_t iCurrentIteration = 0; iCurrentIteration< iNumberIterations; iCurrentIteration++)
{
//Length of direction vector between two adjacent points in the shortest path.
vector<float> vfDirectionVectorLength;
......
......@@ -17,12 +17,14 @@ struct CITAMeshPtr
ITAPropagationPathSim::CombinedModel::CPathEngine::CPathEngine()
{
//Initialize filter variables with standard values(no filters)
ConfigureFilter();
Configure();
}
void ITAPropagationPathSim::CombinedModel::CPathEngine::ConfigureFilter(const bool bFilterNotNeighbouredEdges, const bool bFilterIlluminatedRegionDiffraction, const bool bFilterEdgeToEdgeIntersectedPaths,
const bool bFilterEmitterToEdgeIntersectedPaths, const bool bFilterSensorToEdgeIntersectedPaths, const bool bFilterIntersectedPaths,
const float fIntersectionTestResolution, const float fAccumulatedAngleThreshold)
void ITAPropagationPathSim::CombinedModel::CPathEngine::Configure(const bool bFilterNotNeighbouredEdges, const bool bFilterIlluminatedRegionDiffraction,
const bool bFilterEdgeToEdgeIntersectedPaths,
const bool bFilterEmitterToEdgeIntersectedPaths, const bool bFilterSensorToEdgeIntersectedPaths,
const bool bFilterIntersectedPaths,
const int iNumberIterationApexCalculation, const float fIntersectionTestResolution, const float fAccumulatedAngleThreshold)
{
//Set filter variables
m_pFilterNotNeighbouredEdges = make_unique<const bool>(bFilterNotNeighbouredEdges);
......@@ -40,6 +42,9 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConfigureFilter(const bo
//Standard value is -1 (no threshold)
m_pAccumulatedAngleThreshold = make_unique<const float>(fAccumulatedAngleThreshold);
//Number of iterations for the calculation of the aperture points
m_pNumberIterationApexCalc = make_unique<const size_t>((size_t)iNumberIterationApexCalculation);
//Recreate the visibility map, if m_pMeshModelList already initialized
if (m_pMeshModelList != nullptr)
{
......@@ -106,7 +111,7 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationPath
sw.start();
//First, construct the aperture points
Diffraction::ConstructAperturePoints(m_pEmitter, m_pSensor, m_vpPropagationLists, m_vpPropagationLists);
Diffraction::ConstructAperturePoints(m_pEmitter, m_pSensor, (int)*m_pNumberIterationApexCalc, m_vpPropagationLists, m_vpPropagationLists);
std::cout << m_vpPropagationLists.size() << " path candidates after aperture points calculated. Calculation time: " << timeToString(sw.stop()) << endl;
sw.start();
......
......@@ -87,6 +87,8 @@ int main( int iNumInArgs, char* pcInArgs[] )
const bool bFilterNotVisiblePointToEdge = true; //Intersection test between emitter/sensor and edges
const bool bFilterNotVisiblePaths = true; //Intersection test of calculated sub paths
const int iNumIterations = 100;//!< Number of iterations for the calculation of the aperture points
const int iMaxDiffractionOrder = 3;
const int iMaxReflectionOrder = 2;
const int iMaxCombinedOrder = 5;
......@@ -98,7 +100,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
sw.start();
pPathEngine->ConfigureFilter(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowRegion, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge,bFilterNotVisiblePaths);
pPathEngine->Configure(bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowRegion, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge,bFilterNotVisiblePaths, iNumIterations);
cout << "Calculation time configuring filter: " << timeToString(sw.stop()) << endl;
sw.start();
......
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