🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
StateCartesian.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/State.hpp"
25#include "AstMath/Vector.hpp"
26#include "AstCore/OrbitElement.hpp"
27
28AST_NAMESPACE_BEGIN
29
34class StateCartesian;
35using PStateCartesian = StateCartesian*;
36using HStateCartesian = SharedPtr<StateCartesian>;
37
39class AST_CORE_API StateCartesian final: public State
40{
41public:
42 AST_OBJECT(StateCartesian)
43 AST_PROPERT(x)
44 AST_PROPERT(y)
45 AST_PROPERT(z)
46 AST_PROPERT(vx)
47 AST_PROPERT(vy)
48 AST_PROPERT(vz)
49 static PStateCartesian New();
51 static PStateCartesian New(const CartState& state);
52 static HStateCartesian MakeShared(const CartState& state);
53
54 StateCartesian() = default;
55 StateCartesian(const CartState& state);
56 StateCartesian(const State& state);
57 ~StateCartesian() override = default;
58public:
59 EStateType getStateType() const override { return EStateType::eCartesian; }
60 errc_t getState(CartState& state) const override;
61 errc_t setState(const CartState& state) override;
62PROPERTIES:
63 double x() const { return cartState_.x(); }
64 double y() const { return cartState_.y(); }
65 double z() const { return cartState_.z(); }
66 double vx() const { return cartState_.vx(); }
67 double vy() const { return cartState_.vy(); }
68 double vz() const { return cartState_.vz(); }
69 void setX(double x){ cartState_.x() = x; }
70 void setY(double y){ cartState_.y() = y; }
71 void setZ(double z){ cartState_.z() = z; }
72 void setVx(double vx){ cartState_.vx() = vx; }
73 void setVy(double vy){ cartState_.vy() = vy; }
74 void setVz(double vz){ cartState_.vz() = vz; }
75protected:
76 CartState cartState_{};
77};
78
79
80
83AST_NAMESPACE_END
直角坐标
定义 OrbitElement.hpp:46
共享指针
定义 SharedPtr.hpp:33
笛卡尔状态(直角坐标)
定义 StateCartesian.hpp:40
EStateType getStateType() const override
获取状态类型
定义 StateCartesian.hpp:59
航天器状态
定义 State.hpp:53
static HState MakeShared(EStateType type)
创建状态
定义 State.cpp:34
virtual errc_t getState(CartState &state) const =0
获取状态
virtual errc_t setState(const CartState &state)=0
设置状态
static PState New(EStateType type)
创建状态
定义 State.cpp:44
EStateType
状态类型
定义 State.hpp:39
@ eCartesian
笛卡尔状态