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
112f33d6
Commit
112f33d6
authored
Apr 15, 2019
by
Daniel Filbert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added propagation anchor class: detection point. But still inculding bugs...
parent
a64c1eaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
include/ITAGeo/Base.h
include/ITAGeo/Base.h
+28
-0
src/ITAGeo/Base.cpp
src/ITAGeo/Base.cpp
+53
-0
No files found.
include/ITAGeo/Base.h
View file @
112f33d6
...
...
@@ -94,6 +94,7 @@ namespace ITAGeo
DIFFRACTION_OUTER_APEX
,
//!< Diffraction occurrance point (at a boundary outer edge, e.g. house corner)
DIFFRACTION_INNER_APEX
,
//!< Diffraction occurrance point (at a boundary outer edge, e.g. room corner)
MIRROR_IMAGE
,
//!< (Virtual) Mirror image in medium
DETECTION_POINT
,
//!< Point of detection within detection volume (e.g. sphere) of receiver used in ray tracing
LAST_ELEMENT
//!< Last element of EAnchorType to iterate over EAnchorType
}
iAnchorType
;
//! Type of anchor
...
...
@@ -329,6 +330,33 @@ namespace ITAGeo
std
::
shared_ptr
<
Material
::
IMaterial
>
pMaterial
;
//!< Acoustic material connection, i.e. absorption coefficient
};
//! Geometrical propagation anchor of the detection point inside the receiver's detection volume
/**
* A detection point
*/
class
ITA_GEO_API
CDetectionPoint
:
public
CPropagationAnchor
// public CPropagationAnchor
{
public:
inline
CDetectionPoint
()
{
iAnchorType
=
CPropagationAnchor
::
DETECTION_POINT
;
};
inline
CDetectionPoint
(
const
VistaVector3D
&
v3DetectionPoint
)
:
CPropagationAnchor
(
v3DetectionPoint
)
{
iAnchorType
=
CPropagationAnchor
::
DETECTION_POINT
;
};
inline
virtual
~
CDetectionPoint
()
{};
//! Returns a string with the properties of the object
std
::
string
ToString
()
const
;
std
::
stringstream
ToJSON
(
std
::
shared_ptr
<
const
CResourceManager
>
pResourceManager
=
nullptr
)
const
;
//! Load properties from JSON formatted string
void
LoadFromJSONString
(
const
std
::
string
&
sContent
,
std
::
shared_ptr
<
CResourceManager
>
pResourceManager
=
nullptr
);
};
//! Propagation path list class
/**
* Container to hold a list of propagation anchors, that form a propagation path.
...
...
src/ITAGeo/Base.cpp
View file @
112f33d6
...
...
@@ -540,6 +540,59 @@ std::stringstream ITAGeo::CSpecularReflection::ToJSON( std::shared_ptr< const CR
#endif
}
//---CDetectionPoint----------------------------------------------------------------------------------------------------------------------
void
ITAGeo
::
CDetectionPoint
::
LoadFromJSONString
(
const
std
::
string
&
sContent
,
std
::
shared_ptr
<
CResourceManager
>
pResourceManager
)
{
#ifdef WITH_JSON_SUPPORT
JSONNode
jnRoot
=
libjson
::
parse
(
sContent
);
//Check for correct class of the content
if
(
jnRoot
.
at
(
"class"
).
as_string
()
!=
GetTypeStr
())
{
ITA_EXCEPT_INVALID_PARAMETER
(
"The json string doesn't contain properties of type ITAGeo::CSpecularReflection. It contains the properties of "
+
jnRoot
.
at
(
"class"
).
as_string
()
+
"."
);
}
//--Get the properties-------------------------
CPropagationAnchor
::
LoadFromJSONString
(
sContent
,
pResourceManager
);
#endif
}
std
::
string
ITAGeo
::
CDetectionPoint
::
ToString
()
const
{
std
::
stringstream
ss
;
ss
<<
"[ "
<<
std
::
setw
(
10
)
<<
GetAnchorTypeStr
(
iAnchorType
)
<<
" ] "
<<
", Interaction point : "
<<
v3InteractionPoint
;
return
ss
.
str
();
}
std
::
stringstream
ITAGeo
::
CDetectionPoint
::
ToJSON
(
std
::
shared_ptr
<
const
CResourceManager
>
pResourceManager
)
const
{
#ifdef WITH_JSON_SUPPORT
//Get the properties of the parent class
std
::
string
sRoot
=
ITAGeo
::
CPropagationAnchor
::
ToJSON
(
pResourceManager
).
str
();
JSONNode
jnRoot
=
libjson
::
parse
(
sRoot
);
//Set class node. First, search the node. If the node does not exist, push back new node.
if
(
sRoot
.
find
(
"
\"
class
\"
"
)
==
std
::
string
::
npos
)
{
JSONNode
jnClassType
(
"class"
,
GetTypeStr
());
jnRoot
.
push_back
(
jnClassType
);
}
//Convert to stringstream and return value
std
::
stringstream
ss
;
ss
<<
jnRoot
.
write_formatted
();
return
ss
;
#else
ITA_EXCEPT_NOT_IMPLEMENTED
;
#endif
}
//---CITADiffractionWedgeAperture---------------------------------------------------------------------------------------------------------
ITAGeo
::
CITADiffractionWedgeApertureBase
::
CITADiffractionWedgeApertureBase
()
...
...
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