🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
PointMacro.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/BuiltinFrame.hpp"
25
26AST_NAMESPACE_BEGIN
27
33#define _AST_DECL_POINT(NAME) \
34 class AST_CORE_API Point##NAME : public Point \
35 { \
36 public: \
37 Point##NAME() = default; \
38 ~Point##NAME() override= default; \
39 static Point##NAME* Instance();\
40 Frame* getFrame() const override;\
41 errc_t getPos(const TimePoint &tp, Vector3d &pos) const override;\
42 errc_t getPosVel(const TimePoint &tp, Vector3d &pos, Vector3d &vel) const override;\
43 };\
44 A_ALWAYS_INLINE Point* aPoint##NAME()\
45 {\
46 return Point##NAME::Instance();\
47 }\
48
49
50#define _AST_IMPL_POINT(NAME, FRAME)\
51 Point##NAME* Point##NAME::Instance()\
52 {\
53 static SharedPtr<Point##NAME> instance(new Point##NAME());\
54 return instance.get();\
55 }\
56 Frame* Point##NAME::getFrame() const\
57 {\
58 return Frame##FRAME::Instance();\
59 }\
60 errc_t Point##NAME::getPos(const TimePoint &tp, Vector3d &pos) const\
61 {\
62 return a##NAME##PosIn##FRAME(tp, pos);\
63 }\
64 errc_t Point##NAME::getPosVel(const TimePoint &tp, Vector3d &pos, Vector3d &vel) const\
65 {\
66 return a##NAME##PosVelIn##FRAME(tp, pos, vel);\
67 }\
68
69
72AST_NAMESPACE_END
73