WSF
WsfStandardInherentContrast.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 WSFSTANDARDINHERENTCONTRAST_HPP
13#define WSFSTANDARDINHERENTCONTRAST_HPP
14
15#include "wsf_mil_export.h"
16
17#include <memory>
18#include <vector>
19
20#include "UtAzElTypes.hpp"
21
22class UtAzElLookup;
23class UtAzElTable;
25
27
29{
30public:
31 static WsfInherentContrast* ObjectFactory(const std::string& aTypeName);
32
34
35 WsfStandardInherentContrast* Clone() const override;
36
37 bool InitializeType() override;
38
39 std::vector<WsfStringId> GetStateNames() const override;
40
41 bool ProcessInput(UtInput& aInput) override;
42
43 float GetInherentContrast(WsfStringId aStateId, double aAzimuth, double aElevation) override;
44
45private:
46 class State
47 {
48 public:
49 State(WsfStringId aStateId, UtAzElTable* aTablePtr);
50
51 WsfStringId mStateId;
52 UtAzElTable* mTablePtr;
53 };
54
55 using StateIndex = std::vector<State>::size_type;
56
57 class SharedData
58 {
59 using InterpolationType = ut::azel::InterpolationType;
60
61 public:
62 SharedData() = default;
63 ~SharedData();
64
65 bool InitializeType(WsfObject& aBase);
66
67 bool IsA_ValidState(WsfStringId aId) const;
68
69 bool ProcessInput(UtInput& aInput, WsfObject& aBase);
70
71 bool AddTable(UtAzElTable* aTablePtr, WsfStringId aStateId);
72
73 void SelectTable(UtAzElLookup& aContext, WsfStringId aStateId);
74
75 WsfStringId mCurrentStateId{"default"};
76
77 StateIndex mDefaultStateIndex{0};
78 std::vector<State> mStates;
79
80 bool mInterpolateTables{true};
81 InterpolationType mInterpolationType{InterpolationType::cLinear};
82 };
83
84 std::shared_ptr<SharedData> mSharedDataPtr{new SharedData()};
85};
86
87#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
WsfInherentContrast * Clone() const override=0
virtual float GetInherentContrast(WsfStringId aStateId, double aAzimuth, double aElevation)=0
WsfInherentContrast()
Definition WsfInherentContrast.cpp:22
Definition WsfObject.hpp:40
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
static WsfInherentContrast * ObjectFactory(const std::string &aTypeName)
Factory method called by WsfInherentContrastTypes.
Definition WsfStandardInherentContrast.cpp:25
Copyrights Multiple, All Rights Reserved