🛰️航天仿真算法库 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(int spiceIndex)
45 : spiceIndex_(spiceIndex)
46 {}
48 : body_(body)
49 , spiceIndex_(body->getJplSpiceId())
50 {}
51
52 ~BodyEphemerisSPK() override = default;
53
54 errc_t openSPKFile(StringView spkfile);
55
56 const std::string& getFilePath() const;
57
58 errc_t getPosICRF(const TimePoint& tp, Vector3d& pos) const override;
59
60 errc_t getPosVelICRF(const TimePoint& tp, Vector3d& pos, Vector3d& vel) const override;
61
62 errc_t getInterval(TimeInterval &interval) const override;
63PROPERTIES:
64 int getSpiceIndex() const;
65
66 void setSpiceIndex(int spiceIndex){spiceIndex_ = spiceIndex;}
67protected:
68 CelestialBody* body_{nullptr};
69 int spiceIndex_{-1};
70 JplSpk spk_;
71};
72
73
76AST_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:52
int getJplSpiceId() const
获取JPL SPICE ID
定义 CelestialBody.hpp:65
JPL SPK文件
定义 JplSpk.hpp:38
时间区间
定义 TimeInterval.hpp:59
绝对时间点
定义 TimePoint.hpp:106