swift
interpolatorlinearpbh.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2018 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_INTERPOLATORLINEARPBH_H
7 #define SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORLINEARPBH_H
8 
10 #include "misc/aviation/heading.h"
11 #include "misc/pq/angle.h"
12 #include "misc/pq/speed.h"
14 #include "misc/swiftmiscexport.h"
15 
16 namespace swift::misc::simulation
17 {
20  {
21  public:
26  : m_startSituation(start), m_endSituation(end)
27  {}
28  CInterpolatorLinearPbh(double simulationTimeFraction, const aviation::CAircraftSituation &start,
31 
34  aviation::CHeading getHeading() const override;
35  physical_quantities::CAngle getPitch() const override;
36  physical_quantities::CAngle getBank() const override;
37  physical_quantities::CSpeed getGroundSpeed() const override;
38  const aviation::CAircraftSituation &getStartSituation() const override { return m_startSituation; }
39  const aviation::CAircraftSituation &getEndSituation() const override { return m_endSituation; }
41 
43  void setTimeFraction(double tf);
44 
45  private:
47  static physical_quantities::CAngle interpolateAngle(const physical_quantities::CAngle &begin,
49  double timeFraction0to1);
50 
51  double m_simulationTimeFraction = 0.0;
52  aviation::CAircraftSituation m_startSituation;
53  aviation::CAircraftSituation m_endSituation;
54  };
55 } // namespace swift::misc::simulation
56 
57 #endif // SWIFT_MISC_SIMULATION_INTERPOLATION_INTERPOLATORLINEARPBH_H
Value object encapsulating information of an aircraft's situation.
Heading as used in aviation, can be true or magnetic heading.
Definition: heading.h:41
Physical unit angle (radians, degrees)
Definition: angle.h:23
Simple linear interpolator for pitch, bank, heading and groundspeed from start to end situation.
CInterpolatorLinearPbh(const aviation::CAircraftSituation &start, const aviation::CAircraftSituation &end)
Constructor.
const aviation::CAircraftSituation & getStartSituation() const
Getter.
const aviation::CAircraftSituation & getEndSituation() const
Getter.
Base class for Pitch-Bank-Heading interpolators.
T::const_iterator begin(const LockFreeReader< T > &reader)
Non-member begin() and end() for so LockFree containers can be used in ranged for loops.
Definition: lockfree.h:332
T::const_iterator end(const LockFreeReader< T > &reader)
Non-member begin() and end() for so LockFree containers can be used in ranged for loops.
Definition: lockfree.h:338
#define SWIFT_MISC_EXPORT
Export a class or function from the library.