14 #include "MapProjection.h" 28 static constexpr std::array<OverlayImageSpec,static_cast<size_t>(MapOverLayImage::Count)> CelestialOverlayFileName
30 { MapOverLayImage::Sun,
"35px-SunBg.png" },
31 { MapOverLayImage::Moon,
"moon22.png"},
34 std::array<ImageId,CelestialOverlayFileName.size()> mMapOverlayId{};
63 explicit CelestialOverlay(std::shared_ptr<TimerTick> timerTick, std::filesystem::path& xdgDataPath);
75 static constexpr std::string_view
id =
"CelestialOverlay";
76 std::string_view nodeId()
const noexcept
override {
96 void setCelestialObservations() {
100 if (mCelestialObservations.empty()) {
102 mCelestialObservations.predict(
DateTime{
true});
105 if (!mCelestialObservations.empty()) {
106 mCelestialObservations.predict(
DateTime{
true});
107 auto[lat, lon] = mCelestialObservations.front().geo();
112 static void throwContainerError() {
Encapsulate the day-in-space for orbital mechanics computations.
Definition: Plan13.h:141
Rectangle layout(gm::Context &context, const Rectangle &screenRect) override
Layout the CelestialOverlay.
Definition: CelestialOverlay.cpp:58
void addedToContainer() override
Called when added to a container.
Definition: CelestialOverlay.cpp:62
SatelliteObservation mCelestialObservations
The last calculated celestial observations.
Definition: CelestialOverlay.h:43
GeoPosition mSubLunar
The geographic sub-lunar position.
Definition: CelestialOverlay.h:49
Definition: SatelliteModel.h:139
std::shared_ptr< Slot< Args... > > slot_type
Composed Slot type.
Definition: Signals.h:123
std::shared_ptr< TimerTick > mTimerTick
Source of timing information.
Definition: CelestialOverlay.h:58
bool mDisplayCelestialObjects
If true celestial objects (Sun, Moon) will be displayed.
Definition: CelestialOverlay.h:40
An abstraction of a geographic position.
Definition: MapProjection.h:165
SatelliteObservation mSatelliteObservation
The last calculated observations.
Definition: CelestialOverlay.h:52
Context
Definition: GraphicsModel.h:76
Add observable celestial objects to MapProjection.
Definition: CelestialOverlay.h:25
static std::tuple< double, double > subSolar()
Compute the sub-solar geographic coordinates, used in plotting the solar illumination.
Definition: MapProjection.cpp:319
An exception to indicate an unexpected container type at runtime.
Definition: StructuredTypes.h:41
std::filesystem::path mXdgDataPath
Path to the XDG application data directory.
Definition: CelestialOverlay.h:55
A composite of a Position and a Size.
Definition: Types.h:307
TickProtocol::slot_type mCelestialUpdateTimer
Slot to receive celestial update time signals on.
Definition: CelestialOverlay.h:37
void draw(gm::Context &context, const Position< int > &containerPosition) override
Draw the CelestialOverlay.
Definition: CelestialOverlay.cpp:20
void loadMapCelestialObjectImages(const std::filesystem::path &xdgResourcePath, gm::Context &context)
Load overlay images into the ImageStore.
Definition: CelestialOverlay.cpp:95
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
GeoPosition mSubSolar
The geographic sub-solar position.
Definition: CelestialOverlay.h:46