Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAPropagationPathSim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Institute of Technical Acoustics (ITA)
ITAPropagationPathSim
Commits
43c1093b
Commit
43c1093b
authored
Jan 09, 2019
by
Armin Erraji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small changes is BaseImageSource.cpp and its test.
parent
508b4120
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
24 deletions
+27
-24
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
+1
-1
include/ITAPropagationPathSim/BaseEngine/BaseImageSource.h
include/ITAPropagationPathSim/BaseEngine/BaseImageSource.h
+2
-2
src/ITAPropagationPathSim/BaseEngine/BaseImageSource.cpp
src/ITAPropagationPathSim/BaseEngine/BaseImageSource.cpp
+8
-8
tests/ImageModel/SimpleImageModelTest.cpp
tests/ImageModel/SimpleImageModelTest.cpp
+1
-1
tests/MeshModelList/Diffraction/CMakeLists.txt
tests/MeshModelList/Diffraction/CMakeLists.txt
+1
-1
tests/MeshModelList/Reflection/CMakeLists.txt
tests/MeshModelList/Reflection/CMakeLists.txt
+1
-1
tests/MeshModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
...shModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
+13
-10
No files found.
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
View file @
43c1093b
...
...
@@ -21,7 +21,7 @@
// ITA includes
#include <ITAGeo/Base.h>
#include <ITAGeo/Halfedge/MeshModel.h>
#include <ITAGeo/U
rban/RTree
.h>
#include <ITAGeo/U
tils
.h>
using
namespace
std
;
...
...
include/ITAPropagationPathSim/BaseEngine/BaseImageSource.h
View file @
43c1093b
...
...
@@ -46,7 +46,7 @@ namespace ITAPropagationPathSim
* @param[in] iSourceImageOrder Defaults to 2 (first order images of sending entity / source)
*
*/
CSource
(
const
ITAGeo
::
Halfedge
::
CMeshModelList
&
vpMeshModelList
,
int
iSourceImageOrder
=
ITAGeo
::
ORDER_2
);
CSource
(
shared_ptr
<
const
ITAGeo
::
Halfedge
::
CMeshModelList
>
vpMeshModelList
,
int
iSourceImageOrder
=
ITAGeo
::
ORDER_2
);
//! Destructor
virtual
~
CSource
();
...
...
@@ -106,7 +106,7 @@ namespace ITAPropagationPathSim
//---Member variables-------------------------------------------------------------------------------------------------
//Vector of mesh models
ITAGeo
::
Halfedge
::
CMeshModelList
m_vpMeshModelList
;
shared_ptr
<
const
ITAGeo
::
Halfedge
::
CMeshModelList
>
m_vpMeshModelList
;
//! Root of image sources as image source of order 0 (commonly the emitter)
CImageNode
*
m_pImagesRoot
;
...
...
src/ITAPropagationPathSim/BaseEngine/BaseImageSource.cpp
View file @
43c1093b
...
...
@@ -15,22 +15,22 @@ struct CITAMeshPtr
//---Constructor----------------------------------------------------------------------------------------------------------------------------
CSource
::
CSource
(
const
ITAGeo
::
Halfedge
::
CMeshModelList
&
vpMeshModelList
,
const
int
iSourceImageOrder
)
CSource
::
CSource
(
shared_ptr
<
const
ITAGeo
::
Halfedge
::
CMeshModelList
>
vpMeshModelList
,
const
int
iSourceImageOrder
)
{
m_vpMeshModelList
.
CopyFrom
(
vpMeshModelList
)
;
m_vpMeshModelList
=
vpMeshModelList
;
//Copy to mesh model vector
for
(
int
i
=
0
;
i
<
vpMeshModelList
.
GetNumMeshes
();
i
++
)
for
(
int
i
=
0
;
i
<
vpMeshModelList
->
GetNumMeshes
();
i
++
)
{
// Calculate mesh face normals
CITAMesh
*
pMesh
=
m_vpMeshModelList
[
i
]
->
GetMesh
()
->
pMesh
;
CITAMesh
*
pMesh
=
m_vpMeshModelList
->
at
(
i
)
->
GetMesh
()
->
pMesh
;
pMesh
->
request_face_normals
();
pMesh
->
update_face_normals
();
}
//Initialize image root
m_pImagesRoot
=
new
CImageNode
(
ITAGeo
::
ORDER_0
,
iSourceImageOrder
,
vpMeshModelList
);
m_pImagesRoot
=
new
CImageNode
(
ITAGeo
::
ORDER_0
,
iSourceImageOrder
,
*
vpMeshModelList
);
//Set max order member variable
m_iMaxOrder
=
iSourceImageOrder
;
...
...
@@ -65,7 +65,7 @@ void CSource::ConstructImagesRecursive(CImageNode* pParent, const int iMaxOrder,
return
;
//Iterate over all mesh models
for
(
auto
&
pMeshModel
:
m_vpMeshModelList
)
for
(
auto
&
pMeshModel
:
*
m_vpMeshModelList
)
{
CITAMesh
*
pCurrentMesh
=
pMeshModel
->
GetMesh
()
->
pMesh
;
...
...
@@ -136,7 +136,7 @@ void CSource::ConstructReflectionPathList(CImageNode * pRoot, std::shared_ptr<IT
auto
iCurrentOrder
=
pRoot
->
pImage
->
iOrder
;
if
((
iOrder
!=
iCurrentOrder
)
&&
(
iCurrentOrder
<
iMaxOrder
))
{
for
each
(
auto
&
pMeshModel
in
m_vpMeshModelList
)
for
each
(
auto
&
pMeshModel
in
*
m_vpMeshModelList
)
{
for
each
(
auto
pChild
in
pRoot
->
mpImageChildren
[
pMeshModel
->
GetName
()])
{
...
...
@@ -156,7 +156,7 @@ void CSource::ConstructReflectionsPath(CImageNode* pNode, std::shared_ptr< const
return
;
//Get current mesh and the corresponding face handle
auto
pCurrentMesh
=
m_vpMeshModelList
.
GetMeshModel
(
pNode
->
m_sMeshModelName
)
->
GetMesh
()
->
pMesh
;
auto
pCurrentMesh
=
m_vpMeshModelList
->
GetMeshModel
(
pNode
->
m_sMeshModelName
)
->
GetMesh
()
->
pMesh
;
auto
hFace
=
pCurrentMesh
->
face_handle
(
iFaceIndex
);
VistaVector3D
v3CurrentOrigin
=
pStartAnchor
->
v3InteractionPoint
;
...
...
tests/ImageModel/SimpleImageModelTest.cpp
View file @
43c1093b
...
...
@@ -39,7 +39,7 @@ int main( int iNumInArgs, char* pcInArgs[] )
string
sSubFolder
=
"SketchUpFiles/"
;
//string sInFile = "NonSimpleRoom - Outside.skp";
string
sInFile
=
"Simple
UrbanEnvironmentNotGrouped
.skp"
;
string
sInFile
=
"Simple
Room
.skp"
;
if
(
iNumInArgs
>
1
)
sInFile
=
string
(
pcInArgs
[
1
]
);
...
...
tests/MeshModelList/Diffraction/CMakeLists.txt
View file @
43c1093b
...
...
@@ -22,4 +22,4 @@ vista_configure_app( SimpleMeshModelDiffractionTest )
vista_install
(
SimpleMeshModelDiffractionTest
)
vista_create_default_info_file
(
SimpleMeshModelDiffractionTest
)
set_property
(
TARGET SimpleMeshModelDiffractionTest PROPERTY FOLDER
"ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/MeshModelDiffraction"
)
set_property
(
TARGET SimpleMeshModelDiffractionTest PROPERTY FOLDER
"ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/MeshModel
/
Diffraction"
)
tests/MeshModelList/Reflection/CMakeLists.txt
View file @
43c1093b
...
...
@@ -22,4 +22,4 @@ vista_configure_app( SimpleMeshModelImageSourceTest )
vista_install
(
SimpleMeshModelImageSourceTest
)
vista_create_default_info_file
(
SimpleMeshModelImageSourceTest
)
set_property
(
TARGET SimpleMeshModelImageSourceTest PROPERTY FOLDER
"ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/MeshModel
Diffra
ction"
)
set_property
(
TARGET SimpleMeshModelImageSourceTest PROPERTY FOLDER
"ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/MeshModel
/Refle
ction"
)
tests/MeshModelList/Reflection/SimpleMeshModelImageSourceTest.cpp
View file @
43c1093b
...
...
@@ -41,22 +41,22 @@ using namespace ITAPropagationPathSim;
int
main
(
int
iNumInArgs
,
char
*
pcInArgs
[]
)
{
string
sSUFolder
=
"SketchUpFiles/"
;
string
sSUFolder
=
"
../../ImageModel/
SketchUpFiles/"
;
string
sJsonFolder
=
"JsonFiles/"
;
string
sInFile
=
"Simple
UrbanEnvironment
"
;
string
sInFile
=
"Simple
Room
"
;
if
(
iNumInArgs
>
1
)
sInFile
=
string
(
pcInArgs
[
1
]
);
CMaterialDirectory
oMaterialDir
(
"./"
);
SketchUp
::
CModel
oGeoModel
;
ITAGeo
::
Halfedge
::
CMeshModelList
vpMeshModelList
;
auto
vpMeshModelList
=
make_shared
<
ITAGeo
::
Halfedge
::
CMeshModelList
>
()
;
vpMeshModelList
.
SetMaterialManager
(
&
oMaterialDir
);
vpMeshModelList
->
SetMaterialManager
(
&
oMaterialDir
);
if
(
vpMeshModelList
.
Load
(
sSUFolder
+
sInFile
+
".skp"
))
if
(
vpMeshModelList
->
Load
(
sSUFolder
+
sInFile
+
".skp"
))
{
cout
<<
"Succesffully loaded '"
<<
sInFile
<<
"'"
<<
endl
;
}
...
...
@@ -74,19 +74,22 @@ int main( int iNumInArgs, char* pcInArgs[] )
//auto pSensor = make_shared<CSensor>( VistaVector3D( 3.0f, 3.3f, 1.3f ) );
auto
pSensor
=
make_shared
<
CSensor
>
(
VistaVector3D
(
-
3.0
f
,
-
3.3
f
,
2.3
f
));
pSensor
=
make_shared
<
CSensor
>
(
VistaVector3D
(
3.0
f
,
3.3
f
,
1.3
f
));
pEmitter
=
make_shared
<
CEmitter
>
(
VistaVector3D
(
2.1
f
,
2.2
f
,
1.7
f
));
cout
<<
"Emitter: "
<<
pEmitter
->
vPos
<<
endl
;
cout
<<
"Sensor: "
<<
pSensor
->
vPos
<<
endl
;
//Set the mirror image engine for the urban environment
ITAPropagationPathSim
::
BaseEngine
::
MirrorImage
::
CSource
oImageSourceEngine
(
vpMeshModelList
,
Order
::
ORDER_
2
);
ITAPropagationPathSim
::
BaseEngine
::
MirrorImage
::
CSource
oImageSourceEngine
(
vpMeshModelList
,
Order
::
ORDER_
3
);
oImageSourceEngine
.
ConstructImages
(
pEmitter
);
//Set the reflection sound paths
CPropagationPathList
oPathListAll
,
oPathListVisible
;
oImageSourceEngine
.
ConstructReflectionPaths
Out
side
(
pSensor
,
oPathListAll
);
oImageSourceEngine
.
ConstructReflectionPaths
In
side
(
pSensor
,
oPathListAll
);
//Get the visible sound paths
vpMeshModelList
.
FilterVisiblePaths
(
oPathListAll
,
oPathListVisible
);
vpMeshModelList
->
FilterVisiblePaths
(
oPathListAll
,
oPathListVisible
);
//Add paths to SketchUp Visualisation
...
...
@@ -107,9 +110,9 @@ int main( int iNumInArgs, char* pcInArgs[] )
oGeoModel
.
AddSensorVisualization
(
*
pSensor
,
"Sensor A"
);
//Store model
oGeoModel
.
Store
(
sSUFolder
+
"Simple
Urban
ImageModelTest_"
+
sInFile
+
".skp"
);
oGeoModel
.
Store
(
sSUFolder
+
"Simple
MeshModel
ImageModelTest_"
+
sInFile
+
".skp"
);
oPathListVisible
.
Store
(
sJsonFolder
+
"Simple
Urban
ImageModelTest_"
+
sInFile
+
".json"
);
oPathListVisible
.
Store
(
sJsonFolder
+
"Simple
MeshModel
ImageModelTest_"
+
sInFile
+
".json"
);
return
0
;
}
Write
Preview
Markdown
is supported
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