• 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
  • annotate
EditGroundOverlayDialog.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 2013 Adrian Draghici <draghici.adrian.b@gmail.com>
9 //
10 
11 #include "EditGroundOverlayDialog.h"
12 #include "ui_EditGroundOverlayDialog.h"
13 
14 namespace Marble
15 {
16 
17 class EditGroundOverlayDialog::Private : public Ui::UiEditGroundOverlayDialog
18 {
19 
20 public:
21  GeoDataGroundOverlay *m_overlay;
22  TextureLayer *m_textureLayer;
23 
24  Private( GeoDataGroundOverlay *overlay, TextureLayer *textureLayer );
25  ~Private();
26 
27  void updateCoordinates();
28 };
29 
30 EditGroundOverlayDialog::Private::Private( GeoDataGroundOverlay *overlay, TextureLayer *textureLayer ) :
31  Ui::UiEditGroundOverlayDialog(), m_overlay( overlay ), m_textureLayer( textureLayer )
32 {
33 
34 }
35 
36 EditGroundOverlayDialog::Private::~Private()
37 {
38 
39 }
40 
41 EditGroundOverlayDialog::EditGroundOverlayDialog( GeoDataGroundOverlay *overlay, TextureLayer *textureLayer, QWidget *parent )
42  : QDialog( parent ), d( new Private( overlay, textureLayer ) )
43 {
44  d->setupUi( this );
45 
46  d->m_name->setText( overlay->name() );
47  d->m_link->setText( overlay->absoluteIconFile() );
48  d->m_description->setText( overlay->description() );
49 
50  d->m_north->setRange( -90, 90 );
51  d->m_south->setRange( -90, 90 );
52  d->m_west->setRange( -180, 180 );
53  d->m_east->setRange( -180, 180 );
54  d->m_rotation->setRange( -360, 360 );
55 
56  GeoDataLatLonBox latLonBox = overlay->latLonBox();
57  d->m_north->setValue( latLonBox.north( GeoDataCoordinates::Degree ) );
58  d->m_south->setValue( latLonBox.south( GeoDataCoordinates::Degree ) );
59  d->m_west->setValue( latLonBox.west( GeoDataCoordinates::Degree ) );
60  d->m_east->setValue( latLonBox.east( GeoDataCoordinates::Degree ) );
61  d->m_rotation->setValue( latLonBox.rotation( GeoDataCoordinates::Degree ) );
62 
63  connect( d->buttonBox, SIGNAL(accepted()), this, SLOT(updateGroundOverlay()) );
64  connect( d->buttonBox, SIGNAL(accepted()), this, SLOT(setGroundOverlayUpdated()) );
65  connect( d->buttonBox, SIGNAL(accepted()), d->m_textureLayer, SLOT(reset()) );
66 }
67 
68 EditGroundOverlayDialog::~EditGroundOverlayDialog()
69 {
70  delete d;
71 }
72 
73 
74 void EditGroundOverlayDialog::updateGroundOverlay()
75 {
76  d->m_overlay->setName( d->m_name->text() );
77  d->m_overlay->setIconFile( d->m_link->text() );
78  d->m_overlay->setDescription( d->m_description->toPlainText() );
79 
80  d->m_overlay->latLonBox().setBoundaries( d->m_north->value(),
81  d->m_south->value(),
82  d->m_east->value(),
83  d->m_west->value(),
84  GeoDataCoordinates::Degree );
85 
86  d->m_overlay->latLonBox().setRotation( d->m_rotation->value(), GeoDataCoordinates::Degree );
87 }
88 
89 void EditGroundOverlayDialog::setGroundOverlayUpdated()
90 {
91  emit groundOverlayUpdated( d->m_overlay );
92 }
93 
94 }
95 
96 #include "EditGroundOverlayDialog.moc"
QWidget
Marble::EditGroundOverlayDialog::EditGroundOverlayDialog
EditGroundOverlayDialog(GeoDataGroundOverlay *overlay, TextureLayer *textureLayer, QWidget *parent=0)
Definition: EditGroundOverlayDialog.cpp:41
Marble::EditGroundOverlayDialog::groundOverlayUpdated
void groundOverlayUpdated(GeoDataGroundOverlay *)
QDialog::accepted
void accepted()
Marble::GeoDataFeature::description
QString description() const
Return the text description of the feature.
Definition: GeoDataFeature.cpp:588
Marble::GeoDataGroundOverlay::latLonBox
GeoDataLatLonBox & latLonBox() const
Definition: GeoDataGroundOverlay.cpp:97
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
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
EditGroundOverlayDialog.h
Marble::TextureLayer
Definition: TextureLayer.h:38
Marble::GeoDataLatLonBox::rotation
qreal rotation(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the rotation of the bounding box.
Definition: GeoDataLatLonBox.cpp:190
Marble::GeoDataLatLonBox::west
qreal west(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the western boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:156
Marble::EditGroundOverlayDialog::~EditGroundOverlayDialog
~EditGroundOverlayDialog()
Definition: EditGroundOverlayDialog.cpp:68
Marble::GeoDataFeature::name
QString name() const
The name of the feature.
Definition: GeoDataFeature.cpp:544
Marble::GeoDataLatLonBox::south
qreal south(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
Get the southern boundary of the bounding box.
Definition: GeoDataLatLonBox.cpp:114
Marble::GeoDataGroundOverlay
Definition: GeoDataGroundOverlay.h:24
QDialog
Marble::GeoDataOverlay::absoluteIconFile
QString absoluteIconFile() const
Returns the iconFile as an absolute filename.
Definition: GeoDataOverlay.cpp:103
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Marble::GeoDataLatLonBox
A class that defines a 2D bounding box for geographic data.
Definition: GeoDataLatLonBox.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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