• 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
EclipsesPlugin.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 "EclipsesPlugin.h"
12 
13 #include "MarbleWidget.h"
14 #include "MarbleDebug.h"
15 #include "MarbleModel.h"
16 #include "MarbleClock.h"
17 #include "ViewportParams.h"
18 #include "GeoPainter.h"
19 
20 #include "EclipsesModel.h"
21 #include "EclipsesItem.h"
22 #include "EclipsesBrowserDialog.h"
23 
24 #include "ui_EclipsesConfigDialog.h"
25 #include "ui_EclipsesReminderDialog.h"
26 
27 #include <QPushButton>
28 #include <QTreeWidget>
29 #include <QTreeWidgetItem>
30 
31 namespace Marble
32 {
33 
34 EclipsesPlugin::EclipsesPlugin()
35  : RenderPlugin( 0 ),
36  m_isInitialized( false ),
37  m_marbleWidget( 0 ),
38  m_model( 0 ),
39  m_eclipsesActionGroup( 0 ),
40  m_eclipsesMenuAction( 0 ),
41  m_eclipsesListMenu( 0 ),
42  m_menuYear( 0 ),
43  m_configDialog( 0 ),
44  m_configWidget( 0 ),
45  m_browserDialog( 0 ),
46  m_reminderDialog( 0 ),
47  m_reminderWidget( 0 )
48 {
49 }
50 
51 EclipsesPlugin::EclipsesPlugin( const MarbleModel *marbleModel )
52  : RenderPlugin( marbleModel ),
53  m_isInitialized( false ),
54  m_marbleWidget( 0 ),
55  m_model( 0 ),
56  m_eclipsesActionGroup( 0 ),
57  m_eclipsesMenuAction( 0 ),
58  m_eclipsesListMenu( 0 ),
59  m_menuYear( 0 ),
60  m_configDialog( 0 ),
61  m_configWidget( 0 ),
62  m_browserDialog( 0 ),
63  m_reminderDialog( 0 ),
64  m_reminderWidget( 0 )
65 {
66  connect( this, SIGNAL(settingsChanged(QString)),
67  SLOT(updateSettings()) );
68 }
69 
70 EclipsesPlugin::~EclipsesPlugin()
71 {
72  if( m_isInitialized ) {
73  delete m_model;
74  delete m_eclipsesActionGroup;
75  delete m_eclipsesListMenu;
76  delete m_configDialog;
77  delete m_browserDialog;
78  delete m_reminderDialog;
79  }
80 }
81 
82 QStringList EclipsesPlugin::backendTypes() const
83 {
84  return QStringList( "eclipses" );
85 }
86 
87 QString EclipsesPlugin::renderPolicy() const
88 {
89  return QString( "ALWAYS" );
90 }
91 
92 QStringList EclipsesPlugin::renderPosition() const
93 {
94  return QStringList( "ORBIT" );
95 }
96 
97 QString EclipsesPlugin::name() const
98 {
99  return tr( "Eclipses" );
100 }
101 
102 QString EclipsesPlugin::nameId() const
103 {
104  return "eclipses";
105 }
106 
107 QString EclipsesPlugin::guiString() const
108 {
109  return tr( "E&clipses" );
110 }
111 
112 QString EclipsesPlugin::version() const
113 {
114  return "1.0";
115 }
116 
117 QString EclipsesPlugin::description() const
118 {
119  return tr( "This plugin visualizes solar eclipses." );
120 }
121 
122 QString EclipsesPlugin::copyrightYears() const
123 {
124  return "2013";
125 }
126 
127 QList<PluginAuthor> EclipsesPlugin::pluginAuthors() const
128 {
129  return QList<PluginAuthor>()
130  << PluginAuthor( "Rene Kuettner", "rene@bitkanal.net" )
131  << PluginAuthor( "Gerhard Holtkamp", "" );
132 }
133 
134 QIcon EclipsesPlugin::icon() const
135 {
136  return QIcon( ":res/eclipses.png" );
137 }
138 
139 RenderPlugin::RenderType EclipsesPlugin::renderType() const
140 {
141  return RenderPlugin::ThemeRenderType;
142  //return UnknownRenderType;
143 }
144 
145 QList<QActionGroup*>* EclipsesPlugin::actionGroups() const
146 {
147  return const_cast<QList<QActionGroup*>*>( &m_actionGroups );
148 }
149 
150 QDialog* EclipsesPlugin::configDialog()
151 {
152  Q_ASSERT( m_isInitialized );
153  return m_configDialog;
154 }
155 
156 void EclipsesPlugin::initialize()
157 {
158  if( isInitialized() ) {
159  return;
160  }
161 
162  // initialize dialogs
163  m_configDialog = new QDialog();
164  m_configWidget = new Ui::EclipsesConfigDialog();
165  m_configWidget->setupUi( m_configDialog );
166 
167  connect( m_configDialog, SIGNAL(accepted()),
168  this, SLOT(writeSettings()) );
169  connect( m_configDialog, SIGNAL(rejected()),
170  this, SLOT(readSettings()) );
171  connect( m_configWidget->buttonBox->button( QDialogButtonBox::Reset ),
172  SIGNAL(clicked()), this, SLOT(readSettings()) );
173  connect( m_configWidget->buttonBox->button( QDialogButtonBox::Apply ),
174  SIGNAL(clicked()), this, SLOT(writeSettings()) );
175  connect( m_configWidget->buttonBox->button( QDialogButtonBox::Apply ),
176  SIGNAL(clicked()), this, SLOT(updateEclipses()) );
177 
178  m_browserDialog = new EclipsesBrowserDialog( marbleModel() );
179  connect( m_browserDialog, SIGNAL(buttonShowClicked(int, int)),
180  this, SLOT(showEclipse(int,int)) );
181  connect( m_browserDialog, SIGNAL(buttonSettingsClicked()),
182  m_configDialog, SLOT(show()) );
183 
184  m_reminderDialog = new QDialog();
185  m_reminderWidget = new Ui::EclipsesReminderDialog();
186  m_reminderWidget->setupUi( m_reminderDialog );
187 
188  // initialize menu entries
189  m_eclipsesActionGroup = new QActionGroup( this );
190  m_actionGroups.append( m_eclipsesActionGroup );
191 
192  m_eclipsesListMenu = new QMenu( "" );
193  m_eclipsesActionGroup->addAction( m_eclipsesListMenu->menuAction() );
194  connect( m_eclipsesListMenu, SIGNAL(triggered(QAction*)),
195  this, SLOT(showEclipseFromMenu(QAction*)) );
196 
197  m_eclipsesMenuAction = new QAction(
198  tr("Browse Ecli&pses..."), m_eclipsesActionGroup );
199  m_eclipsesMenuAction->setIcon( QIcon( ":res/eclipses.png" ) );
200  m_eclipsesActionGroup->addAction( m_eclipsesMenuAction );
201  connect( m_eclipsesMenuAction, SIGNAL(triggered()),
202  m_browserDialog, SLOT(show()) );
203 
204  // initialize eclipses model
205  m_model = new EclipsesModel( marbleModel() );
206 
207  connect( marbleModel()->clock(), SIGNAL(timeChanged()),
208  this, SLOT(updateEclipses()) );
209 
210  m_isInitialized = true;
211 
212  readSettings();
213  updateEclipses();
214  updateMenuItemState();
215  updateSettings();
216 }
217 
218 bool EclipsesPlugin::isInitialized() const
219 {
220  return m_isInitialized;
221 }
222 
223 bool EclipsesPlugin::eventFilter( QObject *object, QEvent *e )
224 {
225  // delayed initialization of pointer to marble widget
226  MarbleWidget *widget = dynamic_cast<MarbleWidget*> (object);
227  if ( widget && m_marbleWidget != widget ) {
228  connect( widget, SIGNAL(themeChanged(QString)),
229  this, SLOT(updateMenuItemState()) );
230  m_marbleWidget = widget;
231  }
232 
233  return RenderPlugin::eventFilter(object, e);
234 }
235 
236 bool EclipsesPlugin::render( GeoPainter *painter,
237  ViewportParams *viewport,
238  const QString &renderPos,
239  GeoSceneLayer *layer )
240 {
241  Q_UNUSED( viewport );
242  Q_UNUSED( renderPos );
243  Q_UNUSED( layer );
244 
245  if( marbleModel()->planetId() == "earth" ) {
246  foreach( EclipsesItem *item, m_model->items() ) {
247  if( item->takesPlaceAt( marbleModel()->clock()->dateTime() ) ) {
248  return renderItem( painter, item );
249  }
250  }
251  }
252 
253  return true;
254 }
255 
256 bool EclipsesPlugin::renderItem( GeoPainter *painter, EclipsesItem *item ) const
257 {
258  int phase = item->phase();
259 
260  // Draw full penumbra shadow cone
261  if( m_configWidget->checkBoxShowFullPenumbra->isChecked() ) {
262  painter->setPen( Oxygen::aluminumGray1 );
263  QColor sunBoundingBrush ( Oxygen::aluminumGray6 );
264  sunBoundingBrush.setAlpha( 48 );
265  painter->setBrush( sunBoundingBrush );
266  painter->drawPolygon( item->shadowConePenumbra() );
267  }
268 
269  // Draw 60% penumbra shadow cone
270  if( m_configWidget->checkBoxShow60MagPenumbra->isChecked() ) {
271  painter->setPen( Oxygen::aluminumGray2 );
272  QColor penumbraBrush ( Oxygen::aluminumGray6 );
273  penumbraBrush.setAlpha( 96 );
274  painter->setBrush( penumbraBrush );
275  painter->drawPolygon( item->shadowCone60MagPenumbra() );
276  }
277 
278  // Draw southern boundary of the penumbra
279  if( m_configWidget->checkBoxShowSouthernPenumbra->isChecked() ) {
280  QColor southernBoundaryColor(Oxygen::brickRed1);
281  southernBoundaryColor.setAlpha(128);
282  QPen southernBoundary(southernBoundaryColor);
283  southernBoundary.setWidth(3);
284  painter->setPen( southernBoundary );
285  painter->drawPolyline( item->southernPenumbra() );
286  painter->setPen( Oxygen::brickRed5 );
287  painter->drawPolyline( item->southernPenumbra() );
288  }
289 
290  // Draw northern boundary of the penumbra
291  if( m_configWidget->checkBoxShowNorthernPenumbra->isChecked() ) {
292  QColor northernBoundaryColor(Oxygen::brickRed1);
293  northernBoundaryColor.setAlpha(128);
294  QPen northernBoundary(northernBoundaryColor);
295  northernBoundary.setWidth(3);
296  painter->setPen( northernBoundary );
297  painter->drawPolyline( item->northernPenumbra() );
298  painter->setPen( Oxygen::brickRed5 );
299  painter->drawPolyline( item->northernPenumbra() );
300  }
301 
302  // Draw Sunrise / Sunset Boundaries
303  if( m_configWidget->checkBoxShowSunBoundaries->isChecked() ) {
304  painter->setPen( Oxygen::hotOrange6 );
305  const QList<GeoDataLinearRing> boundaries = item->sunBoundaries();
306  QList<GeoDataLinearRing>::const_iterator i = boundaries.constBegin();
307  QColor sunBoundingBrush ( Oxygen::hotOrange5 );
308  sunBoundingBrush.setAlpha( 64 );
309  painter->setBrush( sunBoundingBrush );
310  for( ; i != boundaries.constEnd(); ++i ) {
311  painter->drawPolygon( *i );
312  }
313  }
314 
315  // total or annular eclipse
316  if( m_configWidget->checkBoxShowUmbra->isChecked() && phase > 3 )
317  {
318  painter->setPen( Oxygen::aluminumGray4 );
319  QColor sunBoundingBrush ( Oxygen::aluminumGray6 );
320  sunBoundingBrush.setAlpha( 128 );
321  painter->setBrush( sunBoundingBrush );
322  painter->drawPolygon( item->umbra() );
323 
324  // draw shadow cone
325  painter->setPen( Qt::black );
326  QColor shadowConeBrush ( Oxygen::aluminumGray6 );
327  shadowConeBrush.setAlpha( 128 );
328  painter->setBrush( shadowConeBrush );
329  painter->drawPolygon( item->shadowConeUmbra() );
330  }
331 
332  // plot central line
333  if( m_configWidget->checkBoxShowCentralLine->isChecked() && phase > 3 ) {
334  painter->setPen( Qt::black );
335  painter->drawPolyline( item->centralLine() );
336  }
337 
338  // mark point of maximum eclipse
339  if( m_configWidget->checkBoxShowMaximum->isChecked() ) {
340  painter->setPen( Qt::white );
341  QColor sunBoundingBrush ( Qt::white );
342  sunBoundingBrush.setAlpha( 128 );
343  painter->setBrush( sunBoundingBrush );
344 
345  painter->drawEllipse( item->maxLocation(), 15, 15 );
346  painter->setPen( Oxygen::brickRed4 );
347  painter->drawText( item->maxLocation(), tr( "Maximum of Eclipse" ) );
348  }
349 
350  return true;
351 }
352 
353 QHash<QString, QVariant> EclipsesPlugin::settings() const
354 {
355  return RenderPlugin::settings();
356 }
357 
358 void EclipsesPlugin::setSettings( const QHash<QString, QVariant> &settings )
359 {
360  RenderPlugin::setSettings( settings );
361  m_settings = settings;
362  emit settingsChanged( nameId() );
363 }
364 
365 void EclipsesPlugin::readSettings()
366 {
367  m_configWidget->checkBoxEnableLunarEclipses->setChecked(
368  m_settings.value( "enableLunarEclipses", false ).toBool() );
369  m_configWidget->checkBoxShowMaximum->setChecked(
370  m_settings.value( "showMaximum", true ).toBool() );
371  m_configWidget->checkBoxShowUmbra->setChecked(
372  m_settings.value( "showUmbra", true ).toBool() );
373  m_configWidget->checkBoxShowSouthernPenumbra->setChecked(
374  m_settings.value( "showSouthernPenumbra", true ).toBool() );
375  m_configWidget->checkBoxShowNorthernPenumbra->setChecked(
376  m_settings.value( "showNorthernPenumbra", true ).toBool() );
377  m_configWidget->checkBoxShowCentralLine->setChecked(
378  m_settings.value( "showCentralLine", true ).toBool() );
379  m_configWidget->checkBoxShowFullPenumbra->setChecked(
380  m_settings.value( "showFullPenumbra", true ).toBool() );
381  m_configWidget->checkBoxShow60MagPenumbra->setChecked(
382  m_settings.value( "show60MagPenumbra", false ).toBool() );
383  m_configWidget->checkBoxShowSunBoundaries->setChecked(
384  m_settings.value( "showSunBoundaries", true ).toBool() );
385 }
386 
387 void EclipsesPlugin::writeSettings()
388 {
389  m_settings.insert( "enableLunarEclipses",
390  m_configWidget->checkBoxEnableLunarEclipses->isChecked() );
391  m_settings.insert( "showMaximum",
392  m_configWidget->checkBoxShowMaximum->isChecked() );
393  m_settings.insert( "showUmbra",
394  m_configWidget->checkBoxShowUmbra->isChecked() );
395  m_settings.insert( "showSouthernPenumbra",
396  m_configWidget->checkBoxShowSouthernPenumbra->isChecked() );
397  m_settings.insert( "showNorthernPenumbra",
398  m_configWidget->checkBoxShowNorthernPenumbra->isChecked() );
399  m_settings.insert( "showCentralLine",
400  m_configWidget->checkBoxShowCentralLine->isChecked() );
401  m_settings.insert( "showFullPenumbra",
402  m_configWidget->checkBoxShowFullPenumbra->isChecked() );
403  m_settings.insert( "show60MagPenumbra",
404  m_configWidget->checkBoxShow60MagPenumbra->isChecked() );
405  m_settings.insert( "showSunBoundaries",
406  m_configWidget->checkBoxShowSunBoundaries->isChecked() );
407 
408  emit settingsChanged( nameId() );
409 }
410 
411 void EclipsesPlugin::updateSettings()
412 {
413  if (!isInitialized()) {
414  return;
415  }
416 
417  m_browserDialog->setWithLunarEclipses(
418  m_settings.value( "enableLunarEclipses" ).toBool() );
419  if( m_model->withLunarEclipses() !=
420  m_settings.value( "enableLunarEclipses" ).toBool() ) {
421  updateEclipses();
422  }
423 }
424 
425 void EclipsesPlugin::updateEclipses()
426 {
427  mDebug() << "Updating eclipses....";
428  const int year = marbleModel()->clock()->dateTime().date().year();
429  const bool lun = m_settings.value( "enableLunarEclipses" ).toBool();
430 
431  if( ( m_menuYear != year ) || ( m_model->withLunarEclipses() != lun ) ) {
432 
433  // remove old menus
434  foreach( QAction *action, m_eclipsesListMenu->actions() ) {
435  m_eclipsesListMenu->removeAction( action );
436  delete action;
437  }
438 
439  // update year and create menus for this year's eclipse events
440  if( m_model->year() != year ) {
441  m_model->setYear( year );
442  }
443  m_menuYear = year;
444 
445  // enable/disable lunar eclipses if necessary
446  if( m_model->withLunarEclipses() != lun ) {
447  m_model->setWithLunarEclipses( lun );
448  }
449 
450  m_eclipsesListMenu->setTitle( tr("Eclipses in %1").arg( year ) );
451 
452  foreach( EclipsesItem *item, m_model->items() ) {
453  QAction *action = m_eclipsesListMenu->addAction(
454  item->dateMaximum().date().toString() );
455  action->setData( QVariant( 1000 * item->dateMaximum().date().year() + item->index() ) );
456  action->setIcon( item->icon() );
457  }
458 
459  emit actionGroupsChanged();
460  }
461 }
462 
463 void EclipsesPlugin::updateMenuItemState()
464 {
465  if( !isInitialized() ) {
466  return;
467  }
468 
469  // eclipses are only supported for earth based obervers at the moment
470  // so we disable the menu items for other celestial bodies
471 
472  bool active = ( marbleModel()->planetId() == "earth" );
473 
474  m_eclipsesListMenu->setEnabled( active );
475  m_eclipsesMenuAction->setEnabled( active );
476 }
477 
478 void EclipsesPlugin::showEclipse( int year, int index )
479 {
480  if( m_model->year() != year ) {
481  m_model->setYear( year );
482  }
483 
484  EclipsesItem *item = m_model->eclipseWithIndex( index );
485  Q_ASSERT( item );
486 
487  if( item ) {
488  m_marbleWidget->model()->clock()->setDateTime( item->dateMaximum() );
489  m_marbleWidget->centerOn( item->maxLocation() );
490  }
491 }
492 
493 void EclipsesPlugin::showEclipseFromMenu( QAction *action )
494 {
495  Q_ASSERT( action->data().isValid() );
496  int year = action->data().toInt() / 1000;
497  int index = action->data().toInt() - 1000 * year;
498 
499  showEclipse( year, index );
500 }
501 
502 } // namespace Marble
503 
504 Q_EXPORT_PLUGIN2( EclipsesPlugin, Marble::EclipsesPlugin )
505 
506 #include "EclipsesPlugin.moc"
507 
Marble::EclipsesItem::northernPenumbra
const GeoDataLineString & northernPenumbra()
Return the eclipse's northern penumbra.
Definition: EclipsesItem.cpp:171
QEvent
QHash::insert
iterator insert(const Key &key, const T &value)
Marble::EclipsesPlugin::copyrightYears
QString copyrightYears() const
Definition: EclipsesPlugin.cpp:122
Marble::GeoPainter::drawPolygon
void drawPolygon(const GeoDataLinearRing &linearRing, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws a given linear ring (a "polygon without holes").
Definition: GeoPainter.cpp:560
QActionGroup
Marble::EclipsesItem::shadowConePenumbra
GeoDataLinearRing shadowConePenumbra()
Return the shadow cone of the penumbra.
Definition: EclipsesItem.cpp:189
Marble::EclipsesBrowserDialog
The eclipse browser dialog.
Definition: EclipsesBrowserDialog.h:33
Marble::EclipsesPlugin::setSettings
void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: EclipsesPlugin.cpp:358
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
Marble::Oxygen::brickRed1
QColor const brickRed1
Definition: MarbleColors.h:35
Marble::EclipsesItem::phase
EclipsesItem::EclipsePhase phase() const
Returns the phase of this eclipse event.
Definition: EclipsesItem.cpp:54
EclipsesPlugin.h
Marble::MarbleClock::setDateTime
void setDateTime(const QDateTime &datetime)
Sets the internal date and time a custom one.
Definition: MarbleClock.cpp:94
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::RenderPlugin::eventFilter
bool eventFilter(QObject *, QEvent *)
Definition: RenderPlugin.cpp:216
Marble::EclipsesPlugin::renderPolicy
QString renderPolicy() const
Return how the plugin settings should be used.
Definition: EclipsesPlugin.cpp:87
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::EclipsesModel::eclipseWithIndex
EclipsesItem * eclipseWithIndex(int index)
Get eclipse item of a given year.
Definition: EclipsesModel.cpp:89
QAction::data
QVariant data() const
Marble::EclipsesPlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: EclipsesPlugin.cpp:102
Marble::EclipsesItem::sunBoundaries
const QList< GeoDataLinearRing > & sunBoundaries()
Return the eclipse's sun boundaries.
Definition: EclipsesItem.cpp:207
QAction::setIcon
void setIcon(const QIcon &icon)
Marble::MarbleModel::planetId
QString planetId() const
Definition: MarbleModel.cpp:532
Marble::PluginAuthor
Definition: PluginInterface.h:28
Marble::EclipsesPlugin::description
QString description() const
Returns a user description of the plugin.
Definition: EclipsesPlugin.cpp:117
QMenu::addAction
void addAction(QAction *action)
Marble::MarbleModel::clock
MarbleClock * clock()
Definition: MarbleModel.cpp:537
Marble::EclipsesPlugin::initialize
void initialize()
Definition: EclipsesPlugin.cpp:156
Marble::EclipsesPlugin::actionGroups
QList< QActionGroup * > * actionGroups() const
Getting all actions.
Definition: EclipsesPlugin.cpp:145
Marble::GeoPainter::drawPolyline
void drawPolyline(const GeoDataLineString &lineString, const QString &labelText=QString(), LabelPositionFlags labelPositionFlags=LineCenter)
Draws a given line string (a "polyline").
Definition: GeoPainter.cpp:474
QActionGroup::addAction
QAction * addAction(QAction *action)
Marble::EclipsesPlugin::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: EclipsesPlugin.cpp:223
Marble::RenderPlugin::action
QAction * action() const
Plugin's menu action.
Definition: RenderPlugin.cpp:88
EclipsesBrowserDialog.h
Marble::GeoPainter::drawEllipse
void drawEllipse(const GeoDataCoordinates &centerPosition, qreal width, qreal height, bool isGeoProjected=false)
Draws an ellipse at the given position. The ellipse is placed with its center located at the given ce...
Definition: GeoPainter.cpp:289
Marble::EclipsesPlugin::renderPosition
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: EclipsesPlugin.cpp:92
MarbleDebug.h
Marble::EclipsesModel::setYear
void setYear(int year)
Set the year.
Definition: EclipsesModel.cpp:58
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QList::const_iterator
Marble::EclipsesPlugin::version
QString version() const
Definition: EclipsesPlugin.cpp:112
Marble::MarbleClock::dateTime
QDateTime dateTime() const
Returns the internal date and time.
Definition: MarbleClock.cpp:100
Marble::EclipsesPlugin::backendTypes
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: EclipsesPlugin.cpp:82
Marble::EclipsesPlugin::isInitialized
bool isInitialized() const
Definition: EclipsesPlugin.cpp:218
EclipsesModel.h
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
Marble::Oxygen::aluminumGray2
QColor const aluminumGray2
Definition: MarbleColors.h:94
Marble::RenderPlugin::actionGroupsChanged
void actionGroupsChanged()
This signal is emitted if the actions that the plugin supports change in any way. ...
Marble::EclipsesModel::items
QList< EclipsesItem * > items() const
Return the items in this model.
Definition: EclipsesModel.cpp:100
QWidget::setEnabled
void setEnabled(bool)
Marble::EclipsesItem::centralLine
const GeoDataLineString & centralLine()
The eclipse's central line.
Definition: EclipsesItem.cpp:144
QList::append
void append(const T &value)
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
QVariant::toInt
int toInt(bool *ok) const
Marble::Oxygen::aluminumGray4
QColor const aluminumGray4
Definition: MarbleColors.h:92
QHash< QString, QVariant >
Marble::EclipsesPlugin::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: EclipsesPlugin.cpp:150
Marble::EclipsesModel::setWithLunarEclipses
void setWithLunarEclipses(const bool enable)
Set if lunar eclipses are enbled.
Definition: EclipsesModel.cpp:75
QObject
QPainter::setPen
void setPen(const QColor &color)
Marble::RenderPlugin::settingsChanged
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
Marble::Oxygen::aluminumGray6
QColor const aluminumGray6
Definition: MarbleColors.h:90
Marble::Oxygen::brickRed5
QColor const brickRed5
Definition: MarbleColors.h:31
Marble::MarbleWidget::model
MarbleModel * model()
Return the model that this view shows.
Definition: MarbleWidget.cpp:289
QPainter::setBrush
void setBrush(const QBrush &brush)
Marble::EclipsesPlugin::render
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer)
Renders the content provided by the layer on the viewport.
Definition: EclipsesPlugin.cpp:236
Marble::EclipsesPlugin::renderType
RenderPlugin::RenderType renderType() const
Render type of the plugin.
Definition: EclipsesPlugin.cpp:139
QMenu::setTitle
void setTitle(const QString &title)
Marble::EclipsesPlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: EclipsesPlugin.cpp:97
QDate::year
int year() const
QString
QList
QColor
GeoPainter.h
Marble::EclipsesModel::year
int year() const
Return the year.
Definition: EclipsesModel.cpp:70
Marble::EclipsesPlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: EclipsesPlugin.cpp:127
Marble::Oxygen::hotOrange5
QColor const hotOrange5
Definition: MarbleColors.h:85
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::Oxygen::aluminumGray1
QColor const aluminumGray1
Definition: MarbleColors.h:95
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
Marble::EclipsesPlugin
This plugin displays solar eclipses.
Definition: EclipsesPlugin.h:40
QAction::setData
void setData(const QVariant &userData)
Marble::EclipsesPlugin::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: EclipsesPlugin.cpp:107
QHash::value
const T value(const Key &key) const
QMenu
Marble::MarbleWidget::centerOn
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
Definition: MarbleWidget.cpp:549
MarbleClock.h
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::EclipsesModel::withLunarEclipses
bool withLunarEclipses() const
Return whether or not lunar eclipses are enabled.
Definition: EclipsesModel.cpp:84
Marble::EclipsesItem::takesPlaceAt
bool takesPlaceAt(const QDateTime &dateTime) const
Check if the event takes place at a given datetime.
Definition: EclipsesItem.cpp:48
Marble::Oxygen::brickRed4
QColor const brickRed4
Definition: MarbleColors.h:32
Marble::GeoPainter::drawText
void drawText(const GeoDataCoordinates &position, const QString &text)
Draws the given text at a given geographic position. The text is drawn starting at the given position...
Definition: GeoPainter.cpp:264
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
Marble::EclipsesItem::shadowConeUmbra
GeoDataLinearRing shadowConeUmbra()
Return the shadow cone of the umbra.
Definition: EclipsesItem.cpp:180
EclipsesItem.h
QDateTime::date
QDate date() const
Marble::Oxygen::hotOrange6
QColor const hotOrange6
Definition: MarbleColors.h:84
QAction
QWidget::removeAction
void removeAction(QAction *action)
Marble::EclipsesItem::umbra
const GeoDataLinearRing & umbra()
Return the eclipse's umbra.
Definition: EclipsesItem.cpp:153
QPen
QDialog
MarbleWidget.h
This file contains the headers for MarbleWidget.
QVariant::isValid
bool isValid() const
Marble::EclipsesBrowserDialog::setWithLunarEclipses
void setWithLunarEclipses(const bool enable)
Set whether or not to list lunar eclipses.
Definition: EclipsesBrowserDialog.cpp:47
QMenu::menuAction
QAction * menuAction() const
Marble::RenderPlugin::ThemeRenderType
Definition: RenderPlugin.h:64
QList::constEnd
const_iterator constEnd() const
QList::constBegin
const_iterator constBegin() const
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:83
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QWidget::actions
QList< QAction * > actions() const
Marble::RenderPlugin::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: RenderPlugin.cpp:185
Marble::EclipsesItem::southernPenumbra
const GeoDataLineString & southernPenumbra()
Return the eclipse's southern penumbra.
Definition: EclipsesItem.cpp:162
Marble::EclipsesPlugin::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: EclipsesPlugin.cpp:134
Marble::RenderPlugin::RenderType
RenderType
A Type of plugin.
Definition: RenderPlugin.h:59
Marble::EclipsesPlugin::~EclipsesPlugin
virtual ~EclipsesPlugin()
Definition: EclipsesPlugin.cpp:70
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:36
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::RenderPlugin::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: RenderPlugin.cpp:195
Marble::EclipsesItem
The representation of an eclipse event.
Definition: EclipsesItem.h:37
QAction::setEnabled
void setEnabled(bool)
Marble::EclipsesPlugin::EclipsesPlugin
EclipsesPlugin()
Definition: EclipsesPlugin.cpp:34
QIcon
Marble::EclipsesModel
The model for eclipses.
Definition: EclipsesModel.h:36
Marble::EclipsesPlugin::settings
QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: EclipsesPlugin.cpp:353
QVariant
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