Files
qt5-legatus-legacy/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_point.h
T
2026-08-13 18:33:10 +02:00

52 lines
1.3 KiB
C++
Executable File

/**
* Commom base types * $Id$
* $HeadURL$
* $Author$
* Created by Norbert Thoden, ESVG, 2026-05-19
*/
#pragma once
#include <QVector>
#include <LtsUtilsCore/qpoint3d.h>
#include <Trajectory/trajectory_export.h>
namespace AreaEffectSimulation
{
/**
* @brief The TrajectoryPoint class was introduced for ADLER / SAA
* initially the positions are metrical and relative.
*/
class TrajectoryPoint
{
public:
TrajectoryPoint() = default;
TrajectoryPoint(double x, double y, double z, double _time = -1)
: position(x,y,z), time (_time)
{}
TrajectoryPoint(const LtsUtils::QPoint3D &_position, double _time)
: position(_position), time (_time)
{}
LtsUtils::QPoint3D position; // x,y are relative, z is above sea level; both metrical
double time {-1.0}; // relative
};
Q_DECL_CONSTEXPR inline bool operator==(const TrajectoryPoint &p1, const TrajectoryPoint &p2)
{
return p1.position == p2.position && p1.time == p2.time;
}
Q_DECL_CONSTEXPR inline bool operator!=(const TrajectoryPoint &p1, const TrajectoryPoint &p2)
{
return p1.position != p2.position || p1.time != p2.time;
}
} // namespace AreaEffectSimulation
// at global namespace:
TRAJECTORY_EXPORT std::ostream &operator<< (std::ostream &stream, const AreaEffectSimulation::TrajectoryPoint &value);