File PositionCache.hpp¶
File List > analysis > PositionCache.hpp
Go to the documentation of this file
#pragma once
#include <vector>
#include <gtl/btree.hpp>
#include <astro/frames/CartesianVector.hpp>
#include <astro/frames/frames.hpp>
#include <astro/state/angular_elements/angular_elements.hpp>
#include <trace/types/typedefs.hpp>
namespace astrea {
namespace trace {
using EcefRadiusVec = astro::RadiusVector<astro::frames::earth::earth_fixed>;
class PositionCache {
public:
PositionCache() = default;
~PositionCache() = default;
void reserve(std::size_t nPlatforms);
std::size_t add_platform(std::size_t platformId, std::size_t nTimesteps);
void set_position(std::size_t platformIdx, std::size_t timeIdx, const EcefRadiusVec& position);
const EcefRadiusVec& get_position_by_id(std::size_t platformId, std::size_t timeIdx) const;
const EcefRadiusVec& get_position_by_index(std::size_t platformIdx, std::size_t timeIdx) const;
std::size_t get_index(std::size_t platformId) const;
std::size_t get_platform_id(std::size_t platformIdx) const;
std::size_t n_platforms() const;
std::size_t n_timesteps() const;
void clear();
private:
std::vector<std::size_t> _platformIds;
std::vector<std::vector<EcefRadiusVec>> _positions;
gtl::btree_map<std::size_t, std::size_t> _idToIndex;
};
} // namespace trace
} // namespace astrea