🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
BodyEphemerisSPK.hpp
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "BodyEphemeris.hpp"
25#include "AstCore/CelestialBody.hpp"
26#include "AstCore/JplSpk.hpp"
27
28
29AST_NAMESPACE_BEGIN
30
37class AST_CORE_API BodyEphemerisSPK : public BodyEphemeris
38{
39public:
40 AST_OBJECT(BodyEphemerisSPK)
41 AST_PROPERT(SpiceIndex)
42 BodyEphemerisSPK() = default;
43
44 BodyEphemerisSPK(const BodyEphemerisSPK&) = delete;
45 BodyEphemerisSPK& operator=(const BodyEphemerisSPK&) = delete;
46
47 BodyEphemerisSPK(int spiceIndex)
48 : spiceIndex_(spiceIndex)
49 , spk_()
50 {}
52 : body_(body)
53 , spiceIndex_(body->getJplSpiceId())
54 , spk_()
55 {}
56
57 ~BodyEphemerisSPK() override = default;
58
59 errc_t openSPKFile(StringView spkfile);
60
61 const std::string& getFilePath() const;
62
63 errc_t getPosICRF(const TimePoint& tp, Vector3d& pos) const override;
64
65 errc_t getPosVelICRF(const TimePoint& tp, Vector3d& pos, Vector3d& vel) const override;
66
67 errc_t getInterval(TimeInterval &interval) const override;
68PROPERTIES:
69 int getSpiceIndex() const;
70
71 void setSpiceIndex(int spiceIndex){spiceIndex_ = spiceIndex;}
72protected:
73 CelestialBody* body_{nullptr};
74 int spiceIndex_{-1};
75 JplSpk spk_{};
76};
77
78
81AST_NAMESPACE_END
定义 BodyEphemerisSPK.hpp:38
天体星历接口
定义 BodyEphemeris.hpp:38
virtual errc_t getPosVelICRF(const TimePoint &tp, Vector3d &pos, Vector3d &vel) const =0
获取天体在ICRF坐标系下的位置和速度
virtual errc_t getPosICRF(const TimePoint &tp, Vector3d &pos) const =0
获取天体在ICRF坐标系下的位置
天体
定义 CelestialBody.hpp:72
int getJplSpiceId() const
获取JPL SPICE ID
定义 CelestialBody.hpp:86
JPL SPK文件
定义 JplSpk.hpp:38
时间区间
定义 TimeInterval.hpp:64
绝对时间点
定义 TimePoint.hpp:108