WSF
wsf::coverage::RectangularGrid Class Referenceabstract

#include <WsfCoverageRectangularGrid.hpp>

Inheritance diagram for wsf::coverage::RectangularGrid:
Collaboration diagram for wsf::coverage::RectangularGrid:

Public Member Functions

 RectangularGrid (const WsfScenario &aScenario)
 RectangularGrid (const RectangularGrid &aOther)
 ~RectangularGrid () override=default
bool ProcessInput (UtInput &aInput) override
void PreparePlatforms (WsfSimulation &aSimulation) override
const PointGetPoint (PointId aPointId) const override
std::size_t GetSize () const override
void Invoke (GridAction &aAction) const override
GridAsset GetAsset (PointId aPointId) const override
GridAsset GetAsset (const std::string &aPlatformName) const override
void HasNullDevice (bool &aAnyNull, bool &aAllNull) const override
bool CreatesNewPlatforms () const override
bool IsStructured () const override
std::pair< std::size_t, std::size_t > GetComponentSizes (std::size_t aComponentIndex) const override
std::pair< std::size_t, std::size_t > GetPointIndices (PointId aPointId) const override
const std::string & GetAssetPlatformType () const
 Return the platform type of the assets for this grid.
const std::string & GetAssetDeviceName () const
 Return the device name for the assets for this grid.
double GetAltitude () const
 Return the altitude of the grid points.
bool IsAltitudeAGL () const
double GetLatitudeOriginDeg () const
 Get the origin point in latitude.
double GetLongitudeOriginDeg () const
 Get the origin point in longitude.
Public Member Functions inherited from wsf::coverage::Grid
 Grid (const WsfScenario &aScenario)
 Grid (const Grid &aOther)=default
 ~Grid () override=default
GridClone () const override=0
virtual std::size_t GetNumComponents () const
virtual std::string GetComponentName (std::size_t aComponentIndex) const
 Return the name of the specified grid component.
virtual void InvokeOnComponent (GridAction &aAction, std::size_t aComponentIndex) const
 Invoke the given aAction on the points of the specified grid component.
void SetUsedFlag ()
bool IsUsed () const
bool Initialize ()
void CategorizeAssets (const WsfSimulation &aSimulation, const std::string &aCategory) const
bool IsInitialized () const
 Return if this Grid has been initialized.
const ut::CentralBody & GetCentralBody () const
 Return the central body to which this grid's point locations refer.
void SetCentralBody (const ut::CentralBody &aCentralBody)
 Set the central body of this grid.
const std::string & GetGridDataFileName () const
 Return the configured grid data file name.
bool GetSuppressGridPlatforms () const
 Return if this grid is suppressing grid platforms.
void SetSuppressGridPlatforms (bool aSuppress)
 Set if this grid suppresses grid platforms.
bool WriteGridDataFile (TextOutputWriter &aWriter) const
bool WriteGridDataFile () 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)

Protected Member Functions

virtual std::vector< double > GetLatitudeLoopValues () const =0
virtual std::vector< double > GetLongitudeLoopValues (double aLatitudeDeg) const =0
bool CreateRectangularGrid ()
std::string GetPlatformName (PointId aPointId) const
Protected Member Functions inherited from wsf::coverage::Grid
virtual bool InitializeP ()=0
PointId GetNextAvailableId ()
const WsfScenarioGetScenario () const
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Protected Attributes

std::string mPlatformType {}
std::string mDeviceName {}
double mAltitude {0.0}
double mLatOriginDeg {}
double mLonOriginDeg {}
size_t mLatSize {}
size_t mLonSize {}
std::map< PointId, PointmPoints {}
std::map< PointId, std::pair< std::size_t, std::size_t > > mIndices {}
std::map< std::string, GridAssetmAssets {}
bool mOriginSet {false}
bool mAltitudeAGL {false}

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.

Detailed Description

A grid that forms a rectangular lattice of points, with the details of the placement of those points left up to the subclasses.

Constructor & Destructor Documentation

◆ RectangularGrid() [1/2]

wsf::coverage::RectangularGrid::RectangularGrid ( const WsfScenario & aScenario)
inlineexplicit

◆ RectangularGrid() [2/2]

wsf::coverage::RectangularGrid::RectangularGrid ( const RectangularGrid & aOther)

◆ ~RectangularGrid()

wsf::coverage::RectangularGrid::~RectangularGrid ( )
overridedefault

Member Function Documentation

◆ CreateRectangularGrid()

◆ CreatesNewPlatforms()

bool wsf::coverage::RectangularGrid::CreatesNewPlatforms ( ) const
inlineoverridevirtual

Return if the grid creates new platforms during initialization.

A grid should either create new platforms, or use existing platforms. This method returns if this grid creates new platforms. The behavior of some coverage classes will vary depending on the result of this method.

Returns
- true if this grid creates new platforms during initialization; false if it uses existing platforms.

Implements wsf::coverage::Grid.

◆ GetAltitude()

double wsf::coverage::RectangularGrid::GetAltitude ( ) const
inline

Return the altitude of the grid points.

References mAltitude.

◆ GetAsset() [1/2]

GridAsset wsf::coverage::RectangularGrid::GetAsset ( const std::string & aPlatformName) const
overridevirtual

Return a grid asset for the given platform.

This returns the grid asset associated with the platform that has the given aPlatformName. If there is no such asset, this will return an invalid grid asset.

Parameters
aPlatformName- The name of one of this grid's asset platform.
Returns
- The corresponding grid asset if it exists; an invalid grid asset otherwise.

Implements wsf::coverage::Grid.

References wsf::coverage::cINVALID_POINT_ID, and mAssets.

◆ GetAsset() [2/2]

GridAsset wsf::coverage::RectangularGrid::GetAsset ( PointId aPointId) const
overridevirtual

Return a grid asset for the point with the given ID.

This returns the grid asset for the point with the given aPointId. If there is no such point, this will return an invalid grid asset.

Parameters
aPointId- The ID of a point in this grid.
Returns
- The corresponding grid asset if it exists; an invalid grid asset otherwise.

Implements wsf::coverage::Grid.

References GetAsset(), and GetPlatformName().

Referenced by GetAsset().

◆ GetAssetDeviceName()

const std::string & wsf::coverage::RectangularGrid::GetAssetDeviceName ( ) const
inline

Return the device name for the assets for this grid.

References mDeviceName.

◆ GetAssetPlatformType()

const std::string & wsf::coverage::RectangularGrid::GetAssetPlatformType ( ) const
inline

Return the platform type of the assets for this grid.

References mPlatformType.

◆ GetComponentSizes()

std::pair< std::size_t, std::size_t > wsf::coverage::RectangularGrid::GetComponentSizes ( std::size_t aComponentIndex) const
overridevirtual

Return the number of points in the specified grid component.

This method returns the size of the structured grid as the N-S and E-W size of the grid in the first and second components of the returned pair, but only if this grid returns true from IsStructured. Otherwise, the size of the component is returned in the first component, and a 1 is returned in the second component.

Parameters
aComponentIndexThe component whose size is being queried.
Returns
A pair containing the N-S and E-W number of points in the structured grid (respectively), or the size of the component in the first component and 1 in the second component if the grid is not structured.

Reimplemented from wsf::coverage::Grid.

References mLatSize, and mLonSize.

◆ GetLatitudeLoopValues()

virtual std::vector< double > wsf::coverage::RectangularGrid::GetLatitudeLoopValues ( ) const
protectedpure virtual

Referenced by CreateRectangularGrid().

◆ GetLatitudeOriginDeg()

double wsf::coverage::RectangularGrid::GetLatitudeOriginDeg ( ) const
inline

Get the origin point in latitude.

References mLatOriginDeg.

◆ GetLongitudeLoopValues()

virtual std::vector< double > wsf::coverage::RectangularGrid::GetLongitudeLoopValues ( double aLatitudeDeg) const
protectedpure virtual

◆ GetLongitudeOriginDeg()

double wsf::coverage::RectangularGrid::GetLongitudeOriginDeg ( ) const
inline

Get the origin point in longitude.

References mLonOriginDeg.

◆ GetPlatformName()

std::string wsf::coverage::RectangularGrid::GetPlatformName ( PointId aPointId) const
protected

◆ GetPoint()

const Point * wsf::coverage::RectangularGrid::GetPoint ( PointId aPointId) const
overridevirtual

Return the Point at the given index if it exists.

This will return the Point with the given aPointId if such a point exists. This will return nullptr if this Grid has not been initialized.

Parameters
aPointId- The ID of the point to retrieve.
Returns
- The Point if it exists; nullptr otherwise.

Implements wsf::coverage::Grid.

References mPoints.

Referenced by ~RectangularGrid().

◆ GetPointIndices()

std::pair< std::size_t, std::size_t > wsf::coverage::RectangularGrid::GetPointIndices ( PointId aPointId) const
overridevirtual

Return the structured index of the point with the given aPointId.

This returns the indices of the point with the given aPointId in the structure of the grid. If the grid is not structured, this will return a pair containing two zeros. The returned indices will each be in the range [0, N) where N is the respective component of the value returned by GetComponentSizes. If the given aPointId does not refer to a point in this grid, this will return a pair with out of bounds indices (they are larger than the return values from GetComponentSizes).

Parameters
aPointIdThe id of the point whose structure indices are requested.
Returns
The structure indices of the point for structured grids; a pair with two zeros otherwise.

Reimplemented from wsf::coverage::Grid.

References mIndices, mLatSize, and mLonSize.

◆ GetSize()

std::size_t wsf::coverage::RectangularGrid::GetSize ( ) const
inlineoverridevirtual

Return the number of Points in this Grid.

This will return the number of Points in this Grid. This will return 0 if this Grid has not been initialized.

Returns
- The number of Points in this grid.

Implements wsf::coverage::Grid.

References mPoints.

Referenced by wsf::coverage::ZoneBasedGrid::PreparePlatforms().

◆ HasNullDevice()

void wsf::coverage::RectangularGrid::HasNullDevice ( bool & aAnyNull,
bool & aAllNull ) const
overridevirtual

Return if this grid's assets have null devices.

This will determine if this grid has any asset with a null device, and set aAnyNull accordingly. This will also determing if all of this grid's assets have null devices, and set aAllNull accordingly.

Parameters
aAnyNull[out] - Does any asset have a null device.
aAllNull[out] - Do all assets have a null device.

Implements wsf::coverage::Grid.

References wsf::coverage::cNULL_COVERAGE_DEVICE_NAME, and mDeviceName.

◆ Invoke()

void wsf::coverage::RectangularGrid::Invoke ( GridAction & aAction) const
overridevirtual

Invoke the given action on every Point in this Grid.

This method invokes the given action for every Point in this Grid. If this method is used before this Grid is initialized, this method will do nothing.

Parameters
aAction- The action to invoke for every Point in this Grid.

Implements wsf::coverage::Grid.

References wsf::coverage::GridAction::Call(), and mPoints.

Referenced by wsf::coverage::ZoneBasedGrid::PreparePlatforms().

◆ IsAltitudeAGL()

bool wsf::coverage::RectangularGrid::IsAltitudeAGL ( ) const
inline

Return if the altitude reference of the grid points is AGL.

Returns
true if the altitude reference is AGL; false if the reference is MSL.

References mAltitudeAGL.

◆ IsStructured()

bool wsf::coverage::RectangularGrid::IsStructured ( ) const
inlineoverridevirtual

Return if the grid is structured.

Structured grids are those grids that have some positional organization of the grid points. Most grids are structured. For an example of an unstructured grid, see the ExistingPlatformGrid. To prevent a subclass from participating in overlay output from a Coverage object, IsStructured should return false.

Returns
true if the grid has some structure to its points; false otherwise.

Reimplemented from wsf::coverage::Grid.

◆ PreparePlatforms()

void wsf::coverage::RectangularGrid::PreparePlatforms ( WsfSimulation & aSimulation)
overridevirtual

Prepare the platforms for this grid.

This method will create or modify the platforms associated with this grid object. In particular, this should mark created platforms as private so they are not sent over DIS. This should also set the side of created platforms so they might be easily removed from the visual tools.

Parameters
aSimulation- The simulation in which this grid's platforms will participate.

Implements wsf::coverage::Grid.

Reimplemented in wsf::coverage::ZoneBasedGrid.

References WsfSimulation::AddPlatform(), WsfExtInterface::Find(), WsfObjectTypeList< T >::Find(), wsf::coverage::Grid::GetCentralBody(), WsfObject::GetName(), GetPlatformName(), WsfScenario::GetPlatformTypes(), WsfSimulation::GetScenario(), wsf::coverage::Grid::GetSuppressGridPlatforms(), mPlatformType, and mPoints.

Referenced by ~RectangularGrid().

◆ ProcessInput()

bool wsf::coverage::RectangularGrid::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 wsf::coverage::Grid.

Reimplemented in wsf::coverage::ZoneBasedGrid.

References mAltitude, mAltitudeAGL, mDeviceName, mLatOriginDeg, mLonOriginDeg, mOriginSet, mPlatformType, and wsf::coverage::Grid::ProcessInput().

Referenced by wsf::coverage::DistanceSteppedGrid::ProcessInput(), wsf::coverage::LatLonGrid::ProcessInput(), and ~RectangularGrid().

Member Data Documentation

◆ mAltitude

double wsf::coverage::RectangularGrid::mAltitude {0.0}
protected

◆ mAltitudeAGL

bool wsf::coverage::RectangularGrid::mAltitudeAGL {false}
protected

◆ mAssets

std::map<std::string, GridAsset> wsf::coverage::RectangularGrid::mAssets {}
protected

◆ mDeviceName

std::string wsf::coverage::RectangularGrid::mDeviceName {}
protected

◆ mIndices

std::map<PointId, std::pair<std::size_t, std::size_t> > wsf::coverage::RectangularGrid::mIndices {}
protected

◆ mLatOriginDeg

double wsf::coverage::RectangularGrid::mLatOriginDeg {}
protected

◆ mLatSize

size_t wsf::coverage::RectangularGrid::mLatSize {}
protected

◆ mLonOriginDeg

double wsf::coverage::RectangularGrid::mLonOriginDeg {}
protected

◆ mLonSize

size_t wsf::coverage::RectangularGrid::mLonSize {}
protected

◆ mOriginSet

◆ mPlatformType

std::string wsf::coverage::RectangularGrid::mPlatformType {}
protected

◆ mPoints

std::map<PointId, Point> wsf::coverage::RectangularGrid::mPoints {}
protected

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