🛰️航天仿真算法库 SpaceAST 0.3.1
载入中...
搜索中...
未找到
State.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstUtil/Object.hpp"
25#include "AstUtil/ObjectNamed.hpp"
26#include "AstCore/Frame.hpp"
27#include "AstCore/EventTime.hpp"
28
29AST_NAMESPACE_BEGIN
30
38enum class EStateType
39{
43 eBPlane,
45 eGeodetic,
46 eUnknown,
47};
48
49class State;
50using PState = State*;
51using HState = SharedPtr<State>;
52
56class AST_CORE_API State: public ObjectNamed
57{
58public:
59 AST_OBJECT(State)
60 AST_PROPERT(Frame)
61 AST_PROPERT(StateEpoch)
62;
63
64 static PState NewDefault();
65
66 State() = default;
67 ~State() override = default;
68
72 static HState MakeShared(EStateType type);
73
78 static HState MakeShared(State& state, EStateType type);
79
80
84 static PState New(EStateType type);
85
86
91 static PState New(State& state, EStateType type);
92protected:
93 State(const State& state);
94public:
97 virtual EStateType getStateType() const = 0;
98
102 virtual errc_t getState(CartState& state) const = 0;
103
107 virtual errc_t getState(ModOrbElem& orbElem) const = 0;
108
112 virtual errc_t setState(const CartState& state) = 0;
113
117 virtual errc_t setState(const ModOrbElem& orbElem) = 0;
118
123 errc_t getStateIn(Body* body, GeodeticPoint& geodetic) const;
124
129 errc_t getStateIn(Frame* frame, ModOrbElem& orbElem) const;
130
131
136 errc_t getStateIn(Frame* frame, CartState& state) const;
137
142 errc_t getStateInBodyInertial(Body* body, CartState& state) const;
143
144
145public:
146
149 errc_t setFrameByName(StringView frameName);
150
154 errc_t changeFrame(Frame* frame);
155
156
157
160 void setStateEpoch(const TimePoint& stateEpoch);
161
163 TimePoint getStateEpoch_TimePoint() const;
164
168 errc_t getStateEpoch(TimePoint& stateEpoch) const;
169
173
175 Body* getBody() const;
176
179 double getBodyRadius() const;
180
183 double getGM() const { return gm_; }
184
187 void setGM(double gm){ gm_ = gm; }
188public:
189
190public:
191
192
193#if 0
194// 这些与历元坐标系定义相关的接口增加了类设计的复杂度
195// 应该考虑如何将历元坐标系相关逻辑放在该类的顶层模块,不在这里处理相关逻辑
196public: // 与历元坐标系定义相关的接口:
197 void setCoordEpoch(EventTime* coordEpoch);
198
199 void setCoordEpoch(const TimePoint& coordEpoch);
200
201 errc_t getCoordEpoch(TimePoint& coordEpoch) const;
202
203 bool getUseCoordEpoch() const;
204
205 void setUseCoordEpoch(bool useCoordEpoch);
206
207 void setCoordAxes(Axes* axes);
208
209 errc_t changeCoordAxes(Axes* axes);
210
211 Axes* getCoordAxes() const;
212#endif
213
214PROPERTIES:
216 Frame* getFrame() const{ return frame_.get(); }
217
219 void setFrame(Frame* frame);
220
222 EventTime* getStateEpoch() const{ return stateEpoch_.get(); }
223
226 void setStateEpoch(EventTime* stateEpoch);
227
228protected:
230 double gm_{0};
231 SharedPtr<EventTime> stateEpoch_{};
232};
233
236AST_NAMESPACE_END
轴系抽象基类
定义 Axes.hpp:86
直角坐标
定义 OrbitElement.hpp:53
天体
定义 CelestialBody.hpp:72
事件时间
定义 EventTime.hpp:44
坐标系抽象基类
定义 Frame.hpp:74
大地坐标
定义 GeodeticPoint.hpp:33
修正轨道根数
定义 OrbitElement.hpp:154
命名对象
定义 ObjectNamed.hpp:36
航天器状态
定义 State.hpp:57
EventTime * getStateEpoch() const
获取状态历元时间
定义 State.hpp:222
virtual errc_t getState(CartState &state) const =0
获取状态
virtual EStateType getStateType() const =0
获取状态类型
double getGM() const
获取引力常数
定义 State.hpp:183
virtual errc_t setState(const CartState &state)=0
设置状态
SharedPtr< EventTime > & getStateEpochHandle()
获取状态历元时间句柄
定义 State.hpp:172
virtual errc_t setState(const ModOrbElem &orbElem)=0
设置状态
virtual errc_t getState(ModOrbElem &orbElem) const =0
获取状态
void setGM(double gm)
设置引力常数
定义 State.hpp:187
绝对时间点
定义 TimePoint.hpp:108
EStateType
状态类型
定义 State.hpp:39
@ eSpherical
球坐标状态
@ eBPlane
B平面状态
@ eGeodetic
大地坐标状态(固连系下的位置与速度)
@ eMixedSpherical
混合球坐标状态
@ eCartesian
笛卡尔状态
@ eKeplerian
开普勒状态
@ eUnknown
未知插值方法
定义 STKEphemerisFileParser.cpp:43