• 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
  • annotate
AnnotatePlugin.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 2009 Andrew Manson <g.real.ate@gmail.com>
9 // Copyright 2013 Thibaut Gridel <tgridel@free.fr>
10 //
11 
12 #include "AnnotatePlugin.h"
13 
14 #include "MarbleDebug.h"
15 #include "AbstractProjection.h"
16 #include "AreaAnnotation.h"
17 #include "GeoDataDocument.h"
18 #include "GeoDataLatLonBox.h"
19 #include "GeoDataParser.h"
20 #include "GeoDataPlacemark.h"
21 #include "GeoDataStyle.h"
22 #include "GeoDataTreeModel.h"
23 #include "GeoDataTypes.h"
24 #include "GeoPainter.h"
25 #include "GeoWriter.h"
26 #include "KmlElementDictionary.h"
27 #include "MarbleDirs.h"
28 #include "MarbleModel.h"
29 #include "MarbleWidget.h"
30 #include "PlacemarkTextAnnotation.h"
31 
32 #include <QFileDialog>
33 #include <QAction>
34 #include <QNetworkAccessManager>
35 #include <QNetworkReply>
36 #include <QNetworkRequest>
37 #include <QMessageBox>
38 
39 namespace Marble
40 {
41 
42 AnnotatePlugin::AnnotatePlugin( const MarbleModel *model )
43  : RenderPlugin(model),
44  m_widgetInitialized( false ),
45  m_marbleWidget( 0 ),
46  m_annotationDocument( new GeoDataDocument ),
47  m_polygon_placemark( 0 ),
48  m_selectedItem( 0 ),
49  m_addingPlacemark( false ),
50  m_drawingPolygon( false ),
51  m_removingItem( false ),
52  // m_networkAccessManager( 0 ),
53  m_isInitialized( false )
54 {
55  Q_UNUSED(model);
56 
57  // Plugin is enabled by default
58  setEnabled( true );
59  // Plugin is not visible by default
60  setVisible( false );
61  connect( this, SIGNAL(visibilityChanged(bool,QString)), SLOT(enableModel(bool)) );
62 
63  m_annotationDocument->setName( tr("Annotations") );
64  m_annotationDocument->setDocumentRole( UserDocument );
65  GeoDataStyle style;
66  GeoDataPolyStyle polyStyle;
67  polyStyle.setColor( QColor( 0, 255, 255, 80 ) );
68  style.setStyleId( "polygon" );
69  style.setPolyStyle( polyStyle );
70  m_annotationDocument->addStyle( style );
71 }
72 
73 AnnotatePlugin::~AnnotatePlugin()
74 {
75  if( m_marbleWidget != 0 ) {
76  m_marbleWidget->model()->treeModel()->removeDocument( m_annotationDocument );
77  }
78  delete m_annotationDocument;
79  // delete m_networkAccessManager;
80 }
81 
82 QStringList AnnotatePlugin::backendTypes() const
83 {
84  return QStringList( "annotation" );
85 }
86 
87 QString AnnotatePlugin::renderPolicy() const
88 {
89  return QString( "ALWAYS" );
90 }
91 
92 QStringList AnnotatePlugin::renderPosition() const
93 {
94  return QStringList() << "ALWAYS_ON_TOP";
95 }
96 
97 QString AnnotatePlugin::name() const
98 {
99  return tr( "Annotation" );
100 }
101 
102 QString AnnotatePlugin::guiString() const
103 {
104  return tr( "&Annotation" );
105 }
106 
107 QString AnnotatePlugin::nameId() const
108 {
109  return QString( "annotation" );
110 }
111 
112 QString AnnotatePlugin::description() const
113 {
114  return tr( "Draws annotations on maps with placemarks or polygons." );
115 }
116 
117 QString AnnotatePlugin::version() const
118 {
119  return "1.0";
120 }
121 
122 QString AnnotatePlugin::copyrightYears() const
123 {
124  return "2009, 2013";
125 }
126 
127 QList<PluginAuthor> AnnotatePlugin::pluginAuthors() const
128 {
129  return QList<PluginAuthor>()
130  << PluginAuthor( "Andrew Manson", "<g.real.ate@gmail.com>" )
131  << PluginAuthor( "Thibaut Gridel", "<tgridel@free.fr>" );
132 }
133 
134 QIcon AnnotatePlugin::icon() const
135 {
136  return QIcon( ":/icons/draw-placemark.png");
137 }
138 
139 
140 void AnnotatePlugin::initialize()
141 {
142  if( !m_isInitialized ) {
143  m_widgetInitialized= false;
144  delete m_polygon_placemark;
145  m_polygon_placemark = 0;
146  delete m_selectedItem;
147  m_selectedItem = 0;
148  m_addingPlacemark = false;
149  m_drawingPolygon = false;
150  m_removingItem = false;
151  m_isInitialized = true;
152  }
153 }
154 
155 bool AnnotatePlugin::isInitialized() const
156 {
157  return m_isInitialized;
158 }
159 
160 QString AnnotatePlugin::runtimeTrace() const
161 {
162  return QString("Annotate Items: %1").arg( m_annotationDocument->size() );
163 }
164 const QList<QActionGroup*>* AnnotatePlugin::actionGroups() const
165 {
166  return &m_actions;
167 }
168 
169 const QList<QActionGroup*>* AnnotatePlugin::toolbarActionGroups() const
170 {
171  return &m_toolbarActions;
172 }
173 
174 bool AnnotatePlugin::render( GeoPainter *painter, ViewportParams *viewport, const QString& renderPos, GeoSceneLayer * layer )
175 {
176  Q_UNUSED(renderPos);
177  Q_UNUSED(layer);
178 
179  QListIterator<SceneGraphicsItem*> iter( m_graphicsItems );
180  while( iter.hasNext() ) {
181  iter.next()->paint( painter, viewport );
182  }
183 
184  return true;
185 }
186 
187 void AnnotatePlugin::enableModel( bool enabled )
188 {
189  if( enabled ) {
190  if( m_marbleWidget ) {
191  setupActions( m_marbleWidget );
192  m_marbleWidget->model()->treeModel()->addDocument( m_annotationDocument );
193  }
194  } else {
195  setupActions( 0 );
196  if( m_marbleWidget ) {
197  m_marbleWidget->model()->treeModel()->removeDocument( m_annotationDocument );
198  }
199  }
200 }
201 
202 void AnnotatePlugin::setAddingPlacemark( bool enabled )
203 {
204  m_addingPlacemark = enabled ;
205 }
206 
207 void AnnotatePlugin::setDrawingPolygon( bool enabled )
208 {
209  m_drawingPolygon = enabled;
210  if( enabled ) {
211  m_polygon_placemark = new GeoDataPlacemark;
212  m_polygon_placemark->setGeometry( new GeoDataPolygon( Tessellate ) );
213  m_polygon_placemark->setParent( m_annotationDocument );
214  m_polygon_placemark->setStyleUrl( "#polygon" );
215  m_marbleWidget->model()->treeModel()->addFeature( m_annotationDocument, m_polygon_placemark );
216  } else {
217  //stopped drawing the polygon
218  GeoDataPolygon *poly = dynamic_cast<GeoDataPolygon*>( m_polygon_placemark->geometry() );
219  Q_ASSERT( poly );
220  if ( !poly->outerBoundary().isEmpty() ) {
221  AreaAnnotation* area = new AreaAnnotation( m_polygon_placemark );
222  m_graphicsItems.append( area );
223  m_marbleWidget->update();
224  }
225  else {
226  m_marbleWidget->model()->treeModel()->removeFeature( m_polygon_placemark );
227  delete m_polygon_placemark;
228  }
229  m_polygon_placemark = 0;
230  }
231 }
232 
233 void AnnotatePlugin::setRemovingItems( bool enabled )
234 {
235  m_removingItem = enabled;
236 }
237 
238 //void AnnotatePlugin::receiveNetworkReply( QNetworkReply *reply )
239 //{
240 // if( reply->error() == QNetworkReply::NoError ) {
241 // readOsmFile( reply, false );
242 // } else {
243 // m_errorMessage.showMessage( tr("Error while trying to download the "
244 // "OSM file from the server. The "
245 // "error was:\n %1" ).arg(reply->errorString()) );
246 // }
247 //}
248 
249 //void AnnotatePlugin::downloadOsmFile()
250 //{
251 // QPointF topLeft(0,0);
252 // QPointF bottomRight(m_marbleWidget->size().width(), m_marbleWidget->size().height());
253 
254 // qreal lonTop, latTop;
255 // qreal lonBottom, latBottom;
256 
257 // GeoDataCoordinates topLeftCoordinates;
258 // GeoDataCoordinates bottomRightCoordinates;
259 
260 // bool topIsOnGlobe = m_marbleWidget->geoCoordinates( topLeft.x(),
261 // topLeft.y(),
262 // lonTop, latTop,
263 // GeoDataCoordinates::Radian);
264 // bool bottomIsOnGlobe = m_marbleWidget->geoCoordinates( bottomRight.x(),
265 // bottomRight.y(),
266 // lonBottom, latBottom,
267 // GeoDataCoordinates::Radian );
268 
269 // if( ! ( topIsOnGlobe && bottomIsOnGlobe ) ) {
270 // m_errorMessage.showMessage( tr("One of the selection points is not on"
271 // " the Globe. Please only select a region"
272 // " on the globe.") );
273 // return;
274 // }
275 
276 // topLeftCoordinates = GeoDataCoordinates( lonTop, latTop, 0,
277 // GeoDataCoordinates::Radian );
278 
279 // bottomRightCoordinates = GeoDataCoordinates( lonBottom, latBottom, 0,
280 // GeoDataCoordinates::Radian );
281 
282 // GeoDataLineString tempString;
283 // tempString.append( topLeftCoordinates );
284 // tempString.append( bottomRightCoordinates );
285 
286 // GeoDataLatLonAltBox bounds = GeoDataLatLonAltBox::fromLineString( tempString );
287 
288 // QString request;
289 // request = QString("http://api.openstreetmap.org/api/0.6/map?bbox=%1,%2,%3,%4")
290 // .arg(bounds.west(GeoDataCoordinates::Degree) )
291 // .arg(bounds.south(GeoDataCoordinates::Degree) )
292 // .arg(bounds.east( GeoDataCoordinates::Degree) )
293 // .arg( bounds.north( GeoDataCoordinates::Degree ) );
294 
295 // QNetworkRequest networkRequest;
296 // networkRequest.setUrl(QUrl(request) );
297 
298 // if( ! m_networkAccessManager ) {
299 // m_networkAccessManager = new QNetworkAccessManager( this ) ;
300 // connect( m_networkAccessManager, SIGNAL(finished(QNetworkReply*)),
301 // this, SLOT(receiveNetworkReply(QNetworkReply*)) );
302 // }
303 
304 // m_networkAccessManager->get( networkRequest );
305 //}
306 
307 void AnnotatePlugin::clearAnnotations()
308 {
309 
310  const int result = QMessageBox::question( m_marbleWidget,
311  QObject::tr( "Clear all annotations" ),
312  QObject::tr( "Are you sure you want to clear all annotations?" ),
313  QMessageBox::Yes | QMessageBox::Cancel );
314 
315  if ( result == QMessageBox::Yes ) {
316  m_selectedItem = 0;
317  delete m_polygon_placemark;
318  m_polygon_placemark = 0;
319  qDeleteAll( m_graphicsItems );
320  m_graphicsItems.clear();
321  m_marbleWidget->model()->treeModel()->removeDocument( m_annotationDocument );
322  m_annotationDocument->clear();
323  m_marbleWidget->model()->treeModel()->addDocument( m_annotationDocument );
324  }
325 }
326 
327 void AnnotatePlugin::saveAnnotationFile()
328 {
329  QString const filename = QFileDialog::getSaveFileName( 0, tr("Save Annotation File"),
330  QString(), tr("All Supported Files (*.kml);;KML file (*.kml)"));
331  if ( !filename.isNull() ) {
332  GeoWriter writer;
333  //FIXME: a better way to do this?
334  writer.setDocumentType( kml::kmlTag_nameSpace22 );
335  QFile file( filename );
336  file.open( QIODevice::WriteOnly );
337  if ( !writer.write( &file, m_annotationDocument ) ) {
338  mDebug() << "Could not write the file " << filename;
339  }
340  file.close();
341  }
342 }
343 
344 void AnnotatePlugin::loadAnnotationFile()
345 {
346  QString const filename = QFileDialog::getOpenFileName(0, tr("Open Annotation File"),
347  QString(), tr("All Supported Files (*.kml);;Kml Annotation file (*.kml)"));
348  if ( filename.isNull() ) {
349  return;
350  }
351 
352  QFile file( filename );
353  if ( !file.exists() ) {
354  mDebug() << "File " << filename << " does not exist!";
355  return;
356  }
357 
358  file.open( QIODevice::ReadOnly );
359  GeoDataParser parser( GeoData_KML );
360  if ( !parser.read( &file ) ) {
361  mDebug() << "Could not parse file " << filename;
362  return;
363  }
364 
365  GeoDataDocument* document = dynamic_cast<GeoDataDocument*>( parser.releaseDocument() );
366  Q_ASSERT( document );
367  file.close();
368 
369  foreach( GeoDataFeature *feature, document->featureList() ) {
370  if( feature->nodeType() == GeoDataTypes::GeoDataPlacemarkType ) {
371  GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( feature );
372  if( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPointType ) {
373  GeoDataPlacemark *newPlacemark = new GeoDataPlacemark( *placemark );
374  PlacemarkTextAnnotation* annotation = new PlacemarkTextAnnotation( newPlacemark );
375  m_graphicsItems.append( annotation );
376  m_marbleWidget->model()->treeModel()->addFeature( m_annotationDocument, newPlacemark );
377  } else if( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType ) {
378  GeoDataPlacemark *newPlacemark = new GeoDataPlacemark( *placemark );
379  newPlacemark->setParent( m_annotationDocument );
380  newPlacemark->setStyleUrl( placemark->styleUrl() );
381  AreaAnnotation* annotation = new AreaAnnotation( newPlacemark );
382  m_graphicsItems.append( annotation );
383  m_marbleWidget->model()->treeModel()->addFeature( m_annotationDocument, newPlacemark );
384  }
385  }
386  }
387  m_marbleWidget->centerOn( document->latLonAltBox() );
388 
389  delete document;
390  emit repaintNeeded(QRegion());
391 }
392 
393 bool AnnotatePlugin::eventFilter(QObject* watched, QEvent* event)
394 {
395  if( !m_widgetInitialized ) {
396  MarbleWidget* marbleWidget = qobject_cast<MarbleWidget*>( watched );
397  if( marbleWidget ) {
398  m_marbleWidget = marbleWidget;
399  setupActions( marbleWidget );
400  m_marbleWidget->model()->treeModel()->addDocument( m_annotationDocument );
401  m_widgetInitialized = true;
402  }
403  }
404 
405  if( !m_marbleWidget ) {
406  return false;
407  }
408  //FIXME why is the QEvent::MousePress not working? caught somewhere else?
409  //does this mean we need to centralize the event handling?
410 
411  //so far only accept mouse events
412  if( event->type() != QEvent::MouseButtonPress
413  && event->type() != QEvent::MouseButtonRelease
414  && event->type() != QEvent::MouseMove )
415  {
416  return false;
417  }
418 
419  QMouseEvent* mouseEvent = dynamic_cast<QMouseEvent*>(event);
420  Q_ASSERT( mouseEvent );
421 
422  qreal lon, lat;
423  bool isOnGlobe = m_marbleWidget->geoCoordinates( mouseEvent->pos().x(),
424  mouseEvent->pos().y(),
425  lon, lat,
426  GeoDataCoordinates::Radian );
427  if( !isOnGlobe ) {
428  return false;
429  }
430 
431  // handle easily the mousemove
432  if( event->type() == QEvent::MouseMove && m_selectedItem ) {
433  if( m_selectedItem->sceneEvent( event ) ) {
434  m_marbleWidget->model()->treeModel()->updateFeature( m_selectedItem->placemark() );
435  return true;
436  }
437  }
438 
439  //Pass the event to Graphics Items
440  foreach( SceneGraphicsItem *item, m_graphicsItems ) {
441  QListIterator<QRegion> it ( item->regions() );
442 
443  while ( it.hasNext() ) {
444  QRegion region = it.next();
445  if( region.contains( mouseEvent->pos() ) ) {
446  // deal with removing items
447  if( mouseEvent->button() == Qt::LeftButton && event->type() == QEvent::MouseButtonRelease && m_removingItem ) {
448 
449  const int result = QMessageBox::question( m_marbleWidget,
450  QObject::tr( "Remove current item" ),
451  QObject::tr( "Are you sure you want to remove the current item?" ),
452  QMessageBox::Yes | QMessageBox::Yes );
453 
454  if ( result == QMessageBox::Yes ) {
455  m_selectedItem = 0;
456  m_graphicsItems.removeAll( item );
457  m_marbleWidget->model()->treeModel()->removeFeature( item->feature() );
458  delete item->feature();
459  delete item;
460  emit itemRemoved();
461  }
462  return true;
463  }
464  else {
465  if( item->sceneEvent( event ) ) {
466  if( event->type() == QEvent::MouseButtonPress ) {
467  m_selectedItem = item;
468  } else {
469  m_selectedItem = 0;
470  }
471  m_marbleWidget->model()->treeModel()->updateFeature( item->placemark() );
472  return true;
473  }
474  }
475  }
476  }
477  }
478 
479  //FIXME: finish cleaning this up
480 
481  GeoDataCoordinates const coordinates( lon, lat );
482  // deal with adding a placemark
483  if ( mouseEvent->button() == Qt::LeftButton && m_addingPlacemark ) {
484  //Add a placemark on the screen
485  GeoDataPlacemark *placemark = new GeoDataPlacemark;
486  placemark->setCoordinate( coordinates );
487  PlacemarkTextAnnotation* textAnnotation = new PlacemarkTextAnnotation( placemark );
488  m_marbleWidget->model()->treeModel()->addFeature( m_annotationDocument, placemark );
489  m_graphicsItems.append( textAnnotation );
490  emit placemarkAdded();
491  return true;
492  }
493 
494  // deal with drawing a polygon
495  if ( mouseEvent->button() == Qt::LeftButton
496  && mouseEvent->type() == QEvent::MouseButtonPress
497  && m_drawingPolygon ) {
498  m_marbleWidget->model()->treeModel()->removeFeature( m_polygon_placemark );
499  GeoDataPolygon *poly = dynamic_cast<GeoDataPolygon*>( m_polygon_placemark->geometry() );
500  poly->outerBoundary().append(GeoDataCoordinates(lon, lat));
501  m_marbleWidget->model()->treeModel()->addFeature( m_annotationDocument, m_polygon_placemark );
502  return true;
503  }
504 
505  return false;
506 }
507 
508 void AnnotatePlugin::setupActions(MarbleWidget* widget)
509 {
510  qDeleteAll( m_actions );
511  m_actions.clear();
512  m_toolbarActions.clear();
513 
514  if( widget ) {
515  QActionGroup* group = new QActionGroup(0);
516  group->setExclusive( false );
517 
518  QActionGroup* nonExclusiveGroup = new QActionGroup(0);
519  nonExclusiveGroup->setExclusive( false );
520 
521 
522  QAction* enableInputAction = new QAction(this);
523  enableInputAction->setToolTip(tr("Enable Moving Map"));
524  enableInputAction->setCheckable(true);
525  enableInputAction->setChecked( true );
526  enableInputAction->setIcon( QIcon( ":/icons/hand.png") );
527  connect( enableInputAction, SIGNAL(toggled(bool)),
528  widget, SLOT(setInputEnabled(bool)) );
529 
530  QAction* addPlacemark= new QAction(this);
531  addPlacemark->setToolTip( tr("Add Placemark") );
532  addPlacemark->setCheckable( true );
533  addPlacemark->setIcon( QIcon( ":/icons/draw-placemark.png") );
534  connect( addPlacemark, SIGNAL(toggled(bool)),
535  this, SLOT(setAddingPlacemark(bool)) );
536  connect( this, SIGNAL(placemarkAdded()) ,
537  addPlacemark, SLOT(toggle()) );
538 
539  QAction* drawPolygon = new QAction( this );
540  drawPolygon->setToolTip( tr("Add Polygon") );
541  drawPolygon->setCheckable( true );
542  drawPolygon->setIcon( QIcon( ":/icons/draw-polygon.png") );
543  connect( drawPolygon, SIGNAL(toggled(bool)),
544  this, SLOT(setDrawingPolygon(bool)) );
545 
546  QAction* removeItem = new QAction( this );
547  removeItem->setToolTip( tr("Remove Item") );
548  removeItem->setCheckable( true );
549  removeItem->setIcon( QIcon( ":/icons/edit-delete-shred.png") );
550  connect( removeItem, SIGNAL(toggled(bool)),
551  this, SLOT(setRemovingItems(bool)) );
552  connect( this, SIGNAL(itemRemoved()),
553  removeItem, SLOT(toggle()) );
554 
555  QAction* loadAnnotationFile = new QAction( this );
556  loadAnnotationFile->setToolTip( tr("Load Annotation File" ) );
557  loadAnnotationFile->setIcon( QIcon( ":/icons/document-import.png") );
558  connect( loadAnnotationFile, SIGNAL(triggered()),
559  this, SLOT(loadAnnotationFile()) );
560 
561  QAction* saveAnnotationFile = new QAction( this );
562  saveAnnotationFile->setToolTip( tr("Save Annotation File") );
563  saveAnnotationFile->setIcon( QIcon( ":/icons/document-export.png") );
564  connect( saveAnnotationFile, SIGNAL(triggered()),
565  this, SLOT(saveAnnotationFile()) );
566 
567  QAction* clearAnnotations = new QAction( this );
568  clearAnnotations->setToolTip( tr("Clear all Annotations") );
569  clearAnnotations->setIcon( QIcon( ":/icons/remove.png") );
570  connect( drawPolygon, SIGNAL(toggled(bool)), clearAnnotations, SLOT(setDisabled(bool)) );
571  connect( clearAnnotations, SIGNAL(triggered()),
572  this, SLOT(clearAnnotations()) );
573 
574  QAction* beginSeparator = new QAction( this );
575  beginSeparator->setSeparator( true );
576  QAction* endSeparator = new QAction ( this );
577  endSeparator->setSeparator( true );
578 
579 
580  // QAction* downloadOsm = new QAction( this );
581  // downloadOsm->setText( tr("Download Osm File") );
582  // downloadOsm->setToolTip(tr("Download Osm File for selected area"));
583  // connect( downloadOsm, SIGNAL(triggered()),
584  // this, SLOT(downloadOsmFile()) );
585 
586 
587  group->addAction( enableInputAction );
588  group->addAction( beginSeparator );
589  group->addAction( addPlacemark );
590  group->addAction( drawPolygon );
591  group->addAction( removeItem );
592  group->addAction( loadAnnotationFile );
593  group->addAction( saveAnnotationFile );
594  group->addAction( clearAnnotations );
595  group->addAction( endSeparator );
596 
597  // nonExclusiveGroup->addAction( downloadOsm );
598 
599  m_actions.append( group );
600  m_actions.append( nonExclusiveGroup );
601 
602  m_toolbarActions.append( group );
603  m_toolbarActions.append( nonExclusiveGroup );
604  }
605 
606  emit actionGroupsChanged();
607 }
608 
609 //void AnnotatePlugin::readOsmFile( QIODevice *device, bool flyToFile )
610 //{
611 //}
612 
613 }
614 
615 Q_EXPORT_PLUGIN2( AnnotatePlugin, Marble::AnnotatePlugin )
616 
617 #include "AnnotatePlugin.moc"
GeoDataDocument.h
Marble::AnnotatePlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: AnnotatePlugin.cpp:97
Marble::AnnotatePlugin::~AnnotatePlugin
virtual ~AnnotatePlugin()
Definition: AnnotatePlugin.cpp:73
Marble::AnnotatePlugin::itemRemoved
void itemRemoved()
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataGeometry::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataGeometry.cpp:77
AnnotatePlugin.h
Marble::GeoDataCoordinates::Radian
Definition: GeoDataCoordinates.h:65
Marble::GeoDataStyleSelector::setStyleId
void setStyleId(const QString &value)
Set a new style id.
Definition: GeoDataStyleSelector.cpp:60
Marble::GeoDataTreeModel::addFeature
int addFeature(GeoDataContainer *parent, GeoDataFeature *feature, int row=-1)
Definition: GeoDataTreeModel.cpp:566
Marble::GeoDataDocument
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:64
Marble::GeoDataTypes::GeoDataPointType
const char * GeoDataPointType
Definition: GeoDataTypes.cpp:64
Marble::GeoDataParser
Definition: GeoDataParser.h:40
Marble::AnnotatePlugin::isInitialized
bool isInitialized() const
Definition: AnnotatePlugin.cpp:155
Marble::GeoDataDocument::setDocumentRole
void setDocumentRole(DocumentRole role)
Definition: GeoDataDocument.cpp:62
Marble::AnnotatePlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: AnnotatePlugin.cpp:107
Marble::GeoDataTypes::GeoDataPolygonType
const char * GeoDataPolygonType
Definition: GeoDataTypes.cpp:65
Marble::RenderPlugin::repaintNeeded
void repaintNeeded(QRegion dirtyRegion=QRegion())
This signal is emitted if an update of the view is needed.
Marble::MarbleModel::treeModel
GeoDataTreeModel * treeModel()
Return the list of Placemarks as a QAbstractItemModel *.
Definition: MarbleModel.cpp:407
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
MarbleModel.h
This file contains the headers for MarbleModel.
Marble::AnnotatePlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: AnnotatePlugin.cpp:127
Marble::GeoDataColorStyle::setColor
void setColor(const QColor &value)
Set a new color.
Definition: GeoDataColorStyle.cpp:73
Marble::PluginAuthor
Definition: PluginInterface.h:28
Marble::GeoDataTypes::GeoDataPlacemarkType
const char * GeoDataPlacemarkType
Definition: GeoDataTypes.cpp:62
Marble::GeoDataTreeModel::removeFeature
bool removeFeature(GeoDataContainer *parent, int index)
Definition: GeoDataTreeModel.cpp:600
GeoDataStyle.h
Marble::GeoGraphicsItem::feature
const GeoDataFeature * feature() const
Returns the placemark for that item.
Definition: GeoGraphicsItem.cpp:62
Marble::AnnotatePlugin::loadAnnotationFile
void loadAnnotationFile()
Definition: AnnotatePlugin.cpp:344
GeoDataParser.h
Marble::kml::kmlTag_nameSpace22
const char * kmlTag_nameSpace22
Definition: KmlElementDictionary.cpp:33
Marble::GeoDataFeature::styleUrl
QString styleUrl() const
Return the styleUrl of the feature.
Definition: GeoDataFeature.cpp:551
Marble::GeoDataPlacemark::setCoordinate
void setCoordinate(qreal longitude, qreal latitude, qreal altitude=0, GeoDataCoordinates::Unit _unit=GeoDataCoordinates::Radian)
Set the coordinate of the placemark in longitude and latitude.
Definition: GeoDataPlacemark.cpp:121
AreaAnnotation.h
QObject
Marble::GeoDataPlacemark::geometry
GeoDataGeometry * geometry() const
The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the c...
Definition: GeoDataPlacemark.cpp:63
MarbleDebug.h
Marble::GeoDataTreeModel::addDocument
int addDocument(GeoDataDocument *document)
Definition: GeoDataTreeModel.cpp:595
AbstractProjection.h
This file contains the headers for AbstractProjection.
GeoWriter.h
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:102
Marble::GeoData_KML
Definition: GeoDataParser.h:36
Marble::GeoDataObject::setParent
virtual void setParent(GeoDataObject *parent)
Sets the parent of the object.
Definition: GeoDataObject.cpp:70
Marble::RenderPlugin::actionGroupsChanged
void actionGroupsChanged()
This signal is emitted if the actions that the plugin supports change in any way. ...
Marble::AnnotatePlugin::actionGroups
virtual const QList< QActionGroup * > * actionGroups() const
Getting all actions.
Definition: AnnotatePlugin.cpp:164
Marble::SceneGraphicsItem::sceneEvent
bool sceneEvent(QEvent *event)
Definition: SceneGraphicsItem.cpp:41
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::AnnotatePlugin::placemarkAdded
void placemarkAdded()
Marble::AnnotatePlugin::setRemovingItems
void setRemovingItems(bool)
Definition: AnnotatePlugin.cpp:233
Marble::AnnotatePlugin
The class that specifies the Marble layer interface of a plugin.
Definition: AnnotatePlugin.h:43
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
Marble::GeoParser::read
bool read(QIODevice *)
Main API for reading the XML document.
Definition: GeoParser.cpp:74
Marble::GeoDataFeature::setName
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:485
KmlElementDictionary.h
Marble::GeoDataTreeModel::removeDocument
void removeDocument(int index)
Definition: GeoDataTreeModel.cpp:646
Marble::AnnotatePlugin::setDrawingPolygon
void setDrawingPolygon(bool)
Definition: AnnotatePlugin.cpp:207
Marble::AreaAnnotation
Definition: AreaAnnotation.h:20
Marble::SceneGraphicsItem
Definition: SceneGraphicsItem.h:28
Marble::UserDocument
Definition: GeoDataDocument.h:42
Marble::RenderPlugin::visibilityChanged
void visibilityChanged(bool visible, const QString &nameId)
This signal is emitted if the visibility is changed with.
Marble::GeoDataPolygon
A polygon that can have "holes".
Definition: GeoDataPolygon.h:81
Marble::AnnotatePlugin::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Definition: AnnotatePlugin.cpp:393
MarbleDirs.h
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:28
Marble::AnnotatePlugin::render
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
Definition: AnnotatePlugin.cpp:174
Marble::MarbleWidget::model
MarbleModel * model() const
Return the model that this view shows.
Definition: MarbleWidget.cpp:283
Marble::GeoDataDocument::addStyle
void addStyle(const GeoDataStyle &style)
Add a style to the style storage.
Definition: GeoDataDocument.cpp:110
Marble::GeoDataContainer::size
int size() const
size of the container
Definition: GeoDataContainer.cpp:179
Marble::RenderPlugin::setVisible
void setVisible(bool visible)
settting visible
Definition: RenderPlugin.cpp:149
Marble::AnnotatePlugin::renderPolicy
QString renderPolicy() const
Return how the plugin settings should be used.
Definition: AnnotatePlugin.cpp:87
GeoPainter.h
Marble::AnnotatePlugin::renderPosition
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: AnnotatePlugin.cpp:92
Marble::GeoDataContainer::latLonAltBox
GeoDataLatLonAltBox latLonAltBox() const
A convenience function that returns the LatLonAltBox of all placemarks in this container.
Definition: GeoDataContainer.cpp:53
Marble::GeoDataTreeModel::updateFeature
void updateFeature(GeoDataFeature *feature)
Definition: GeoDataTreeModel.cpp:638
GeoDataPlacemark.h
GeoDataTreeModel.h
Marble::GeoDataLineString::append
void append(const GeoDataCoordinates &position)
Appends a given geodesic position as a new node to the LineString.
Definition: GeoDataLineString.cpp:221
Marble::GeoDataPolygon::outerBoundary
GeoDataLinearRing & outerBoundary()
Returns the outer boundary that is represented as a LinearRing.
Definition: GeoDataPolygon.cpp:85
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::AnnotatePlugin::clearAnnotations
void clearAnnotations()
Definition: AnnotatePlugin.cpp:307
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
Marble::GeoDataFeature::setStyleUrl
void setStyleUrl(const QString &value)
Set the styleUrl of this feature to value.
Definition: GeoDataFeature.cpp:556
Marble::AnnotatePlugin::copyrightYears
QString copyrightYears() const
Definition: AnnotatePlugin.cpp:122
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::AnnotatePlugin::description
QString description() const
Returns a user description of the plugin.
Definition: AnnotatePlugin.cpp:112
Marble::GeoWriter::setDocumentType
void setDocumentType(const QString &documentType)
Set the current document type.
Definition: GeoWriter.cpp:79
Marble::AnnotatePlugin::setAddingPlacemark
void setAddingPlacemark(bool)
Definition: AnnotatePlugin.cpp:202
GeoDataLatLonBox.h
Marble::SceneGraphicsItem::placemark
GeoDataPlacemark * placemark()
Definition: SceneGraphicsItem.cpp:36
Marble::AnnotatePlugin::initialize
void initialize()
Definition: AnnotatePlugin.cpp:140
Marble::PlacemarkTextAnnotation
Definition: PlacemarkTextAnnotation.h:23
Marble::MarbleModel
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:96
Marble::SceneGraphicsItem::regions
QList< QRegion > regions() const
Definition: SceneGraphicsItem.cpp:31
Marble::RenderPlugin::setEnabled
void setEnabled(bool enabled)
settting enabled
Definition: RenderPlugin.cpp:137
Marble::GeoDataLineString::isEmpty
bool isEmpty() const
Returns whether the LineString has no nodes at all.
Definition: GeoDataLineString.cpp:129
Marble::AnnotatePlugin::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: AnnotatePlugin.cpp:82
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:55
Marble::GeoDataContainer::featureList
QVector< GeoDataFeature * > featureList() const
A convenience function that returns all features in this container.
Definition: GeoDataContainer.cpp:124
Marble::MarbleWidget::geoCoordinates
bool geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Degree) const
Get the earth coordinates corresponding to a pixel in the widget.
Definition: MarbleWidget.cpp:764
Marble::AnnotatePlugin::toolbarActionGroups
virtual const QList< QActionGroup * > * toolbarActionGroups() const
Getting all actions which should be placed in the toolbar.
Definition: AnnotatePlugin.cpp:169
Marble::AnnotatePlugin::enableModel
void enableModel(bool enabled)
Definition: AnnotatePlugin.cpp:187
Marble::AnnotatePlugin::icon
QIcon icon() const
Returns an icon for the plugin.
Definition: AnnotatePlugin.cpp:134
Marble::AnnotatePlugin::saveAnnotationFile
void saveAnnotationFile()
Definition: AnnotatePlugin.cpp:327
Marble::AnnotatePlugin::AnnotatePlugin
AnnotatePlugin(const MarbleModel *model=0)
Definition: AnnotatePlugin.cpp:42
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::RenderPlugin::enabled
bool enabled() const
is enabled
Marble::GeoWriter::write
bool write(QIODevice *device, const GeoNode *feature)
The main API call to use the XML writer.
Definition: GeoWriter.cpp:28
PlacemarkTextAnnotation.h
GeoDataTypes.h
Marble::AnnotatePlugin::runtimeTrace
virtual QString runtimeTrace() const
Returns a debug line for perfo/tracing issues.
Definition: AnnotatePlugin.cpp:160
Marble::AnnotatePlugin::version
QString version() const
Definition: AnnotatePlugin.cpp:117
Marble::Tessellate
Definition: MarbleGlobal.h:32
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
Marble::GeoDataFeature::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataFeature.cpp:94
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
Marble::GeoDataStyle::setPolyStyle
void setPolyStyle(const GeoDataPolyStyle &style)
set the poly style
Definition: GeoDataStyle.cpp:98
Marble::RenderPlugin
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
Marble::GeoDataContainer::clear
void clear()
Definition: GeoDataContainer.cpp:217
Marble::AnnotatePlugin::guiString
QString guiString() const
String that should be displayed in GUI.
Definition: AnnotatePlugin.cpp:102
Marble::GeoParser::releaseDocument
GeoDocument * releaseDocument()
retrieve the parsed document and reset the parser If parsing was successful, retrieve the resulting d...
Definition: GeoParser.cpp:205
Marble::GeoDataPlacemark::setGeometry
void setGeometry(GeoDataGeometry *entry)
Sets the current Geometry of this Placemark.
Definition: GeoDataPlacemark.cpp:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:48 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