• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • edu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • extragear
  • edu
  • kstars
  • kstars
  • skyobjects
ksearthshadow.h
Go to the documentation of this file.
1 /***************************************************************************
2  ksearthshadow.h - K Desktop Planetarium
3  -------------------
4  begin : Fri Aug 24 2018
5  copyright : (C) 2018 by Valentin Boettcher
6  email : [email protected] (do not hesitate to contact)
7  matrix : @[email protected]
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #pragma once
20 
21 #include "ksplanetbase.h"
22 
23 class KSSun;
24 class KSMoon;
25 class KSPlanet;
26 
38 class KSEarthShadow : public KSPlanetBase
39 {
40  public:
51  KSEarthShadow(const KSMoon *moon, const KSSun *sun, const KSPlanet * earth);
52 
56  enum ECLIPSE_TYPE
57  {
58  PARTIAL, FULL_PENUMBRA, FULL_UMBRA, NONE
59  };
60 
66  bool shouldUpdate();
67 
68 
73  bool isInEclipse();
74 
79  ECLIPSE_TYPE getEclipseType();
80 
81  bool findGeocentricPosition(const KSNumbers *, const KSPlanetBase * Earth = nullptr) override;
82 
87  void updateCoords(const KSNumbers *num, bool includePlanets = true, const CachingDms *lat = nullptr,
88  const CachingDms *LST = nullptr, bool forceRecompute = false) override;
89 
93  void updateCoords();
94 
98  void calculateShadowRadius();
99 
103  double getUmbraAngSize() const
104  {
105  return m_umbra_ang;
106  }
107 
111  double getPenumbraAngSize() const
112  {
113  return m_penumbra_ang;
114  }
115 
120  double findAngularSize() final override
121  {
122  calculateShadowRadius();
123  return m_penumbra_ang;
124  }
125 
126  // Some Compatibility Nonsense
127  void findMagnitude(const KSNumbers *) override {} // Empty
128  bool loadData() override
129  {
130  return true;
131  }
132  void findPhase() override {}
133 
134  private:
135  double m_umbra_ang { 0 }; // Radius!
136  double m_penumbra_ang { 0 }; // Radius!
137 
138  const KSSun* m_sun { nullptr };
139  const KSMoon* m_moon { nullptr };
140  const KSPlanet* m_earth { nullptr };
141 
142  void findSun();
143  void findMoon();
144  void findEarth();
145 };
ksplanetbase.h
KSEarthShadow::getUmbraAngSize
double getUmbraAngSize() const
Definition: ksearthshadow.h:103
KSEarthShadow::FULL_UMBRA
Definition: ksearthshadow.h:58
KSPlanet
A subclass of KSPlanetBase for seven of the major planets in the solar system (Earth and Pluto have t...
Definition: ksplanet.h:43
KSSun
Child class of KSPlanetBase; encapsulates information about the Sun.
Definition: kssun.h:34
KSEarthShadow::shouldUpdate
bool shouldUpdate()
The earths shadow on the moon appears only at new moon so calculating it on other occasions is rather...
Definition: ksearthshadow.cpp:26
KSEarthShadow::NONE
Definition: ksearthshadow.h:58
KSEarthShadow::findGeocentricPosition
bool findGeocentricPosition(const KSNumbers *, const KSPlanetBase *Earth=nullptr) override
find the object's current geocentric equatorial coordinates (RA and Dec) This function is pure virtua...
Definition: ksearthshadow.cpp:56
KSEarthShadow::KSEarthShadow
KSEarthShadow(const KSMoon *moon, const KSSun *sun, const KSPlanet *earth)
Definition: ksearthshadow.cpp:21
KSEarthShadow::findAngularSize
double findAngularSize() finaloverride
angSize
Definition: ksearthshadow.h:120
KSEarthShadow::findPhase
void findPhase() override
Determine the phase of the planet.
Definition: ksearthshadow.h:132
KSEarthShadow::ECLIPSE_TYPE
ECLIPSE_TYPE
The ECLIPSE_TYPE enum describes the quality of an eclipse.
Definition: ksearthshadow.h:56
KSEarthShadow::updateCoords
void updateCoords()
Update the RA/DEC of the shadow.
Definition: ksearthshadow.cpp:69
KSEarthShadow::PARTIAL
Definition: ksearthshadow.h:58
KSEarthShadow::getPenumbraAngSize
double getPenumbraAngSize() const
Definition: ksearthshadow.h:111
KSEarthShadow::calculateShadowRadius
void calculateShadowRadius()
Updates umbra and penumbra radius from the positions of the three bodies.
Definition: ksearthshadow.cpp:82
KSEarthShadow::loadData
bool loadData() override
Definition: ksearthshadow.h:128
KSEarthShadow
A class that manages the calculation of the earths shadow (in moon distance) as a 'virtual' skyobject...
Definition: ksearthshadow.h:38
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:54
KSMoon
Provides necessary information about the Moon.
Definition: ksmoon.h:36
KSEarthShadow::FULL_PENUMBRA
Definition: ksearthshadow.h:58
KSPlanetBase
A subclass of TrailObject that provides additional information needed for most solar system objects...
Definition: ksplanetbase.h:60
KSEarthShadow::isInEclipse
bool isInEclipse()
isInEclipse - a slim version of getEclipseType()
Definition: ksearthshadow.cpp:31
KSEarthShadow::getEclipseType
ECLIPSE_TYPE getEclipseType()
eclipse
Definition: ksearthshadow.cpp:37
KSEarthShadow::findMagnitude
void findMagnitude(const KSNumbers *) override
Computes the visual magnitude for the major planets.
Definition: ksearthshadow.h:127
CachingDms
a dms subclass that caches its sine and cosine values every time the angle is changed.
Definition: cachingdms.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 02:56:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

edu API Reference

Skip menu "edu API Reference"
  •     core
  • kstars

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal