WSF
WsfCoverageRectangularGrid.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFCOVERAGERECTANGULARGRID_HPP
13#define WSFCOVERAGERECTANGULARGRID_HPP
14
15#include "wsf_coverage_export.h"
16
17#include <map>
18#include <string>
19
20#include "WsfCoverageGrid.hpp"
21
22namespace wsf
23{
24namespace coverage
25{
26
29class WSF_COVERAGE_EXPORT RectangularGrid : public Grid
30{
31public:
32 explicit RectangularGrid(const WsfScenario& aScenario)
33 : Grid(aScenario)
34 {
35 }
36 RectangularGrid(const RectangularGrid& aOther);
37 ~RectangularGrid() override = default;
38
39 bool ProcessInput(UtInput& aInput) override;
40 void PreparePlatforms(WsfSimulation& aSimulation) override;
41 const Point* GetPoint(PointId aPointId) const override;
42 std::size_t GetSize() const override { return mPoints.size(); }
43 void Invoke(GridAction& aAction) const override;
44 GridAsset GetAsset(PointId aPointId) const override;
45 GridAsset GetAsset(const std::string& aPlatformName) const override;
46 void HasNullDevice(bool& aAnyNull, bool& aAllNull) const override;
47 bool CreatesNewPlatforms() const override { return true; }
48 bool IsStructured() const override { return true; }
49 std::pair<std::size_t, std::size_t> GetComponentSizes(std::size_t aComponentIndex) const override;
50 std::pair<std::size_t, std::size_t> GetPointIndices(PointId aPointId) const override;
51
53 const std::string& GetAssetPlatformType() const { return mPlatformType; }
54
56 const std::string& GetAssetDeviceName() const { return mDeviceName; }
57
59 double GetAltitude() const { return mAltitude; }
60
64 bool IsAltitudeAGL() const { return mAltitudeAGL; }
65
67 double GetLatitudeOriginDeg() const { return mLatOriginDeg; }
68
70 double GetLongitudeOriginDeg() const { return mLonOriginDeg; }
71
72protected:
73 virtual std::vector<double> GetLatitudeLoopValues() const = 0;
74 virtual std::vector<double> GetLongitudeLoopValues(double aLatitudeDeg) const = 0;
76 std::string GetPlatformName(PointId aPointId) const;
77
78 std::string mPlatformType{};
79 std::string mDeviceName{};
80 double mAltitude{0.0};
81 double mLatOriginDeg{};
82 double mLonOriginDeg{};
83 size_t mLatSize{};
84 size_t mLonSize{};
85 std::map<PointId, Point> mPoints{};
86 std::map<PointId, std::pair<std::size_t, std::size_t>> mIndices{};
87 std::map<std::string, GridAsset> mAssets{};
88 bool mOriginSet{false};
89 bool mAltitudeAGL{false};
90};
91
92} // namespace coverage
93} // namespace wsf
94
95#endif // WSFCOVERAGERECTANGULARGRID_HPP
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
An object that can be invoked for each point in a grid.
Definition WsfCoverageGridAction.hpp:30
Definition WsfCoverageAsset.hpp:37
Grid(const WsfScenario &aScenario)
Definition WsfCoverageGrid.cpp:31
A point in a coverage grid.
Definition WsfCoverageGridPoint.hpp:40
Definition WsfCoverageRectangularGrid.hpp:30
const std::string & GetAssetPlatformType() const
Return the platform type of the assets for this grid.
Definition WsfCoverageRectangularGrid.hpp:53
std::map< PointId, std::pair< std::size_t, std::size_t > > mIndices
Definition WsfCoverageRectangularGrid.hpp:86
size_t mLonSize
Definition WsfCoverageRectangularGrid.hpp:84
std::map< std::string, GridAsset > mAssets
Definition WsfCoverageRectangularGrid.hpp:87
bool CreateRectangularGrid()
Definition WsfCoverageRectangularGrid.cpp:192
double GetLongitudeOriginDeg() const
Get the origin point in longitude.
Definition WsfCoverageRectangularGrid.hpp:70
bool CreatesNewPlatforms() const override
Definition WsfCoverageRectangularGrid.hpp:47
virtual std::vector< double > GetLongitudeLoopValues(double aLatitudeDeg) const =0
virtual std::vector< double > GetLatitudeLoopValues() const =0
std::string mPlatformType
Definition WsfCoverageRectangularGrid.hpp:78
const std::string & GetAssetDeviceName() const
Return the device name for the assets for this grid.
Definition WsfCoverageRectangularGrid.hpp:56
std::size_t GetSize() const override
Definition WsfCoverageRectangularGrid.hpp:42
bool mAltitudeAGL
Definition WsfCoverageRectangularGrid.hpp:89
double mLonOriginDeg
Definition WsfCoverageRectangularGrid.hpp:82
double mAltitude
Definition WsfCoverageRectangularGrid.hpp:80
~RectangularGrid() override=default
void PreparePlatforms(WsfSimulation &aSimulation) override
Definition WsfCoverageRectangularGrid.cpp:93
std::string GetPlatformName(PointId aPointId) const
Definition WsfCoverageRectangularGrid.cpp:236
double mLatOriginDeg
Definition WsfCoverageRectangularGrid.hpp:81
bool IsStructured() const override
Definition WsfCoverageRectangularGrid.hpp:48
size_t mLatSize
Definition WsfCoverageRectangularGrid.hpp:83
bool mOriginSet
Definition WsfCoverageRectangularGrid.hpp:88
std::map< PointId, Point > mPoints
Definition WsfCoverageRectangularGrid.hpp:85
std::string mDeviceName
Definition WsfCoverageRectangularGrid.hpp:79
bool IsAltitudeAGL() const
Definition WsfCoverageRectangularGrid.hpp:64
double GetAltitude() const
Return the altitude of the grid points.
Definition WsfCoverageRectangularGrid.hpp:59
bool ProcessInput(UtInput &aInput) override
Definition WsfCoverageRectangularGrid.cpp:50
const Point * GetPoint(PointId aPointId) const override
Definition WsfCoverageRectangularGrid.cpp:135
RectangularGrid(const WsfScenario &aScenario)
Definition WsfCoverageRectangularGrid.hpp:32
double GetLatitudeOriginDeg() const
Get the origin point in latitude.
Definition WsfCoverageRectangularGrid.hpp:67
Definition WsfCoverage.cpp:35
std::uint64_t PointId
Definition WsfCoverageGridPoint.hpp:33
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved