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
9627dbc3
Commit
9627dbc3
authored
Jan 09, 2019
by
Armin Erraji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced map of meshmodels with MeshModelList.
parent
058d115e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
30 deletions
+14
-30
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
+2
-5
src/ITAPropagationPathSim/BaseEngine/BaseDiffraction.cpp
src/ITAPropagationPathSim/BaseEngine/BaseDiffraction.cpp
+12
-25
No files found.
include/ITAPropagationPathSim/BaseEngine/BaseDiffraction.h
View file @
9627dbc3
...
...
@@ -160,15 +160,12 @@ namespace ITAPropagationPathSim
//! Pointer to destination anchor
shared_ptr
<
ITAGeo
::
CPropagationAnchor
>
m_pDestinationAnchor
;
//
m
esh model list
ITAGeo
::
Halfedge
::
CMeshModelList
m_pMeshModelList
;
//
M
esh model list
ITAGeo
::
Halfedge
::
CMeshModelList
m_
v
pMeshModelList
;
//! Map of illuminated edges
DiffractionEdgesMap
m_mvhIlluminatedEdges
;
//Vector of meshes
map
<
string
,
ITAGeo
::
Halfedge
::
CMeshModelShared
>
m_mpMeshModels
;
//Relations map between two edge directions
map
<
MeshListEdgeHandle
,
map
<
MeshListEdgeHandle
,
double
>>
m_mdEdgeDirMultiplicationMap
;
...
...
src/ITAPropagationPathSim/BaseEngine/BaseDiffraction.cpp
View file @
9627dbc3
...
...
@@ -16,33 +16,21 @@ CDiffractionPath::CDiffractionPath(ITAGeo::Halfedge::CMeshModelList pMeshModelLi
m_iMaxDiffractionOrder
=
iDiffractionOrder
;
//Set mesh model list member variable //TODO: ersetzen durch kopie und Eingangsparameter auf const setzen
m_pMeshModelList
=
pMeshModelList
;
m_
v
pMeshModelList
=
pMeshModelList
;
//Copy to mesh model map
vector
<
Halfedge
::
CMeshModelShared
>
pMeshModels
;
for
(
int
i
=
0
;
i
<
pMeshModelList
.
GetNumMeshes
();
i
++
)
{
auto
pCurrentMeshModel
=
pMeshModelList
[
i
];
string
sMeshName
=
pMeshModelList
[
i
]
->
GetName
();
Halfedge
::
CMeshModelShared
pCurrentMeshCopy
=
make_shared
<
Halfedge
::
CMeshModel
>
();
pCurrentMeshCopy
->
CopyFrom
(
*
pCurrentMeshModel
);
// Calculate mesh normals
CITAMesh
*
pMesh
=
pCurrentMeshCopy
->
GetMesh
()
->
pMesh
;
CITAMesh
*
pMesh
=
m_vpMeshModelList
[
i
]
->
GetMesh
()
->
pMesh
;
pMesh
->
request_face_normals
();
pMesh
->
update_face_normals
();
pMesh
->
request_halfedge_normals
();
pMesh
->
request_vertex_normals
();
//Add current mesh model to member variable
m_mpMeshModels
[
sMeshName
]
=
pCurrentMeshCopy
;
pMeshModels
.
push_back
(
pCurrentMeshCopy
);
}
//Add mesh tree for faster filtering of illuminable mesh meshes //TODO aer: baumstruktur fr schnellere erstellung von Bumen
//m_pBuildingsTree = make_shared<ITAGeo::Urban::RTree::CBuildings>();
//m_pBuildingsTree->Create(pBuildings);
//Construct diffraction matrix
ConstructDiffractionMatrix
();
...
...
@@ -251,7 +239,7 @@ bool CDiffractionPath::CalculateDiffractionPath(vector<shared_ptr<DiffractionEdg
void
CDiffractionPath
::
RecursiveGetIlluminableDiffractionEdges
(
vector
<
shared_ptr
<
DiffractionEdge
>>&
vpOutIllumEdges
,
const
VistaVector3D
&
v3InOrigin
,
shared_ptr
<
DiffractionEdge
>
pInParentEdge
)
{
//Add current edge to output vector if current edge and origin point can see each other
auto
pEdgeMesh
=
m_
mpMeshModels
[
pInParentEdge
->
sMeshModelName
]
->
GetMesh
()
->
pMesh
;
auto
pEdgeMesh
=
m_
vpMeshModelList
.
GetMeshModel
(
pInParentEdge
->
sMeshModelName
)
->
GetMesh
()
->
pMesh
;
if
(
IsEdgeIlluminated
(
*
pEdgeMesh
,
pInParentEdge
->
hEdge
,
v3InOrigin
))
vpOutIllumEdges
.
push_back
(
pInParentEdge
);
...
...
@@ -271,10 +259,9 @@ void CDiffractionPath::ConstructDiffractionMatrix()
//get all diffraction edges
vector
<
shared_ptr
<
DiffractionEdge
>>
vpDiffractionEdges
;
for
(
auto
&
keyMeshModel
:
m_mpMeshModels
)
for
(
auto
&
pMeshModel
:
m_vpMeshModelList
)
{
auto
pCurrentMeshModel
=
keyMeshModel
.
second
;
CITAMesh
*
pCurrentMesh
=
pCurrentMeshModel
->
GetMesh
()
->
pMesh
;
CITAMesh
*
pCurrentMesh
=
pMeshModel
->
GetMesh
()
->
pMesh
;
CITAMesh
::
ConstEdgeRange
hCurrentMeshEdges
=
pCurrentMesh
->
edges
();
...
...
@@ -299,7 +286,7 @@ void CDiffractionPath::ConstructDiffractionMatrix()
//Set diffraction edge
auto
pDiffractionEdge
=
make_shared
<
DiffractionEdge
>
();
pDiffractionEdge
->
sMeshModelName
=
p
Current
MeshModel
->
GetName
();
pDiffractionEdge
->
sMeshModelName
=
pMeshModel
->
GetName
();
pDiffractionEdge
->
hEdge
=
hCurrentEdge
;
pDiffractionEdge
->
v3StartPoint
=
v3FromPoint
;
pDiffractionEdge
->
v3EndPoint
=
v3ToPoint
;
...
...
@@ -373,7 +360,7 @@ void CDiffractionPath::ConstructDiffractionTree(const CPropagationAnchor* pOrigi
void
CDiffractionPath
::
RecursiveAddIlluminatedEdges
(
shared_ptr
<
DiffractionEdge
>&
pParentDiffractionEdge
)
{
CITAMesh
*
pParentMesh
=
m_
mpMeshModels
[
pParentDiffractionEdge
->
sMeshModelName
]
->
GetMesh
()
->
pMesh
;
CITAMesh
*
pParentMesh
=
m_
vpMeshModelList
.
GetMeshModel
(
pParentDiffractionEdge
->
sMeshModelName
)
->
GetMesh
()
->
pMesh
;
CITAMesh
::
HalfedgeHandle
hParentHalfedge
=
pParentMesh
->
halfedge_handle
(
pParentDiffractionEdge
->
hEdge
,
0
);
//Halfedge is needed for vertex points
string
sParentMeshModelName
=
pParentDiffractionEdge
->
sMeshModelName
;
...
...
@@ -415,7 +402,7 @@ void CDiffractionPath::SetStartDiffractionEdges()
{
auto
sCurrentMeshModelName
=
kDiffractionEdge
.
first
.
first
;
auto
hCurrentEdge
=
kDiffractionEdge
.
first
.
second
;
auto
pCurrentMesh
=
m_
mpMeshModels
[
sCurrentMeshModelName
]
->
GetMesh
()
->
pMesh
;
auto
pCurrentMesh
=
m_
vpMeshModelList
.
GetMeshModel
(
sCurrentMeshModelName
)
->
GetMesh
()
->
pMesh
;
//Face handles of current edge handle
auto
hFace0
=
pCurrentMesh
->
face_handle
(
pCurrentMesh
->
halfedge_handle
(
hCurrentEdge
,
0
));
...
...
@@ -497,8 +484,8 @@ bool CDiffractionPath::CanEdgeIlluminateInDirection(const CITAMesh& oMesh, const
bool
CDiffractionPath
::
IsDiffractionEdgeIlluminated
(
const
DiffractionEdge
&
oStartEdge
,
const
DiffractionEdge
&
oEndEdge
)
{
//Start edge mesh and end edge mesh
auto
pStartEdgeMesh
=
m_
mpMeshModels
[
oStartEdge
.
sMeshModelName
]
->
GetMesh
()
->
pMesh
;
auto
pEndEdgeMesh
=
m_
mpMeshModels
[
oEndEdge
.
sMeshModelName
]
->
GetMesh
()
->
pMesh
;
auto
pStartEdgeMesh
=
m_
vpMeshModelList
.
GetMeshModel
(
oStartEdge
.
sMeshModelName
)
->
GetMesh
()
->
pMesh
;
auto
pEndEdgeMesh
=
m_
vpMeshModelList
.
GetMeshModel
(
oEndEdge
.
sMeshModelName
)
->
GetMesh
()
->
pMesh
;
//Corresponding Halfedges
auto
pStartHalfedge
=
pStartEdgeMesh
->
halfedge_handle
(
oStartEdge
.
hEdge
,
0
);
...
...
@@ -566,10 +553,10 @@ bool CDiffractionPath::IsEdgeIlluminated(const CITAMesh& oEdgeMesh, const CITAMe
//Test if any face is between the edge vertex point and the emitter
bool
isEdgeIlluminated
=
true
;
for
(
auto
&
keyMeshModel
:
m_mpMeshModels
)
for
(
auto
&
pMeshModel
:
m_vpMeshModelList
)
{
//Current Mesh of current and its face handles
CITAMesh
*
pCurrentMesh
=
keyMeshModel
.
second
->
GetMesh
()
->
pMesh
;
CITAMesh
*
pCurrentMesh
=
pMeshModel
->
GetMesh
()
->
pMesh
;
CITAMesh
::
ConstFaceRange
hFaces
=
pCurrentMesh
->
faces
();
for
(
CITAMesh
::
FaceHandle
const
&
hFace
:
hFaces
)
...
...
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