WSF
WsfZone Class Referenceabstract

#include <WsfZone.hpp>

Inheritance diagram for WsfZone:
Collaboration diagram for WsfZone:

Classes

struct  Point

Public Member Functions

 WsfZone ()
WsfZoneoperator= (const WsfZone &)=delete
 ~WsfZone () override=default
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 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
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 Initialize2 (double aSimTime)
virtual void PreInput ()
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept

Static Public Attributes

static constexpr const char * cTYPE_KIND = "zone"
static constexpr double cUNSPECIFIED = 1.0E20
static constexpr double cHUGE = 9.9E20
static constexpr double cSMALL = -9.9E20
Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed

Component infrastructure methods

WsfPlatformmPlatformPtr
std::map< WsfStringId, double > mModifierList
double mMinAlt
double mMaxAlt
double mMinX
double mMaxX
double mMinY
double mMaxY
double mArea
Point mCentroid
bool mIsInitialized
WsfComponentCloneComponent () const override
int GetComponentInitializationOrder () const override
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
WsfPlatformGetPlatform () const
WsfZoneClone () const override=0
 The standard Clone() method (virtual copy constructor).
bool ProcessInput (UtInput &aInput) override
bool Initialize (double aSimTime) override
virtual void Initialize (const WsfScenario &aScenario)
virtual bool PointIsInside (WsfSimulation *aSimulationPtr, const double aViewedPointWCS[3], const double aEyePointWCS[3], const double aLookHeading, const double aDeltaDownRange=0.0)
virtual double CheckIntersections (const double aLLA1[3], const double aLLA2[3])
virtual bool GetLatLonExtrema (double &aSouthernLat, double &aWesternLon, double &aNorthernLat, double &aEasternLon) const
void SetGlobalName (WsfStringId aGlobalName)
 Set the global model that this zone was cloned from.
WsfStringId GetGlobalName () const
virtual double Area ()
virtual WsfGeoPoint Reference ()=0
virtual WsfGeoPoint Centroid ()
virtual void MaxPoint (double &aX, double &aY, double &aAlt)
virtual void MinPoint (double &aX, double &aY, double &aAlt)
virtual void DrawBounds (WsfDraw &aDraw)
virtual void DrawCentroid (WsfDraw &aDraw)
virtual void Draw (WsfDraw &aDraw)
virtual void DrawRelative (WsfDraw &aDraw, const double aEyePointWCS[3], const double aLookHeading)
virtual void DebugDrawBounds (WsfDraw &aDraw)
virtual void DebugDrawCentroid (WsfDraw &aDraw)
virtual void DebugDrawZone (WsfDraw &aDraw)
virtual void DebugDrawZoneRelative (WsfDraw &aDraw, const double aEyePointWCS[3], const double aLookHeading)
virtual const std::map< WsfStringId, double > & GetModifierList () const
 Get the modifier list for WsfZoneAttenuation.
virtual double ModifierValue (const std::string &aModifierName) const
 returns the value of the modifier matching the given name
bool IsInitialized () const
void SetFillColor (const std::string &aColor)
void SetFillColor (const UtColor &aColor)
void SetLineColor (const std::string &aColor)
void SetLineColor (const UtColor &aColor)
virtual ut::optional< UtColor > GetFillColor () const
virtual ut::optional< UtColor > GetLineColor () const
 WsfZone (const WsfZone &aSrc)
 Copy constructor (for Clone()).

Additional Inherited Members

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.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Detailed Description

An abstract base class for a zone.

Zones represent an volume that is formed either by extruding a polygon or other geometric shape in the vertical direction, or specifying a 3-D spherical radius. The key run-time function for a Zone is the determination of whether a point of interest lies within the Zone or not. A Zone must be specified relative to some point of reference. There are two possibilities – relative to:

  • 1) the Observer (who must specify his location and direction when he makes the function call), or
  • 2) an internally-specified reference position. The internally-specified location may be fixed or variable, but since this class will NOT be responsible for tracking the movement of another entity, it is up to the owner of the Zone to maintain currency of the reference values.

One Zone may be created referencing another. This will result in a geometric- ally similar volume, but translated and (heading) rotated to another position. If the original Zone was defined with a (Lat, Lon) polygon, the new Zone will use (X, Y) relative offsets, but will NOT account for earth's curvature, and so may contain vertical distortions as the size grows.

A polygonal Zone must be defined in a clockwise fashion, as viewed from above.

Note
Every Zone must be Initialize()'d by the instantiator before use. has been processed, or after all values have been set via accessors.
See also
WsfZoneDefinition
WsfZoneReference
WsfZoneSet

Constructor & Destructor Documentation

◆ WsfZone() [1/2]

◆ ~WsfZone()

WsfZone::~WsfZone ( )
overridedefault

◆ WsfZone() [2/2]

Member Function Documentation

◆ Area()

double WsfZone::Area ( )
virtual

Reimplemented in WsfZoneReference.

References mArea.

◆ Centroid()

WsfGeoPoint WsfZone::Centroid ( )
virtual

Reimplemented in WsfZoneReference.

References mCentroid.

Referenced by ZoneUtils::GetZoneCentroid(), and Reference().

◆ CheckIntersections()

virtual double WsfZone::CheckIntersections ( const double aLLA1[3],
const double aLLA2[3] )
inlinevirtual

Reimplemented in WsfZoneDefinition, and WsfZoneSet.

◆ Clone()

WsfZone * WsfZone::Clone ( ) const
overridepure virtual

The standard Clone() method (virtual copy constructor).

Implements WsfObject.

Implemented in WsfCodedZone, WsfZoneDefinition, WsfZoneReference, and WsfZoneSet.

References PointIsInside(), and WsfZone().

Referenced by WsfATG_WeaponLAR::WsfATG_WeaponLAR().

◆ CloneComponent()

WsfComponent * WsfZone::CloneComponent ( ) const
inlineoverridevirtual

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

Implements WsfComponent.

References WsfObject::Clone().

◆ ComponentParentChanged()

void WsfZone::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 >.

References mPlatformPtr.

◆ DebugDrawBounds()

virtual void WsfZone::DebugDrawBounds ( WsfDraw & aDraw)
inlinevirtual

◆ DebugDrawCentroid()

virtual void WsfZone::DebugDrawCentroid ( WsfDraw & aDraw)
inlinevirtual

◆ DebugDrawZone()

virtual void WsfZone::DebugDrawZone ( WsfDraw & aDraw)
inlinevirtual

◆ DebugDrawZoneRelative()

virtual void WsfZone::DebugDrawZoneRelative ( WsfDraw & aDraw,
const double aEyePointWCS[3],
const double aLookHeading )
inlinevirtual

Reimplemented in WsfZoneDefinition.

◆ Draw()

virtual void WsfZone::Draw ( WsfDraw & aDraw)
inlinevirtual

Reimplemented in WsfZoneDefinition.

◆ DrawBounds()

virtual void WsfZone::DrawBounds ( WsfDraw & aDraw)
inlinevirtual

Reimplemented in WsfZoneDefinition.

◆ DrawCentroid()

virtual void WsfZone::DrawCentroid ( WsfDraw & aDraw)
inlinevirtual

Reimplemented in WsfZoneDefinition.

◆ DrawRelative()

virtual void WsfZone::DrawRelative ( WsfDraw & aDraw,
const double aEyePointWCS[3],
const double aLookHeading )
inlinevirtual

Reimplemented in WsfZoneDefinition.

◆ GetComponentInitializationOrder()

int WsfZone::GetComponentInitializationOrder ( ) const
inlineoverridevirtual

Forces a specific initialization order. Components are initialized in increasing initialization order value.

Reimplemented from WsfComponent.

References cWSF_INITIALIZE_ORDER_ZONE.

◆ GetComponentName()

WsfStringId WsfZone::GetComponentName ( ) const
inlineoverridevirtual

Returns the component's name. Each component in a component list has a unique name. Names are usually defined by the user, but they may also be generated by code and prefixed with a '#' to guarantee no collisions with user-defined names.

Implements WsfComponent.

References WsfObject::GetNameId().

◆ GetComponentRoles()

const int * WsfZone::GetComponentRoles ( ) const
overridevirtual

Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Implements WsfComponent.

References cWSF_COMPONENT_NULL, and cWSF_COMPONENT_ZONE.

◆ GetFillColor()

virtual ut::optional< UtColor > WsfZone::GetFillColor ( ) const
inlinevirtual

◆ GetGlobalName()

WsfStringId WsfZone::GetGlobalName ( ) const
inline

Get the name of the globe template that this zone derives from.

Returns
The name of the template. WsfStringId(0) if there was no derivation.

Referenced by WsfXIO_ObjectInfoLoad::Load_Platform(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetLatLonExtrema()

bool WsfZone::GetLatLonExtrema ( double & aSouthernLat,
double & aWesternLon,
double & aNorthernLat,
double & aEasternLon ) const
virtual

◆ GetLineColor()

virtual ut::optional< UtColor > WsfZone::GetLineColor ( ) const
inlinevirtual

◆ GetModifierList()

virtual const std::map< WsfStringId, double > & WsfZone::GetModifierList ( ) const
inlinevirtual

Get the modifier list for WsfZoneAttenuation.

Reimplemented in WsfZoneReference.

References mModifierList.

Referenced by WsfZoneAttenuation::Initialize().

◆ GetPlatform()

WsfPlatform * WsfZone::GetPlatform ( ) const
inline

References mPlatformPtr.

◆ Initialize() [1/2]

void WsfZone::Initialize ( const WsfScenario & aScenario)
virtual

This method is called to initialize the zone for use. This form is called from scenario initialization for globally defined zones.

Reimplemented in WsfZoneDefinition, WsfZoneReference, and WsfZoneSet.

References mIsInitialized.

◆ Initialize() [2/2]

bool WsfZone::Initialize ( double aSimTime)
overridevirtual

Implementation of WsfComponent::Initialize. This is called by when initializing components attached to a platform (WsfPlatform::Initialize)

Parameters
aSimTimeThe current simulation time.
Returns
true;

Reimplemented from WsfComponent.

References Initialize(), and mPlatformPtr.

Referenced by Initialize(), WsfZoneReference::Initialize(), and UT_DEFINE_SCRIPT_METHOD().

◆ IsInitialized()

bool WsfZone::IsInitialized ( ) const
inline

◆ MaxPoint()

void WsfZone::MaxPoint ( double & aX,
double & aY,
double & aAlt )
virtual

Reimplemented in WsfZoneReference.

References mMaxAlt, mMaxX, and mMaxY.

Referenced by Reference().

◆ MinPoint()

void WsfZone::MinPoint ( double & aX,
double & aY,
double & aAlt )
virtual

Reimplemented in WsfZoneReference.

References mMinAlt, mMinX, and mMinY.

Referenced by Reference().

◆ ModifierValue()

double WsfZone::ModifierValue ( const std::string & aModifierName) const
virtual

returns the value of the modifier matching the given name

Reimplemented in WsfZoneReference.

References mModifierList.

◆ operator=()

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

References WsfZone().

◆ PointIsInside()

bool WsfZone::PointIsInside ( WsfSimulation * aSimulationPtr,
const double aViewedPointWCS[3],
const double aEyePointWCS[3],
const double aLookHeading,
const double aDeltaDownRange = 0.0 )
virtual

Is the point inside the zone?

Parameters
aSimulationPtrthe simulation
aViewedPointWCSthe point which is being tested for containment in the zone.
aEyePointWCSis the potential reference point for a relative Zone.
aLookHeadingthe current heading (for relative references)
aDeltaDownRangeis an (optional) delta to slide the Zone away from the eyepoint. (Used to adjust the Zone location for off-design conditions.)
Returns
'true' if the point is inside the Zone or 'false' otherwise.

Reimplemented in WsfZoneDefinition, WsfZoneReference, and WsfZoneSet.

Referenced by Clone(), wsf::Terrain::GetHeightExtremaIn(), WsfPlatformAvailability::PlatformIsAvailable(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ ProcessInput()

bool WsfZone::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.

Reimplemented in WsfZoneDefinition, and WsfZoneSet.

References WsfAuxDataEnabled::ProcessInput(), and SetFillColor().

Referenced by WsfZoneDefinition::ProcessInput(), and WsfZoneSet::ProcessInput().

◆ QueryInterface()

void * WsfZone::QueryInterface ( int aRole)
overridevirtual

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_ZONE.

◆ Reference()

virtual WsfGeoPoint WsfZone::Reference ( )
pure virtual

◆ SetFillColor() [1/2]

void WsfZone::SetFillColor ( const std::string & aColor)

◆ SetFillColor() [2/2]

void WsfZone::SetFillColor ( const UtColor & aColor)
inline

◆ SetGlobalName()

void WsfZone::SetGlobalName ( WsfStringId aGlobalName)
inline

Set the global model that this zone was cloned from.

◆ SetLineColor() [1/2]

void WsfZone::SetLineColor ( const std::string & aColor)

References SetLineColor().

Referenced by SetLineColor().

◆ SetLineColor() [2/2]

void WsfZone::SetLineColor ( const UtColor & aColor)
inline

Member Data Documentation

◆ cHUGE

double WsfZone::cHUGE = 9.9E20
staticconstexpr

◆ cSMALL

double WsfZone::cSMALL = -9.9E20
staticconstexpr

◆ cTYPE_KIND

const char* WsfZone::cTYPE_KIND = "zone"
staticconstexpr

◆ cUNSPECIFIED

◆ mArea

double WsfZone::mArea
protected

Referenced by Area(), WsfZone(), and WsfZone().

◆ mCentroid

◆ mIsInitialized

◆ mMaxAlt

◆ mMaxX

◆ mMaxY

◆ mMinAlt

◆ mMinX

◆ mMinY

◆ mModifierList

◆ mPlatformPtr

WsfPlatform* WsfZone::mPlatformPtr
protected

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