Adding JSON reflection plane normal export for prop paths and fixing some...

Adding JSON reflection plane normal export for prop paths and fixing some class related stuff in engine
parent ec396c22
...@@ -310,6 +310,7 @@ namespace ITAGeo ...@@ -310,6 +310,7 @@ namespace ITAGeo
inline CSpecularReflection() inline CSpecularReflection()
{ {
iAnchorType = CPropagationAnchor::SPECULAR_REFLECTION; iAnchorType = CPropagationAnchor::SPECULAR_REFLECTION;
v3FaceNormal.SetToZeroVector();
}; };
inline CSpecularReflection(const VistaVector3D& v3SpecularReflectionPoint) inline CSpecularReflection(const VistaVector3D& v3SpecularReflectionPoint)
: CPropagationAnchor(v3SpecularReflectionPoint) : CPropagationAnchor(v3SpecularReflectionPoint)
...@@ -326,6 +327,8 @@ namespace ITAGeo ...@@ -326,6 +327,8 @@ namespace ITAGeo
//! Load properties from JSON formatted string //! Load properties from JSON formatted string
void LoadFromJSONString(const std::string& sContent, std::shared_ptr< CResourceManager > pResourceManager = nullptr); void LoadFromJSONString(const std::string& sContent, std::shared_ptr< CResourceManager > pResourceManager = nullptr);
VistaVector3D v3FaceNormal; //!< Face normal of reflection plane
std::shared_ptr< Material::IMaterial > pMaterial; //!< Acoustic material connection, i.e. absorption coefficient std::shared_ptr< Material::IMaterial > pMaterial; //!< Acoustic material connection, i.e. absorption coefficient
}; };
......
...@@ -522,6 +522,18 @@ std::stringstream ITAGeo::CSpecularReflection::ToJSON( std::shared_ptr< const CR ...@@ -522,6 +522,18 @@ std::stringstream ITAGeo::CSpecularReflection::ToJSON( std::shared_ptr< const CR
JSONNode jnClassType("class", GetTypeStr()); JSONNode jnClassType("class", GetTypeStr());
jnRoot.push_back(jnClassType); jnRoot.push_back(jnClassType);
} }
if (!v3FaceNormal.GetIsZeroVector())
{
//Set interaction point array
JSONNode jnFaceNormalArray(JSON_ARRAY);
jnFaceNormalArray.set_name("face_normal");
jnFaceNormalArray.push_back(JSONNode("x", v3FaceNormal[Vista::X]));
jnFaceNormalArray.push_back(JSONNode("y", v3FaceNormal[Vista::Y]));
jnFaceNormalArray.push_back(JSONNode("z", v3FaceNormal[Vista::Z]));
jnFaceNormalArray.push_back(JSONNode("w", v3FaceNormal[Vista::W]));
jnRoot.push_back(jnFaceNormalArray);
}
//Get the acoustic material //Get the acoustic material
if( pMaterial && pResourceManager ) if( pMaterial && pResourceManager )
......
...@@ -12,6 +12,7 @@ int main( int, char** ) ...@@ -12,6 +12,7 @@ int main( int, char** )
auto pReflection = make_shared< CSpecularReflection >(); auto pReflection = make_shared< CSpecularReflection >();
pReflection->v3InteractionPoint.SetValues(-0.5f, -1.0f, -2.0f); pReflection->v3InteractionPoint.SetValues(-0.5f, -1.0f, -2.0f);
pReflection->v3FaceNormal.SetValues(1.f, 0.f, 0.f, 0.f);
auto pReceiver = make_shared< CSensor >(); auto pReceiver = make_shared< CSensor >();
pReceiver->v3InteractionPoint.SetValues(-1.0f, -2.0f, -3.0f); pReceiver->v3InteractionPoint.SetValues(-1.0f, -2.0f, -3.0f);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment