FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2006-2008 Marc Brooker and Michael Inggs
4// Copyright (c) 2008-present FERS Contributors (see AUTHORS.md).
5//
6// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
7
8/**
9 * @file platform.h
10 * @brief Defines the Platform class used in radar simulation.
11 */
12
13#pragma once
14
15#include <memory>
16#include <string>
17#include <utility>
18
19#include "core/config.h"
20#include "math/geometry_ops.h"
21#include "math/path.h"
22#include "math/rotation_path.h"
23
24namespace radar
25{
26 /**
27 * @class Platform
28 * @brief Represents a simulation platform with motion and rotation paths.
29 */
31 {
32 public:
33 /**
34 * @brief Constructs a Platform with the specified name.
35 *
36 * @param name The name of the platform.
37 */
38 explicit Platform(std::string name) noexcept :
39 _motion_path(std::make_unique<math::Path>()), _rotation_path(std::make_unique<math::RotationPath>()),
40 _name(std::move(name))
41 {
42 }
43
44 Platform(const Platform&) = delete;
45
46 Platform& operator=(const Platform&) = delete;
47
48 ~Platform() = default;
49
50 Platform(Platform&&) = default;
51
53
54 /**
55 * @brief Gets the motion path of the platform.
56 *
57 * @return A pointer to the motion path of the platform.
58 */
59 [[nodiscard]] math::Path* getMotionPath() const noexcept { return _motion_path.get(); }
60
61 /**
62 * @brief Gets the rotation path of the platform.
63 *
64 * @return A pointer to the rotation path of the platform.
65 */
66 [[nodiscard]] math::RotationPath* getRotationPath() const noexcept { return _rotation_path.get(); }
67
68 /**
69 * @brief Gets the position of the platform at a specific time.
70 *
71 * @param time The time for which the position is requested.
72 * @return A vector representing the position of the platform.
73 */
74 [[nodiscard]] math::Vec3 getPosition(const RealType time) const { return _motion_path->getPosition(time); }
75
76 /**
77 * @brief Gets the rotation of the platform at a specific time.
78 *
79 * @param time The time for which the rotation is requested.
80 * @return A vector representing the rotation of the platform.
81 */
82 [[nodiscard]] math::SVec3 getRotation(const RealType time) const { return _rotation_path->getPosition(time); }
83
84 /**
85 * @brief Gets the name of the platform.
86 *
87 * @return A constant reference to the name of the platform.
88 */
89 [[nodiscard]] const std::string& getName() const noexcept { return _name; }
90
91 /**
92 * @brief Sets the rotation path of the platform.
93 *
94 * @param path A unique pointer to the new rotation path.
95 */
96 void setRotationPath(std::unique_ptr<math::RotationPath> path) noexcept { _rotation_path = std::move(path); }
97
98 /**
99 * @brief Sets the motion path of the platform.
100 *
101 * @param path A unique pointer to the new motion path.
102 */
103 void setMotionPath(std::unique_ptr<math::Path> path) noexcept { _motion_path = std::move(path); }
104
105 private:
106 std::unique_ptr<math::Path> _motion_path; ///< The motion path of the platform.
107 std::unique_ptr<math::RotationPath> _rotation_path; ///< The rotation path of the platform.
108 std::string _name; ///< The name of the platform.
109 };
110}
Represents a path with coordinates and allows for various interpolation methods.
Definition path.h:30
Manages rotational paths with different interpolation techniques.
A class representing a vector in spherical coordinates.
A class representing a vector in rectangular coordinates.
Represents a simulation platform with motion and rotation paths.
Definition platform.h:31
math::Path * getMotionPath() const noexcept
Gets the motion path of the platform.
Definition platform.h:59
math::Vec3 getPosition(const RealType time) const
Gets the position of the platform at a specific time.
Definition platform.h:74
Platform(Platform &&)=default
const std::string & getName() const noexcept
Gets the name of the platform.
Definition platform.h:89
~Platform()=default
void setMotionPath(std::unique_ptr< math::Path > path) noexcept
Sets the motion path of the platform.
Definition platform.h:103
math::SVec3 getRotation(const RealType time) const
Gets the rotation of the platform at a specific time.
Definition platform.h:82
Platform & operator=(Platform &&)=default
math::RotationPath * getRotationPath() const noexcept
Gets the rotation path of the platform.
Definition platform.h:66
Platform & operator=(const Platform &)=delete
Platform(std::string name) noexcept
Constructs a Platform with the specified name.
Definition platform.h:38
void setRotationPath(std::unique_ptr< math::RotationPath > path) noexcept
Sets the rotation path of the platform.
Definition platform.h:96
Platform(const Platform &)=delete
Global configuration file for the project.
double RealType
Type for real numbers.
Definition config.h:27
Classes and operations for 3D geometry.
Provides the definition and functionality of the Path class for handling coordinate-based paths with ...
Defines the RotationPath class for handling rotational paths with different interpolation types.