WIP for image model implementation

parent 7a34c069
......@@ -52,8 +52,8 @@ namespace ITAGeo
enum EAnchorType
{
ITA_ANCHOR_INVALID = 0,
ITA_ACOUSTIC_SOURCE,
ITA_ACOUSTIC_RECEIVER,
ITA_ACOUSTIC_EMITTER,
ITA_ACOUSTIC_SENSOR,
ITA_SPECULAR_REFLECTION,
ITA_DIFFUSE_REFLECTION,
ITA_TRANSMISSION,
......@@ -89,19 +89,19 @@ namespace ITAGeo
: CPropagationAnchor( vPos_ )
, vPos( v3InteractionPoint )
{
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_SOURCE;
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_EMITTER;
};
inline CEmitter( const CEmitter& oSrc )
: CPropagationAnchor( oSrc )
, vPos( v3InteractionPoint )
{
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_SOURCE;
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_EMITTER;
};
inline CEmitter() : vPos( v3InteractionPoint )
{
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_SOURCE;
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_EMITTER;
};
VistaVector3D& vPos; //!< Position point / geometric interaction point
......@@ -124,14 +124,14 @@ namespace ITAGeo
inline CSensor() : vPos( v3InteractionPoint )
{
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_RECEIVER;
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_SENSOR;
};
inline CSensor( VistaVector3D vPos_ )
: CPropagationAnchor( vPos_ )
, vPos( v3InteractionPoint )
{
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_RECEIVER;
CPropagationAnchor::iAnchorType = CPropagationAnchor::ITA_ACOUSTIC_SENSOR;
};
VistaVector3D& vPos; //!< Position point / geometric interaction point
......@@ -160,16 +160,22 @@ namespace ITAGeo
public:
VistaVector3D v3MirrorNormal; //<! If normal is zero vector, image is invalid / was not reflected
int iPolygonIndex; //!< Polygon index helper (for recursive audibility test)
int iOrder;
void* pUserData; //!< User data pointer (for future use)
inline CMirrorImage() {};
inline CMirrorImage() : iPolygonIndex( -1 ), pUserData( nullptr ), iOrder( -1 ) {};
inline explicit CMirrorImage( const CPropagationAnchor& oAnchor )
: CPropagationAnchor( oAnchor )
, iPolygonIndex( -1 )
, iOrder( -1 )
, pUserData( nullptr )
{};
inline virtual ~CMirrorImage() {};
inline void CopyFrom( const ITAGeo::CPropagationAnchor& oOther, CITAMaterialManager* pManager = nullptr )
inline void CopyFromAnchor( const ITAGeo::CPropagationAnchor& oOther, CITAMaterialManager* pManager = nullptr )
{
bProtected = oOther.bProtected;
v3InteractionPoint = oOther.v3InteractionPoint;
......
......@@ -40,7 +40,7 @@ namespace ITAGeoUtils
ITA_GEO_API bool IsPointInPolygon( const VistaVector3D& v3Point, const VistaPolygon& oPolygon );
//! Mirrors point over a plane
ITA_GEO_API bool MirrorPointOverPlane( const VistaVector3D v3Point, const VistaPlane& oPlane, VistaVector3D& v3MirroredPoint );
ITA_GEO_API void MirrorPointOverPlane( const VistaVector3D& v3Point, const VistaPlane& oPlane, VistaVector3D& v3MirroredPoint );
//! Return opening angle from wedge main face to a point in space
/**
......
......@@ -6,9 +6,9 @@ std::string ITAGeo::CPropagationAnchor::GetAnchorTypeStr( ITAGeo::CPropagationAn
{
switch( iType )
{
case ITA_ACOUSTIC_SOURCE:
case ITA_ACOUSTIC_EMITTER:
return "Source";
case ITA_ACOUSTIC_RECEIVER:
case ITA_ACOUSTIC_SENSOR:
return "Receiver";
case ITA_SPECULAR_REFLECTION:
return "SpecularReflection";
......
......@@ -51,9 +51,17 @@ bool ITAGeoUtils::IsPointInPolygon( const VistaVector3D& v3Point, const VistaPol
ITA_EXCEPT0( NOT_IMPLEMENTED );
}
bool ITAGeoUtils::MirrorPointOverPlane( const VistaVector3D v3Point, const VistaPlane& oPlane, VistaVector3D& v3MirroredPoint )
void ITAGeoUtils::MirrorPointOverPlane( const VistaVector3D& v3Point, const VistaPlane& oPlane, VistaVector3D& v3MirroredPoint )
{
ITA_EXCEPT0( NOT_IMPLEMENTED );
const float fDistance = oPlane.CalcDistance( v3Point );
if( fDistance < ITAConstants::EPS_F_L )
{
v3MirroredPoint = v3Point;
}
else
{
v3MirroredPoint = v3Point - 2.0f * fDistance * oPlane.GetNormVector();
}
}
ITA_GEO_API float ITAGeoUtils::GetWedgeMainFaceElevationToPointRad( const VistaVector3D& v3StartVertex, const VistaVector3D& v3EndVertex, const VistaVector3D& v3MainFaceNormal, const VistaVector3D& v3Point )
......
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