Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITAPropagationPathSim
Commits
c1238de1
Commit
c1238de1
authored
May 18, 2020
by
Dipl.-Ing. Jonas Stienen
Browse files
Improving combined model
parent
898f071b
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
include/ITAPropagationPathSim/CombinedModel/DiffractionLocator.h
View file @
c1238de1
#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
);
}
}
...
...
include/ITAPropagationPathSim/CombinedModel/PropagationEngine.h
View file @
c1238de1
...
...
@@ -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
f
MaxLevelReduction
;
float
f
DynamicRange
;
float
fReflectionPenalty
;
float
fDiffractionPenalty
;
float
fAccumulatedAngleThreshold
;
...
...
@@ -71,7 +71,7 @@ namespace ITAPropagationPathSim
iMaxDiffractionOrder
=
2
;
iMaxReflectionOrder
=
2
;
iMaxCombinedOrder
=
4
;
f
MaxLevelReduction
=
-
1.0
f
;
// disabled
f
DynamicRange
=
-
1.0
f
;
// disabled
fReflectionPenalty
=
-
10.0
f
*
log10
(
0.8
f
);
// for conservative sim, set to 0
fDiffractionPenalty
=
2.5
f
;
// for conservative sim, set to 0
fAccumulatedAngleThreshold
=
-
1.0
f
;
// 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
);
};
}
}
...
...
src/ITAPropagationPathSim/CombinedModel/DiffractionLocator.cpp
View file @
c1238de1
This diff is collapsed.
Click to expand it.
src/ITAPropagationPathSim/CombinedModel/PropagationEngine.cpp
View file @
c1238de1
...
...
@@ -38,21 +38,29 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::SetAbortionCriteria( con
m_oAbort
=
oAbort
;
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
SetProgressCallbackHandler
(
ITABase
::
IProgressHandler
*
pHandler
)
{
m_pProgressHandler
=
pHandler
;
}
float
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
GetMaxPropagationRange
()
const
{
if
(
GetMaxPropagationRangeValid
()
)
return
powf
(
10.
f
,
m_oAbort
.
f
MaxLevelReduction
/
20
);
return
powf
(
10.
f
,
m_oAbort
.
f
DynamicRange
/
20
);
else
return
0.0
f
;
}
bool
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
GetMaxPropagationRangeValid
()
const
{
return
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
;
return
m_oAbort
.
f
DynamicRange
>
0.0
f
;
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
InitializePathEnvironment
(
shared_ptr
<
const
ITAGeo
::
Halfedge
::
CMeshModelList
>
pMeshModelList
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetSection
(
"Initializing path environment"
);
m_pMeshModelList
=
pMeshModelList
;
//Calculate the face normals
...
...
@@ -62,28 +70,31 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::InitializePathEnvironmen
CITAMesh
*
pMesh
=
m_pMeshModelList
->
at
(
i
)
->
GetMesh
()
->
pMesh
;
pMesh
->
request_face_normals
();
pMesh
->
update_face_normals
();
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
"Calculating face normals"
,
i
/
float
(
m_pMeshModelList
->
GetNumMeshes
()
)
*
100.0
f
);
}
//Get all propagation shapes of the mesh model list
ConstructPropagationShapes
();
//Create a visibility map
CreateVisibilityMap
();
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
ApplyEmitter
(
shared_ptr
<
ITAGeo
::
CEmitter
>
pEmitter
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetSection
(
"Applying emitter algorithms"
);
//Set emitter
m_pEmitter
=
pEmitter
;
//Create propagation tree
CreatePropagationTree
();
//Construct image sources
PushStatus
(
"Constructing specluar images of emitter"
,
0.0
f
);
ImageConstruction
::
ConstructImageSources
(
m_pEmitter
,
m_vpPropagationTree
);
//Construct image edges
PushStatus
(
"Constructing edge images of emitter"
,
0.0
f
);
ImageConstruction
::
ConstructImageEdges
(
m_vpPropagationTree
);
//Following not working accurately
...
...
@@ -144,10 +155,11 @@ size_t ITAPropagationPathSim::CombinedModel::CPathEngine::GetNumberPropagationPa
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
ApplySensor
(
shared_ptr
<
ITAGeo
::
CSensor
>
pSensor
)
{
//Set sensor
m_pSensor
=
pSensor
;
//Create propagation lists with each one containing a possible propagation path candidate
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetSection
(
"Applying sensor algorithms"
);
CreatePropagationLists
();
}
...
...
@@ -159,7 +171,8 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationPath
std
::
cout
<<
m_vpPropagationCandidates
.
size
()
<<
" path candidates at start. Calculation time for counting: "
<<
timeToString
(
sw
.
stop
()
)
<<
endl
;
sw
.
start
();
//First, construct the aperture points
// First, construct the aperture points
Diffraction
::
ConstructAperturePoints
(
m_pEmitter
,
m_pSensor
,
(
int
)
m_oConfig
.
iNumberIterationApexCalculation
,
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
std
::
cout
<<
m_vpPropagationCandidates
.
size
()
<<
" path candidates after aperture points calculated. Calculation time: "
<<
timeToString
(
sw
.
stop
()
)
<<
endl
;
...
...
@@ -175,7 +188,7 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationPath
std
::
cout
<<
m_vpPropagationCandidates
.
size
()
<<
" path candidates after points of reflection calculated. Calculation time: "
<<
timeToString
(
sw
.
stop
()
)
<<
endl
;
//Calculate perceptional culling
if
(
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
>
0.0
f
)
{
sw
.
start
();
PerceptionalCulling
(
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
...
...
@@ -212,29 +225,39 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationPath
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
ConstructPropagationPaths
(
ITAGeo
::
CPropagationPathList
&
oPaths
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetSection
(
"Constructing propagation paths"
);
//First, c
onstruct
the
aperture points
Diffraction
::
ConstructAperturePoints
(
m_pEmitter
,
m_pSensor
,
(
int
)
m_oConfig
.
iNumberIterationApexCalculation
,
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
PushStatus
(
"C
onstruct
ing
aperture points
"
,
0.0
f
);
Diffraction
::
ConstructAperturePoints
(
m_pEmitter
,
m_pSensor
,
(
int
)
m_oConfig
.
iNumberIterationApexCalculation
,
m_vpPropagationCandidates
,
m_vpPropagationCandidates
,
m_pProgressHandler
);
//Thereafter, with the constructed aperture points, construct the image apertures as secondary image sources
//for the faces after each edge
// Thereafter, with the constructed aperture points, construct the image apertures as secondary image sources
// for the faces after each edge
PushStatus
(
"Constructing aperture points of images"
,
0.0
f
);
ImageConstruction
::
ConstructImageApertures
(
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
// Construct the intersection points of the reflections
PushStatus
(
"Constructing intersection points of reflections"
,
0.0
f
);
Reflection
::
ConstructPointsOfReflection
(
m_pSensor
,
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
// Calculate perceptional culling
if
(
m_oAbort
.
fMaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
fDynamicRange
>
0.0
f
)
{
PushStatus
(
"Perceptual culling: dynamic range"
,
0.0
f
);
PerceptionalCulling
(
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
// Calculate accumulated angle and filter lists
}
if
(
m_oAbort
.
fAccumulatedAngleThreshold
>
0
)
{
PushStatus
(
"Perceptual culling: accumulated angle"
,
0.0
f
);
Diffraction
::
AccumulatedAngleCulling
(
m_oAbort
.
fAccumulatedAngleThreshold
,
m_pEmitter
,
m_pSensor
,
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
}
if
(
m_oConfig
.
bFilterIntersectedPaths
)
{
PushStatus
(
"Filtering intersected paths"
,
0.0
f
);
FilterVisiblePaths
(
m_vpPropagationCandidates
,
m_vpPropagationCandidates
);
}
// Convert pPropagationShapes to pPropagationAnchors
ConvertShapeListsToPropagationPaths
(
oPaths
);
}
...
...
@@ -324,7 +347,7 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::PerceptionalCulling( con
fTotalLevelDrop
+=
10
*
log10f
(
fLength2
*
(
fLength1
+
fLength2
)
/
fLength1
);
//Compare total level drop with threshold
bIsPerceived
=
(
m_oAbort
.
f
MaxLevelReduction
-
fTotalLevelDrop
)
>
0.0
f
;
bIsPerceived
=
(
m_oAbort
.
f
DynamicRange
-
fTotalLevelDrop
)
>
0.0
f
;
//Add propagation path if it is in the audible range
if
(
bIsPerceived
)
...
...
@@ -354,35 +377,26 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::FilterVisiblePaths( cons
if
(
IsPathVisible
(
*
pShape
->
v3InteractionPoint
,
*
pShape
->
pChild
->
v3InteractionPoint
)
)
{
pShape
=
pShape
->
pChild
;
}
else
{
bIsVisible
=
false
;
break
;
//Break the while loop
}
}
//If the path is not already invalid, also check for intersections between sensor and last point
if
(
bIsVisible
)
{
if
(
IsPathVisible
(
m_pSensor
->
v3InteractionPoint
,
*
pShape
->
v3InteractionPoint
)
)
{
vpVisiblePathsOut
.
push_back
(
vpPropagationList
);
}
}
}
}
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
ConvertShapeListsToPropagationPaths
(
ITAGeo
::
CPropagationPathList
&
oPathsOut
)
{
oPathsOut
.
clear
();
//If the intersection filter member variable is set, only allow not intersected paths
if
(
(
!
m_oConfig
.
bFilterIntersectedPaths
)
||
IsPathVisible
(
m_pEmitter
->
v3InteractionPoint
,
m_pSensor
->
v3InteractionPoint
)
)
{
...
...
@@ -393,7 +407,6 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConvertShapeListsToPropa
oPathsOut
.
push_back
(
oDirectPath
);
}
for
(
auto
&
pShapeStart
:
m_vpPropagationCandidates
)
{
if
(
pShapeStart
==
nullptr
)
...
...
@@ -462,12 +475,24 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConvertShapeListsToPropa
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
PushStatus
(
std
::
string
s
,
float
f
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
s
,
f
);
}
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
CreatePropagationTree
()
{
//Set initial values for number of diffractions/reflections
// Set initial values for number of diffractions/reflections
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetItem
(
"Creating propagation tree"
);
int
i
=
0
;
for
(
const
auto
&
pPropagationShape
:
m_vpPropagationShapes
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
i
++
/
float
(
m_vpPropagationShapes
.
size
()
)
*
100.0
f
);
//Initialize the accumulated penalty [dB]
float
fAccumulatedPenalty
=
0.0
f
;
...
...
@@ -500,12 +525,12 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::CreatePropagationTree()
bool
bCanIlluminated
=
true
;
//Check for audibility if a max level drop threshold is given
if
(
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
>
0.0
f
)
{
//Calculate propagation level drop (without the reflection and diffraction penalty)
float
fLevelDrop
=
pFaceCopy
->
CalculateLevelDrop
(
fFirstDistance
,
fSecondDistance
,
fLevelDropAtFirstEdge
);
if
(
m_oAbort
.
f
MaxLevelReduction
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
bCanIlluminated
=
false
;
}
...
...
@@ -555,12 +580,12 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::CreatePropagationTree()
bool
bCanIlluminated
=
true
;
//Check for audibility if a max level drop threshold is given
if
(
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
>
0.0
f
)
{
//Calculate propagation level drop (without the reflection and diffraction penalty)
float
fLevelDrop
=
pEdgeCopy
->
CalculateLevelDrop
(
fFirstDistance
,
fSecondDistance
,
fLevelDropAtFirstEdge
);
if
(
m_oAbort
.
f
MaxLevelReduction
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
bCanIlluminated
=
false
;
}
...
...
@@ -596,8 +621,10 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::CreatePropagationTree()
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
CreatePropagationLists
()
{
int
i
=
0
;
for
(
auto
&
pPropagationShape
:
m_vpPropagationTree
)
{
PushStatus
(
"Filling propagation tree"
,
i
++
/
float
(
m_vpPropagationTree
.
size
()
)
*
100.0
f
);
RecursiveAddShapesToPropagationLists
(
pPropagationShape
);
}
}
...
...
@@ -625,12 +652,12 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::RecursiveAddChildrenToTr
bool
bCanIlluminated
=
true
;
//Check for audibility if a max level drop threshold is given
if
(
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
>
0.0
f
)
{
//Calculate propagation level drop (without the reflection and diffraction penalty)
float
fLevelDrop
=
pFaceChildCopy
->
CalculateLevelDrop
(
fFirstDistance
,
fSecondDistance
,
fLevelDropAtFirstEdge
);
if
(
m_oAbort
.
f
MaxLevelReduction
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
bCanIlluminated
=
false
;
}
...
...
@@ -670,12 +697,12 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::RecursiveAddChildrenToTr
bool
bCanIlluminated
=
true
;
// Check for audibility if a max level drop threshold is given
if
(
m_oAbort
.
f
MaxLevelReduction
>
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
>
0.0
f
)
{
// Calculate propagation level drop (without the reflection and diffraction penalty)
float
fLevelDrop
=
pEdgeChildCopy
->
CalculateLevelDrop
(
fFirstDistance
,
fSecondDistance
,
fLevelDropAtFirstEdge
);
if
(
m_oAbort
.
f
MaxLevelReduction
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
if
(
m_oAbort
.
f
DynamicRange
-
fLevelDrop
-
fAccumulatedPenalty
<
0.0
f
)
bCanIlluminated
=
false
;
}
...
...
@@ -816,15 +843,20 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::RecursiveAddShapesToProp
void
ITAPropagationPathSim
::
CombinedModel
::
CPathEngine
::
CreateVisibilityMap
()
{
//Create a visibility map
for
(
auto
&
pPropagationShapeFrom
:
m_vpPropagationShapes
)
{
if
(
m_pProgressHandler
)
m_pProgressHandler
->
SetItem
(
"Creating visibility map"
);
int
i
=
0
;
int
iNumSteps
=
std
::
pow
(
(
int
)
m_vpPropagationShapes
.
size
(),
2
);
for
(
auto
pPropagationShapeFrom
:
m_vpPropagationShapes
)
{
for
(
auto
pPropagationShapeTo
:
m_vpPropagationShapes
)
{
if
(
pPropagationShapeFrom
==
pPropagationShapeTo
)
continue
;
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
i
++
/
float
(
iNumSteps
)
*
100.0
f
);
bool
bCanIlluminate
=
false
;
...
...
@@ -843,8 +875,8 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::CreateVisibilityMap()
//Set minimum distance and test by means of the maximum propagation range for spherical propagation
if
(
GetMaxPropagationRangeValid
()
)
{
auto
pPropagationFaceToCopy
=
make_shared
<
CPropagationFace
>
();
pPropagationFaceToCopy
->
CopyFrom
(
*
pPropagationFaceTo
);
auto
pPropagationFaceToCopy
=
make_shared
<
CPropagationFace
>
();
// jst: why more copies here?
pPropagationFaceToCopy
->
CopyFrom
(
*
pPropagationFaceTo
);
// jst: why more copies here?
pPropagationFaceToCopy
->
SetMinimumDistance
(
*
pPropagationShapeFrom
);
if
(
pPropagationFaceToCopy
->
fMinimumDistance
>
GetMaxPropagationRange
()
)
...
...
@@ -1183,10 +1215,14 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationShap
//Iterate over all faces of current mesh
CITAMesh
::
ConstFaceIter
cf_it
=
pMesh
->
faces_begin
();
int
i
=
0
;
while
(
cf_it
!=
pMesh
->
faces_end
()
)
{
CITAMesh
::
FaceHandle
hFace
(
*
cf_it
++
);
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
"Constructing face propagation items"
,
i
++
/
float
(
pMesh
->
n_faces
()
)
*
100.0
f
);
CPropagationFaceShared
pPropagationFace
=
make_shared
<
CPropagationFace
>
();
pPropagationFace
->
iShapeType
=
CPropagationShape
::
FACE
;
...
...
@@ -1218,10 +1254,14 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationShap
//Iterate over all edges of current mesh
CITAMesh
::
ConstEdgeIter
cf_et
=
pMesh
->
edges_begin
();
int
j
=
0
;
while
(
cf_et
!=
pMesh
->
edges_end
()
)
{
CITAMesh
::
EdgeHandle
hEdge
(
*
cf_et
++
);
if
(
m_pProgressHandler
)
m_pProgressHandler
->
PushProgressUpdate
(
"Constructing edge propagation items"
,
j
++
/
float
(
pMesh
->
n_edges
()
)
*
100.0
f
);
//Halfedge representation of edge
auto
hHalfedge
=
pMesh
->
halfedge_handle
(
hEdge
,
0
);
...
...
@@ -1274,5 +1314,4 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConstructPropagationShap
m_vpPropagationShapes
.
push_back
(
pPropagationEdge
);
}
}
}
src/ITAPropagationPathSim/CombinedModel/PropagationShapes.cpp
View file @
c1238de1
...
...
@@ -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.0
f
);
return
true
;
}
...
...
tests/CombinedModel/CombinedModelTest.cpp
View file @
c1238de1
...
...
@@ -158,7 +158,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
CombinedModel
::
CPathEngine
::
CAbortionCriteria
oAbort
;
oAbort
.
fDiffractionPenalty
=
fDiffractionPenalty
;
oAbort
.
fAccumulatedAngleThreshold
=
fMaxAccumulatedDiffractionAngle
;
oAbort
.
f
MaxLevelReduction
=
fLevelDropThreshhold
;
oAbort
.
f
DynamicRange
=
fLevelDropThreshhold
;
oAbort
.
fReflectionPenalty
=
fReflectionPenalty
;
oAbort
.
iMaxCombinedOrder
=
iMaxCombinedOrder
;
oAbort
.
iMaxDiffractionOrder
=
iMaxDiffractionOrder
;
...
...
tests/CombinedModel/GRAS_scene5.cpp
View file @
c1238de1
...
...
@@ -152,7 +152,7 @@ int main( int, char** )
CombinedModel
::
CPathEngine
::
CAbortionCriteria
oAbort
;
oAbort
.
fDiffractionPenalty
=
fDiffractionPenalty
;
oAbort
.
fAccumulatedAngleThreshold
=
fMaxAccumulatedDiffractionAngle
;
oAbort
.
f
MaxLevelReduction
=
fLevelDropThreshhold
;
oAbort
.
f
DynamicRange
=
fLevelDropThreshhold
;
oAbort
.
fReflectionPenalty
=
fReflectionPenalty
;
oAbort
.
iMaxCombinedOrder
=
iMaxCombinedOrder
;
oAbort
.
iMaxDiffractionOrder
=
iMaxDiffractionOrder
;
...
...
tests/CombinedModel/GRAS_scene6.cpp
View file @
c1238de1
...
...
@@ -142,7 +142,7 @@ int main( int, char** )
CombinedModel
::
CPathEngine
::
CAbortionCriteria
oAbort
;
oAbort
.
fDiffractionPenalty
=
fDiffractionPenalty
;
oAbort
.
fAccumulatedAngleThreshold
=
fMaxAccumulatedDiffractionAngle
;
oAbort
.
f
MaxLevelReduction
=
fLevelDropThreshhold
;
oAbort
.
f
DynamicRange
=
fLevelDropThreshhold
;
oAbort
.
fReflectionPenalty
=
fReflectionPenalty
;
oAbort
.
iMaxCombinedOrder
=
iMaxCombinedOrder
;
oAbort
.
iMaxDiffractionOrder
=
iMaxDiffractionOrder
;
...
...
tests/CombinedModel/stienen2019auralization_INTERNOISE.cpp
View file @
c1238de1
...
...
@@ -122,7 +122,7 @@ int main( int, char** )
CombinedModel
::
CPathEngine
::
CAbortionCriteria
oAbort
;
oAbort
.
fDiffractionPenalty
=
fDiffractionPenalty
;
oAbort
.
fAccumulatedAngleThreshold
=
fMaxAccumulatedDiffractionAngle
;
oAbort
.
f
MaxLevelReduction
=
fLevelDropThreshhold
;
oAbort
.
f
DynamicRange
=
fLevelDropThreshhold
;
oAbort
.
fReflectionPenalty
=
fReflectionPenalty
;
oAbort
.
iMaxCombinedOrder
=
iMaxCombinedOrder
;
oAbort
.
iMaxDiffractionOrder
=
iMaxDiffractionOrder
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment