🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
TraitPosVel.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "TraitObject.hpp"
25
26AST_NAMESPACE_BEGIN
27
28
29
32{
33public:
34 virtual ~IPosVelPrv()
35 {};
36 virtual Type* type() const = 0;
37 virtual errc_t getPosIn(Frame* frame, const TimePoint& tp, Vector3d& pos) const = 0;
38 virtual errc_t getPosVelIn(Frame* frame, const TimePoint& tp, Vector3d& pos, Vector3d& vel) const = 0;
39};
40
41
42
43template<typename T>
44class ImplFor<IPosVelPrv, T>: public TraitObject<IPosVelPrv>
45{
46public:
48 ImplFor(T* obj)
49 :Base{ obj }
50 {}
51 ImplFor(const T& obj)
52 :Base{(void*) & obj}
53 {}
54 Type* type() const override
55 {
56 return T::staticType();
57 }
58 errc_t getValue(const TimePoint& tp, double& value) const override
59 {
60 return get()->getValue(tp, value);
61 }
62
63 T* get() const{return (T*) data_; }
64};
65
66
67
68
69AST_NAMESPACE_END
70
类元信息
定义 Class.hpp:40
坐标系类
定义 Frame.hpp:60
提供位置速度
定义 TraitPosVel.hpp:32
定义 TraitObject.hpp:39
绝对时间点
定义 TimePoint.hpp:106
定义 TraitObject.hpp:30