Class astrea::astro::AstrodynamicsSystem¶
ClassList > astrea > astro > AstrodynamicsSystem
Represents a system of celestial bodies and their interactions. More...
#include <AstrodynamicsSystem.hpp>
Public Types¶
| Type | Name |
|---|---|
| typedef std::unordered_map< CelestialBodyId, CelestialBodyUniquePtr >::const_iterator | const_iterator Constant iterator type for iterating over celestial bodies. |
| typedef std::unordered_map< CelestialBodyId, CelestialBodyUniquePtr >::iterator | iterator Iterator type for iterating over celestial bodies. |
Public Functions¶
| Type | Name |
|---|---|
| constexpr | AstrodynamicsSystem (const CelestialBodyId & centralBody=CelestialBodyId::EARTH, const std::unordered_set< CelestialBodyId > & secondaryBodies={}) Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies. |
| constexpr | AstrodynamicsSystem (const CelestialBody & centralBody, const std::unordered_set< CelestialBodyId > & secondaryBodies={}) Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies. |
| constexpr | AstrodynamicsSystem (const CelestialBody & centralBody, const std::unordered_set< CelestialBody > & secondaryBodies={}) Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies. |
| AstrodynamicsSystem (const AstrodynamicsSystem &) = delete Deleted copy constructor for the AstrodynamicsSystem class. |
|
| AstrodynamicsSystem (AstrodynamicsSystem &&) = default Default move constructor for the AstrodynamicsSystem class. |
|
| constexpr const CelestialBodyUniquePtr & | add_body (const CelestialBodyId & id) Create a celestial body by id. |
| constexpr const CelestialBodyUniquePtr & | add_body (const CelestialBody & body) Store manually generated celestial body. |
| constexpr CelestialBodyUniquePtr | add_body (const CelestialBodyId & id) const Create a celestial body by id (const version). |
| constexpr auto | begin () const Returns an iterator to the beginning of the celestial bodies. |
| constexpr void | clear () Clears all celestial bodies managed by this factory. |
| constexpr auto | end () const Returns an iterator to the end of the celestial bodies. |
| constexpr const auto & | get_all_bodies () const Returns a vector of all celestial bodies in the system. |
| constexpr const CelestialBodyUniquePtr & | get_body (const CelestialBodyId & id) const Return a specific celestial body by ID. |
| constexpr const SystemCenter & | get_center_type () const Returns the central celestial body of the system. |
| constexpr const CelestialBodyUniquePtr & | get_central_body () const Returns the central celestial body as a CelestialBodyUniquePtr. |
| constexpr const CelestialBodyId & | get_central_body_id () const Returns the central celestial body ID. |
| constexpr GravParam | get_mu () const Get the gravitational parameter (mu) of the central body. |
| CartesianVector< Distance, frames::solar_system_barycenter::icrf > | get_relative_position (const Date & date, const CelestialBodyId id1, const CelestialBodyId id2) const Get the relative position between two celestial bodies at a specific date. |
| constexpr const CelestialBodyId & | get_system_root () const Get the root object of the celestial body hierarchy. |
| AstrodynamicsSystem & | operator= (const AstrodynamicsSystem &) = delete Deleted assignment operator for the AstrodynamicsSystem class. |
| AstrodynamicsSystem & | operator= (AstrodynamicsSystem &&) = default Default move assignment operator for the AstrodynamicsSystem class. |
| requires (std::is_base_of< CelestialBody, T >::value) const Creates a celestial body of a specific type. |
|
| constexpr const std::size_t | size () const Returns the number of celestial bodies managed by this factory. |
| ~AstrodynamicsSystem () = default Default destructor for the AstrodynamicsSystem class. |
Public Static Functions¶
| Type | Name |
|---|---|
| constexpr AstrodynamicsSystem | EarthMoon () Creates a default AstrodynamicsSystem . |
Detailed Description¶
This class manages celestial bodies, their properties, and provides methods to access them.
Public Types Documentation¶
typedef const_iterator¶
Constant iterator type for iterating over celestial bodies.
using astrea::astro::AstrodynamicsSystem::const_iterator = std::unordered_map<CelestialBodyId, CelestialBodyUniquePtr>::const_iterator;
typedef iterator¶
Iterator type for iterating over celestial bodies.
using astrea::astro::AstrodynamicsSystem::iterator = std::unordered_map<CelestialBodyId, CelestialBodyUniquePtr>::iterator;
Public Functions Documentation¶
function AstrodynamicsSystem [1/5]¶
Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies.
inline constexpr astrea::astro::AstrodynamicsSystem::AstrodynamicsSystem (
const CelestialBodyId & centralBody=CelestialBodyId::EARTH,
const std::unordered_set< CelestialBodyId > & secondaryBodies={}
)
Parameters:
centralBodyThe name of the central celestial body (default is "Earth").allBodiesA set of names of all secondary celestial bodies in the system (default is none).
function AstrodynamicsSystem [2/5]¶
Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies.
inline constexpr astrea::astro::AstrodynamicsSystem::AstrodynamicsSystem (
const CelestialBody & centralBody,
const std::unordered_set< CelestialBodyId > & secondaryBodies={}
)
Parameters:
centralBodyThe central celestial body.allBodiesA set of all secondary celestial bodies in the system (default is none).
function AstrodynamicsSystem [3/5]¶
Constructs an AstrodynamicsSystem with a specified central body, and the set of all other bodies.
inline constexpr astrea::astro::AstrodynamicsSystem::AstrodynamicsSystem (
const CelestialBody & centralBody,
const std::unordered_set< CelestialBody > & secondaryBodies={}
)
Parameters:
centralBodyThe central celestial body.allBodiesA set of all secondary celestial bodies in the system (default is none).
function AstrodynamicsSystem [4/5]¶
Deleted copy constructor for the AstrodynamicsSystem class.
function AstrodynamicsSystem [5/5]¶
Default move constructor for the AstrodynamicsSystem class.
function add_body [1/3]¶
Create a celestial body by id.
inline constexpr const CelestialBodyUniquePtr & astrea::astro::AstrodynamicsSystem::add_body (
const CelestialBodyId & id
)
Parameters:
idThe id of the celestial body to create.systemThe astrodynamics system to which the body belongs.
Returns:
const CelestialBodyUniquePtr& A pointer to the created celestial body.
function add_body [2/3]¶
Store manually generated celestial body.
inline constexpr const CelestialBodyUniquePtr & astrea::astro::AstrodynamicsSystem::add_body (
const CelestialBody & body
)
Parameters:
idThe id of the celestial body to create.systemThe astrodynamics system to which the body belongs.
Returns:
const CelestialBodyUniquePtr& A pointer to the created celestial body.
function add_body [3/3]¶
Create a celestial body by id (const version).
inline constexpr CelestialBodyUniquePtr astrea::astro::AstrodynamicsSystem::add_body (
const CelestialBodyId & id
) const
Parameters:
idThe id of the celestial body to create.
Returns:
const CelestialBodyUniquePtr& A pointer to the created celestial body.
function begin¶
Returns an iterator to the beginning of the celestial bodies.
Returns:
iterator An iterator to the first celestial body.
function clear¶
Clears all celestial bodies managed by this factory.
function end¶
Returns an iterator to the end of the celestial bodies.
Returns:
iterator An iterator to the end of the celestial bodies.
function get_all_bodies¶
Returns a vector of all celestial bodies in the system.
Returns:
const std::vector<CelestialBodyUniquePtr>& A vector containing pointers to all celestial bodies in the system.
function get_body¶
Return a specific celestial body by ID.
inline constexpr const CelestialBodyUniquePtr & astrea::astro::AstrodynamicsSystem::get_body (
const CelestialBodyId & id
) const
Parameters:
idThe ID of the celestial body to retrieve.
Returns:
const CelestialBodyUniquePtr& A pointer to the celestial body with the specified ID.
function get_center_type¶
Returns the central celestial body of the system.
Returns:
const SystemCenter& The name of the central celestial body.
function get_central_body¶
Returns the central celestial body as a CelestialBodyUniquePtr.
inline constexpr const CelestialBodyUniquePtr & astrea::astro::AstrodynamicsSystem::get_central_body () const
Returns:
const CelestialBodyUniquePtr& A pointer to the central celestial body.
function get_central_body_id¶
Returns the central celestial body ID.
inline constexpr const CelestialBodyId & astrea::astro::AstrodynamicsSystem::get_central_body_id () const
Returns:
const CelestialBodyId& The ID of the central celestial body.
function get_mu¶
Get the gravitational parameter (mu) of the central body.
Returns:
GravParam The gravitational parameter of the central body.
function get_relative_position¶
Get the relative position between two celestial bodies at a specific date.
CartesianVector < Distance, frames::solar_system_barycenter::icrf > astrea::astro::AstrodynamicsSystem::get_relative_position (
const Date & date,
const CelestialBodyId id1,
const CelestialBodyId id2
) const
Parameters:
dateThe date at which to get the relative position.id1The ID of the first celestial body.id2The ID of the second celestial body.
Returns:
CartesianVector<Distance, frames::solar_system_barycenter::icrf> The relative position vector from id2 to id1.
function get_system_root¶
Get the root object of the celestial body hierarchy.
inline constexpr const CelestialBodyId & astrea::astro::AstrodynamicsSystem::get_system_root () const
Returns:
const CelestialBodyId& The name of the root celestial body.
function operator=¶
Deleted assignment operator for the AstrodynamicsSystem class.
AstrodynamicsSystem & astrea::astro::AstrodynamicsSystem::operator= (
const AstrodynamicsSystem &
) = delete
function operator=¶
Default move assignment operator for the AstrodynamicsSystem class.
AstrodynamicsSystem & astrea::astro::AstrodynamicsSystem::operator= (
AstrodynamicsSystem &&
) = default
function requires¶
Creates a celestial body of a specific type.
template<typename T, typename... Args>
inline astrea::astro::AstrodynamicsSystem::requires (
std::is_base_of< CelestialBody , T >::value
) const
This method allows for the creation of celestial bodies of derived types, such as specific planets or moons. The created body is assigned to the provided astrodynamics system.
Template parameters:
TThe type of celestial body to create, must be derived from CelestialBody.ArgsThe types of arguments to pass to the constructor of T.
Parameters:
argsThe arguments to pass to the constructor of T.systemThe astrodynamics system to which the body belongs.
Returns:
A unique pointer to the created CelestialBody of type T.
function size¶
Returns the number of celestial bodies managed by this factory.
Returns:
const std::size_t The number of celestial bodies.
function ~AstrodynamicsSystem¶
Default destructor for the AstrodynamicsSystem class.
Public Static Functions Documentation¶
function EarthMoon¶
Creates a default AstrodynamicsSystem .
Returns:
A default AstrodynamicsSystem instance.
The documentation for this class was generated from the following file astrea/astro/astro/systems/AstrodynamicsSystem.hpp