6#ifndef SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORSPLINE_H
7#define SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORSPLINE_H
15namespace swift::misc::simulation
20 void anchor()
override;
27 :
CInterpolator(callsign, envProvider, setupProvider, aircraftProvider, logger)
41 std::array<double, 3>
x;
42 std::array<double, 3>
y;
43 std::array<double, 3>
z;
44 std::array<double, 3>
a;
45 std::array<double, 3>
gnd;
46 std::array<double, 3>
t;
47 std::array<double, 3>
dx;
48 std::array<double, 3>
dy;
49 std::array<double, 3>
dz;
50 std::array<double, 3>
da;
51 std::array<double, 3>
dgnd;
55 int size()
const {
return static_cast<int>(
x.size()); }
70 std::tuple<geo::CCoordinateGeodetic, aviation::CAltitude> interpolatePositionAndAltitude()
const override;
76 void setTimes(qint64 currentTimeMs,
double timeFraction, qint64 interpolatedTimeMs);
79 const PosArray &getPa()
const {
return m_pa; }
87 qint64 m_currentTimeMsSinceEpoc { -1 };
92 const IInterpolant &getInterpolant(SituationLog &log)
override;
96 bool updateElevations(
bool canSkip);
99 bool areAnyElevationsMissing()
const;
102 bool isAnySituationNearGroundRelevant()
const;
105 bool fillSituationsArray();
111 const CInterpolationAndRenderingSetupPerCallsign &setup =
112 CInterpolationAndRenderingSetupPerCallsign::null());
114 qint64 m_prevSampleAdjustedTime = 0;
115 qint64 m_nextSampleAdjustedTime = 0;
116 qint64 m_prevSampleTime = 0;
117 qint64 m_nextSampleTime = 0;
118 std::array<aviation::CAircraftSituation, 3> m_s;
119 CInterpolant m_interpolant;
Value object encapsulating information of an aircraft's situation.
Value object encapsulating information of a callsign.
Information about the ground status.
Specialized class for distance units (meter, foot, nautical miles).
Record internal state of interpolator for debugging.
CInterpolator(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *simEnvProvider, IInterpolationSetupProvider *setupProvider, IRemoteAircraftProvider *remoteProvider, CInterpolationLogger *logger)
Constructor.
Simple linear interpolator for pitch, bank, heading and groundspeed from start to end situation.
Cubic function that performs the actual interpolation.
const IInterpolatorPbh & pbh() const
Get the PBH interpolator.
CInterpolatorSpline(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *envProvider, IInterpolationSetupProvider *setupProvider, IRemoteAircraftProvider *aircraftProvider, CInterpolationLogger *logger=nullptr)
Constructor.
IInterpolant()=default
Default ctor.
Direct in memory access to interpolation setup, normally implemented by simulator.
Base class for Pitch-Bank-Heading interpolators.
Direct thread safe in memory access to remote aircraft.
Direct in memory access to elevation data.
Position arrays for interpolation.
std::array< double, 3 > dz
3 coordinates for spline interpolation
int size() const
Array size.
std::array< double, 3 > dx
3 coordinates for spline interpolation
static const PosArray & zeroPosArray()
Zero initialized position array.
std::array< double, 3 > a
3 coordinates for spline interpolation
std::array< double, 3 > y
3 coordinates for spline interpolation
std::array< double, 3 > t
3 coordinates for spline interpolation
std::array< double, 3 > x
3 coordinates for spline interpolation
std::array< double, 3 > gnd
3 coordinates for spline interpolation
std::array< double, 3 > dgnd
3 coordinates for spline interpolation
std::array< double, 3 > z
3 coordinates for spline interpolation
void initToZero()
Init all values to zero.
std::array< double, 3 > dy
3 coordinates for spline interpolation
std::array< double, 3 > da
3 coordinates for spline interpolation
#define SWIFT_MISC_EXPORT
Export a class or function from the library.