Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAGeo
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)
ITAGeo
Commits
f51cbf02
Commit
f51cbf02
authored
Jan 22, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://git.rwth-aachen.de/ita/ITAGeo
into develop
parents
7f320304
dd1f677e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
60 deletions
+60
-60
src/ITAGeo/Base.cpp
src/ITAGeo/Base.cpp
+60
-60
No files found.
src/ITAGeo/Base.cpp
View file @
f51cbf02
...
...
@@ -42,23 +42,23 @@ std::string ITAGeo::CPropagationAnchor::GetAnchorTypeStr( ITAGeo::CPropagationAn
switch
(
iType
)
{
case
INVALID
:
return
"
InvalidA
nchor"
;
return
"
invalid_a
nchor"
;
case
ACOUSTIC_EMITTER
:
return
"
S
ource"
;
return
"
s
ource"
;
case
ACOUSTIC_SENSOR
:
return
"
R
eceiver"
;
return
"
r
eceiver"
;
case
SPECULAR_REFLECTION
:
return
"
SpecularR
eflection"
;
return
"
specular_r
eflection"
;
case
ITA_DIFFUSE_REFLECTION
:
return
"
DiffuseR
eflection"
;
return
"
diffuse_r
eflection"
;
case
TRANSMISSION_APEX
:
return
"
T
ransmission"
;
return
"
t
ransmission"
;
case
DIFFRACTION_OUTER_APEX
:
return
"
OuterEdgeD
iffraction"
;
return
"
outer_edge_d
iffraction"
;
case
DIFFRACTION_INNER_APEX
:
return
"
InnerEdgeD
iffraction"
;
return
"
inner_edge_d
iffraction"
;
case
GENERIC_ANCHOR
:
return
"
GenericA
nchor"
;
return
"
generic_a
nchor"
;
default:
return
"Unkown"
;
}
...
...
@@ -79,7 +79,7 @@ ITAGeo::CPropagationAnchor::EAnchorType ITAGeo::CPropagationAnchor::ParseAnchorT
std
::
string
ITAGeo
::
CPropagationAnchor
::
GetTypeStr
()
{
return
"
PropagationA
nchor"
;
return
"
propagation_a
nchor"
;
}
void
ITAGeo
::
CPropagationAnchor
::
LoadFromJSONString
(
const
std
::
string
&
sContent
,
std
::
shared_ptr
<
CResourceManager
>
)
...
...
@@ -98,7 +98,7 @@ void ITAGeo::CPropagationAnchor::LoadFromJSONString(const std::string& sContent,
//Get the interaction point of the propagation anchor
auto
jnPosition
=
jnRoot
.
at
(
"interaction
point"
).
as_array
();
auto
jnPosition
=
jnRoot
.
at
(
"interaction
_
point"
).
as_array
();
double
dX
=
jnPosition
.
at
(
0
).
as_float
();
double
dY
=
jnPosition
.
at
(
1
).
as_float
();
double
dZ
=
jnPosition
.
at
(
2
).
as_float
();
...
...
@@ -108,7 +108,7 @@ void ITAGeo::CPropagationAnchor::LoadFromJSONString(const std::string& sContent,
v3InteractionPoint
.
SetValues
(
dX
,
dY
,
dZ
,
dW
);
//Get and set the anchor type
iAnchorType
=
ParseAnchorType
(
jnRoot
.
at
(
"anchor
type"
).
as_string
());
iAnchorType
=
ParseAnchorType
(
jnRoot
.
at
(
"anchor
_
type"
).
as_string
());
#endif
}
...
...
@@ -130,19 +130,19 @@ std::stringstream ITAGeo::CPropagationAnchor::ToJSON(std::shared_ptr< const ITAG
//Set the anchor type node
CPropagationAnchor
::
EAnchorType
eAnchorType
=
iAnchorType
;
JSONNode
jnAnchorType
(
"anchor
type"
,
GetAnchorTypeStr
(
eAnchorType
));
JSONNode
jnAnchorType
(
"anchor
_
type"
,
GetAnchorTypeStr
(
eAnchorType
));
//Set interaction point array
JSONNode
jnPosArray
(
JSON_ARRAY
);
jnPosArray
.
set_name
(
"interaction
point"
);
jnPosArray
.
set_name
(
"interaction
_
point"
);
//Set the interaction point nodes
double
dX
,
dY
,
dZ
,
dW
;
v3InteractionPoint
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnPosX
(
"
X
"
,
dX
);
JSONNode
jnPosY
(
"
Y
"
,
dY
);
JSONNode
jnPosZ
(
"
Z
"
,
dZ
);
JSONNode
jnPosW
(
"
W
"
,
dW
);
JSONNode
jnPosX
(
"
x
"
,
dX
);
JSONNode
jnPosY
(
"
y
"
,
dY
);
JSONNode
jnPosZ
(
"
z
"
,
dZ
);
JSONNode
jnPosW
(
"
w
"
,
dW
);
//Add positions to array
jnPosArray
.
push_back
(
jnPosX
);
...
...
@@ -240,10 +240,10 @@ std::stringstream ITAGeo::CEmitter::ToJSON(std::shared_ptr< const CResourceManag
//Get orientation nodes
double
dOrient
[
4
];
qOrient
.
GetValues
(
dOrient
);
JSONNode
jnOrientX
(
"
X
"
,
dOrient
[
0
]);
JSONNode
jnOrientY
(
"
Y
"
,
dOrient
[
1
]);
JSONNode
jnOrientZ
(
"
Z
"
,
dOrient
[
2
]);
JSONNode
jnOrientW
(
"
W
"
,
dOrient
[
3
]);
JSONNode
jnOrientX
(
"
x
"
,
dOrient
[
0
]);
JSONNode
jnOrientY
(
"
y
"
,
dOrient
[
1
]);
JSONNode
jnOrientZ
(
"
z
"
,
dOrient
[
2
]);
JSONNode
jnOrientW
(
"
w
"
,
dOrient
[
3
]);
//Add orientation to array
jnOrientArray
.
push_back
(
jnOrientX
);
...
...
@@ -343,10 +343,10 @@ std::stringstream ITAGeo::CSensor::ToJSON( std::shared_ptr< const ITAGeo::CResou
//Get orientation nodes
double
dOrient
[
4
];
qOrient
.
GetValues
(
dOrient
);
JSONNode
jnOrientX
(
"
X
"
,
dOrient
[
0
]);
JSONNode
jnOrientY
(
"
Y
"
,
dOrient
[
1
]);
JSONNode
jnOrientZ
(
"
Z
"
,
dOrient
[
2
]);
JSONNode
jnOrientW
(
"
W
"
,
dOrient
[
3
]);
JSONNode
jnOrientX
(
"
x
"
,
dOrient
[
0
]);
JSONNode
jnOrientY
(
"
y
"
,
dOrient
[
1
]);
JSONNode
jnOrientZ
(
"
z
"
,
dOrient
[
2
]);
JSONNode
jnOrientW
(
"
w
"
,
dOrient
[
3
]);
//Add orientation to array
jnOrientArray
.
push_back
(
jnOrientX
);
...
...
@@ -404,7 +404,7 @@ void ITAGeo::CMirrorImage::LoadFromJSONString( const std::string& sContent, std:
v3MirrorNormal
.
SetValues
(
dMirrorNormal
);
//Get and set the polygon index
iPolygonIndex
=
(
int
)
jnRoot
.
at
(
"polygon
index"
).
as_int
();
iPolygonIndex
=
(
int
)
jnRoot
.
at
(
"polygon
_
index"
).
as_int
();
//Get and set the order number
iOrder
=
(
int
)
jnRoot
.
at
(
"order"
).
as_int
();
...
...
@@ -443,15 +443,15 @@ std::stringstream ITAGeo::CMirrorImage::ToJSON( std::shared_ptr< const ITAGeo::C
//Set mirror normal array
JSONNode
jnNormalArray
(
JSON_ARRAY
);
jnNormalArray
.
set_name
(
"mirror
normal"
);
jnNormalArray
.
set_name
(
"mirror
-
normal"
);
//Set the mirror normal nodes
double
dX
,
dY
,
dZ
,
dW
;
v3MirrorNormal
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnNormalX
(
"
X
"
,
dX
);
JSONNode
jnNormalY
(
"
Y
"
,
dY
);
JSONNode
jnNormalZ
(
"
Z
"
,
dZ
);
JSONNode
jnNormalW
(
"
W
"
,
dW
);
JSONNode
jnNormalX
(
"
x
"
,
dX
);
JSONNode
jnNormalY
(
"
y
"
,
dY
);
JSONNode
jnNormalZ
(
"
z
"
,
dZ
);
JSONNode
jnNormalW
(
"
w
"
,
dW
);
//Add mirror normal nodes to array
jnNormalArray
.
push_back
(
jnNormalX
);
...
...
@@ -460,7 +460,7 @@ std::stringstream ITAGeo::CMirrorImage::ToJSON( std::shared_ptr< const ITAGeo::C
jnNormalArray
.
push_back
(
jnNormalW
);
//Set polygon index node
JSONNode
jnPolIndex
(
"polygon
index"
,
iPolygonIndex
);
JSONNode
jnPolIndex
(
"polygon
_
index"
,
iPolygonIndex
);
//Set order node
JSONNode
jnOrder
(
"order"
,
iOrder
);
...
...
@@ -692,7 +692,7 @@ void ITAGeo::CITADiffractionWedgeApertureBase::LoadFromJSONString( const std::st
CPropagationAnchor
::
LoadFromJSONString
(
sContent
,
pResourceManager
);
//Get the vertex start
auto
jnVertextStart
=
jnRoot
.
at
(
"vertex
start"
).
as_array
();
auto
jnVertextStart
=
jnRoot
.
at
(
"vertex
_
start"
).
as_array
();
double
dX
=
jnVertextStart
.
at
(
0
).
as_float
();
double
dY
=
jnVertextStart
.
at
(
1
).
as_float
();
double
dZ
=
jnVertextStart
.
at
(
2
).
as_float
();
...
...
@@ -702,7 +702,7 @@ void ITAGeo::CITADiffractionWedgeApertureBase::LoadFromJSONString( const std::st
v3VertextStart
.
SetValues
(
dX
,
dY
,
dZ
,
dW
);
//Get the vertex end
auto
jnVertextEnd
=
jnRoot
.
at
(
"vertex
end"
).
as_array
();
auto
jnVertextEnd
=
jnRoot
.
at
(
"vertex
_
end"
).
as_array
();
dX
=
jnVertextEnd
.
at
(
0
).
as_float
();
dY
=
jnVertextEnd
.
at
(
1
).
as_float
();
dZ
=
jnVertextEnd
.
at
(
2
).
as_float
();
...
...
@@ -712,7 +712,7 @@ void ITAGeo::CITADiffractionWedgeApertureBase::LoadFromJSONString( const std::st
v3VertextEnd
.
SetValues
(
dX
,
dY
,
dZ
,
dW
);
//Get the main wedge face normal
auto
jnMainWedgeFaceNormal
=
jnRoot
.
at
(
"main
wedge face
normal"
).
as_array
();
auto
jnMainWedgeFaceNormal
=
jnRoot
.
at
(
"main
_wedge_face_
normal"
).
as_array
();
dX
=
jnMainWedgeFaceNormal
.
at
(
0
).
as_float
();
dY
=
jnMainWedgeFaceNormal
.
at
(
1
).
as_float
();
dZ
=
jnMainWedgeFaceNormal
.
at
(
2
).
as_float
();
...
...
@@ -722,7 +722,7 @@ void ITAGeo::CITADiffractionWedgeApertureBase::LoadFromJSONString( const std::st
v3MainWedgeFaceNormal
.
SetValues
(
dX
,
dY
,
dZ
,
dW
);
//Get the opposite wedge face normal
auto
jnOppositeWedgeFaceNormal
=
jnRoot
.
at
(
"opposite
wedge face
normal"
).
as_array
();
auto
jnOppositeWedgeFaceNormal
=
jnRoot
.
at
(
"opposite
_wedge_face_
normal"
).
as_array
();
dX
=
jnOppositeWedgeFaceNormal
.
at
(
0
).
as_float
();
dY
=
jnOppositeWedgeFaceNormal
.
at
(
1
).
as_float
();
dZ
=
jnOppositeWedgeFaceNormal
.
at
(
2
).
as_float
();
...
...
@@ -762,18 +762,18 @@ std::stringstream ITAGeo::CITADiffractionWedgeApertureBase::ToJSON( std::shared_
JSONNode
jnVertexEndArray
(
JSON_ARRAY
);
JSONNode
jnMainWedgeFaceNormalArray
(
JSON_ARRAY
);
JSONNode
jnOppositeWedgeFaceNormalArray
(
JSON_ARRAY
);
jnVertexStartArray
.
set_name
(
"vertex
start"
);
jnVertexEndArray
.
set_name
(
"vertex
end"
);
jnMainWedgeFaceNormalArray
.
set_name
(
"main
wedge face
normal"
);
jnOppositeWedgeFaceNormalArray
.
set_name
(
"opposite
wedge face
normal"
);
jnVertexStartArray
.
set_name
(
"vertex
_
start"
);
jnVertexEndArray
.
set_name
(
"vertex
_
end"
);
jnMainWedgeFaceNormalArray
.
set_name
(
"main
_wedge_face_
normal"
);
jnOppositeWedgeFaceNormalArray
.
set_name
(
"opposite
_wedge_face_
normal"
);
//Set the vertex start nodes
double
dX
,
dY
,
dZ
,
dW
;
v3VertextStart
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnVertexStartX
(
"
X
"
,
dX
);
JSONNode
jnVertexStartY
(
"
Y
"
,
dY
);
JSONNode
jnVertexStartZ
(
"
Z
"
,
dZ
);
JSONNode
jnVertexStartW
(
"
W
"
,
dW
);
JSONNode
jnVertexStartX
(
"
x
"
,
dX
);
JSONNode
jnVertexStartY
(
"
y
"
,
dY
);
JSONNode
jnVertexStartZ
(
"
z
"
,
dZ
);
JSONNode
jnVertexStartW
(
"
w
"
,
dW
);
//Add vertex start nodes to array
jnVertexStartArray
.
push_back
(
jnVertexStartX
);
...
...
@@ -783,10 +783,10 @@ std::stringstream ITAGeo::CITADiffractionWedgeApertureBase::ToJSON( std::shared_
//Set the vertex end nodes
v3VertextEnd
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnVertexEndX
(
"
X
"
,
dX
);
JSONNode
jnVertexEndY
(
"
Y
"
,
dY
);
JSONNode
jnVertexEndZ
(
"
Z
"
,
dZ
);
JSONNode
jnVertexEndW
(
"
W
"
,
dW
);
JSONNode
jnVertexEndX
(
"
x
"
,
dX
);
JSONNode
jnVertexEndY
(
"
y
"
,
dY
);
JSONNode
jnVertexEndZ
(
"
z
"
,
dZ
);
JSONNode
jnVertexEndW
(
"
w
"
,
dW
);
//Add vertex end nodes to array
jnVertexEndArray
.
push_back
(
jnVertexEndX
);
...
...
@@ -796,10 +796,10 @@ std::stringstream ITAGeo::CITADiffractionWedgeApertureBase::ToJSON( std::shared_
//Set the main wedge face normal nodes
v3MainWedgeFaceNormal
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnMainWedgeFaceNormalX
(
"
X
"
,
dX
);
JSONNode
jnMainWedgeFaceNormalY
(
"
Y
"
,
dY
);
JSONNode
jnMainWedgeFaceNormalZ
(
"
Z
"
,
dZ
);
JSONNode
jnMainWedgeFaceNormalW
(
"
W
"
,
dW
);
JSONNode
jnMainWedgeFaceNormalX
(
"
x
"
,
dX
);
JSONNode
jnMainWedgeFaceNormalY
(
"
y
"
,
dY
);
JSONNode
jnMainWedgeFaceNormalZ
(
"
z
"
,
dZ
);
JSONNode
jnMainWedgeFaceNormalW
(
"
w
"
,
dW
);
//Add main wedge face normal nodes to array
jnMainWedgeFaceNormalArray
.
push_back
(
jnMainWedgeFaceNormalX
);
...
...
@@ -809,10 +809,10 @@ std::stringstream ITAGeo::CITADiffractionWedgeApertureBase::ToJSON( std::shared_
//Set the opposite wedge face normal nodes
v3OppositeWedgeFaceNormal
.
GetValues
(
dX
,
dY
,
dZ
,
dW
);
JSONNode
jnOppositeWedgeFaceNormalX
(
"
X
"
,
dX
);
JSONNode
jnOppositeWedgeFaceNormalY
(
"
Y
"
,
dY
);
JSONNode
jnOppositeWedgeFaceNormalZ
(
"
Z
"
,
dZ
);
JSONNode
jnOppositeWedgeFaceNormalW
(
"
W
"
,
dW
);
JSONNode
jnOppositeWedgeFaceNormalX
(
"
x
"
,
dX
);
JSONNode
jnOppositeWedgeFaceNormalY
(
"
y
"
,
dY
);
JSONNode
jnOppositeWedgeFaceNormalZ
(
"
z
"
,
dZ
);
JSONNode
jnOppositeWedgeFaceNormalW
(
"
w
"
,
dW
);
//Add opposite wedge face normal nodes to array
jnOppositeWedgeFaceNormalArray
.
push_back
(
jnOppositeWedgeFaceNormalX
);
...
...
@@ -1034,7 +1034,7 @@ std::stringstream ITAGeo::CPropagationPath::ToJSON(std::shared_ptr< const ITAGeo
jnPropagationPath
.
push_back
(
jnFile
);
JSONNode
jnAnchorArray
(
JSON_ARRAY
);
jnAnchorArray
.
set_name
(
"propagation
anchors"
);
jnAnchorArray
.
set_name
(
"propagation
_
anchors"
);
for
each
(
auto
pAnchor
in
*
this
)
{
...
...
@@ -1159,7 +1159,7 @@ void ITAGeo::CPropagationPathList::LoadFromJSONString( const std::string& sConte
sIdentifier
=
jnRoot
.
at
(
"identifier"
).
as_string
();
//Get the propagation anchors of the path
JSONNode
jnPropagationPaths
=
jnRoot
.
at
(
"propagation
paths"
).
as_array
();
JSONNode
jnPropagationPaths
=
jnRoot
.
at
(
"propagation
_
paths"
).
as_array
();
for
each
(
JSONNode
jnPath
in
jnPropagationPaths
)
{
//Initialization of the emitter as a shared pointer
...
...
@@ -1241,7 +1241,7 @@ std::stringstream ITAGeo::CPropagationPathList::ToJSON( std::shared_ptr< const I
//Add the propagation path in an array node
JSONNode
jnPathArray
(
JSON_ARRAY
);
jnPathArray
.
set_name
(
"propagation
paths"
);
jnPathArray
.
set_name
(
"propagation
_
paths"
);
for
each
(
auto
pPath
in
*
this
)
{
...
...
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