Commit 6f4b9206 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing some minor issues and improving coded style

parents 745c6d2b 88ddc14d
......@@ -107,9 +107,9 @@ namespace ITAPropagationPathSim
public:
inline const std::vector<double>& ThetaDeg() const { return m_vdThetaDeg; };
inline const std::vector<double>& PhiDeg() const { return m_vdPhiDeg; };
inline int NTheta() const { return m_vdThetaDeg.size(); };
inline int NPhi() const { return m_vdPhiDeg.size(); };
inline int NRays() const { return m_vpRays.size(); };
inline int NTheta() const { return (int)m_vdThetaDeg.size(); };
inline int NPhi() const { return (int)m_vdPhiDeg.size(); };
inline int NRays() const { return (int)m_vpRays.size(); };
inline const VistaVector3D& SourcePosition() const { return m_v3SourcePos; };
inline const std::set<std::shared_ptr<CRay>>& UniqueRays() const { return m_vpUniqueRays; };
inline const std::shared_ptr<CRay> At(int idxTheta, int idxPhi) const { return m_vvpRayMatrix[idxTheta][idxPhi]; };
......
......@@ -144,4 +144,4 @@ namespace ITAPropagationPathSim
}
}
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_RAYS
\ No newline at end of file
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_RAYS
......@@ -114,7 +114,7 @@ std::vector<CRayGrid> EigenraySearch::CInitialWorker::Run(const ITAGeo::CStratif
FindMinimumDistanceRays(rayGrid.UniqueRays());
return FinalizeResult(rayGrid);
}
CRayGrid EigenraySearch::CInitialWorker::InitRayGrid(const ITAGeo::CStratifiedAtmosphere& atmosphere)
CRayGrid EigenraySearch::CInitialWorker::InitRayGrid(const ITAGeo::CStratifiedAtmosphere&)
{
return CEquiangularRayDistribution(m_v3SourcePosition, 7, 10);
//TODO: Set limits for additional directions according to atmosphere if possible
......@@ -159,8 +159,8 @@ EigenraySearch::CAdaptiveWorker::CAdaptiveWorker(const CRayGrid& rayGrid, const
m_adaptiveRayGrid(rayGrid), m_iActiveReflexionOrder(activeReflectionOrder), m_rayAdaptationSettings(eigenraySettings.rayAdaptation)
{
const float sourceReceiverDistance = (VirtualReceiverPosition() - rayGrid.SourcePosition()).GetLength();
m_fReceiverRadius = tan(m_rayAdaptationSettings.accuracy.maxSourceReceiverAngle * M_PI/180.0) * sourceReceiverDistance;
m_fReceiverRadius = fmin(m_rayAdaptationSettings.accuracy.maxReceiverRadius, m_fReceiverRadius);
m_fReceiverRadius = (float)tan(m_rayAdaptationSettings.accuracy.maxSourceReceiverAngle * M_PI/180.0) * sourceReceiverDistance;
m_fReceiverRadius = fmin( (float)m_rayAdaptationSettings.accuracy.maxReceiverRadius, m_fReceiverRadius );
ReceiverDataVector receiverData = { CReceiverData(VirtualReceiverPosition(), m_iActiveReflexionOrder) };
m_pSimulationWatcher = std::make_shared<CEigenraySearchWatcher>(receiverData, m_rayTracingAbortSettings.maxTime, m_rayTracingAbortSettings.bAbortOnReceiverDistIncrease);
......
......@@ -312,7 +312,7 @@ int CRayGrid::GetIndex(const std::shared_ptr<CRay> pRay) const
if (it == m_vpRays.cend())
return -1;
return std::distance(m_vpRays.cbegin(), it);
return (int)std::distance(m_vpRays.cbegin(), it);
}
int CRayGrid::IndexToThetaIndex(const int idx) const
{
......
......@@ -42,7 +42,7 @@ class CWorker
ITA_EXCEPT_INVALID_PARAMETER("Both points are already at same altitude.");
const double portion = -r1[Vista::Z] / dr[Vista::Z];
rReflection = r1 + dr * portion;
rReflection = r1 + dr * (float)portion;
dtReflection = dt * portion;
};
inline void ExtendRayByOnePeriod()
......
......@@ -70,7 +70,7 @@ void Simulation::CAdaptiveSolver::AdaptiveIntegrationStep(const VistaVector3D& r
double Simulation::CAdaptiveSolver::EstimateIntegrationError(const double& rz1, const double& rz2, const VistaVector3D& n2, const ITAGeo::CStratifiedAtmosphere& atmosphere) const
{
const VistaVector3D windVectorError = atmosphere.WindVector(rz2) - atmosphere.WindVector(rz1) - atmosphere.WindVectorGradient(rz1) * (rz2 - rz1);
const VistaVector3D windVectorError = atmosphere.WindVector(rz2) - atmosphere.WindVector(rz1) - atmosphere.WindVectorGradient(rz1) * (float)(rz2 - rz1);
const double error = windVectorError[Vista::X] * n2[Vista::X] + windVectorError[Vista::Y] * n2[Vista::Y]; //Same as .Dot since z-component is zero
return std::abs(error);
}
......
......@@ -75,7 +75,6 @@ bool RecursiveAngleCulling( const ITAPropagationPathSim::CombinedModel::CPropaga
{
if( RecursiveAngleCulling( pChild, pChild, fAccumulatedAngle, fAngleThreshold, v3Source, pDiffractionEdge ) )
vpChildren.push_back( pChild );
}
pShapeOut->vpChildren = vpChildren;
......@@ -506,7 +505,6 @@ bool ITAPropagationPathSim::CombinedModel::Diffraction::AccumulatedAngleCulling(
bValidPath = false;
break;
}
}
pLastShape = pCurrentShape;
......
......@@ -95,31 +95,26 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::SetEntities( shared_ptr<
UpdateTargetEntity( pTargetEntity );
UpdateOriginEntity( pOriginEntity );
if( m_pProgressHandler )
m_pProgressHandler->SetSection( "Creating propagation list" );
CreatePropagationLists();
UpdateOriginEntity( pOriginEntity ); // Creates propagation list!
}
void ITAPropagationPathSim::CombinedModel::CPathEngine::UpdateOriginEntity( shared_ptr< CPropagationAnchor > pOriginEntity )
{
if( !m_pTargetEntity )
ITA_EXCEPT1( MODAL_EXCEPTION, "Target entity has not been set yet, please do before updating origin" );
m_pOriginEntity = pOriginEntity;
PushStatus( "Creating propagation tree fom origin entity", 0.0f );
CreatePropagationTree( pOriginEntity );
CreatePropagationTree( m_pOriginEntity );
PushStatus( "Constructing specular images of origin entity", 0.0f );
ImageConstruction::ConstructImages( m_pOriginEntity->v3InteractionPoint, m_vpPropagationTree );
//Construct image edges
PushStatus( "Constructing edge images of origin entity", 0.0f );
PushStatus( "Constructing diffraction edge images of origin entity", 0.0f );
ImageConstruction::ConstructImageEdges( m_vpPropagationTree );
if( m_pProgressHandler )
m_pProgressHandler->SetSection( "Applying sensor algorithms" );
PushStatus( "Constructing propagation list", 0.0f );
CreatePropagationLists();
}
......
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