swift
Loading...
Searching...
No Matches
interpolatorlinear.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2014 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORLINEAR_H
7#define SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORLINEAR_H
8
9#include <QtGlobal>
10
16
17class QObject;
18
19namespace swift::misc
20{
21 namespace aviation
22 {
23 class CCallsign;
24 }
25 namespace simulation
26 {
29 {
30 void anchor() override;
31
32 public:
35 IInterpolationSetupProvider *setupProvider,
36 IRemoteAircraftProvider *remoteAircraftProvider, CInterpolationLogger *logger = nullptr)
37 : CInterpolator(callsign, simEnvProvider, setupProvider, remoteAircraftProvider, logger)
38 {}
39
42 {
43 public:
46 CInterpolant() = default;
47 CInterpolant(const aviation::CAircraftSituation &startSituation);
49 CInterpolant(const aviation::CAircraftSituation &startSituation,
50 const aviation::CAircraftSituation &endSituation, double timeFraction,
51 qint64 interpolatedTime);
53
55 std::tuple<geo::CCoordinateGeodetic, aviation::CAltitude>
56 interpolatePositionAndAltitude() const override;
57
60
62 const aviation::CAircraftSituation &getStartSituation() const { return m_startSituation; }
63
65 const aviation::CAircraftSituation &getEndSituation() const { return m_endSituation; }
66
68 const IInterpolatorPbh &pbh() const override { return m_pbh; }
69
70 private:
71 aviation::CAircraftSituation m_startSituation;
72 aviation::CAircraftSituation m_endSituation;
73 double m_simulationTimeFraction = 0.0;
75 };
76
78 const IInterpolant &getInterpolant(SituationLog &log) override;
79
80 private:
81 CInterpolant m_interpolant;
82 };
83 } // namespace simulation
84} // namespace swift::misc
85
86#endif // SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORLINEAR_H
Value object encapsulating information of an aircraft's situation.
Value object encapsulating information of a callsign.
Definition callsign.h:30
Information about the ground status.
Record internal state of interpolator for debugging.
CInterpolator(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *simEnvProvider, IInterpolationSetupProvider *setupProvider, IRemoteAircraftProvider *remoteProvider, CInterpolationLogger *logger)
Constructor.
const aviation::CAircraftSituation & getEndSituation() const
End situation.
aviation::COnGroundInfo interpolateGroundFactor() const
Interpolate the ground information/factor.
const aviation::CAircraftSituation & getStartSituation() const
Start situation.
const IInterpolatorPbh & pbh() const
Get the PBH interpolator.
std::tuple< geo::CCoordinateGeodetic, aviation::CAltitude > interpolatePositionAndAltitude() const
Perform the interpolation.
CInterpolatorLinear(const aviation::CCallsign &callsign, ISimulationEnvironmentProvider *simEnvProvider, IInterpolationSetupProvider *setupProvider, IRemoteAircraftProvider *remoteAircraftProvider, CInterpolationLogger *logger=nullptr)
Constructor.
Simple linear interpolator for pitch, bank, heading and groundspeed from start to end situation.
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.
Free functions in swift::misc.
Log entry for situation interpolation.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.