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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • render
  • eclipses
EclipsesItem.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2012 Rene Kuettner <rene@bitkanal.net>
9 //
10 
11 #include "EclipsesItem.h"
12 
13 #include "MarbleDebug.h"
14 
15 #include <QIcon>
16 
17 namespace Marble
18 {
19 
20 EclipsesItem::EclipsesItem( EclSolar *ecl, int index, QObject *parent )
21  : QObject( parent ),
22  m_ecl( ecl ),
23  m_index( index ),
24  m_calculationsNeedUpdate( true ),
25  m_isTotal( false ),
26  m_phase( TotalSun ),
27  m_magnitude( 0. ),
28  m_centralLine(Tessellate),
29  m_umbra( Tessellate ),
30  m_southernPenumbra( Tessellate ),
31  m_northernPenumbra( Tessellate ),
32  m_shadowConeUmbra( Tessellate ),
33  m_shadowConePenumbra( Tessellate ),
34  m_shadowCone60MagPenumbra( Tessellate )
35 {
36  initialize();
37 }
38 
39 EclipsesItem::~EclipsesItem()
40 {
41 }
42 
43 int EclipsesItem::index() const
44 {
45  return m_index;
46 }
47 
48 bool EclipsesItem::takesPlaceAt( const QDateTime &dateTime ) const
49 {
50  return ( ( m_startDatePartial <= dateTime ) &&
51  ( m_endDatePartial >= dateTime ) );
52 }
53 
54 EclipsesItem::EclipsePhase EclipsesItem::phase() const
55 {
56  return m_phase;
57 }
58 
59 QIcon EclipsesItem::icon() const
60 {
61  switch( m_phase ) {
62  case EclipsesItem::TotalMoon:
63  return QIcon( ":res/lunar_total.png" );
64  case EclipsesItem::PartialMoon:
65  return QIcon( ":res/lunar_partial.png" );
66  case EclipsesItem::PenumbralMoon:
67  return QIcon( ":res/lunar_penumbra.png" );
68  case EclipsesItem::PartialSun:
69  return QIcon( ":res/solar_partial.png" );
70  case EclipsesItem::NonCentralAnnularSun:
71  case EclipsesItem::AnnularSun:
72  return QIcon( ":res/solar_annular.png" );
73  case EclipsesItem::AnnularTotalSun:
74  case EclipsesItem::NonCentralTotalSun:
75  case EclipsesItem::TotalSun:
76  return QIcon( ":res/solar_total.png" );
77  }
78 
79  return QIcon();
80 }
81 
82 QString EclipsesItem::phaseText() const
83 {
84  switch( m_phase ) {
85  case TotalMoon: return tr( "Moon, Total" );
86  case PartialMoon: return tr( "Moon, Partial" );
87  case PenumbralMoon: return tr( "Moon, Penumbral" );
88  case PartialSun: return tr( "Sun, Partial" );
89  case NonCentralAnnularSun: return tr( "Sun, non-central, Annular" );
90  case NonCentralTotalSun: return tr( "Sun, non-central, Total" );
91  case AnnularSun: return tr( "Sun, Annular" );
92  case TotalSun: return tr( "Sun, Total" );
93  case AnnularTotalSun: return tr( "Sun, Annular/Total" );
94  }
95 
96  return QString();
97 }
98 
99 double EclipsesItem::magnitude() const
100 {
101  return m_magnitude;
102 }
103 
104 const QDateTime& EclipsesItem::dateMaximum() const
105 {
106  return m_dateMaximum;
107 }
108 
109 const QDateTime& EclipsesItem::startDatePartial() const
110 {
111  return m_startDatePartial;
112 }
113 
114 const QDateTime& EclipsesItem::endDatePartial() const
115 {
116  return m_endDatePartial;
117 }
118 
119 int EclipsesItem::partialDurationHours() const
120 {
121  return (m_endDatePartial.toTime_t() -
122  m_startDatePartial.toTime_t()) / 3600;
123 }
124 
125 const QDateTime& EclipsesItem::startDateTotal() const
126 {
127  return m_startDateTotal;
128 }
129 
130 const QDateTime& EclipsesItem::endDateTotal() const
131 {
132  return m_endDateTotal;
133 }
134 
135 const GeoDataCoordinates& EclipsesItem::maxLocation()
136 {
137  if( m_calculationsNeedUpdate ) {
138  calculate();
139  }
140 
141  return m_maxLocation;
142 }
143 
144 const GeoDataLineString& EclipsesItem::centralLine()
145 {
146  if( m_calculationsNeedUpdate ) {
147  calculate();
148  }
149 
150  return m_centralLine;
151 }
152 
153 const GeoDataLinearRing& EclipsesItem::umbra()
154 {
155  if( m_calculationsNeedUpdate ) {
156  calculate();
157  }
158 
159  return m_umbra;
160 }
161 
162 const GeoDataLineString& EclipsesItem::southernPenumbra()
163 {
164  if( m_calculationsNeedUpdate ) {
165  calculate();
166  }
167 
168  return m_southernPenumbra;
169 }
170 
171 const GeoDataLineString& EclipsesItem::northernPenumbra()
172 {
173  if( m_calculationsNeedUpdate ) {
174  calculate();
175  }
176 
177  return m_northernPenumbra;
178 }
179 
180 GeoDataLinearRing EclipsesItem::shadowConeUmbra()
181 {
182  if( m_calculationsNeedUpdate ) {
183  calculate();
184  }
185 
186  return m_shadowConeUmbra;
187 }
188 
189 GeoDataLinearRing EclipsesItem::shadowConePenumbra()
190 {
191  if( m_calculationsNeedUpdate ) {
192  calculate();
193  }
194 
195  return m_shadowConePenumbra;
196 }
197 
198 GeoDataLinearRing EclipsesItem::shadowCone60MagPenumbra()
199 {
200  if( m_calculationsNeedUpdate ) {
201  calculate();
202  }
203 
204  return m_shadowCone60MagPenumbra;
205 }
206 
207 const QList<GeoDataLinearRing>& EclipsesItem::sunBoundaries()
208 {
209  if( m_calculationsNeedUpdate ) {
210  calculate();
211  }
212 
213  return m_sunBoundaries;
214 }
215 
216 void EclipsesItem::initialize()
217 {
218  // set basic information
219  int year, month, day, hour, min, phase;
220  double secs, tz;
221 
222  phase = m_ecl->getEclYearInfo( m_index, year, month, day,
223  hour, min, secs,
224  tz, m_magnitude );
225 
226  switch( phase ) {
227  case -4: m_phase = EclipsesItem::TotalMoon; break;
228  case -3: m_phase = EclipsesItem::PartialMoon; break;
229  case -2:
230  case -1: m_phase = EclipsesItem::PenumbralMoon; break;
231  case 1: m_phase = EclipsesItem::PartialSun; break;
232  case 2: m_phase = EclipsesItem::NonCentralAnnularSun; break;
233  case 3: m_phase = EclipsesItem::NonCentralTotalSun; break;
234  case 4: m_phase = EclipsesItem::AnnularSun; break;
235  case 5: m_phase = EclipsesItem::TotalSun; break;
236  case 6: m_phase = EclipsesItem::AnnularTotalSun; break;
237  default:
238  mDebug() << "Invalid phase for eclipse at" << year << "/" <<
239  day << "/" << month << "!";
240  }
241 
242  m_dateMaximum = QDateTime( QDate( year, month, day ),
243  QTime( hour, min, secs ),
244  Qt::LocalTime );
245 
246  // get global start/end date of eclipse
247 
248  double mjd_start, mjd_end;
249  m_ecl->putEclSelect( m_index );
250 
251  if( m_ecl->getPartial( mjd_start, mjd_end ) != 0 ) {
252  m_ecl->getDatefromMJD( mjd_start, year, month, day, hour, min, secs );
253  m_startDatePartial = QDateTime( QDate( year, month, day ),
254  QTime( hour, min, secs ),
255  Qt::LocalTime );
256  m_ecl->getDatefromMJD( mjd_end, year, month, day, hour, min, secs );
257  m_endDatePartial = QDateTime( QDate( year, month, day ),
258  QTime( hour, min, secs ),
259  Qt::LocalTime );
260  } else {
261  // duration is shorter than 1 min
262  m_startDatePartial = m_dateMaximum;
263  m_endDatePartial = m_dateMaximum;
264  }
265 
266  m_isTotal = ( m_ecl->getTotal( mjd_start, mjd_end ) != 0 );
267  if( m_isTotal ) {
268  m_ecl->getDatefromMJD( mjd_start, year, month, day, hour, min, secs );
269  m_startDateTotal = QDateTime( QDate( year, month, day ),
270  QTime( hour, min, secs ),
271  Qt::LocalTime );
272  m_ecl->getDatefromMJD( mjd_end, year, month, day, hour, min, secs );
273  m_endDateTotal = QDateTime( QDate( year, month, day ),
274  QTime( hour, min, secs ),
275  Qt::LocalTime );
276  }
277 
278  // detailed calculations are done when required
279  m_calculationsNeedUpdate = true;
280 }
281 
282 void EclipsesItem::calculate()
283 {
284  int np, kp, j;
285  double lat1, lng1, lat2, lng2, lat3, lng3, lat4, lng4;
286  double ltf[60], lnf[60];
287 
288  m_ecl->putEclSelect( m_index );
289 
290  // FIXME: set observer location
291  m_ecl->getMaxPos( lat1, lng1 );
292  m_ecl->setLocalPos( lat1, lng1, 0 );
293 
294  // eclipse's maximum location
295  m_maxLocation = GeoDataCoordinates( lng1, lat1, 0., GeoDataCoordinates::Degree );
296 
297  // calculate central line
298  np = m_ecl->eclPltCentral( true, lat1, lng1 );
299  kp = np;
300  m_centralLine.clear();
301  m_centralLine << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
302  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
303  0., GeoDataCoordinates::Degree );
304 
305  if( np > 3 ) { // central eclipse
306  while( np > 3 ) {
307  np = m_ecl->eclPltCentral( false, lat1, lng1 );
308  if( np > 3 ) {
309  m_centralLine << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
310  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
311  0., GeoDataCoordinates::Degree );
312  }
313  }
314  }
315 
316  // calculate umbra
317  np = kp;
318  m_umbra.clear();
319  if( np > 3 ) { // total or annual eclipse
320  // northern /southern boundaries of umbra
321  np = m_ecl->centralBound( true, lat1, lng1, lat2, lng2 );
322 
323  GeoDataLinearRing lowerUmbra( Tessellate ), upperUmbra( Tessellate );
324  lowerUmbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
325  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
326  0., GeoDataCoordinates::Degree );
327  upperUmbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
328  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
329  0., GeoDataCoordinates::Degree );
330 
331  while( np > 0 ) {
332  np = m_ecl->centralBound( false, lat1, lng1, lat2, lng2 );
333  if( lat1 <= 90. ) {
334  lowerUmbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
335  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
336  0., GeoDataCoordinates::Degree );
337  }
338  if( lat1 <= 90. ) {
339  upperUmbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng2, GeoDataCoordinates::Degree),
340  GeoDataCoordinates::normalizeLon(lat2, GeoDataCoordinates::Degree),
341  0., GeoDataCoordinates::Degree );
342  }
343  }
344 
345  GeoDataLinearRing invertedUpperUmbra( Tessellate );
346  QVector<GeoDataCoordinates>::const_iterator iter = upperUmbra.constEnd() - 1;
347  for( ; iter != upperUmbra.constBegin(); --iter ) {
348  invertedUpperUmbra << *iter;
349  }
350  invertedUpperUmbra << upperUmbra.first();
351  upperUmbra = invertedUpperUmbra;
352 
353  m_umbra << lowerUmbra << upperUmbra;
354  }
355 
356  // shadow cones
357  m_shadowConeUmbra.clear();
358  m_shadowConePenumbra.clear();
359  m_shadowCone60MagPenumbra.clear();
360 
361  m_ecl->getLocalMax( lat2, lat3, lat4 );
362 
363  m_ecl->getShadowCone( lat2, true, 40, ltf, lnf );
364  for( j = 0; j < 40; ++j ) {
365  if( ltf[j] < 100. ) {
366  m_shadowConeUmbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lnf[j], GeoDataCoordinates::Degree),
367  GeoDataCoordinates::normalizeLon(ltf[j], GeoDataCoordinates::Degree),
368  0., GeoDataCoordinates::Degree );
369  }
370  }
371 
372  m_ecl->setPenumbraAngle( 1., 0 );
373  m_ecl->getShadowCone( lat2, false, 60, ltf, lnf );
374  for( j = 0; j < 60; ++j ) {
375  if( ltf[j] < 100. ) {
376  m_shadowConePenumbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lnf[j], GeoDataCoordinates::Degree),
377  GeoDataCoordinates::normalizeLon(ltf[j], GeoDataCoordinates::Degree),
378  0., GeoDataCoordinates::Degree );
379  }
380  }
381 
382  m_ecl->setPenumbraAngle( 0.6, 1 );
383  m_ecl->getShadowCone( lat2, false, 60, ltf, lnf );
384  for( j = 0; j < 60; ++j ) {
385  if( ltf[j] < 100. ) {
386  m_shadowCone60MagPenumbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lnf[j], GeoDataCoordinates::Degree),
387  GeoDataCoordinates::normalizeLon(ltf[j], GeoDataCoordinates::Degree),
388  0., GeoDataCoordinates::Degree );
389  }
390  }
391 
392  m_ecl->setPenumbraAngle( 1., 0 );
393 
394  // eclipse boundaries
395  m_southernPenumbra.clear();
396  m_northernPenumbra.clear();
397 
398  np = m_ecl->GNSBound( true, true, lat1, lng2 );
399  while( np > 0 ) {
400  np = m_ecl->GNSBound( false, true, lat1, lng1 );
401  if( ( np > 0 ) && ( lat1 <= 90. ) ) {
402  m_southernPenumbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
403  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
404  0., GeoDataCoordinates::Degree );
405  }
406  }
407 
408  np = m_ecl->GNSBound( true, false, lat1, lng1 );
409  while( np > 0 ) {
410  np = m_ecl->GNSBound( false, false, lat1, lng1 );
411  if( ( np > 0 ) && ( lat1 <= 90. ) ) {
412  m_northernPenumbra << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
413  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
414  0., GeoDataCoordinates::Degree );
415  }
416  }
417 
418  // sunrise / sunset boundaries
419 
420  QList<GeoDataLinearRing*> sunBoundaries;
421  np = m_ecl->GRSBound( true, lat1, lng1, lat3, lng3 );
422 
423  GeoDataLinearRing *lowerBoundary = new GeoDataLinearRing( Tessellate );
424  *lowerBoundary << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng1, GeoDataCoordinates::Degree),
425  GeoDataCoordinates::normalizeLon(lat1, GeoDataCoordinates::Degree),
426  0., GeoDataCoordinates::Degree );
427 
428  GeoDataLinearRing *upperBoundary = new GeoDataLinearRing( Tessellate );
429  *upperBoundary << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng3, GeoDataCoordinates::Degree),
430  GeoDataCoordinates::normalizeLon(lat3, GeoDataCoordinates::Degree),
431  0., GeoDataCoordinates::Degree );
432 
433  m_sunBoundaries.clear();
434 
435  while ( np > 0 ) {
436  np = m_ecl->GRSBound( false, lat2, lng2, lat4, lng4 );
437  bool pline = fabs( lng1 - lng2 ) < 10.; // during partial eclipses, the Rise/Set
438  // lines switch at one stage.
439  // This will prevent an ugly line between
440  // the switch points. If there is a
441  // longitude jump then add the current
442  // section to our sun boundaries collection
443  // and start a new section
444  if ( !pline && !lowerBoundary->isEmpty() ) {
445  sunBoundaries.prepend( lowerBoundary );
446  lowerBoundary = new GeoDataLinearRing( Tessellate );
447  }
448  if ( ( np > 0 ) && ( lat2 <= 90. ) && ( lat1 <= 90. ) ) {
449  *lowerBoundary << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng2, GeoDataCoordinates::Degree),
450  GeoDataCoordinates::normalizeLon(lat2, GeoDataCoordinates::Degree),
451  0., GeoDataCoordinates::Degree );
452  }
453  pline = fabs( lng3 - lng4 ) < 10.; // during partial eclipses, the Rise/Set lines
454  // switch at one stage.
455  // This will prevent an ugly line between the
456  // switch points. If there is a longitude jump
457  // then add the current section to our sun
458  // boundaries collection and start a new section
459  if ( !pline && !upperBoundary->isEmpty() ) {
460  sunBoundaries.prepend( upperBoundary );
461  upperBoundary = new GeoDataLinearRing( Tessellate );
462  }
463  if ( pline && ( np > 0 ) && ( lat4 <= 90. ) && ( lat3 <= 90. ) ) {
464  *upperBoundary << GeoDataCoordinates( GeoDataCoordinates::normalizeLon(lng4, GeoDataCoordinates::Degree),
465  GeoDataCoordinates::normalizeLon(lat4, GeoDataCoordinates::Degree),
466  0., GeoDataCoordinates::Degree );
467  }
468 
469  lng1 = lng2;
470  lat1 = lat2;
471  lng3 = lng4;
472  lat3 = lat4;
473  }
474 
475  if ( !lowerBoundary->isEmpty() ) {
476  sunBoundaries.prepend(lowerBoundary);
477  } else {
478  delete lowerBoundary;
479  }
480  if ( !upperBoundary->isEmpty() ) {
481  sunBoundaries.prepend(upperBoundary);
482  } else {
483  delete upperBoundary;
484  }
485 
486  for ( int result = 0; result < 2; ++result ) {
487  GeoDataLinearRing sunBoundary( Tessellate );
488 
489  sunBoundary = *sunBoundaries.last();
490  sunBoundaries.pop_back();
491 
492  while ( sunBoundaries.size() > 0) {
493  int closestSection = -1;
494 
495  // TODO: Now that MableMath is not public anymore we need a
496  // GeoDataCoordinates::distance() method in Marble.
497  GeoDataLineString ruler;
498  ruler << sunBoundary.last() << sunBoundary.first();
499  qreal closestDistance = ruler.length( 1 );
500  int closestEnd = 0; // 0 = start of section, 1 = end of section
501 
502  // Look for a section that is closest to our sunBoundary section.
503  for ( int it = 0; it < sunBoundaries.size(); ++it ) {
504  GeoDataLineString distanceStartSection;
505  distanceStartSection << sunBoundary.last() << sunBoundaries.at( it )->first();
506 
507  GeoDataLineString distanceEndSection;
508  distanceEndSection << sunBoundary.last() << sunBoundaries.at( it )->last();
509  if ( distanceStartSection.length( 1 ) < closestDistance ) {
510  closestDistance = distanceStartSection.length( 1 );
511  closestSection = it;
512  closestEnd = 0;
513  }
514  if ( distanceEndSection.length(1) < closestDistance ) {
515  closestDistance = distanceEndSection.length( 1 );
516  closestSection = it;
517  closestEnd = 1;
518  }
519  }
520 
521  if ( closestSection == -1 ) {
522  // There is no other section that is closer to the end of
523  // our sunBoundary section than the startpoint of our
524  // sunBoundary itself
525  break;
526  }
527  else {
528  // We now concatenate the closest section to the sunBoundary.
529  // First we might have to invert it so that we concatenate
530  // the right end
531  if ( closestEnd == 1 ) {
532  // TODO: replace this with a GeoDataLinearRing::invert()
533  // method that needs to be added to Marble ...
534  GeoDataLinearRing * invertedBoundary = new GeoDataLinearRing( Tessellate );
535  QVector<GeoDataCoordinates>::const_iterator iter = sunBoundaries.at( closestSection )->constEnd();
536  --iter;
537  for( ; iter != sunBoundaries.at( closestSection )->constBegin(); --iter ) {
538  *invertedBoundary << *iter;
539  }
540  *invertedBoundary << sunBoundaries.at( closestSection )->first();
541  delete sunBoundaries[closestSection];
542  sunBoundaries[closestSection] = invertedBoundary;
543  }
544  sunBoundary << *sunBoundaries[closestSection];
545 
546  // Now remove the section that we've just added from the list
547  delete sunBoundaries[closestSection];
548  sunBoundaries.removeAt( closestSection );
549  }
550  }
551 
552  m_sunBoundaries << sunBoundary;
553 
554  if ( sunBoundaries.size() == 0 ) break;
555  }
556 
557  m_calculationsNeedUpdate = false;
558 }
559 
560 } // Namespace Marble
561 
562 #include "EclipsesItem.moc"
563 
Marble::EclipsesItem::icon
QIcon icon() const
Returns an icon of the eclipse type.
Definition: EclipsesItem.cpp:59
Marble::EclipsesItem::northernPenumbra
const GeoDataLineString & northernPenumbra()
Return the eclipse's northern penumbra.
Definition: EclipsesItem.cpp:171
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
EclSolar::putEclSelect
void putEclSelect(int es)
Definition: eclsolar.cpp:652
Marble::EclipsesItem::TotalSun
Definition: EclipsesItem.h:54
Marble::EclipsesItem::AnnularTotalSun
Definition: EclipsesItem.h:55
Marble::GeoDataLinearRing
A LinearRing that allows to store a closed, contiguous set of line segments.
Definition: GeoDataLinearRing.h:68
Marble::EclipsesItem::shadowConePenumbra
GeoDataLinearRing shadowConePenumbra()
Return the shadow cone of the penumbra.
Definition: EclipsesItem.cpp:189
Marble::EclipsesItem::shadowCone60MagPenumbra
GeoDataLinearRing shadowCone60MagPenumbra()
Return the shadow cone of the penumbra at 60 percent magnitude.
Definition: EclipsesItem.cpp:198
Marble::EclipsesItem::maxLocation
const GeoDataCoordinates & maxLocation()
Return the coordinates of the eclipse's maximum.
Definition: EclipsesItem.cpp:135
EclSolar::getShadowCone
void getShadowCone(double mjd, bool umbra, int numpts, double *lat, double *lng)
Definition: eclsolar.cpp:2706
Marble::EclipsesItem::phase
EclipsesItem::EclipsePhase phase() const
Returns the phase of this eclipse event.
Definition: EclipsesItem.cpp:54
EclSolar::getEclYearInfo
void getEclYearInfo(char *wbuf)
Definition: eclsolar.cpp:458
Marble::GeoDataCoordinates::normalizeLon
static qreal normalizeLon(qreal lon, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize the longitude to always be -M_PI <= lon <= +M_PI (Radian).
Definition: GeoDataCoordinates.cpp:776
Marble::EclipsesItem::TotalMoon
Definition: EclipsesItem.h:47
EclSolar::setLocalPos
void setLocalPos(double lat, double lng, double hgt)
Definition: eclsolar.cpp:202
EclSolar::GRSBound
int GRSBound(bool firstc, double &lat1, double &lng1, double &lat2, double &lng2)
Definition: eclsolar.cpp:1972
Marble::EclipsesItem::sunBoundaries
const QList< GeoDataLinearRing > & sunBoundaries()
Return the eclipse's sun boundaries.
Definition: EclipsesItem.cpp:207
QVector::constEnd
const_iterator constEnd() const
QList::at
const T & at(int i) const
Marble::EclipsesItem::~EclipsesItem
~EclipsesItem()
Definition: EclipsesItem.cpp:39
QList::removeAt
void removeAt(int i)
Marble::EclipsesItem::partialDurationHours
int partialDurationHours() const
Returns the number of hours the partial phase takes place.
Definition: EclipsesItem.cpp:119
QVector::first
T & first()
EclSolar::getTotal
int getTotal(double &mjd_start, double &mjd_stop)
Definition: eclsolar.cpp:379
EclSolar::eclPltCentral
int eclPltCentral(bool firstc, double &lat, double &lng)
Definition: eclsolar.cpp:1582
QTime
MarbleDebug.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
EclSolar::setPenumbraAngle
void setPenumbraAngle(double pa, int mode)
Definition: eclsolar.cpp:771
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::EclipsesItem::AnnularSun
Definition: EclipsesItem.h:53
QList::size
int size() const
EclSolar::centralBound
int centralBound(bool firstc, double &lat1, double &lng1, double &lat2, double &lng2)
Definition: eclsolar.cpp:2621
EclSolar::getDatefromMJD
void getDatefromMJD(double mjd, int &year, int &month, int &day, int &hour, int &min, double &sec) const
Definition: eclsolar.cpp:438
EclSolar::GNSBound
int GNSBound(bool firstc, bool north, double &lat, double &lng)
Definition: eclsolar.cpp:1784
EclSolar
Definition: eclsolar.h:22
Marble::EclipsesItem::centralLine
const GeoDataLineString & centralLine()
The eclipse's central line.
Definition: EclipsesItem.cpp:144
Marble::EclipsesItem::PenumbralMoon
Definition: EclipsesItem.h:49
Marble::EclipsesItem::index
int index() const
The index of the eclipse event.
Definition: EclipsesItem.cpp:43
Marble::EclipsesItem::dateMaximum
const QDateTime & dateMaximum() const
Returns the date of the eclipse event's maximum.
Definition: EclipsesItem.cpp:104
QObject
EclSolar::getMaxPos
void getMaxPos(double &lat, double &lng)
Definition: eclsolar.cpp:1551
Marble::EclipsesItem::NonCentralAnnularSun
Definition: EclipsesItem.h:51
QDate
QString
QList
Marble::EclipsesItem::PartialMoon
Definition: EclipsesItem.h:48
Marble::EclipsesItem::EclipsesItem
EclipsesItem(EclSolar *ecl, int index, QObject *parent=0)
Construct the EclipseItem object and trigger basic calculations.
Definition: EclipsesItem.cpp:20
Marble::GeoDataLineString
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:75
Marble::EclipsesItem::endDatePartial
const QDateTime & endDatePartial() const
Returns the end date of the eclipse's partial phase.
Definition: EclipsesItem.cpp:114
QList::pop_back
void pop_back()
Marble::EclipsesItem::magnitude
double magnitude() const
Return the eclipse's magnitude.
Definition: EclipsesItem.cpp:99
QDateTime::toTime_t
uint toTime_t() const
Marble::EclipsesItem::takesPlaceAt
bool takesPlaceAt(const QDateTime &dateTime) const
Check if the event takes place at a given datetime.
Definition: EclipsesItem.cpp:48
QVector::constBegin
const_iterator constBegin() const
Marble::EclipsesItem::shadowConeUmbra
GeoDataLinearRing shadowConeUmbra()
Return the shadow cone of the umbra.
Definition: EclipsesItem.cpp:180
EclipsesItem.h
QVector
Marble::EclipsesItem::NonCentralTotalSun
Definition: EclipsesItem.h:52
QList::last
T & last()
Marble::GeoDataLineString::clear
void clear()
Destroys all nodes in a LineString.
Definition: GeoDataLineString.cpp:298
Marble::EclipsesItem::umbra
const GeoDataLinearRing & umbra()
Return the eclipse's umbra.
Definition: EclipsesItem.cpp:153
QList::prepend
void prepend(const T &value)
Marble::EclipsesItem::EclipsePhase
EclipsePhase
A type of an eclipse event.
Definition: EclipsesItem.h:46
Marble::EclipsesItem::phaseText
QString phaseText() const
Returns a human readable representation of the eclipse type.
Definition: EclipsesItem.cpp:82
EclSolar::getPartial
int getPartial(double &mjd_start, double &mjd_stop)
Definition: eclsolar.cpp:334
Marble::EclipsesItem::PartialSun
Definition: EclipsesItem.h:50
Marble::Tessellate
Definition: MarbleGlobal.h:32
EclSolar::getLocalMax
int getLocalMax(double &mjdmax, double &magmax, double &elmax)
Definition: eclsolar.cpp:275
Marble::EclipsesItem::startDateTotal
const QDateTime & startDateTotal() const
Returns the start date of the eclipse's total phase.
Definition: EclipsesItem.cpp:125
Marble::EclipsesItem::southernPenumbra
const GeoDataLineString & southernPenumbra()
Return the eclipse's southern penumbra.
Definition: EclipsesItem.cpp:162
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:36
Marble::EclipsesItem::endDateTotal
const QDateTime & endDateTotal() const
Returns the end date of the eclipse's total phase.
Definition: EclipsesItem.cpp:130
QIcon
QDateTime
Marble::EclipsesItem::startDatePartial
const QDateTime & startDatePartial() const
Returns the start date of the eclipse's partial phase.
Definition: EclipsesItem.cpp:109
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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