WSF
WsfStandardOpticalReflectivity.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 2003-2015 The Boeing 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 WSFSTANDARDOPTICALREFLECTIVITY_HPP
13#define WSFSTANDARDOPTICALREFLECTIVITY_HPP
14
15#include <memory>
16#include <vector>
17
18class UtAzElLookup;
19class UtAzElTable;
20#include "wsf_mil_export.h"
21
22#include "UtAzElTypes.hpp"
24
26
28{
29public:
30 static WsfOpticalReflectivity* ObjectFactory(const std::string& aTypeName);
31
33
34 WsfStandardOpticalReflectivity* Clone() const override;
35
36 bool InitializeType() override;
37
38 std::vector<WsfStringId> GetStateNames() const override;
39
40 bool ProcessInput(UtInput& aInput) override;
41
42 float GetOpticalReflectivity(double aSimTime,
43 WsfStringId aStateId,
44 double aWavelength,
45 double aTgtToXmtrAz,
46 double aTgtToXmtrEl,
47 double aTgtToRcvrAz,
48 double aTgtToRcvrEl) override;
49
51 class Table
52 {
53 public:
54 Table(double aWavelengthLimit, UtAzElTable* aTablePtr);
55
57 UtAzElTable* mTablePtr;
58 };
59
61 using TableSet = std::vector<Table>;
62
64 class State
65 {
66 public:
67 State(WsfStringId aStateId);
68
71 };
72
73 using States = std::vector<State>;
74
75 const States& GetStates() const;
76
77private:
78 class SharedData
79 {
80 using InterpolationType = ut::azel::InterpolationType;
81
82 public:
83 SharedData() = default;
84 ~SharedData();
85
87
88 bool IsA_ValidState(WsfStringId aId) const;
89
90 bool ProcessInput(UtInput& aInput, WsfStandardOpticalReflectivity& aObject);
91
92 bool AddTable(UtAzElTable* aTablePtr, WsfStringId aStateId, double aWavelengthLimit);
93
94 void SelectTable(UtAzElLookup& aContext, WsfStringId aState, double aWavelength);
95
97
98 WsfStringId mCurrentStateId{"default"};
99 double mCurrentWavelengthLimit{1.0E+30};
101
102 size_t mDefaultStateIndex{0};
103 States mStates;
104
105 bool mInterpolateTables{true};
106 InterpolationType mInterpolationType{InterpolationType::cLinear};
107
108 private:
109 // the following methods were added to simplify ProcessInput
110 void ProcessInputState(UtInput& aInput, WsfStandardOpticalReflectivity& aObject);
111
112 void ProcessInputWavelengthLimit(UtInput& aInput, WsfStandardOpticalReflectivity& aObject);
113
114 void ProcessInputQuery(UtInput& aInput, WsfStandardOpticalReflectivity& aObject);
115
116 bool ProcessInputTableData(UtInput& aInput, WsfStandardOpticalReflectivity& aObject);
117 };
118
119 std::shared_ptr<SharedData> mSharedDataPtr{new SharedData()};
120};
121
122#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
virtual float GetOpticalReflectivity(double aSimTime, WsfStringId aStateId, double aWavelength, double aTgtToXmtrAz, double aTgtToXmtrEl, double aTgtToRcvrAz, double aTgtToRcvrEl)=0
WsfOpticalReflectivity * Clone() const override=0
WsfOpticalReflectivity()
Definition WsfOpticalReflectivity.cpp:22
bool ProcessInput(UtInput &aInput) override
Definition WsfSignature.cpp:74
virtual bool InitializeType()
Definition WsfSignature.cpp:40
virtual std::vector< WsfStringId > GetStateNames() const
get the list of all valid states belonging to the signature
Definition WsfSignature.hpp:43
virtual bool IsA_ValidState(WsfStringId aId) const
Definition WsfSignature.cpp:62
WsfStringId mStateId
Definition WsfStandardOpticalReflectivity.hpp:69
TableSet mTables
Definition WsfStandardOpticalReflectivity.hpp:70
State(WsfStringId aStateId)
Definition WsfStandardOpticalReflectivity.cpp:436
UtAzElTable * mTablePtr
A pointer to the actual table data for this table.
Definition WsfStandardOpticalReflectivity.hpp:57
double mWavelengthLimit
The upper wavelength to which this table applies.
Definition WsfStandardOpticalReflectivity.hpp:56
Table(double aWavelengthLimit, UtAzElTable *aTablePtr)
Definition WsfStandardOpticalReflectivity.cpp:429
const States & GetStates() const
Definition WsfStandardOpticalReflectivity.cpp:99
bool InitializeType() override
Definition WsfStandardOpticalReflectivity.cpp:47
static WsfOpticalReflectivity * ObjectFactory(const std::string &aTypeName)
Factory method called by WsfOpticalReflectivityTypes.
Definition WsfStandardOpticalReflectivity.cpp:28
bool ProcessInput(UtInput &aInput) override
Definition WsfStandardOpticalReflectivity.cpp:64
std::vector< State > States
Definition WsfStandardOpticalReflectivity.hpp:73
std::vector< Table > TableSet
A 'TableSet' is just a collection of 'Table's.
Definition WsfStandardOpticalReflectivity.hpp:61
Copyrights Multiple, All Rights Reserved