• 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
  • lib
  • marble
VisiblePlacemark.h
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 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 //
13 // VisiblePlacemarks are those Placemarks which become visible on the map
14 //
15 
16 #ifndef MARBLE_VISIBLEPLACEMARK_H
17 #define MARBLE_VISIBLEPLACEMARK_H
18 
19 #include "GeoDataPlacemark.h"
20 
21 #include <QPixmap>
22 #include <QPoint>
23 #include <QRect>
24 #include <QString>
25 
26 namespace Marble
27 {
28 
29 static const qreal s_labelOutlineWidth = 2.5;
30 
31 
38 class VisiblePlacemark
39 {
40  public:
41  explicit VisiblePlacemark( const GeoDataPlacemark *placemark );
42 
47  const GeoDataPlacemark* placemark() const;
48 
52  const QPixmap& symbolPixmap() const;
53 
57  bool selected() const;
58 
62  void setSelected( bool selected );
63 
67  const QPoint& symbolPosition() const;
68 
72  const QPointF hotSpot() const;
73 
77  void setSymbolPosition( const QPoint& position );
78 
82  const QPixmap& labelPixmap() const;
83 
87  const QRectF& labelRect() const;
88 
92  void setLabelRect( const QRectF& area );
93 
94  enum LabelStyle {
95  Normal = 0,
96  Glow,
97  Selected
98  };
99 
100  private:
101  void drawLabelText( QPainter &labelPainter, const QString &text, const QFont &labelFont, LabelStyle labelStyle, const QColor &color );
102  void drawLabelPixmap();
103 
104  const GeoDataPlacemark *m_placemark;
105 
106  // View stuff
107  QPoint m_symbolPosition; // position of the placemark's symbol
108  bool m_selected; // state of the placemark
109  QPixmap m_labelPixmap; // the text label (most often name)
110  QRectF m_labelRect; // bounding box of label
111 
112  mutable QPixmap m_symbolPixmap; // cached value
113 };
114 
115 }
116 
117 #endif
QPainter
Marble::VisiblePlacemark::setSelected
void setSelected(bool selected)
Sets the state of the place mark.
Definition: VisiblePlacemark.cpp:54
Marble::VisiblePlacemark::symbolPixmap
const QPixmap & symbolPixmap() const
Returns the pixmap of the place mark symbol.
Definition: VisiblePlacemark.cpp:38
Marble::VisiblePlacemark
A class which represents the visible place marks on a map.
Definition: VisiblePlacemark.h:38
Marble::VisiblePlacemark::labelPixmap
const QPixmap & labelPixmap() const
Returns the pixmap of the place mark name label.
Definition: VisiblePlacemark.cpp:105
Marble::VisiblePlacemark::Glow
Definition: VisiblePlacemark.h:96
Marble::VisiblePlacemark::LabelStyle
LabelStyle
Definition: VisiblePlacemark.h:94
Marble::VisiblePlacemark::symbolPosition
const QPoint & symbolPosition() const
Returns the position of the place mark symbol on the map.
Definition: VisiblePlacemark.cpp:60
Marble::VisiblePlacemark::labelRect
const QRectF & labelRect() const
Returns the area covered by the place mark name label on the map.
Definition: VisiblePlacemark.cpp:110
Marble::s_labelOutlineWidth
static const qreal s_labelOutlineWidth
Definition: VisiblePlacemark.h:29
Marble::VisiblePlacemark::VisiblePlacemark
VisiblePlacemark(const GeoDataPlacemark *placemark)
Definition: VisiblePlacemark.cpp:26
GeoDataPlacemark.h
Marble::VisiblePlacemark::selected
bool selected() const
Returns the state of the place mark.
Definition: VisiblePlacemark.cpp:49
Marble::VisiblePlacemark::setLabelRect
void setLabelRect(const QRectF &area)
Sets the area covered by the place mark name label on the map.
Definition: VisiblePlacemark.cpp:115
Marble::VisiblePlacemark::Normal
Definition: VisiblePlacemark.h:95
Marble::VisiblePlacemark::placemark
const GeoDataPlacemark * placemark() const
Returns the index of the place mark model which is associated with this visible place mark...
Definition: VisiblePlacemark.cpp:33
Marble::VisiblePlacemark::setSymbolPosition
void setSymbolPosition(const QPoint &position)
Sets the position of the place mark symbol on the map.
Definition: VisiblePlacemark.cpp:100
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::VisiblePlacemark::hotSpot
const QPointF hotSpot() const
Returns the top left corner of the place mark symbol's hot spot.
Definition: VisiblePlacemark.cpp:65
Marble::VisiblePlacemark::Selected
Definition: VisiblePlacemark.h:97
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:53 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