Skip to content
Snippets Groups Projects
Commit f62b3846 authored by Daniel Filbert's avatar Daniel Filbert
Browse files

wip

parent bdeb789f
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,8 @@ void CEngine::Run( std::shared_ptr< ITAGeo::CPropagationAnchor > pSource, std::s
CITAMesh* pMesh = m_oMeshModel.GetMesh()->pMesh;
VistaVector3D v3SourcePoint = pSource->v3InteractionPoint;
cout << "Number of Rays: " << GetNumberOfRays() << endl;
for (unsigned long int n = 0; n < GetNumberOfRays(); n++)
{
// Create and initialize ray with random direction
......@@ -94,14 +96,14 @@ void CEngine::Run( std::shared_ptr< ITAGeo::CPropagationAnchor > pSource, std::s
rRay.SetDir(v3RandomDirection);
// Initialize variables
float tAbsorbtionOfFace = 0.9f; //@todo: dynamic addaption of absorbtion according to material
float tEnergy;
float tAbsorbtionOfFace = 0.2f; //@todo: dynamic addaption of absorbtion according to material
float tEnergy = 1.0f;
float tAbsorbtionLossFactor = 1.0f;
float tPropagationLossFactor = 1.0f; // considering spherical waves (1-by-r law)
float tEnergyThreshold = powf(10, -6);
bool bDetectionSphereHitByRay = false;
bool bFaceIntersectedByRay = false;
bool bDetectionSphereHitByRay;
bool bFaceIntersectedByRay;
bool bEnergyBelowThreshold = false;
VistaVector3D v3DetectionPoint;
......@@ -112,8 +114,19 @@ void CEngine::Run( std::shared_ptr< ITAGeo::CPropagationAnchor > pSource, std::s
ITAGeo::CPropagationPath oPropagationPath;
oPropagationPath.push_back(pSource);
// console outputs
cout << endl << endl << "###################################" << endl;
cout << "Current Ray Number: " << n << endl;
while( !bEnergyBelowThreshold )
{
// Console outputs
cout << "current energy of the ray: " << tEnergy << endl;
// Initialize flags
bFaceIntersectedByRay = false;
bDetectionSphereHitByRay = false;
// Check ray propagation for each face of the mesh
auto it = pMesh->faces_begin();
while( it != pMesh->faces_end() && !bFaceIntersectedByRay )
......@@ -179,10 +192,6 @@ void CEngine::Run( std::shared_ptr< ITAGeo::CPropagationAnchor > pSource, std::s
// Update energy of ray
tEnergy = tAbsorbtionLossFactor * tPropagationLossFactor;
bEnergyBelowThreshold = tEnergy < tEnergyThreshold;
// Reset flags
bFaceIntersectedByRay = false;
bDetectionSphereHitByRay = false;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment