• 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
  • lib
  • marble
  • graphicsview
GeoGraphicsItem.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 "GeoGraphicsItem.h"
13 #include "GeoGraphicsItem_p.h"
14 
15 #include "GeoDataPlacemark.h"
16 
17 // Qt
18 #include "MarbleDebug.h"
19 
20 using namespace Marble;
21 
22 GeoGraphicsItem::GeoGraphicsItem( const GeoDataFeature *feature )
23  : d( new GeoGraphicsItemPrivate( feature ) )
24 {
25  setFlag( ItemIsVisible, true );
26 }
27 
28 GeoGraphicsItem::~GeoGraphicsItem()
29 {
30  delete d;
31 }
32 
33 bool GeoGraphicsItem::visible() const
34 {
35  return d->m_flags & ItemIsVisible;
36 }
37 
38 void GeoGraphicsItem::setVisible( bool visible )
39 {
40  setFlag( ItemIsVisible, visible );
41 }
42 
43 GeoGraphicsItem::GeoGraphicsItemFlags GeoGraphicsItem::flags() const
44 {
45  return p()->m_flags;
46 }
47 
48 void GeoGraphicsItem::setFlag( GeoGraphicsItemFlag flag, bool enabled )
49 {
50  if( enabled ) {
51  p()->m_flags = p()->m_flags | flag;
52  } else {
53  p()->m_flags = p()->m_flags & ~flag;
54  }
55 }
56 
57 void GeoGraphicsItem::setFlags( GeoGraphicsItemFlags flags )
58 {
59  p()->m_flags = flags;
60 }
61 
62 const GeoDataFeature* GeoGraphicsItem::feature() const
63 {
64  return p()->m_feature;
65 }
66 
67 const GeoDataLatLonAltBox& GeoGraphicsItem::latLonAltBox() const
68 {
69  return p()->m_latLonAltBox;
70 }
71 
72 void GeoGraphicsItem::setLatLonAltBox( const GeoDataLatLonAltBox& latLonAltBox )
73 {
74  p()->m_latLonAltBox = latLonAltBox;
75 }
76 
77 void GeoGraphicsItem::setStyle( const GeoDataStyle* style )
78 {
79  p()->m_style = style;
80 }
81 
82 const GeoDataStyle* GeoGraphicsItem::style() const
83 {
84  return p()->m_style;
85 }
86 
87 qreal GeoGraphicsItem::zValue() const
88 {
89  return p()->m_zValue;
90 }
91 
92 void GeoGraphicsItem::setZValue( qreal z )
93 {
94  p()->m_zValue = z;
95 }
96 
97 GeoGraphicsItemPrivate *GeoGraphicsItem::p()
98 {
99  return reinterpret_cast<GeoGraphicsItemPrivate *>( d );
100 }
101 
102 const GeoGraphicsItemPrivate *GeoGraphicsItem::p() const
103 {
104  return reinterpret_cast<GeoGraphicsItemPrivate *>( d );
105 }
106 
107 int GeoGraphicsItem::minZoomLevel() const
108 {
109  return p()->m_minZoomLevel;
110 }
111 
112 void GeoGraphicsItem::setMinZoomLevel(int zoomLevel)
113 {
114  p()->m_minZoomLevel = zoomLevel;
115 }
116 
Marble::GeoGraphicsItem::ItemIsVisible
Definition: GeoGraphicsItem.h:40
Marble::GeoGraphicsItem::setStyle
void setStyle(const GeoDataStyle *style)
Set the style for the item.
Definition: GeoGraphicsItem.cpp:77
Marble::GeoGraphicsItem::style
const GeoDataStyle * style() const
Returns the style of item.
Definition: GeoGraphicsItem.cpp:82
GeoGraphicsItem_p.h
Marble::GeoGraphicsItem::minZoomLevel
int minZoomLevel() const
Returns the minim zoom level on which item will be active.
Definition: GeoGraphicsItem.cpp:107
Marble::GeoGraphicsItem::GeoGraphicsItemFlag
GeoGraphicsItemFlag
Definition: GeoGraphicsItem.h:36
Marble::GeoGraphicsItem::feature
const GeoDataFeature * feature() const
Returns the placemark for that item.
Definition: GeoGraphicsItem.cpp:62
Marble::GeoGraphicsItem::d
GeoGraphicsItemPrivate *const d
Definition: GeoGraphicsItem.h:122
MarbleDebug.h
Marble::GeoGraphicsItem::latLonAltBox
virtual const GeoDataLatLonAltBox & latLonAltBox() const
Returns the bounding box covered by the item.
Definition: GeoGraphicsItem.cpp:67
Marble::GeoGraphicsItemPrivate::m_style
const GeoDataStyle * m_style
Definition: GeoGraphicsItem_p.h:45
Marble::GeoGraphicsItem::GeoGraphicsItem
GeoGraphicsItem(const GeoDataFeature *feature)
Definition: GeoGraphicsItem.cpp:22
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::GeoGraphicsItem::setMinZoomLevel
void setMinZoomLevel(int zoomLevel)
Sets the minimum zoom level.
Definition: GeoGraphicsItem.cpp:112
Marble::GeoGraphicsItem::zValue
qreal zValue() const
Returns the z value of the item.
Definition: GeoGraphicsItem.cpp:87
Marble::GeoGraphicsItem::visible
bool visible() const
Definition: GeoGraphicsItem.cpp:33
Marble::GeoGraphicsItem::setVisible
void setVisible(bool visible)
Definition: GeoGraphicsItem.cpp:38
Marble::GeoGraphicsItem::setLatLonAltBox
void setLatLonAltBox(const GeoDataLatLonAltBox &latLonAltBox)
Set the box used to determine if an item is active or inactive.
Definition: GeoGraphicsItem.cpp:72
Marble::GeoGraphicsItemPrivate::m_minZoomLevel
int m_minZoomLevel
Definition: GeoGraphicsItem_p.h:42
GeoDataPlacemark.h
Marble::GeoGraphicsItem::~GeoGraphicsItem
virtual ~GeoGraphicsItem()
Definition: GeoGraphicsItem.cpp:28
Marble::GeoGraphicsItem::setFlags
void setFlags(GeoGraphicsItemFlags flags)
Replace all of the current flags.
Definition: GeoGraphicsItem.cpp:57
GeoGraphicsItem.h
Marble::GeoGraphicsItemPrivate
Definition: GeoGraphicsItem_p.h:23
Marble::GeoGraphicsItem::flags
GeoGraphicsItemFlags flags() const
Get the GeoGraphicItemFlags value that describes which flags are set on this item.
Definition: GeoGraphicsItem.cpp:43
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:57
Marble::GeoGraphicsItemPrivate::m_zValue
qreal m_zValue
Definition: GeoGraphicsItem_p.h:39
Marble::GeoGraphicsItem::setZValue
void setZValue(qreal z)
Set the z value of the item.
Definition: GeoGraphicsItem.cpp:92
Marble::GeoGraphicsItemPrivate::m_feature
const GeoDataFeature * m_feature
Definition: GeoGraphicsItem_p.h:43
Marble::GeoGraphicsItemPrivate::m_latLonAltBox
GeoDataLatLonAltBox m_latLonAltBox
Definition: GeoGraphicsItem_p.h:44
Marble::GeoGraphicsItemPrivate::m_flags
GeoGraphicsItem::GeoGraphicsItemFlags m_flags
Definition: GeoGraphicsItem_p.h:40
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
Marble::GeoGraphicsItem::setFlag
void setFlag(GeoGraphicsItemFlag flag, bool enabled=true)
Set or unset a single flag.
Definition: GeoGraphicsItem.cpp:48
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