🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
DataGroupLightingTimes.hpp
浏览该文件的文档.
1
22
23#pragma once
24
25#include "AstGlobal.h"
26#include "AstReport/DataGroupInterval.hpp"
27#include "AstUtil/StringView.hpp"
28#include "AstCore/CelestialBody.hpp"
29#include "AstCore/Eclipse.hpp"
30#include "AstCore/TimePoint.hpp"
31#include "AstCore/TimeInterval.hpp"
32#include "AstCore/Point.hpp"
33#include "AstCore/Frame.hpp"
34
35#include <string>
36#include <vector>
37
38AST_NAMESPACE_BEGIN
39
48class AST_REPORT_API DataGroupLightingTimes : public DataGroupInterval
49{
50public:
52 struct Data
53 {
54 TimeInterval interval_{};
55 std::string obstruction_{};
56
57 const TimePoint& getStartTime() const { return interval_.start(); }
58 const TimePoint& getStopTime() const { return interval_.stop(); }
59 double getDuration() const { return interval_.duration(); }
60 const std::string& getObstruction() const { return obstruction_; }
61 };
62
63 static DataElements Elements();
64
66 static ELightingType LightingTypeFromString(StringView type);
67
68 DataGroupLightingTimes() = default;
69 ~DataGroupLightingTimes() = default;
70
71 errc_t calculate(const TimeInterval& interval, VariantVector& result) const override;
72 errc_t calculate(const TimeInterval& interval, std::vector<Data>& result) const;
73 const DataElements& getElements() const override;
74
77 Point* getPoint() const { return point_.get(); }
78 void setPoint(Point* p) { point_ = p; }
79 void setLightSource(CelestialBody* b) { lightSource_ = b; }
80 CelestialBody* getLightSource() const { return lightSource_.get(); }
81 void setOccultingBodies(const std::vector<HCelestialBody>& bodies) { occultingBodies_ = bodies; }
82 void setStepSize(double s) { stepSize_ = s; }
83 void setLightingType(ELightingType t) { lightingType_ = t; }
84 ELightingType getLightingType() const { return lightingType_; }
86
87private:
88 WeakPtr<Point> point_{nullptr};
89 WeakPtr<CelestialBody> lightSource_{nullptr};
90 std::vector<HCelestialBody> occultingBodies_{};
91 double stepSize_{60.0};
92 ELightingType lightingType_{ELightingType::eSunlight};
93};
94
97AST_NAMESPACE_END
数据元素容器
定义 DataElements.hpp:90
定义 DataGroupInterval.hpp:34
virtual errc_t calculate(const TimeInterval &interval, VariantVector &result) const =0
计算数据组
光照时刻数据组
定义 DataGroupLightingTimes.hpp:49
点抽象基类
定义 Point.hpp:41
时间区间
定义 TimeInterval.hpp:64
绝对时间点
定义 TimePoint.hpp:108
变类型向量容器
定义 VariantVector.hpp:59
Unit s
定义 Unit.cpp:465
ELightingType
光照类型
定义 Eclipse.hpp:35
单行数据
定义 DataGroupLightingTimes.hpp:53