FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
object.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 object.h
10 * @brief Base class for all physical objects in the radar system.
11 */
12
13#pragma once
14
15#include "platform.h"
16
17namespace radar
18{
19 /**
20 * @class Object
21 * @brief Represents a physical object in the radar system.
22 */
23 class Object
24 {
25 public:
26 /**
27 * @brief Constructor for Object.
28 *
29 * @param platform Pointer to the Platform object associated with this Object.
30 * @param name The name of the Object.
31 */
32 Object(Platform* platform, std::string name) noexcept : _platform(platform), _name(std::move(name)) {}
33
34 virtual ~Object() = default;
35 Object(const Object&) = delete;
36 Object& operator=(const Object&) = delete;
37 Object(Object&&) noexcept = default;
38 Object& operator=(Object&&) noexcept = default;
39
40 /**
41 * @brief Retrieves the position of the object.
42 *
43 * @param time The time at which to get the position of the object.
44 * @return A math::Vec3 representing the position of the object.
45 */
46 [[nodiscard]] math::Vec3 getPosition(const RealType time) const { return _platform->getPosition(time); }
47
48 /**
49 * @brief Retrieves the rotation of the object.
50 *
51 * @param time The time at which to get the rotation of the object.
52 * @return A math::SVec3 representing the rotation of the object.
53 */
54 [[nodiscard]] math::SVec3 getRotation(const RealType time) const { return _platform->getRotation(time); }
55
56 /**
57 * @brief Retrieves the associated platform of the object.
58 *
59 * @return A pointer to the Platform object associated with this object.
60 */
61 [[nodiscard]] Platform* getPlatform() const noexcept { return _platform; }
62
63 /**
64 * @brief Retrieves the name of the object.
65 *
66 * @return A const reference to the string representing the object's name.
67 */
68 [[nodiscard]] const std::string& getName() const noexcept { return _name; }
69
70 private:
71 Platform* _platform; ///< Pointer to the Platform object associated with this Object.
72 std::string _name; ///< The name of the Object.
73 };
74}
A class representing a vector in spherical coordinates.
Represents a physical object in the radar system.
Definition object.h:24
const std::string & getName() const noexcept
Retrieves the name of the object.
Definition object.h:68
Platform * getPlatform() const noexcept
Retrieves the associated platform of the object.
Definition object.h:61
Object & operator=(const Object &)=delete
math::SVec3 getRotation(const RealType time) const
Retrieves the rotation of the object.
Definition object.h:54
math::Vec3 getPosition(const RealType time) const
Retrieves the position of the object.
Definition object.h:46
Object(const Object &)=delete
Object(Object &&) noexcept=default
virtual ~Object()=default
Object(Platform *platform, std::string name) noexcept
Constructor for Object.
Definition object.h:32
Represents a simulation platform with motion and rotation paths.
Definition platform.h:31
math::Vec3 getPosition(const RealType time) const
Gets the position of the platform at a specific time.
Definition platform.h:74
math::SVec3 getRotation(const RealType time) const
Gets the rotation of the platform at a specific time.
Definition platform.h:82
double RealType
Type for real numbers.
Definition config.h:27
Definition coord.h:18
Defines the Platform class used in radar simulation.