WSF
BallisticPath.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
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 DESIM_BALLISTIC_PATH
13#define DESIM_BALLISTIC_PATH
14
15#include "wsf_fires_export.h"
16
17#include <map>
18#include <string>
19
20class UtInput;
21#include "UtScriptClassDefine.hpp"
22class UtScriptContext;
23class WsfAero;
24class WsfDraw;
25#include "FiresMover.hpp"
26#include "UtEntity.hpp"
27#include "WsfGeoPoint.hpp"
28#include "WsfPlatform.hpp"
29#include "WsfScenario.hpp"
30
31namespace Fires
32{
33class FiresTables;
34
35class WSF_FIRES_EXPORT BallisticPath
36{
37public:
38 explicit BallisticPath(WsfSimulation* aSimPtr);
39 BallisticPath(const BallisticPath& aSrc);
40 virtual ~BallisticPath();
41
42 BallisticPath& operator=(const BallisticPath& aSrc) = delete;
43
44 bool IsTargetType(const std::string& aType);
45
46 virtual bool Update(const WsfTrack& aTrack);
47
48 virtual void Update(WsfPlatform* aPlatform);
49
50 virtual bool IsValid() const { return mIsInitialized; }
51
52 void Draw(WsfDraw& aDraw) const;
53
55 void SetIntegrationInterval(double aInterval) { mIntegrationInterval = aInterval; }
56
58 double GetApogeeTime() const { return mApogeeTime; }
59
61 double GetImpactTime() const { return mImpactTime; }
62
64 double GetStartTime() const { return mStartTime; }
65
66
67 bool GetLocationWCS(double aSimTime, double aLocWCS[3]) const;
68
69 bool GetVelocityWCS(double aSimTime, double aVelWCS[3]) const;
70
71 static void
72 GetRangeAndAltitude(const double aOriginLocWCS[3], const double aTargetLocWCS[3], double& aRange, double& aAltitude);
73
74 bool IsInitialized() const { return mIsInitialized; }
75
76 const WsfGeoPoint& GetImpactPoint() const { return mImpactPoint; }
77
78protected:
79 virtual void Integrate(double aElapsedTime, double aLocWCS[3], double aVelWCS[3]);
80
81private:
82 void UpdateFires(double aTime, FiresMover& aFiresMover, const double aLocWCS[3], const double aVelWCS[3]);
83
84 void UpdateSpherical(double aTime, const double aLocWCS[3], const double aVelWCS[3]);
85
86 bool WillImpact(double aAltitude);
87
88 void ComputeImpact(double aAlt1, double aAlt2);
89
90 WsfSimulation* mSimPtr;
91 const WsfScenario& mScenario;
92 FiresTables* mFiresTablesPtr;
93
94 UtEntity mTargetState;
95 UtStringId mType;
96 double mMass;
97 WsfAero* mTargetAeroPtr;
98 double mIntegrationInterval;
99 bool mIsInitialized;
100 bool mUseFiresExtrapolation;
101
102 // The following are spherical Earth values. Integration is done is done in the spherical
103 // frame to correspond with the frame used by WsfGuidedMover. Results are converted to
104 // ellipsoidal earth values for external use.
105 double mLocWCS[3];
106 double mVelWCS[3];
107 double mWCS_ToNED_Transform[3][3];
108
110 WsfGeoPoint mImpactPoint;
111
113 double mStartTime;
114
115 // ! The simulation time at which apogee occurs.
116 double mApogeeTime;
117
120 double mImpactTime;
121
122 struct Point
123 {
124 double mLocWCS[3];
125 double mVelWCS[3];
126 };
127
129 std::vector<Point> mPoints;
130};
131
132class WSF_FIRES_EXPORT ScriptBallisticPathClass : public UtScriptClass
133{
134public:
135 ScriptBallisticPathClass(const std::string& aClassName, UtScriptTypes* aTypesPtr);
136
137 ~ScriptBallisticPathClass() override;
138
139 // See the base class for a description of Create, Clone, and Destroy.
140
141 void* Create(const UtScriptContext& aContext) override;
142 void* Clone(void* aObjectPtr) override;
143 void Destroy(void* aObjectPtr) override;
144
145 // Each of the exported methods are defined as function objects.
146
149 UT_DECLARE_SCRIPT_METHOD(IsBallisticType);
154};
155}; // namespace Fires
156
157#endif
aObjectPtr Update(simTime)
aObjectPtr GetVelocityWCS(vel.GetData())
void SetIntegrationInterval(double aInterval)
Set the integration interval to be used for trajectory extrapolation.
Definition BallisticPath.hpp:55
double GetStartTime() const
Get the start time that the trajectory was calculated.
Definition BallisticPath.hpp:64
bool IsTargetType(const std::string &aType)
Definition BallisticPath.cpp:165
double GetImpactTime() const
Get the calculated impact time.
Definition BallisticPath.hpp:61
BallisticPath(WsfSimulation *aSimPtr)
Definition BallisticPath.cpp:36
BallisticPath & operator=(const BallisticPath &aSrc)=delete
bool IsInitialized() const
Definition BallisticPath.hpp:74
double GetApogeeTime() const
Get the time at which the trajectory is at its apogee.
Definition BallisticPath.hpp:58
virtual bool IsValid() const
Definition BallisticPath.hpp:50
const WsfGeoPoint & GetImpactPoint() const
Definition BallisticPath.hpp:76
Definition FiresMover.hpp:32
Definition FiresTables.hpp:31
void * Create(const UtScriptContext &aContext) override
Definition BallisticPath.cpp:578
UT_DECLARE_SCRIPT_METHOD(IsBallisticType)
void * Clone(void *aObjectPtr) override
Definition BallisticPath.cpp:584
ScriptBallisticPathClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition BallisticPath.cpp:556
void Destroy(void *aObjectPtr) override
Definition BallisticPath.cpp:590
Definition WsfAero.hpp:30
Provides the capability to draw shapes into the WSF replay file.
Definition WsfDraw.hpp:35
Definition WsfGeoPoint.hpp:29
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
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 represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Provide a top-level interface for including the fires library's types.
Definition BallisticPath.cpp:34
Copyrights Multiple, All Rights Reserved