Adding a function return if a wedge shape is of inner or outer type in...

Adding a function return if a wedge shape is of inner or outer type in combined model algorithm, then converting into dedicated wedge classes from geo base
parent f58890bc
......@@ -179,6 +179,35 @@ namespace ITAPropagationPathSim
//---Public member functions-----------------------------------------------------------------------
//! Returns true if wedge is like a room corner (inner wedge type)
/**
* The angle of the SOLID part of the wedge is GREATER Pi in radiants or GREATER 180 degree.
* The opening angle is below Pi or 180 degree.
*
* ###|
* ###| medium
* ###|______________
* ######## solid ###
*/
inline bool IsInnerWedge() const
{
return !IsOuterWedge();
};
//! Returns true if wedge is like a house corner (outer wedge type)
/**
* The angle of the SOLID part of the wedge is SMALLER Pi in radiants or SMALLER 180 degree.
* The opening angle is greater Pi or 180 degree.
*
* medium
* _________________
* |################
* medium |## solid #####
* |############
* |####
*/
bool IsOuterWedge() const;
//!< Copy edge
void CopyFrom(const CPropagationEdge& oPropagationEdgeIn);
......
......@@ -454,8 +454,13 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConvertShapeListsToPropa
{
CPropagationEdgeShared pEdge = static_pointer_cast<CPropagationEdge>(pShape);
//Create specular reflection anchor
shared_ptr<CITADiffractionOuterWedgeAperture> pDiffractionAnchor = make_shared<CITADiffractionOuterWedgeAperture>();
shared_ptr< CITADiffractionWedgeApertureBase > pDiffractionAnchor;
if( pEdge->IsOuterWedge() )
pDiffractionAnchor = make_shared< CITADiffractionOuterWedgeAperture >();
else
pDiffractionAnchor = make_shared< CITADiffractionInnerWedgeAperture >();
pDiffractionAnchor->v3InteractionPoint = *pEdge->v3InteractionPoint;
pDiffractionAnchor->v3MainWedgeFaceNormal = *pEdge->v3MainFaceNormal;
pDiffractionAnchor->v3OppositeWedgeFaceNormal = *pEdge->v3OppositeFaceNormal;
......@@ -463,8 +468,7 @@ void ITAPropagationPathSim::CombinedModel::CPathEngine::ConvertShapeListsToPropa
pDiffractionAnchor->v3VertextEnd = *pEdge->v3EndVertex;
pDiffractionAnchor->iMainWedgeFaceID = pEdge->hMainFace.idx();
pDiffractionAnchor->iOppositeWedgeFaceID = pEdge->hOppositeFace.idx();
oPath.push_back(pDiffractionAnchor);
break;
......
......@@ -266,3 +266,14 @@ float CPropagationEdge::CalculateLevelDrop(float & fFirstDistance, float & fSeco
return fLevelDrop;
}
bool ITAPropagationPathSim::CombinedModel::CPropagationEdge::IsOuterWedge() const
{
VistaVector3D v3ApertureDirection = *v3EndVertex - *v3StartVertex;
bool bSameDirection = v3MainFaceNormal->Cross( *v3OppositeFaceNormal ).Dot( v3ApertureDirection ) > 0.0f;
// Per convention, outer wedges defined in a right-handed manner result in a positive
// wedge aperture direction ( main x opposite = aperture dir)
return bSameDirection;
}
......@@ -3,7 +3,7 @@
*
* ITA geometrical acoustics
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
* RWTH Aachen University, Germany, 2015-2019
*
* ----------------------------------------------------------------
* ____ __________ _______
......
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