Skip to content
GitLab
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
5dc24f4a
Commit
5dc24f4a
authored
May 28, 2020
by
Philipp Schäfer
Browse files
ART - RayToPropagationPath
- moved function definitions to cpp file
parent
616b87fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/ITAPropagationPathSim/AtmosphericRayTracing/Utils/RayToPropagationPath.h
View file @
5dc24f4a
...
...
@@ -21,9 +21,6 @@
#include
<ITAPropagationPathSim/Definitions.h>
// Vista includes
#include
<VistaBase/VistaVector3D.h>
// ITA includes
#include
<ITAPropagationPathSim/AtmosphericRayTracing/Rays.h>
#include
<ITAGeo/Base.h>
...
...
@@ -38,56 +35,9 @@ namespace ITAPropagationPathSim
{
namespace
Utils
{
ITA_PROPAGATION_PATH_SIM_API
inline
ITAGeo
::
CPropagationPath
ToPropagationPath
(
const
CRay
&
ray
)
{
ITAGeo
::
CPropagationPath
propagationPath
;
propagationPath
.
reserve
(
ray
.
size
());
VistaVector3D
position
,
wavefrontNormal
;
propagationPath
.
push_back
(
std
::
make_shared
<
ITAGeo
::
CEmitterInhomogeneous
>
(
ray
.
SourcePoint
(),
ray
.
InitialDirection
()));
for
(
int
idx
=
1
;
idx
<
ray
.
size
();
idx
++
)
{
position
=
ray
[
idx
].
position
;
wavefrontNormal
=
ray
[
idx
].
wavefrontNormal
;
if
(
position
[
Vista
::
Z
]
<
0
)
{
position
[
Vista
::
Z
]
=
-
position
[
Vista
::
Z
];
wavefrontNormal
[
Vista
::
Z
]
=
-
wavefrontNormal
[
Vista
::
Z
];
}
if
(
idx
==
ray
.
size
()
-
1
)
{
auto
pReceiver
=
std
::
make_shared
<
ITAGeo
::
CSensorInhomogeneous
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
);
pReceiver
->
dSpreadingLoss
=
ray
.
SpreadingLoss
();
propagationPath
.
push_back
(
pReceiver
);
}
else
if
(
ray
.
IsReflectionIdx
(
idx
))
{
auto
anchor
=
std
::
make_shared
<
ITAGeo
::
CSpecularReflectionInhomogeneous
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
);
anchor
->
v3FaceNormal
=
VistaVector3D
(
0
,
0
,
1
);
propagationPath
.
push_back
(
anchor
);
}
else
propagationPath
.
push_back
(
std
::
make_shared
<
ITAGeo
::
CInhomogeneity
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
));
}
return
propagationPath
;
};
ITA_PROPAGATION_PATH_SIM_API
inline
ITAGeo
::
CPropagationPathList
ToPropagationPath
(
const
std
::
vector
<
std
::
shared_ptr
<
CRay
>>&
vpRays
)
{
ITAGeo
::
CPropagationPathList
propagationPathList
;
propagationPathList
.
reserve
(
vpRays
.
size
());
for
each
(
std
::
shared_ptr
<
CRay
>
pRay
in
vpRays
)
{
if
(
!
pRay
)
continue
;
propagationPathList
.
push_back
(
ToPropagationPath
(
*
pRay
));
}
ITA_PROPAGATION_PATH_SIM_API
ITAGeo
::
CPropagationPath
ToPropagationPath
(
const
CRay
&
ray
);
return
propagationPathList
;
};
ITA_PROPAGATION_PATH_SIM_API
ITAGeo
::
CPropagationPathList
ToPropagationPath
(
const
std
::
vector
<
std
::
shared_ptr
<
CRay
>>&
vpRays
);
}
}
}
...
...
src/ITAPropagationPathSim/AtmosphericRayTracing/Utils/RayToPropagationPath.cpp
0 → 100644
View file @
5dc24f4a
#include
<ITAPropagationPathSim/AtmosphericRayTracing/Utils/RayToPropagationPath.h>
// Vista includes
#include
<VistaBase/VistaVector3D.h>
using
namespace
ITAPropagationPathSim
::
AtmosphericRayTracing
;
ITAGeo
::
CPropagationPath
Utils
::
ToPropagationPath
(
const
CRay
&
ray
)
{
ITAGeo
::
CPropagationPath
propagationPath
;
propagationPath
.
reserve
(
ray
.
size
());
VistaVector3D
position
,
wavefrontNormal
;
propagationPath
.
push_back
(
std
::
make_shared
<
ITAGeo
::
CEmitterInhomogeneous
>
(
ray
.
SourcePoint
(),
ray
.
InitialDirection
()));
for
(
int
idx
=
1
;
idx
<
ray
.
size
();
idx
++
)
{
position
=
ray
[
idx
].
position
;
wavefrontNormal
=
ray
[
idx
].
wavefrontNormal
;
if
(
position
[
Vista
::
Z
]
<
0
)
{
position
[
Vista
::
Z
]
=
-
position
[
Vista
::
Z
];
wavefrontNormal
[
Vista
::
Z
]
=
-
wavefrontNormal
[
Vista
::
Z
];
}
if
(
idx
==
ray
.
size
()
-
1
)
{
auto
pReceiver
=
std
::
make_shared
<
ITAGeo
::
CSensorInhomogeneous
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
);
pReceiver
->
dSpreadingLoss
=
ray
.
SpreadingLoss
();
propagationPath
.
push_back
(
pReceiver
);
}
else
if
(
ray
.
IsReflectionIdx
(
idx
))
{
auto
anchor
=
std
::
make_shared
<
ITAGeo
::
CSpecularReflectionInhomogeneous
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
);
anchor
->
v3FaceNormal
=
VistaVector3D
(
0
,
0
,
1
);
propagationPath
.
push_back
(
anchor
);
}
else
propagationPath
.
push_back
(
std
::
make_shared
<
ITAGeo
::
CInhomogeneity
>
(
position
,
wavefrontNormal
,
ray
[
idx
].
timeStamp
));
}
return
propagationPath
;
}
ITAGeo
::
CPropagationPathList
Utils
::
ToPropagationPath
(
const
std
::
vector
<
std
::
shared_ptr
<
CRay
>>&
vpRays
)
{
ITAGeo
::
CPropagationPathList
propagationPathList
;
propagationPathList
.
reserve
(
vpRays
.
size
());
for
each
(
std
::
shared_ptr
<
CRay
>
pRay
in
vpRays
)
{
if
(
!
pRay
)
continue
;
propagationPathList
.
push_back
(
ToPropagationPath
(
*
pRay
));
}
return
propagationPathList
;
}
src/ITAPropagationPathSim/AtmosphericRayTracing/Utils/_SourceFiles.cmake
0 → 100644
View file @
5dc24f4a
# $Id:$
set
(
RelativeDir
"src/ITAPropagationPathSim/AtmosphericRayTracing/Utils"
)
set
(
RelativeSourceGroup
"Source Files
\\
ITAPropagationPathSim
\\
AtmosphericRayTracing
\\
Utils"
)
set
(
DirFiles
RayToPropagationPath.cpp
)
set
(
DirFiles_SourceGroup
"
${
RelativeSourceGroup
}
"
)
set
(
LocalSourceGroupFiles
)
foreach
(
File
${
DirFiles
}
)
list
(
APPEND LocalSourceGroupFiles
"
${
RelativeDir
}
/
${
File
}
"
)
list
(
APPEND ProjectSources
"
${
RelativeDir
}
/
${
File
}
"
)
endforeach
()
source_group
(
${
DirFiles_SourceGroup
}
FILES
${
LocalSourceGroupFiles
}
)
src/ITAPropagationPathSim/AtmosphericRayTracing/_SourceFiles.cmake
View file @
5dc24f4a
...
...
@@ -3,7 +3,7 @@
set
(
RelativeDir
"src/ITAPropagationPathSim/AtmosphericRayTracing"
)
set
(
RelativeSourceGroup
"Source Files
\\
ITAPropagationPathSim
\\
AtmosphericRayTracing"
)
set
(
SubDirs ODESolver Simulation EigenraySearch
)
set
(
SubDirs ODESolver Simulation EigenraySearch
Utils
)
set
(
DirFiles
Rays.cpp
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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