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

marble

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