• 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
  • panoramio
PanoramioWidget.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 Bastian Holst <bastianholst@gmx.de>
9 //
10 
11 // Self
12 #include "PanoramioWidget.h"
13 
14 // Marble
15 #include "MarbleDebug.h"
16 #include "GeoPainter.h"
17 #include "ViewportParams.h"
18 #include "GeoSceneLayer.h"
19 
20 using namespace Marble;
21 
22 PanoramioWidget::PanoramioWidget( QObject *parent )
23  : AbstractDataPluginWidget( parent )
24 {
25 }
26 
27 QString PanoramioWidget::widgetType() const
28 {
29  return "panoramioWidget";
30 }
31 
32 bool PanoramioWidget::initialized()
33 {
34  return !smallImage.isNull();
35 }
36 
37 void PanoramioWidget::addDownloadedFile( QString url, QString type )
38 {
39  if( standardImageSize == type ) {
40  // Loading original image
41  QImage largeImage;
42  largeImage.load( url );
43 
44  // Scaling the image to the half of the original size
45  smallImage = largeImage.scaled( largeImage.size() / 2,
46  Qt::IgnoreAspectRatio,
47  Qt::SmoothTransformation );
48  }
49  else {
50  mDebug() << "PanoramioWidget: addDownloadFile can't handle type " << type;
51  }
52 }
53 
54 QDate PanoramioWidget::uploadDate() const
55 {
56  return m_uploadDate;
57 }
58 
59 void PanoramioWidget::setUploadDate( QDate uploadDate )
60 {
61  m_uploadDate = uploadDate;
62 }
63 
64 bool PanoramioWidget::operator<( const AbstractDataPluginWidget *other ) const
65 {
66  if( other->widgetType() == widgetType() ) {
67  return uploadDate() > ((PanoramioWidget *) other)->uploadDate();
68  }
69  else {
70  return false;
71  }
72 }
73 
74 bool PanoramioWidget::render( GeoPainter *painter, ViewportParams *viewport,
75  const QString& renderPos, GeoSceneLayer * layer )
76 {
77  painter->drawImage( coordinates(), smallImage );
78  return true;
79 }
80 
81 #include "PanoramioWidget.h"
Marble::PanoramioWidget::setUploadDate
void setUploadDate(QDate uploadDate)
Definition: PanoramioWidget.cpp:59
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::PanoramioWidget::initialized
bool initialized()
Definition: PanoramioWidget.cpp:32
Marble::standardImageSize
const QString standardImageSize
Definition: PanoramioWidget.h:22
AbstractDataPluginWidget
QObject
MarbleDebug.h
Marble::PanoramioWidget::uploadDate
QDate uploadDate() const
Definition: PanoramioWidget.cpp:54
Marble::GeoSceneLayer
Layer of a GeoScene document.
Definition: GeoSceneLayer.h:43
GeoPainter.h
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
PanoramioWidget.h
Marble::GeoPainter::drawImage
void drawImage(const GeoDataCoordinates &centerPosition, const QImage &image)
Draws an image at the given position. The image is placed with its center located at the given center...
Definition: GeoPainter.cpp:428
Marble::PanoramioWidget::widgetType
QString widgetType() const
Definition: PanoramioWidget.cpp:27
ViewportParams.h
This file contains the headers for ViewportParams.
Marble::PanoramioWidget
Definition: PanoramioWidget.h:24
Marble::PanoramioWidget::PanoramioWidget
PanoramioWidget(QObject *parent)
Definition: PanoramioWidget.cpp:22
Marble::PanoramioWidget::operator<
bool operator<(const AbstractDataPluginWidget *other) const
Definition: PanoramioWidget.cpp:64
Marble::PanoramioWidget::addDownloadedFile
void addDownloadedFile(QString url, QString type)
Definition: PanoramioWidget.cpp:37
Marble::PanoramioWidget::render
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer=0)
Definition: PanoramioWidget.cpp:74
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:31
GeoSceneLayer.h
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