...
 
#ifndef INCLUDE_WATCHER_DIFFRACTION_LOCATOR
#define INCLUDE_WATCHER_DIFFRACTION_LOCATOR
#include <ITABase/ITAProgress.h>
// ITA includes
#include <ITAGeo/Base.h>
#include <ITAGeo/Halfedge/MeshModel.h>
#include <ITAGeo/Utils.h>
#include<ITAPropagationPathSim/CombinedModel/PropagationShapes.h>
#include <ITAPropagationPathSim/CombinedModel/PropagationShapes.h>
namespace ITAPropagationPathSim
{
......@@ -16,14 +16,14 @@ namespace ITAPropagationPathSim
using namespace ITAGeo;
using namespace std;
namespace Diffraction
namespace Diffraction
{
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 ConstructAperturePoints( shared_ptr< const CEmitter > pEmitter, shared_ptr< const CSensor > pSensor, const int iNumberIterations, const vector< CPropagationShapeShared > pPropagationListsIn, vector< CPropagationShapeShared >& pPropagationListsOut, ITABase::IProgressHandler* pProgressHandler = nullptr );
//!< 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);
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 );
}
}
......
......@@ -10,7 +10,7 @@
#include <ITAGeo/Halfedge/MeshModel.h>
#include <ITAGeo/Utils.h>
#include <ITABase/ITAProgress.h>
namespace ITAPropagationPathSim
{
......@@ -56,7 +56,7 @@ namespace ITAPropagationPathSim
int iMaxDiffractionOrder;
int iMaxReflectionOrder;
int iMaxCombinedOrder;
float fMaxLevelReduction;
float fDynamicRange;
float fReflectionPenalty;
float fDiffractionPenalty;
float fAccumulatedAngleThreshold;
......@@ -71,7 +71,7 @@ namespace ITAPropagationPathSim
iMaxDiffractionOrder = 2;
iMaxReflectionOrder = 2;
iMaxCombinedOrder = 4;
fMaxLevelReduction = -1.0f; // disabled
fDynamicRange = -1.0f; // disabled
fReflectionPenalty = -10.0f * log10( 0.8f ); // for conservative sim, set to 0
fDiffractionPenalty = 2.5f; // for conservative sim, set to 0
fAccumulatedAngleThreshold = -1.0f; // disabled
......@@ -82,6 +82,9 @@ namespace ITAPropagationPathSim
void SetSimulationConfiguration( const CSimulationConfig& oConfig );
void SetAbortionCriteria( const CAbortionCriteria& oAbort );
void SetProgressCallbackHandler( ITABase::IProgressHandler* pHandler );
void InitializePathEnvironment( shared_ptr< const Halfedge::CMeshModelList > pMeshModelList );
void ApplyEmitter( shared_ptr< CEmitter > pEmitter );
......@@ -101,6 +104,9 @@ namespace ITAPropagationPathSim
CAbortionCriteria m_oAbort;
CSimulationConfig m_oConfig;
void PushStatus( std::string, float );
ITABase::IProgressHandler* m_pProgressHandler;
vector<CPropagationShapeShared> m_vpPropagationShapes; //!< Vector of all propagation shapes
//CShapesTree m_ShapesTree; TODO: Not working yet
......@@ -140,6 +146,7 @@ namespace ITAPropagationPathSim
// Convert the propagation list
void ConvertShapeListsToPropagationPaths( ITAGeo::CPropagationPathList& oPathsOut );
};
}
}
......
......@@ -154,13 +154,12 @@ bool CPropagationFace::SetMinimumDistance(const CPropagationShape & oPropagation
if (v3Barycenter == nullptr || oPropagationShape.v3Barycenter == nullptr)
return false;
//Calculate the distance between two spheres
// Calculate the distance between two spheres
fMinimumDistance = CalculateMinimumDistance(*oPropagationShape.v3Barycenter) - oPropagationShape.fRadius;
//Negative distances are not possible
// Negative distances are not possible
fMinimumDistance = fmaxf(fMinimumDistance, 0.0f);
return true;
}
......
......@@ -158,7 +158,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
CombinedModel::CPathEngine::CAbortionCriteria oAbort;
oAbort.fDiffractionPenalty = fDiffractionPenalty;
oAbort.fAccumulatedAngleThreshold = fMaxAccumulatedDiffractionAngle;
oAbort.fMaxLevelReduction = fLevelDropThreshhold;
oAbort.fDynamicRange = fLevelDropThreshhold;
oAbort.fReflectionPenalty = fReflectionPenalty;
oAbort.iMaxCombinedOrder = iMaxCombinedOrder;
oAbort.iMaxDiffractionOrder = iMaxDiffractionOrder;
......
......@@ -152,7 +152,7 @@ int main( int, char** )
CombinedModel::CPathEngine::CAbortionCriteria oAbort;
oAbort.fDiffractionPenalty = fDiffractionPenalty;
oAbort.fAccumulatedAngleThreshold = fMaxAccumulatedDiffractionAngle;
oAbort.fMaxLevelReduction = fLevelDropThreshhold;
oAbort.fDynamicRange = fLevelDropThreshhold;
oAbort.fReflectionPenalty = fReflectionPenalty;
oAbort.iMaxCombinedOrder = iMaxCombinedOrder;
oAbort.iMaxDiffractionOrder = iMaxDiffractionOrder;
......
......@@ -142,7 +142,7 @@ int main( int, char** )
CombinedModel::CPathEngine::CAbortionCriteria oAbort;
oAbort.fDiffractionPenalty = fDiffractionPenalty;
oAbort.fAccumulatedAngleThreshold = fMaxAccumulatedDiffractionAngle;
oAbort.fMaxLevelReduction = fLevelDropThreshhold;
oAbort.fDynamicRange = fLevelDropThreshhold;
oAbort.fReflectionPenalty = fReflectionPenalty;
oAbort.iMaxCombinedOrder = iMaxCombinedOrder;
oAbort.iMaxDiffractionOrder = iMaxDiffractionOrder;
......
......@@ -122,7 +122,7 @@ int main( int, char** )
CombinedModel::CPathEngine::CAbortionCriteria oAbort;
oAbort.fDiffractionPenalty = fDiffractionPenalty;
oAbort.fAccumulatedAngleThreshold = fMaxAccumulatedDiffractionAngle;
oAbort.fMaxLevelReduction = fLevelDropThreshhold;
oAbort.fDynamicRange = fLevelDropThreshhold;
oAbort.fReflectionPenalty = fReflectionPenalty;
oAbort.iMaxCombinedOrder = iMaxCombinedOrder;
oAbort.iMaxDiffractionOrder = iMaxDiffractionOrder;
......