• 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
  • overviewmap
OverviewMap.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 2008 Torsten Rahn <tackat@kde.org>
9 //
10 
11 #include "OverviewMap.h"
12 
13 #include <QRect>
14 #include <QStringList>
15 #include <QCursor>
16 #include <QMouseEvent>
17 #include <QPainter>
18 #include <QPixmap>
19 #include <QFileDialog>
20 #include <QHBoxLayout>
21 #include <QSvgRenderer>
22 #include <QColorDialog>
23 
24 #include "MarbleDirs.h"
25 #include "MarbleDebug.h"
26 #include "MarbleModel.h"
27 #include "ui_OverviewMapConfigWidget.h"
28 
29 #include "GeoDataPoint.h"
30 #include "ViewportParams.h"
31 #include "MarbleWidget.h"
32 #include "Planet.h"
33 
34 namespace Marble
35 {
36 
37 OverviewMap::OverviewMap()
38  : AbstractFloatItem( 0 ),
39  ui_configWidget( 0 ),
40  m_configDialog( 0 ),
41  m_mapChanged( false )
42 {
43 }
44 
45 OverviewMap::OverviewMap( const MarbleModel *marbleModel )
46  : AbstractFloatItem( marbleModel, QPointF( 10.5, 10.5 ), QSizeF( 166.0, 86.0 ) ),
47  m_target(),
48  m_planetID( Planet::planetList() ),
49  m_defaultSize( AbstractFloatItem::size() ),
50  ui_configWidget( 0 ),
51  m_configDialog( 0 ),
52  m_mapChanged( false )
53 {
54  // cache is no needed because:
55  // (1) the SVG overview map is already rendered and stored in m_worldmap pixmap
56  // (2) bounding box and location dot keep changing during navigation
57  setCacheMode( NoCache );
58  connect( this, SIGNAL(settingsChanged(QString)),
59  this, SLOT(updateSettings()) );
60 
61  restoreDefaultSettings();
62 }
63 
64 OverviewMap::~OverviewMap()
65 {
66  QHash<QString, QSvgWidget *>::const_iterator pos = m_svgWidgets.constBegin();
67  QHash<QString, QSvgWidget *>::const_iterator const end = m_svgWidgets.constEnd();
68  for (; pos != end; ++pos ) {
69  delete pos.value();
70  }
71 }
72 
73 QStringList OverviewMap::backendTypes() const
74 {
75  return QStringList( "overviewmap" );
76 }
77 
78 QString OverviewMap::name() const
79 {
80  return tr("Overview Map");
81 }
82 
83 QString OverviewMap::guiString() const
84 {
85  return tr("&Overview Map");
86 }
87 
88 QString OverviewMap::nameId() const
89 {
90  return QString( "overviewmap" );
91 }
92 
93 QString OverviewMap::version() const
94 {
95  return "1.0";
96 }
97 
98 QString OverviewMap::description() const
99 {
100  return tr("This is a float item that provides an overview map.");
101 }
102 
103 QString OverviewMap::copyrightYears() const
104 {
105  return "2008";
106 }
107 
108 QList<PluginAuthor> OverviewMap::pluginAuthors() const
109 {
110  return QList<PluginAuthor>()
111  << PluginAuthor( "Torsten Rahn", "tackat@kde.org" );
112 }
113 
114 QIcon OverviewMap::icon () const
115 {
116  return QIcon(":/icons/worldmap.png");
117 }
118 
119 QDialog *OverviewMap::configDialog()
120 {
121  if ( !m_configDialog ) {
122  // Initializing configuration dialog
123  m_configDialog = new QDialog();
124  ui_configWidget = new Ui::OverviewMapConfigWidget;
125  ui_configWidget->setupUi( m_configDialog );
126  for( int i = 0; i < m_planetID.size(); ++i ) {
127  ui_configWidget->m_planetComboBox->addItem( Planet::name(m_planetID.value( i ) ) );
128  }
129  ui_configWidget->m_planetComboBox->setCurrentIndex( 2 );
130  readSettings();
131  loadMapSuggestions();
132  connect( ui_configWidget->m_buttonBox, SIGNAL(accepted()),
133  SLOT(writeSettings()) );
134  connect( ui_configWidget->m_buttonBox, SIGNAL(rejected()),
135  SLOT(readSettings()) );
136  connect( ui_configWidget->m_buttonBox->button( QDialogButtonBox::Reset ), SIGNAL(clicked()),
137  SLOT(restoreDefaultSettings()) );
138  QPushButton *applyButton = ui_configWidget->m_buttonBox->button( QDialogButtonBox::Apply );
139  connect( applyButton, SIGNAL(clicked()),
140  SLOT(writeSettings()) );
141  connect( ui_configWidget->m_fileChooserButton, SIGNAL(clicked()),
142  SLOT(chooseCustomMap()) );
143  connect( ui_configWidget->m_widthBox, SIGNAL(valueChanged(int)),
144  SLOT(synchronizeSpinboxes()) );
145  connect( ui_configWidget->m_heightBox, SIGNAL(valueChanged(int)),
146  SLOT(synchronizeSpinboxes()) );
147  connect( ui_configWidget->m_planetComboBox, SIGNAL(currentIndexChanged(int)),
148  SLOT(showCurrentPlanetPreview()) );
149  connect( ui_configWidget->m_colorChooserButton, SIGNAL(clicked()),
150  SLOT(choosePositionIndicatorColor()) );
151  connect( ui_configWidget->m_tableWidget, SIGNAL(cellClicked(int,int)),
152  SLOT(useMapSuggestion(int)) );
153  }
154  return m_configDialog;
155 }
156 
157 void OverviewMap::initialize ()
158 {
159 }
160 
161 bool OverviewMap::isInitialized () const
162 {
163  return true;
164 }
165 
166 void OverviewMap::setProjection( const ViewportParams *viewport )
167 {
168  GeoDataLatLonAltBox latLonAltBox = viewport->latLonAltBox( QRect( QPoint( 0, 0 ), viewport->size() ) );
169  const qreal centerLon = viewport->centerLongitude();
170  const qreal centerLat = viewport->centerLatitude();
171  QString target = marbleModel()->planetId();
172 
173  if ( target != m_target ) {
174  changeBackground( target );
175  m_target = target;
176  update();
177  }
178 
179  if ( !( m_latLonAltBox == latLonAltBox
180  && m_centerLon == centerLon
181  && m_centerLat == centerLat ) )
182  {
183  m_latLonAltBox = latLonAltBox;
184  m_centerLon = centerLon;
185  m_centerLat = centerLat;
186  update();
187  }
188 
189  AbstractFloatItem::setProjection( viewport );
190 }
191 
192 void OverviewMap::paintContent( QPainter *painter )
193 {
194  painter->save();
195 
196  QRectF mapRect( contentRect() );
197 
198  if ( m_svgobj.isValid() ) {
199  // Rerender worldmap pixmap if the size or map has changed
200  if ( m_worldmap.size() != mapRect.size().toSize() || m_mapChanged ) {
201  m_mapChanged = false;
202  m_worldmap = QPixmap( mapRect.size().toSize() );
203  m_worldmap.fill( Qt::transparent );
204  QPainter mapPainter;
205  mapPainter.begin( &m_worldmap );
206  mapPainter.setViewport( m_worldmap.rect() );
207  m_svgobj.render( &mapPainter );
208  mapPainter.end();
209  }
210 
211  painter->drawPixmap( QPoint( 0, 0 ), m_worldmap );
212  }
213  else {
214  painter->setPen( QPen( Qt::DashLine ) );
215  painter->drawRect( QRectF( QPoint( 0, 0 ), mapRect.size().toSize() ) );
216 
217  for ( int y = 1; y < 4; ++y ) {
218  if ( y == 2 ) {
219  painter->setPen( QPen( Qt::DashLine ) );
220  }
221  else {
222  painter->setPen( QPen( Qt::DotLine ) );
223  }
224 
225  painter->drawLine( 0.0, 0.25 * y * mapRect.height(),
226  mapRect.width(), 0.25 * y * mapRect.height() );
227  }
228  for ( int x = 1; x < 8; ++x ) {
229  if ( x == 4 ) {
230  painter->setPen( QPen( Qt::DashLine ) );
231  }
232  else {
233  painter->setPen( QPen( Qt::DotLine ) );
234  }
235 
236  painter->drawLine( 0.125 * x * mapRect.width(), 0,
237  0.125 * x * mapRect.width(), mapRect.height() );
238  }
239  }
240 
241  // Now draw the latitude longitude bounding box
242  qreal xWest = mapRect.width() / 2.0
243  + mapRect.width() / ( 2.0 * M_PI ) * m_latLonAltBox.west();
244  qreal xEast = mapRect.width() / 2.0
245  + mapRect.width() / ( 2.0 * M_PI ) * m_latLonAltBox.east();
246  qreal xNorth = mapRect.height() / 2.0
247  - mapRect.height() / M_PI * m_latLonAltBox.north();
248  qreal xSouth = mapRect.height() / 2.0
249  - mapRect.height() / M_PI * m_latLonAltBox.south();
250 
251  qreal lon = m_centerLon;
252  qreal lat = m_centerLat;
253  GeoDataCoordinates::normalizeLonLat( lon, lat );
254  qreal x = mapRect.width() / 2.0 + mapRect.width() / ( 2.0 * M_PI ) * lon;
255  qreal y = mapRect.height() / 2.0 - mapRect.height() / M_PI * lat;
256 
257  painter->setPen( QPen( Qt::white ) );
258  painter->setBrush( QBrush( Qt::transparent ) );
259  painter->setRenderHint( QPainter::Antialiasing, false );
260 
261  qreal boxWidth = xEast - xWest;
262  qreal boxHeight = xSouth - xNorth;
263 
264  qreal minBoxSize = 2.0;
265  if ( boxHeight < minBoxSize ) boxHeight = minBoxSize;
266 
267  if ( m_latLonAltBox.west() <= m_latLonAltBox.east() ) {
268  // Make sure the latLonBox is still visible
269  if ( boxWidth < minBoxSize ) boxWidth = minBoxSize;
270 
271  painter->drawRect( QRectF( xWest, xNorth, boxWidth, boxHeight ) );
272  }
273  else {
274  // If the dateline is shown in the viewport and if the poles are not
275  // then there are two boxes that represent the latLonBox of the view.
276 
277  boxWidth = xEast;
278 
279  // Make sure the latLonBox is still visible
280  if ( boxWidth < minBoxSize ) boxWidth = minBoxSize;
281 
282  painter->drawRect( QRectF( 0, xNorth, boxWidth, boxHeight ) );
283 
284  boxWidth = mapRect.width() - xWest;
285 
286  // Make sure the latLonBox is still visible
287  if ( boxWidth < minBoxSize ) boxWidth = minBoxSize;
288 
289  painter->drawRect( QRectF( xWest, xNorth, boxWidth, boxHeight ) );
290  }
291 
292  painter->setPen( QPen( m_posColor ) );
293  painter->setBrush( QBrush( m_posColor ) );
294 
295  qreal circleRadius = 2.5;
296  painter->setRenderHint( QPainter::Antialiasing, true );
297  painter->drawEllipse( QRectF( x - circleRadius, y - circleRadius , 2 * circleRadius, 2 * circleRadius ) );
298 
299  painter->restore();
300 }
301 
302 QHash<QString,QVariant> OverviewMap::settings() const
303 {
304  QHash<QString, QVariant> result = AbstractFloatItem::settings();
305 
306  typedef QHash<QString, QVariant>::ConstIterator Iterator;
307  Iterator end = m_settings.constEnd();
308  for ( Iterator iter = m_settings.constBegin(); iter != end; ++iter ) {
309  result.insert( iter.key(), iter.value() );
310  }
311 
312  return result;
313 }
314 
315 void OverviewMap::setSettings( const QHash<QString,QVariant> &settings )
316 {
317  AbstractFloatItem::setSettings( settings );
318 
319  m_settings.insert( "width", settings.value( "width", m_defaultSize.toSize().width() ) );
320  m_settings.insert( "height", settings.value( "height", m_defaultSize.toSize().height() ) );
321 
322  foreach ( const QString& planet, Planet::planetList() ) {
323  QString mapFile = MarbleDirs::path( QString( "svg/%1map.svg" ).arg( planet ) );
324 
325  if ( planet == "moon" ) {
326  mapFile = MarbleDirs::path( "svg/lunarmap.svg" );
327  }
328  else if ( planet == "earth" || mapFile.isEmpty() ) {
329  mapFile = MarbleDirs::path( "svg/worldmap.svg" );
330  }
331 
332  m_settings.insert( "path_" + planet, settings.value( "path_" + planet, mapFile ) );
333  }
334 
335  m_settings.insert( "posColor", settings.value( "posColor", QColor( Qt::white ).name() ) );
336 
337  m_target.clear(); // FIXME: forces execution of changeBackground() in changeViewport()
338 
339  readSettings();
340  emit settingsChanged( nameId() );
341 }
342 
343 void OverviewMap::readSettings()
344 {
345  if ( !m_configDialog ) {
346  return;
347  }
348 
349  ui_configWidget->m_widthBox->setValue( m_settings.value( "width" ).toInt() );
350  ui_configWidget->m_heightBox->setValue( m_settings.value( "height" ).toInt() );
351  QPalette palette = ui_configWidget->m_colorChooserButton->palette();
352  palette.setColor( QPalette::Button, QColor( m_settings.value( "posColor" ).toString() ) );
353  ui_configWidget->m_colorChooserButton->setPalette( palette );
354 }
355 
356 void OverviewMap::writeSettings()
357 {
358  if ( !m_configDialog ) {
359  return;
360  }
361 
362  m_settings.insert( "width", contentRect().width() );
363  m_settings.insert( "height", contentRect().height() );
364 
365  QStringList const planets = Planet::planetList();
366  foreach( const QString &planet, planets ) {
367  m_settings.insert( "path_" + planet, m_svgPaths[planet] );
368  }
369 
370  m_settings.insert( "posColor", m_posColor.name() );
371 
372  emit settingsChanged( nameId() );
373 }
374 
375 void OverviewMap::updateSettings()
376 {
377  QStringList const planets = Planet::planetList();
378  foreach( const QString &planet, planets ) {
379  m_svgPaths.insert( planet, m_settings.value( "path_" + planet, QString() ).toString() );
380  }
381 
382  m_posColor = QColor( m_settings.value( "posColor" ).toString() );
383  loadPlanetMaps();
384 
385  if ( !m_configDialog ) {
386  return;
387  }
388 
389  setCurrentWidget( m_svgWidgets[m_planetID[2]] );
390  showCurrentPlanetPreview();
391  setContentSize( QSizeF( ui_configWidget->m_widthBox->value(), ui_configWidget->m_heightBox->value() ) );
392 }
393 
394 bool OverviewMap::eventFilter( QObject *object, QEvent *e )
395 {
396  if ( !enabled() || !visible() ) {
397  return false;
398  }
399 
400  MarbleWidget *widget = dynamic_cast<MarbleWidget*>(object);
401  if ( !widget ) {
402  return AbstractFloatItem::eventFilter(object,e);
403  }
404 
405  bool cursorAboveFloatItem(false);
406  if ( e->type() == QEvent::MouseButtonDblClick || e->type() == QEvent::MouseMove ) {
407  QMouseEvent *event = static_cast<QMouseEvent*>(e);
408  QRectF floatItemRect = QRectF( positivePosition(), size() );
409 
410  if ( floatItemRect.contains(event->pos()) ) {
411  cursorAboveFloatItem = true;
412 
413  // Double click triggers recentering the map at the specified position
414  if ( e->type() == QEvent::MouseButtonDblClick ) {
415  QRectF mapRect( contentRect() );
416  QPointF pos = event->pos() - floatItemRect.topLeft()
417  - QPointF(padding(),padding());
418 
419  qreal lon = ( pos.x() - mapRect.width() / 2.0 ) / mapRect.width() * 360.0 ;
420  qreal lat = ( mapRect.height() / 2.0 - pos.y() ) / mapRect.height() * 180.0;
421  widget->centerOn(lon,lat,true);
422 
423  return true;
424  }
425  }
426 
427  if ( cursorAboveFloatItem && e->type() == QEvent::MouseMove
428  && !(event->buttons() & Qt::LeftButton) )
429  {
430  // Cross hair cursor when moving above the float item without pressing a button
431  widget->setCursor(QCursor(Qt::CrossCursor));
432  return true;
433  }
434  }
435 
436  return AbstractFloatItem::eventFilter(object,e);
437 }
438 
439 void OverviewMap::changeBackground( const QString& target )
440 {
441  m_svgobj.load( m_svgPaths[target] );
442  m_mapChanged = true;
443 }
444 
445 QSvgWidget *OverviewMap::currentWidget() const
446 {
447  return m_svgWidgets[m_planetID[ui_configWidget->m_planetComboBox->currentIndex()]];
448 }
449 
450 void OverviewMap::setCurrentWidget( QSvgWidget *widget )
451 {
452  m_svgWidgets[m_planetID[ui_configWidget->m_planetComboBox->currentIndex()]] = widget;
453  if( m_target == m_planetID[ui_configWidget->m_planetComboBox->currentIndex()] ) {
454  changeBackground( m_target );
455  }
456 }
457 
458 void OverviewMap::loadPlanetMaps()
459 {
460  foreach( const QString& planet, m_planetID ) {
461  if ( m_svgWidgets.contains( planet) ) {
462  m_svgWidgets[planet]->load( m_svgPaths[planet] );
463  } else {
464  m_svgWidgets[planet] = new QSvgWidget( m_svgPaths[planet] );
465  }
466  }
467 }
468 
469 void OverviewMap::loadMapSuggestions()
470 {
471  QStringList paths = QDir( MarbleDirs::pluginPath( "" ) ).entryList( QStringList( "*.svg" ), QDir::Files | QDir::NoDotAndDotDot );
472  for( int i = 0; i < paths.size(); ++i ) {
473  paths[i] = MarbleDirs::pluginPath( QString() ) + '/' + paths[i];
474  }
475  paths << MarbleDirs::path( "svg/worldmap.svg" ) << MarbleDirs::path( "svg/lunarmap.svg" );
476  ui_configWidget->m_tableWidget->setRowCount( paths.size() );
477  for( int i = 0; i < paths.size(); ++i ) {
478  ui_configWidget->m_tableWidget->setCellWidget( i, 0, new QSvgWidget( paths[i] ) );
479  ui_configWidget->m_tableWidget->setItem( i, 1, new QTableWidgetItem( paths[i] ) );
480  }
481 }
482 
483 void OverviewMap::chooseCustomMap()
484 {
485  QString path = QFileDialog::getOpenFileName ( m_configDialog, tr( "Choose Overview Map" ), "", "SVG (*.svg)" );
486  if( !path.isNull() )
487  {
488  ui_configWidget->m_fileChooserButton->layout()->removeWidget( currentWidget() );
489  delete currentWidget();
490  QSvgWidget *widget = new QSvgWidget( path );
491  setCurrentWidget( widget );
492  ui_configWidget->m_fileChooserButton->layout()->addWidget( widget );
493  m_svgPaths[m_planetID[ui_configWidget->m_planetComboBox->currentIndex()]] = path;
494  }
495 }
496 
497 void OverviewMap::synchronizeSpinboxes()
498 {
499  if( sender() == ui_configWidget->m_widthBox ) {
500  ui_configWidget->m_heightBox->setValue( ui_configWidget->m_widthBox->value() / 2 );
501  }
502  else if( sender() == ui_configWidget->m_heightBox ) {
503  ui_configWidget->m_widthBox->setValue( ui_configWidget->m_heightBox->value() * 2 );
504  }
505 }
506 
507 void OverviewMap::showCurrentPlanetPreview() const
508 {
509  delete ui_configWidget->m_fileChooserButton->layout();
510  ui_configWidget->m_fileChooserButton->setLayout( new QHBoxLayout() );
511  ui_configWidget->m_fileChooserButton->layout()->addWidget( currentWidget() );
512 }
513 
514 void OverviewMap::choosePositionIndicatorColor()
515 {
516  QColor c = QColorDialog::getColor( m_posColor, 0,
517  tr( "Please choose the color for the position indicator" ),
518  QColorDialog::ShowAlphaChannel );
519  if( c.isValid() )
520  {
521  m_posColor = c;
522  QPalette palette = ui_configWidget->m_colorChooserButton->palette();
523  palette.setColor( QPalette::Button, m_posColor );
524  ui_configWidget->m_colorChooserButton->setPalette( palette );
525  }
526 }
527 
528 void OverviewMap::useMapSuggestion( int index )
529 {
530  QString path = ui_configWidget->m_tableWidget->item( index, 1 )->text();
531  m_svgPaths[m_planetID[ui_configWidget->m_planetComboBox->currentIndex()]] = path;
532  delete currentWidget();
533  QSvgWidget *widget = new QSvgWidget( path );
534  setCurrentWidget( widget );
535  showCurrentPlanetPreview();
536 }
537 
538 }
539 
540 Q_EXPORT_PLUGIN2( OverviewMap, Marble::OverviewMap )
541 
542 #include "OverviewMap.moc"
Marble::AbstractFloatItem::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: AbstractFloatItem.cpp:72
QEvent
QPixmap::size
QSize size() const
Marble::ViewportParams::latLonAltBox
GeoDataLatLonAltBox latLonAltBox(const QRect &screenRect) const
Definition: ViewportParams.cpp:317
Marble::MarbleDirs::pluginPath
static QString pluginPath(const QString &relativePath)
Definition: MarbleDirs.cpp:73
Marble::AbstractFloatItem::visible
bool visible() const
Check visibility of the float item.
Definition: AbstractFloatItem.cpp:137
QPainter::setViewport
void setViewport(const QRect &rectangle)
QEvent::type
Type type() const
QHash::insert
iterator insert(const Key &key, const T &value)
Marble::OverviewMap::readSettings
void readSettings()
Definition: OverviewMap.cpp:343
QSize::width
int width() const
Marble::ViewportParams::size
QSize size() const
Definition: ViewportParams.cpp:260
QPainter::end
bool end()
QWidget::setCursor
void setCursor(const QCursor &)
Marble::OverviewMap::writeSettings
void writeSettings()
Definition: OverviewMap.cpp:356
QPainter::setRenderHint
void setRenderHint(RenderHint hint, bool on)
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:59
QPixmap::fill
void fill(const QColor &color)
QTableWidgetItem
QPalette::setColor
void setColor(ColorGroup group, ColorRole role, const QColor &color)
QSvgRenderer::render
void render(QPainter *painter)
QColor::name
QString name() const
Marble::OverviewMap::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: OverviewMap.cpp:108
Marble::OverviewMap::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: OverviewMap.cpp:73
Marble::OverviewMap::copyrightYears
QString copyrightYears() const
Definition: OverviewMap.cpp:103
QObject::sender
QObject * sender() const
OverviewMap.h
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::OverviewMap::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: OverviewMap.cpp:83
QRectF::size
QSizeF size() const
QSvgRenderer::isValid
bool isValid() const
Marble::MarbleModel::planetId
QString planetId() const
Definition: MarbleModel.cpp:532
Marble::PluginAuthor
Definition: PluginInterface.h:28
Marble::AbstractFloatItem::eventFilter
virtual bool eventFilter(QObject *object, QEvent *e)
Definition: AbstractFloatItem.cpp:163
QPainter::save
void save()
Marble::AbstractFloatItem::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: AbstractFloatItem.cpp:79
Marble::OverviewMap::updateSettings
void updateSettings()
Definition: OverviewMap.cpp:375
QHBoxLayout
Marble::OverviewMap::setProjection
void setProjection(const ViewportParams *viewport)
Definition: OverviewMap.cpp:166
QBrush
Marble::RenderPlugin::restoreDefaultSettings
void restoreDefaultSettings()
Passes an empty set of settings to the plugin.
Definition: RenderPlugin.cpp:221
Marble::MarbleGraphicsItem::size
QSizeF size() const
Returns the size of the item.
Definition: MarbleGraphicsItem.cpp:136
QPoint
QMouseEvent
QPainter::drawLine
void drawLine(const QLineF &line)
Planet.h
Marble::OverviewMap::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: OverviewMap.cpp:88
MarbleDebug.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QList::size
int size() const
QString::isNull
bool isNull() const
Marble::OverviewMap::paintContent
void paintContent(QPainter *painter)
Here the items paint their content.
Definition: OverviewMap.cpp:192
QPointF
Marble::Planet::planetList
static QStringList planetList()
Definition: Planet.cpp:373
QList::value
T value(int i) const
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
QObject::event
virtual bool event(QEvent *e)
QString::clear
void clear()
QPainter::drawRect
void drawRect(const QRectF &rectangle)
Marble::GeoDataLatLonBox::north
qreal north(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the northern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:93
Marble::GeoDataLatLonBox::east
qreal east(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the eastern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:135
QRect
QPointF::x
qreal x() const
QPointF::y
qreal y() const
Marble::MarbleGraphicsItem::NoCache
Definition: MarbleGraphicsItem.h:40
QHash::constEnd
const_iterator constEnd() const
QSvgRenderer::load
bool load(const QString &filename)
QHash
QObject
QPainter::setPen
void setPen(const QColor &color)
Marble::OverviewMap::OverviewMap
OverviewMap()
Definition: OverviewMap.cpp:37
Marble::RenderPlugin::settingsChanged
void settingsChanged(QString nameId)
This signal is emitted if the settings of the RenderPlugin changed.
QPainter::drawEllipse
void drawEllipse(const QRectF &rectangle)
QSizeF::toSize
QSize toSize() const
Marble::AbstractFloatItem
The abstract class for float item plugins.
Definition: AbstractFloatItem.h:45
QPainter::drawPixmap
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
QPainter
Marble::FrameGraphicsItem::contentRect
QRectF contentRect() const
Returns the rect of the content in item coordinates.
Definition: FrameGraphicsItem.cpp:167
MarbleDirs.h
QRectF::topLeft
QPointF topLeft() const
QString::isEmpty
bool isEmpty() const
Marble::Planet
Definition: Planet.h:25
Marble::OverviewMap::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the item.
Definition: OverviewMap.cpp:315
QPainter::setBrush
void setBrush(const QBrush &brush)
Marble::OverviewMap::initialize
void initialize()
Definition: OverviewMap.cpp:157
Marble::OverviewMap::version
QString version() const
Definition: OverviewMap.cpp:93
Marble::OverviewMap::description
QString description() const
Returns a user description of the plugin.
Definition: OverviewMap.cpp:98
QString
QList
QColor
Marble::GeoDataCoordinates::normalizeLonLat
static void normalizeLonLat(qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Radian)
normalize both longitude and latitude at the same time This method normalizes both latitude and longi...
Definition: GeoDataCoordinates.cpp:845
Marble::OverviewMap::~OverviewMap
~OverviewMap()
Definition: OverviewMap.cpp:64
Marble::FrameGraphicsItem::padding
qreal padding() const
Returns the padding of the item.
Definition: FrameGraphicsItem.cpp:121
QStringList
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::OverviewMap::settings
virtual QHash< QString, QVariant > settings() const
Definition: OverviewMap.cpp:302
QPixmap
Marble::ScreenGraphicsItem::positivePosition
QPointF positivePosition() const
Return the positive position of the ScreenGraphicsItem.
Definition: ScreenGraphicsItem.cpp:49
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
QHash::value
const T value(const Key &key) const
Marble::OverviewMap::name
QString name() const
Returns the user-visible name of the plugin.
Definition: OverviewMap.cpp:78
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
Marble::OverviewMap::isInitialized
bool isInitialized() const
Definition: OverviewMap.cpp:161
QColorDialog::getColor
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QFlags< QColorDialog::ColorDialogOption > options)
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::OverviewMap::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: OverviewMap.cpp:394
Marble::ViewportParams::centerLatitude
qreal centerLatitude() const
Definition: ViewportParams.cpp:294
QPainter::restore
void restore()
QDir
Marble::GeoDataLatLonBox::west
qreal west(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the western boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:156
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
QHash::constBegin
const_iterator constBegin() const
QRectF::width
qreal width() const
GeoDataPoint.h
QSizeF
Marble::MarbleGraphicsItem::setCacheMode
void setCacheMode(CacheMode mode)
Set the cache mode of the item.
Definition: MarbleGraphicsItem.cpp:159
Marble::ViewportParams::centerLongitude
qreal centerLongitude() const
Definition: ViewportParams.cpp:289
QRectF
Marble::OverviewMap
The class that creates an overview map.
Definition: OverviewMap.h:38
QDir::entryList
QStringList entryList(QFlags< QDir::Filter > filters, QFlags< QDir::SortFlag > sort) const
QSvgWidget
Marble::GeoDataLatLonBox::south
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:114
QSize::height
int height() const
Marble::OverviewMap::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: OverviewMap.cpp:119
M_PI
#define M_PI
Definition: GeoDataCoordinates.h:26
Marble::MarbleGraphicsItem::update
void update()
Marks the item and all parent items as invalid.
Definition: MarbleGraphicsItem.cpp:167
QPen
QDialog
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::Planet::name
QString name() const
The user visible name of the planet.
Definition: Planet.cpp:257
QRectF::height
qreal height() const
QPushButton
QHash::contains
bool contains(const Key &key) const
QRectF::contains
bool contains(const QPointF &point) const
Marble::RenderPlugin::enabled
bool enabled() const
is enabled
QFileDialog::getOpenFileName
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
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)
Marble::FrameGraphicsItem::setContentSize
void setContentSize(const QSizeF &size)
Sets the size of the content of the item.
Definition: FrameGraphicsItem.cpp:200
QPainter::begin
bool begin(QPaintDevice *device)
QCursor
QPixmap::rect
QRect rect() const
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
QPalette
Marble::OverviewMap::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: OverviewMap.cpp:114
QIcon
QColor::isValid
bool isValid() const
Marble::MarbleGraphicsItem::setProjection
virtual void setProjection(const ViewportParams *viewport)
Definition: MarbleGraphicsItem.cpp:272
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 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