|
WSF
|
#include <WsfIntersectMesh.hpp>


Public Types | |
| using | MeshMap = std::map<unsigned int, UtIntersectMesh*> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| 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) | |
| WsfIntersectMesh & | operator= (const WsfIntersectMesh &)=delete |
| ~WsfIntersectMesh () override | |
| WsfComponent * | CloneComponent () const override |
| void * | QueryInterface (int aRole) override |
| WsfObject * | Clone () 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 TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (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) | |
| WsfSimpleComponentT & | operator= (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 | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| ParentType * | GetComponentParent () 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 | |
| WsfNamed & | operator= (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] |
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.
| using WsfIntersectMesh::MeshMap = std::map<unsigned int, UtIntersectMesh*> |
| WsfIntersectMesh::WsfIntersectMesh | ( | ) |
Referenced by Clone(), CloneComponent(), operator=(), and WsfIntersectMesh().
| WsfIntersectMesh::WsfIntersectMesh | ( | const WsfIntersectMesh & | aSrc | ) |
References WsfIntersectMesh().
|
override |
|
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().
|
overridevirtual |
Clones a component. May return null if component does not support clone.
Implements WsfComponent.
References WsfIntersectMesh().
|
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.
| aParentPtr | Pointer to the new parent. The new parent may be null if the attachment was severed. |
Reimplemented from WsfComponentT< WsfPlatform >.
| void WsfIntersectMesh::DefineOffset | ( | const std::string & | aOffsetName, |
| double | aOffsetX, | ||
| double | aOffsetY, | ||
| double | aOffsetZ ) |
Referenced by ProcessInput().
|
inline |
| WsfStringId WsfIntersectMesh::GetTargetOffsetName | ( | unsigned | aOffsetEntry | ) | const |
Get the name of the specified target offset entry id.
Referenced by WsfBeamDirector::WsfBeamDirectorMode::AttemptToDetect(), and WsfHighEnergyLaser::UpdateEngagementGeometry().
| 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().
| 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().
|
delete |
References WsfIntersectMesh().
|
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'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
Reimplemented from WsfObject.
References DefineOffset(), and WsfComponent::ProcessInput().
|
inlineoverridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements WsfComponent.
References cWSF_COMPONENT_INTERSECT_MESH.
| bool WsfIntersectMesh::RemoveOffset | ( | const std::string & | aOffsetName | ) |
| bool WsfIntersectMesh::TargetOffsetExists | ( | const std::string & | aTargetOffsetName | ) | const |