WSF
WsfIntersectMesh Class Reference

#include <WsfIntersectMesh.hpp>

Inheritance diagram for WsfIntersectMesh:
Collaboration diagram for WsfIntersectMesh:

Public Types

using MeshMap = std::map<unsigned int, UtIntersectMesh*>
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.

Public Member Functions

 WsfIntersectMesh ()
 WsfIntersectMesh (const WsfIntersectMesh &aSrc)
WsfIntersectMeshoperator= (const WsfIntersectMesh &)=delete
 ~WsfIntersectMesh () override
WsfComponentCloneComponent () const override
void * QueryInterface (int aRole) override
WsfObjectClone () const override
bool ProcessInput (UtInput &aInput) override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
bool Intersect (WsfPlatform *aSourcePlatform, const std::string &aTargetOffset, const double aErrorAngle, double &aSurfaceDotProduct, int &aMaterialPropertyCode, double &aDistance)
UtIntersectMesh * LookupMesh (const int aIndex)
void DefineOffset (const std::string &aOffsetName, double aOffsetX, double aOffsetY, double aOffsetZ)
bool RemoveOffset (const std::string &aOffsetName)
unsigned int GetTargetOffsetCount ()
WsfStringId GetTargetOffsetName (unsigned aOffsetEntry) const
 Get the name of the specified target offset entry id.
bool TargetOffsetExists (const std::string &aTargetOffsetName) const
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfSimpleComponentT< WsfPlatformComponent >
 WsfSimpleComponentT ()=default
 Empty constructor for serialization.
 WsfSimpleComponentT (int aRole, WsfStringId aName)
 WsfSimpleComponentT (int aRole)
 WsfSimpleComponentT (WsfStringId aName)
 WsfSimpleComponentT (const WsfSimpleComponentT &aSrc)
WsfSimpleComponentToperator= (const WsfSimpleComponentT &aRhs)
 ~WsfSimpleComponentT () override=default
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
virtual int GetComponentInitializationOrder () const
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
virtual bool PreInitialize (double aSimTime)
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual void PreInput ()
Public Member Functions inherited from WsfNamed
 WsfNamed ()
 WsfNamed (WsfStringId aName)
 WsfNamed (const WsfNamed &)=default
WsfNamedoperator= (const WsfNamed &)=default
virtual ~WsfNamed ()=default
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Additional Inherited Members

 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
int mRoles [2]

Detailed Description

WsfIntersectMesh computes a ray-traced intersection with a model (intersection mesh). It is useful for determining specific incidence angle information and occlusion with a sub-portion of a target. It can be expanded to perform hi-fidelity sensor interactions.

Member Typedef Documentation

◆ MeshMap

using WsfIntersectMesh::MeshMap = std::map<unsigned int, UtIntersectMesh*>

Constructor & Destructor Documentation

◆ WsfIntersectMesh() [1/2]

WsfIntersectMesh::WsfIntersectMesh ( )

◆ WsfIntersectMesh() [2/2]

WsfIntersectMesh::WsfIntersectMesh ( const WsfIntersectMesh & aSrc)

References WsfIntersectMesh().

◆ ~WsfIntersectMesh()

WsfIntersectMesh::~WsfIntersectMesh ( )
override

Member Function Documentation

◆ Clone()

WsfObject * WsfIntersectMesh::Clone ( ) const
overridevirtual

Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.

Implements WsfObject.

References WsfIntersectMesh(), and WsfObject::WsfObject().

◆ CloneComponent()

WsfComponent * WsfIntersectMesh::CloneComponent ( ) const
overridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References WsfIntersectMesh().

◆ ComponentParentChanged()

void WsfIntersectMesh::ComponentParentChanged ( WsfPlatform * aParentPtr)
inlineoverridevirtual

The parent to which the component is attached has been updated. This virtual method is called whenever the components parent attachment has been changed. This is provided so derived class receives notification of the change.

Parameters
aParentPtrPointer to the new parent. The new parent may be null if the attachment was severed.

Reimplemented from WsfComponentT< WsfPlatform >.

◆ DefineOffset()

void WsfIntersectMesh::DefineOffset ( const std::string & aOffsetName,
double aOffsetX,
double aOffsetY,
double aOffsetZ )

Referenced by ProcessInput().

◆ GetTargetOffsetCount()

unsigned int WsfIntersectMesh::GetTargetOffsetCount ( )
inline

◆ GetTargetOffsetName()

WsfStringId WsfIntersectMesh::GetTargetOffsetName ( unsigned aOffsetEntry) const

Get the name of the specified target offset entry id.

Referenced by WsfBeamDirector::WsfBeamDirectorMode::AttemptToDetect(), and WsfHighEnergyLaser::UpdateEngagementGeometry().

◆ Intersect()

bool WsfIntersectMesh::Intersect ( WsfPlatform * aSourcePlatform,
const std::string & aTargetOffset,
const double aErrorAngle,
double & aBeamSurfaceDotProduct,
int & aMaterialPropertyCode,
double & aDistance )

This method will give you information about beam intersections from the aSourcePlatform in the general direction of the named offset aTargetOffset on the processor's platform with an added aErrorAngle radians of rotation about the source point. It will return true if there is an intersection. aBeamSurfaceDotProduct is the dot product of the beam direction with the hit surface normal. aMaterialPropertyCode is the material code of the hit surface with: 0 = target body 1 = canopy (material code 1) 2 = sensor (material code 2) aDistance is the distance to the intersection point from the source point. It does not account for occlusions from the source platform, terrain, or any other platforms. Add the intersect mesh definition intersect_mesh aircraft_intersect_mesh define_offset CANOPY 3.461642 m 0.000184 m -0.943480 m define_offset SENSOR 5.138014 m 0.000005 m -0.629733 m file ../meshes/aircraft.imesh end_intersect_mesh

Then add the intersect mesh definition inline, like this platform_type AIRCRAFT WSF_PLATFORM intersect_mesh aircraft_intersect_mesh ... end_platform_type Then in code, the call to intersect the SENSOR would be: partPtr->GetTarget()->GetComponent<WsfSimplePlatformComponent>("aircraft_intersect_mesh")->Intersect(partPtr->GetPlatform(), // the parent (attacker) "SENSOR", 0.0175, // ~1 degree error dotProd, surfProp, dist);

References WsfSimulation::GetRandom(), WsfPlatform::GetSimulation(), LookupMesh(), and pos.

Referenced by WsfBeamDirector::WsfBeamDirectorMode::AttemptToDetect(), and WsfHighEnergyLaser::UpdateEngagementGeometry().

◆ LookupMesh()

UtIntersectMesh * WsfIntersectMesh::LookupMesh ( const int aIndex)

This method will look for a mesh with the given lookup index in its list of available meshes and return the mesh. If none is found, it returns 0

Referenced by Intersect().

◆ operator=()

WsfIntersectMesh & WsfIntersectMesh::operator= ( const WsfIntersectMesh & )
delete

References WsfIntersectMesh().

◆ ProcessInput()

bool WsfIntersectMesh::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

References DefineOffset(), and WsfComponent::ProcessInput().

◆ QueryInterface()

void * WsfIntersectMesh::QueryInterface ( int aRole)
inlineoverridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements WsfComponent.

References cWSF_COMPONENT_INTERSECT_MESH.

◆ RemoveOffset()

bool WsfIntersectMesh::RemoveOffset ( const std::string & aOffsetName)

◆ TargetOffsetExists()

bool WsfIntersectMesh::TargetOffsetExists ( const std::string & aTargetOffsetName) const

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved