• 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
  • routing
RoutingPlugin.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 2010 Siddharth Srivastava <akssps011@gmail.com>
9 // Copyright 2010 Dennis Nienhüser <earthwings@gentoo.org>
10 //
11 
12 #include "RoutingPlugin.h"
13 
14 #include "ui_RoutingPlugin.h"
15 #include "ui_RoutingConfigDialog.h"
16 
17 #include "AudioOutput.h"
18 #include "GeoDataCoordinates.h"
19 #include "GeoPainter.h"
20 #include "MarbleGraphicsGridLayout.h"
21 #include "MarbleModel.h"
22 #include "MarbleWidget.h"
23 #include "MarbleMath.h"
24 #include "MarbleLocale.h"
25 #include "MarbleDirs.h"
26 #include "PluginManager.h"
27 #include "PositionTracking.h"
28 #include "PositionProviderPlugin.h"
29 #include "routing/RoutingManager.h"
30 #include "routing/RoutingModel.h"
31 #include "routing/RouteRequest.h"
32 #include "routing/SpeakersModel.h"
33 #include "ViewportParams.h"
34 #include "WidgetGraphicsItem.h"
35 
36 #include <QRect>
37 #include <QWidget>
38 #include <QToolButton>
39 #include <QFont>
40 #include <QActionGroup>
41 #include <QPixmap>
42 #include <QDialog>
43 #include <QPushButton>
44 #include <QSpacerItem>
45 #if QT_VERSION < 0x050000
46 #include <QPlastiqueStyle>
47 #endif
48 
49 namespace Marble
50 {
51 
52 namespace
53 {
54 int const thresholdDistance = 1000; // in meter
55 }
56 
57 class RoutingPluginPrivate
58 {
59 public:
60  MarbleWidget* m_marbleWidget;
61  WidgetGraphicsItem* m_widgetItem;
62  RoutingModel* m_routingModel;
63  Ui::RoutingPlugin m_widget;
64  bool m_nearNextInstruction;
65  bool m_guidanceModeEnabled;
66  AudioOutput* m_audio;
67  QDialog *m_configDialog;
68  Ui::RoutingConfigDialog m_configUi;
69  bool m_routeCompleted;
70  SpeakersModel* m_speakersModel;
71 
72  RoutingPluginPrivate( RoutingPlugin* parent );
73 
74  void updateZoomButtons( int zoomValue );
75 
76  void updateZoomButtons();
77 
78  void updateGuidanceModeButton();
79 
80  void forceRepaint();
81 
82  void updateButtonVisibility();
83 
84  void reverseRoute();
85 
86  void toggleGuidanceMode( bool enabled );
87 
88  void updateDestinationInformation();
89 
90  void updateGpsButton( PositionProviderPlugin *activePlugin );
91 
92  void togglePositionTracking( bool enabled );
93 
94  static QString richText( const QString &source );
95 
96  static QString fuzzyDistance( qreal distanceMeter );
97 
98  void readSettings();
99 
100  qreal nextInstructionDistance() const;
101 
102  qreal remainingDistance() const;
103 
104 private:
105  RoutingPlugin* m_parent;
106 };
107 
108 RoutingPluginPrivate::RoutingPluginPrivate( RoutingPlugin *parent ) :
109  m_marbleWidget( 0 ),
110  m_widgetItem( 0 ),
111  m_routingModel( 0 ),
112  m_nearNextInstruction( false ),
113  m_guidanceModeEnabled( false ),
114  m_audio( new AudioOutput( parent ) ),
115  m_configDialog( 0 ),
116  m_routeCompleted( false ),
117  m_speakersModel( 0 ),
118  m_parent( parent )
119 {
120  m_audio->setMuted( false );
121  m_audio->setSoundEnabled( true );
122 }
123 
124 QString RoutingPluginPrivate::richText( const QString &source )
125 {
126  return QString( "<font size=\"+1\" color=\"black\">%1</font>" ).arg( source );
127 }
128 
129 QString RoutingPluginPrivate::fuzzyDistance( qreal length )
130 {
131  int precision = 0;
132  QString distanceUnit = QLatin1String( "m" );
133 
134  if ( MarbleGlobal::getInstance()->locale()->measurementSystem() != MarbleLocale::MetricSystem ) {
135  precision = 1;
136  distanceUnit = "mi";
137  length *= METER2KM;
138  length *= KM2MI;
139  } else if (MarbleGlobal::getInstance()->locale()->measurementSystem() ==
140  MarbleLocale::MetricSystem) {
141  if ( length >= 1000 ) {
142  length /= 1000;
143  distanceUnit = "km";
144  precision = 1;
145  } else if ( length >= 200 ) {
146  length = 50 * qRound( length / 50 );
147  } else if ( length >= 100 ) {
148  length = 25 * qRound( length / 25 );
149  } else {
150  length = 10 * qRound( length / 10 );
151  }
152  } else if (MarbleGlobal::getInstance()->locale()->measurementSystem() ==
153  MarbleLocale::NauticalSystem) {
154  precision = 2;
155  distanceUnit = "nm";
156  length *= METER2KM;
157  length *= KM2NM;
158  }
159 
160  return QString( "%1 %2" ).arg( length, 0, 'f', precision ).arg( distanceUnit );
161 }
162 
163 void RoutingPluginPrivate::updateZoomButtons( int zoomValue )
164 {
165  int const minZoom = m_marbleWidget ? m_marbleWidget->minimumZoom() : 900;
166  int const maxZoom = m_marbleWidget ? m_marbleWidget->maximumZoom() : 2400;
167 
168  bool const zoomInEnabled = zoomValue < maxZoom;
169  bool const zoomOutEnabled = zoomValue > minZoom;
170 
171  if ( ( zoomInEnabled != m_widget.zoomInButton->isEnabled() ) ||
172  ( zoomOutEnabled != m_widget.zoomOutButton->isEnabled() ) ) {
173  m_widget.zoomInButton->setEnabled( zoomInEnabled );
174  m_widget.zoomOutButton->setEnabled( zoomOutEnabled );
175  forceRepaint();
176  }
177 }
178 
179 void RoutingPluginPrivate::updateGuidanceModeButton()
180 {
181  bool const hasRoute = m_routingModel->rowCount() > 0;
182  m_widget.routingButton->setEnabled( hasRoute );
183  forceRepaint();
184 }
185 
186 void RoutingPluginPrivate::forceRepaint()
187 {
188  m_parent->update();
189  emit m_parent->repaintNeeded();
190 }
191 
192 void RoutingPluginPrivate::updateButtonVisibility()
193 {
194  bool const show = m_guidanceModeEnabled;
195  bool const near = show && m_nearNextInstruction;
196  m_widget.progressBar->setVisible( near );
197  m_widget.instructionIconLabel->setVisible( show );
198  m_widget.spacer->changeSize( show ? 10 : 0, 20 );
199  m_widget.instructionLabel->setVisible( show );
200 
201  // m_widget.followingInstructionIconLabel->setVisible( show );
202  // Disabling the next instruction turn icon for now, it seems to confuse first time users.
203  m_widget.followingInstructionIconLabel->setVisible( false );
204 
205  m_widget.destinationDistanceLabel->setVisible( show );
206 
207  m_widget.gpsButton->setVisible( !show );
208  m_widget.zoomOutButton->setVisible( !show );
209  m_widget.zoomInButton->setVisible( !show );
210 
211  m_widgetItem->widget()->updateGeometry();
212  QSize const size = m_widgetItem->widget()->sizeHint();
213  m_widgetItem->widget()->resize( size );
214  m_widgetItem->setContentSize( size );
215 
216  bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
217  if ( smallScreen ) {
218  qreal const pluginWidth = size.width();
219  int x = -10;
220  if ( m_guidanceModeEnabled ) {
221  int const parentWidth = m_marbleWidget->width();
222  x = qRound( ( parentWidth - pluginWidth ) / 2.0 );
223  }
224  m_parent->setPosition( QPointF( x, m_parent->position().y() ) );
225  }
226 }
227 
228 void RoutingPluginPrivate::updateZoomButtons()
229 {
230  if ( m_marbleWidget ) {
231  updateZoomButtons( m_marbleWidget->zoom() );
232  }
233 }
234 
235 void RoutingPluginPrivate::toggleGuidanceMode( bool enabled )
236 {
237  if( !m_marbleWidget || m_guidanceModeEnabled == enabled ) {
238  return;
239  }
240 
241  m_guidanceModeEnabled = enabled;
242  updateButtonVisibility();
243 
244  if( enabled ) {
245  QObject::connect( m_routingModel, SIGNAL(positionChanged()),
246  m_parent, SLOT(updateDestinationInformation()) );
247  } else {
248  QObject::disconnect( m_routingModel, SIGNAL(positionChanged()),
249  m_parent, SLOT(updateDestinationInformation()) );
250  }
251 
252  if ( enabled ) {
253  QString const text = QObject::tr( "Starting guidance mode, please wait..." );
254  m_widget.instructionLabel->setText( richText( "%1" ).arg( text ) );
255  }
256 
257  if ( enabled ) {
258  RouteRequest* request = m_marbleWidget->model()->routingManager()->routeRequest();
259  if ( request && request->size() > 0 ) {
260  GeoDataCoordinates source = request->source();
261  if ( source.longitude() != 0.0 || source.latitude() != 0.0 ) {
262  GeoDataLookAt view;
263  view.setCoordinates( source );
264  // By happy coincidence this equals OpenStreetMap tile level 15
265  view.setRange( 851.807 );
266  m_marbleWidget->flyTo( view );
267  }
268  }
269  }
270 
271  m_marbleWidget->model()->routingManager()->setGuidanceModeEnabled( enabled );
272 
273  if ( enabled ) {
274  m_routeCompleted = false;
275  }
276 
277  forceRepaint();
278 }
279 
280 void RoutingPluginPrivate::updateDestinationInformation()
281 {
282  if ( m_routingModel->route().currentSegment().isValid() ) {
283  qreal remaining = remainingDistance();
284  qreal distanceLeft = nextInstructionDistance();
285  m_audio->update( m_routingModel->route(), distanceLeft, remaining, m_routingModel->deviatedFromRoute() );
286 
287  m_nearNextInstruction = distanceLeft < thresholdDistance;
288 
289  QString pixmapHtml = "<img src=\":/flag.png\" /><br />";
290  m_widget.destinationDistanceLabel->setText( pixmapHtml + richText( fuzzyDistance( remaining ) ) );
291 
292  m_widget.instructionIconLabel->setEnabled( m_nearNextInstruction );
293  m_widget.progressBar->setMaximum( thresholdDistance );
294  m_widget.progressBar->setValue( qRound( distanceLeft ) );
295 
296  updateButtonVisibility();
297 
298  QString pixmap = MarbleDirs::path( "bitmaps/routing_step.png" );
299  pixmapHtml = QString( "<img src=\"%1\" />" ).arg( pixmap );
300 
301  GeoDataCoordinates const onRoute = m_routingModel->route().positionOnRoute();
302  GeoDataCoordinates const ego = m_routingModel->route().position();
303  qreal const distanceToRoute = EARTH_RADIUS * distanceSphere( ego, onRoute );
304 
305  if ( !m_routingModel->route().currentSegment().isValid() ) {
306  m_widget.instructionLabel->setText( richText( QObject::tr( "Calculate a route to get directions." ) ) );
307  m_widget.instructionIconLabel->setText( pixmapHtml );
308  } else if ( distanceToRoute > 300.0 ) {
309  m_widget.instructionLabel->setText( richText( QObject::tr( "Route left." ) ) );
310  m_widget.instructionIconLabel->setText( pixmapHtml );
311  } else if ( !m_routingModel->route().currentSegment().nextRouteSegment().isValid() ) {
312  m_widget.instructionLabel->setText( richText( QObject::tr( "Destination ahead." ) ) );
313  m_widget.instructionIconLabel->setText( pixmapHtml );
314  } else {
315  pixmap = m_routingModel->route().currentSegment().nextRouteSegment().maneuver().directionPixmap();
316  QString const instructionText = m_routingModel->route().currentSegment().nextRouteSegment().maneuver().instructionText();
317  m_widget.instructionLabel->setText( richText( "%1" ).arg( instructionText ) );
318  pixmapHtml = QString( "<p align=\"center\"><img src=\"%1\" /><br />%2</p>" ).arg( pixmap );
319  m_widget.instructionIconLabel->setText( pixmapHtml.arg( richText( fuzzyDistance( distanceLeft ) ) ) );
320 
321  if( remaining > 50 ) {
322  m_routeCompleted = false;
323  } else {
324  if ( !m_routeCompleted ) {
325  QString content = QObject::tr( "Arrived at destination. <a href=\"#reverse\">Calculate the way back.</a>" );
326  m_widget.instructionLabel->setText( richText( "%1" ).arg( content ) );
327  }
328  m_routeCompleted = true;
329  }
330  }
331 
332  forceRepaint();
333  }
334 }
335 
336 void RoutingPluginPrivate::updateGpsButton( PositionProviderPlugin *activePlugin )
337 {
338  m_widget.gpsButton->setChecked( activePlugin != 0 );
339  forceRepaint();
340 }
341 
342 void RoutingPluginPrivate::togglePositionTracking( bool enabled )
343 {
344  PositionProviderPlugin* plugin = 0;
345  if ( enabled ) {
346  const PluginManager* pluginManager = m_marbleWidget->model()->pluginManager();
347  QList<const PositionProviderPlugin*> plugins = pluginManager->positionProviderPlugins();
348  if ( plugins.size() > 0 ) {
349  plugin = plugins.first()->newInstance();
350  }
351  }
352  m_parent->marbleModel()->positionTracking()->setPositionProviderPlugin( plugin );
353 }
354 
355 void RoutingPluginPrivate::reverseRoute()
356 {
357  if ( m_marbleWidget ) {
358  m_marbleWidget->model()->routingManager()->reverseRoute();
359  }
360 }
361 
362 void RoutingPluginPrivate::readSettings()
363 {
364  if ( m_configDialog ) {
365  if ( !m_speakersModel ) {
366  m_speakersModel = new SpeakersModel( m_parent );
367  }
368  int const index = m_speakersModel->indexOf( m_audio->speaker() );
369  m_configUi.speakerComboBox->setModel( m_speakersModel );
370  m_configUi.speakerComboBox->setCurrentIndex( index );
371  m_configUi.voiceNavigationCheckBox->setChecked( !m_audio->isMuted() );
372  m_configUi.soundRadioButton->setChecked( m_audio->isSoundEnabled() );
373  m_configUi.speakerRadioButton->setChecked( !m_audio->isSoundEnabled() );
374  }
375 }
376 
377 qreal RoutingPluginPrivate::nextInstructionDistance() const
378 {
379  GeoDataCoordinates position = m_routingModel->route().position();
380  GeoDataCoordinates interpolated = m_routingModel->route().positionOnRoute();
381  GeoDataCoordinates onRoute = m_routingModel->route().currentWaypoint();
382  qreal distance = EARTH_RADIUS * ( distanceSphere( position, interpolated ) + distanceSphere( interpolated, onRoute ) );
383  const RouteSegment &segment = m_routingModel->route().currentSegment();
384  for (int i=0; i<segment.path().size(); ++i) {
385  if (segment.path()[i] == onRoute) {
386  return distance + segment.path().length( EARTH_RADIUS, i );
387  }
388  }
389 
390  return distance;
391 }
392 
393 qreal RoutingPluginPrivate::remainingDistance() const
394 {
395  GeoDataCoordinates position = m_routingModel->route().currentSegment().maneuver().position();
396  bool foundSegment = false;
397  qreal distance = nextInstructionDistance();
398  for ( int i=0; i<m_routingModel->route().size(); ++i ) {
399  if ( foundSegment ) {
400  distance += m_routingModel->route().at( i ).distance();
401  } else {
402  foundSegment = m_routingModel->route().at( i ).maneuver().position() == position;
403  }
404  }
405 
406  return distance;
407 }
408 
409 void RoutingPlugin::writeSettings()
410 {
411  Q_ASSERT( d->m_configDialog );
412  int const index = d->m_configUi.speakerComboBox->currentIndex();
413  if ( index >= 0 ) {
414  QModelIndex const idx = d->m_speakersModel->index( index );
415  d->m_audio->setSpeaker( d->m_speakersModel->data( idx, SpeakersModel::Path ).toString() );
416  if ( !d->m_speakersModel->data( idx, SpeakersModel::IsLocal ).toBool() ) {
417  d->m_speakersModel->install( index );
418  }
419  }
420  d->m_audio->setMuted( !d->m_configUi.voiceNavigationCheckBox->isChecked() );
421  d->m_audio->setSoundEnabled( d->m_configUi.soundRadioButton->isChecked() );
422  d->readSettings();
423  emit settingsChanged( nameId() );
424 }
425 
426 
427 RoutingPlugin::RoutingPlugin() :
428  AbstractFloatItem( 0 ),
429  d( 0 )
430 {
431 }
432 
433 RoutingPlugin::RoutingPlugin( const MarbleModel *marbleModel ) :
434  AbstractFloatItem( marbleModel, QPointF( -10, -10 ) ),
435  d( new RoutingPluginPrivate( this ) )
436 {
437  setEnabled( true );
438  //plugin is visible by default on small screen devices
439  setVisible( MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen );
440  setPadding( 0.5 );
441  setBorderWidth( 1 );
442  setBackground( QBrush( QColor( "white" ) ) );
443 }
444 
445 RoutingPlugin::~RoutingPlugin()
446 {
447  delete d;
448 }
449 
450 QStringList RoutingPlugin::backendTypes() const
451 {
452  return QStringList( "routing" );
453 }
454 
455 QString RoutingPlugin::name() const
456 {
457  return tr( "Routing" );
458 }
459 
460 QString RoutingPlugin::guiString() const
461 {
462  return tr( "&Routing" );
463 }
464 
465 QString RoutingPlugin::nameId() const
466 {
467  return QString( "routing" );
468 }
469 
470 QString RoutingPlugin::version() const
471 {
472  return "1.0";
473 }
474 
475 QString RoutingPlugin::description() const
476 {
477  return tr( "Routing information and navigation controls" );
478 }
479 
480 QString RoutingPlugin::copyrightYears() const
481 {
482  return "2010";
483 }
484 
485 QList<PluginAuthor> RoutingPlugin::pluginAuthors() const
486 {
487  return QList<PluginAuthor>()
488  << PluginAuthor( "Siddharth Srivastava", "akssps011@gmail.com" )
489  << PluginAuthor( QString::fromUtf8( "Dennis Nienhüser" ), "earthwings@gentoo.org" );
490 }
491 
492 QIcon RoutingPlugin::icon() const
493 {
494  return QIcon(":/icons/routeplanning.png");
495 }
496 
497 void RoutingPlugin::initialize()
498 {
499  QWidget *widget = new QWidget;
500  d->m_widget.setupUi( widget );
501  d->m_widgetItem = new WidgetGraphicsItem( this );
502  d->m_widgetItem->setWidget( widget );
503 
504  PositionProviderPlugin* activePlugin = marbleModel()->positionTracking()->positionProviderPlugin();
505  d->updateGpsButton( activePlugin );
506  connect( marbleModel()->positionTracking(),
507  SIGNAL(positionProviderPluginChanged(PositionProviderPlugin*)),
508  this, SLOT(updateGpsButton(PositionProviderPlugin*)) );
509 
510  d->m_widget.routingButton->setEnabled( false );
511  connect( d->m_widget.instructionLabel, SIGNAL(linkActivated(QString)),
512  this, SLOT(reverseRoute()) );
513 
514 #if QT_VERSION < 0x050000
515  bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
516  if ( smallScreen ) {
522  d->m_widget.progressBar->setStyle( new QPlastiqueStyle );
523  }
524 #endif
525 
526  MarbleGraphicsGridLayout *layout = new MarbleGraphicsGridLayout( 1, 1 );
527  layout->addItem( d->m_widgetItem, 0, 0 );
528  setLayout( layout );
529  d->updateButtonVisibility();
530 }
531 
532 bool RoutingPlugin::isInitialized() const
533 {
534  return d->m_widgetItem;
535 }
536 
537 bool RoutingPlugin::eventFilter( QObject *object, QEvent *e )
538 {
539  if ( d->m_marbleWidget || !enabled() || !visible() ) {
540  return AbstractFloatItem::eventFilter( object, e );
541  }
542 
543  MarbleWidget *widget = dynamic_cast<MarbleWidget*> ( object );
544 
545  if ( widget && !d->m_marbleWidget ) {
546  d->m_marbleWidget = widget;
547  d->m_routingModel = d->m_marbleWidget->model()->routingManager()->routingModel();
548 
549  connect( d->m_widget.routingButton, SIGNAL(clicked(bool)),
550  this, SLOT(toggleGuidanceMode(bool)) );
551  connect( d->m_widget.gpsButton, SIGNAL(clicked(bool)),
552  this, SLOT(togglePositionTracking(bool)) );
553  connect( d->m_widget.zoomInButton, SIGNAL(clicked()),
554  d->m_marbleWidget, SLOT(zoomIn()) );
555  connect( d->m_widget.zoomOutButton, SIGNAL(clicked()),
556  d->m_marbleWidget, SLOT(zoomOut()) );
557  connect( d->m_marbleWidget, SIGNAL(themeChanged(QString)),
558  this, SLOT(updateZoomButtons()) );
559  connect( d->m_marbleWidget, SIGNAL(zoomChanged(int)),
560  this, SLOT(updateZoomButtons(int)) );
561  connect( d->m_routingModel, SIGNAL(currentRouteChanged()),
562  this, SLOT(updateGuidanceModeButton()) );
563  d->updateGuidanceModeButton();
564  }
565  return AbstractFloatItem::eventFilter( object, e );
566 }
567 
568 QHash<QString,QVariant> RoutingPlugin::settings() const
569 {
570  QHash<QString, QVariant> result = AbstractFloatItem::settings();
571 
572  result.insert( "muted", d->m_audio->isMuted() );
573  result.insert( "sound", d->m_audio->isSoundEnabled() );
574  result.insert( "speaker", d->m_audio->speaker() );
575 
576  return result;
577 }
578 
579 void RoutingPlugin::setSettings( const QHash<QString,QVariant> &settings )
580 {
581  AbstractFloatItem::setSettings( settings );
582 
583  d->m_audio->setMuted( settings.value( "muted", false ).toBool() );
584  d->m_audio->setSoundEnabled( settings.value( "sound", true ).toBool() );
585  d->m_audio->setSpeaker( settings.value( "speaker" ).toString() );
586 
587  d->readSettings();
588 }
589 
590 QDialog *RoutingPlugin::configDialog()
591 {
592  if ( !d->m_configDialog ) {
593  d->m_configDialog = new QDialog;
594  d->m_configUi.setupUi( d->m_configDialog );
595  d->readSettings();
596 
597  connect( d->m_configDialog, SIGNAL(accepted()), this, SLOT(writeSettings()) );
598  connect( d->m_configDialog, SIGNAL(rejected()), this, SLOT(readSettings()) );
599  connect( d->m_configUi.buttonBox->button( QDialogButtonBox::Reset ), SIGNAL(clicked()),
600  SLOT(restoreDefaultSettings()) );
601  }
602 
603  return d->m_configDialog;
604 }
605 
606 }
607 
608 Q_EXPORT_PLUGIN2( RoutingPlugin, Marble::RoutingPlugin )
609 
610 #include "RoutingPlugin.moc"
Marble::RoutingPlugin::copyrightYears
QString copyrightYears() const
Definition: RoutingPlugin.cpp:480
Marble::PositionTracking::positionProviderPlugin
PositionProviderPlugin positionProviderPlugin
Definition: PositionTracking.h:35
Marble::SpeakersModel::Path
Definition: SpeakersModel.h:33
Marble::AbstractFloatItem::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: AbstractFloatItem.cpp:72
QModelIndex
GeoDataCoordinates.h
QEvent
QWidget
RoutingModel.h
Marble::AbstractFloatItem::visible
bool visible() const
Check visibility of the float item.
Definition: AbstractFloatItem.cpp:137
Marble::RoutingPlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: RoutingPlugin.cpp:465
QHash::insert
iterator insert(const Key &key, const T &value)
QSize::width
int width() const
Marble::MarbleLocale::NauticalSystem
Definition: MarbleLocale.h:40
PositionProviderPlugin.h
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:59
MarbleMath.h
Marble::RoutingPlugin::version
QString version() const
Definition: RoutingPlugin.cpp:470
Marble::RoutingPlugin::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: RoutingPlugin.cpp:492
Marble::RoutingPlugin::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: RoutingPlugin.cpp:579
Marble::RoutingPlugin::RoutingPlugin
RoutingPlugin()
Definition: RoutingPlugin.cpp:427
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::RoutingPlugin::initialize
void initialize()
Definition: RoutingPlugin.cpp:497
Marble::PluginAuthor
Definition: PluginInterface.h:28
Marble::AbstractFloatItem::eventFilter
virtual bool eventFilter(QObject *object, QEvent *e)
Definition: AbstractFloatItem.cpp:163
Marble::RoutingPlugin::eventFilter
bool eventFilter(QObject *object, QEvent *event)
Definition: RoutingPlugin.cpp:537
Marble::FrameGraphicsItem::setBackground
void setBackground(const QBrush &background)
Changes the background brush of the item.
Definition: FrameGraphicsItem.cpp:161
Marble::AbstractFloatItem::setSettings
virtual void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the plugin.
Definition: AbstractFloatItem.cpp:79
QBrush
Marble::RenderPlugin::restoreDefaultSettings
void restoreDefaultSettings()
Passes an empty set of settings to the plugin.
Definition: RenderPlugin.cpp:221
Marble::distanceSphere
qreal distanceSphere(qreal lon1, qreal lat1, qreal lon2, qreal lat2)
This method calculates the shortest distance between two points on a sphere.
Definition: MarbleMath.h:52
Marble::MarbleGraphicsItem::setLayout
void setLayout(AbstractMarbleGraphicsLayout *layout)
Set the layout of the graphics item.
Definition: MarbleGraphicsItem.cpp:146
Marble::MarbleGraphicsGridLayout::addItem
void addItem(ScreenGraphicsItem *item, int row, int column)
Definition: MarbleGraphicsGridLayout.cpp:74
RoutingPlugin.h
QObject::disconnect
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QList::size
int size() const
QPointF
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
Marble::PositionProviderPlugin
The abstract class that provides position information.
Definition: PositionProviderPlugin.h:26
QPlastiqueStyle
Marble::RoutingPlugin::isInitialized
bool isInitialized() const
Definition: RoutingPlugin.cpp:532
RoutingManager.h
QString::fromUtf8
QString fromUtf8(const char *str, int size)
Marble::EARTH_RADIUS
const qreal EARTH_RADIUS
Definition: MarbleGlobal.h:257
Marble::RoutingPlugin::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: RoutingPlugin.cpp:450
QHash< QString, QVariant >
QObject
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:45
Marble::SpeakersModel::IsLocal
Definition: SpeakersModel.h:34
MarbleDirs.h
SpeakersModel.h
Marble::MarbleModel::positionTracking
PositionTracking * positionTracking() const
Definition: MarbleModel.cpp:512
Marble::RoutingPlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: RoutingPlugin.cpp:485
Marble::RoutingPlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: RoutingPlugin.cpp:455
Marble::MarbleGraphicsGridLayout
Definition: MarbleGraphicsGridLayout.h:27
QList::first
T & first()
QString
QList
QColor
MarbleLocale.h
GeoPainter.h
Marble::WidgetGraphicsItem
Definition: WidgetGraphicsItem.h:28
WidgetGraphicsItem.h
Marble::METER2KM
const qreal METER2KM
Definition: MarbleGlobal.h:224
QStringList
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
QHash::value
const T value(const Key &key) const
Marble::KM2MI
const qreal KM2MI
Definition: MarbleGlobal.h:203
QSize
MarbleGraphicsGridLayout.h
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::MarbleGlobal::SmallScreen
Definition: MarbleGlobal.h:287
Marble::MarbleGlobal::getInstance
static MarbleGlobal * getInstance()
Definition: MarbleGlobal.cpp:37
Marble::RoutingPlugin::settings
virtual QHash< QString, QVariant > settings() const
Settings of the plugin.
Definition: RoutingPlugin.cpp:568
Marble::MarbleLocale::MetricSystem
Definition: MarbleLocale.h:38
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
Marble::RoutingPlugin
Definition: RoutingPlugin.h:23
Marble::RenderPlugin::setEnabled
void setEnabled(bool enabled)
settting enabled
Definition: RenderPlugin.cpp:139
QLatin1String
PluginManager.h
AudioOutput.h
Marble::MarbleGlobal::profiles
Profiles profiles() const
Definition: MarbleGlobal.cpp:48
Marble::RoutingPlugin::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: RoutingPlugin.cpp:460
Marble::RoutingPlugin::configDialog
QDialog * configDialog()
Returns a pointer to the configuration dialog of the plugin.
Definition: RoutingPlugin.cpp:590
QDialog
MarbleWidget.h
This file contains the headers for MarbleWidget.
RouteRequest.h
Marble::MarbleGraphicsItem::layout
AbstractMarbleGraphicsLayout * layout() const
Returns the layout of the MarbleGraphicsItem.
Definition: MarbleGraphicsItem.cpp:141
Marble::FrameGraphicsItem::setBorderWidth
void setBorderWidth(qreal width)
Set the border width of the item.
Definition: FrameGraphicsItem.cpp:114
Marble::KM2NM
const qreal KM2NM
Definition: MarbleGlobal.h:207
Marble::RoutingPlugin::~RoutingPlugin
~RoutingPlugin()
Definition: RoutingPlugin.cpp:445
Marble::RoutingPlugin::description
QString description() const
Returns a user description of the plugin.
Definition: RoutingPlugin.cpp:475
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
PositionTracking.h
Marble::RenderPlugin::marbleModel
const MarbleModel * marbleModel() const
Access to the MarbleModel.
Definition: RenderPlugin.cpp:83
Marble::FrameGraphicsItem::setPadding
void setPadding(qreal width)
Set the padding of the item.
Definition: FrameGraphicsItem.cpp:126
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QIcon
Marble::AbstractFloatItem::setVisible
void setVisible(bool visible)
Set visibility of the float item.
Definition: AbstractFloatItem.cpp:130
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