• 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
  • geodata
  • data
GeoDataFeature_p.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 2009 Patrick Spendrin <ps_ml@gmx.de>
9 //
10 
11 #ifndef MARBLE_GEODATAFEATUREPRIVATE_H
12 #define MARBLE_GEODATAFEATUREPRIVATE_H
13 
14 #include <QString>
15 #include <QAtomicInt>
16 
17 #include "GeoDataExtendedData.h"
18 #include "GeoDataAbstractView.h"
19 #include "GeoDataFeature.h"
20 #include "GeoDataRegion.h"
21 #include "GeoDataTimeStamp.h"
22 #include "GeoDataTimeSpan.h"
23 #include "GeoDataTypes.h"
24 #include "GeoDataStyle.h"
25 #include "GeoDataSnippet.h"
26 #include "MarbleDirs.h"
27 
28 namespace Marble
29 {
30 
31 class GeoDataFeaturePrivate
32 {
33  public:
34  GeoDataFeaturePrivate() :
35  m_name(),
36  m_snippet(),
37  m_description(),
38  m_descriptionCDATA(),
39  m_address(),
40  m_phoneNumber(),
41  m_styleUrl(),
42  m_abstractView( 0 ),
43  m_popularity( 0 ),
44  m_zoomLevel( 1 ),
45  m_visible( true ),
46  m_visualCategory( GeoDataFeature::Default ),
47  m_role(" "),
48  m_style( 0 ),
49  m_styleMap( 0 ),
50  m_extendedData(),
51  m_timeSpan(),
52  m_timeStamp(),
53  m_region(),
54  ref( 0 )
55  {
56  }
57 
58  GeoDataFeaturePrivate( const GeoDataFeaturePrivate& other ) :
59  m_name( other.m_name ),
60  m_snippet( other.m_snippet ),
61  m_description( other.m_description ),
62  m_descriptionCDATA( other.m_descriptionCDATA),
63  m_address( other.m_address ),
64  m_phoneNumber( other.m_phoneNumber ),
65  m_styleUrl( other.m_styleUrl ),
66  m_abstractView( other.m_abstractView ),
67  m_popularity( other.m_popularity ),
68  m_zoomLevel( other.m_zoomLevel ),
69  m_visible( other.m_visible ),
70  m_visualCategory( other.m_visualCategory ),
71  m_role( other.m_role ),
72  m_style( other.m_style ), //FIXME: both style and stylemap need to be reworked internally!!!!
73  m_styleMap( other.m_styleMap ),
74  m_extendedData( other.m_extendedData ),
75  m_timeSpan( other.m_timeSpan ),
76  m_timeStamp( other.m_timeStamp ),
77  m_region( other.m_region ),
78  ref( 0 )
79  {
80  }
81 
82  GeoDataFeaturePrivate& operator=( const GeoDataFeaturePrivate& other )
83  {
84  m_name = other.m_name;
85  m_snippet = other.m_snippet;
86  m_description = other.m_description;
87  m_descriptionCDATA = other.m_descriptionCDATA;
88  m_address = other.m_address;
89  m_phoneNumber = other.m_phoneNumber;
90  m_styleUrl = other.m_styleUrl;
91  m_abstractView = other.m_abstractView;
92  m_popularity = other.m_popularity;
93  m_zoomLevel = other.m_zoomLevel;
94  m_visible = other.m_visible;
95  m_role = other.m_role;
96  m_style = other.m_style;
97  m_styleMap = other.m_styleMap;
98  m_timeSpan = other.m_timeSpan;
99  m_timeStamp = other.m_timeStamp;
100  m_visualCategory = other.m_visualCategory;
101  m_extendedData = other.m_extendedData;
102  m_region = other.m_region;
103  return *this;
104  }
105 
106  virtual GeoDataFeaturePrivate* copy()
107  {
108  GeoDataFeaturePrivate* copy = new GeoDataFeaturePrivate;
109  *copy = *this;
110  return copy;
111  }
112 
113  virtual EnumFeatureId featureId() const
114  {
115  return InvalidFeatureId;
116  }
117 
118  virtual ~GeoDataFeaturePrivate()
119  {
120  }
121 
122  virtual const char* nodeType() const
123  {
124  return GeoDataTypes::GeoDataFeatureType;
125  }
126 
127  static void initializeDefaultStyles();
128  static void initializeOsmVisualCategories();
129 
130  static GeoDataStyle* createOsmPOIStyle( const QFont &font, const QString &bitmap,
131  const QColor &color = QColor( 0xBE, 0xAD, 0xAD ),
132  const QColor &outline = QColor( 0xBE, 0xAD, 0xAD ).darker())
133  {
134  GeoDataStyle *style = createStyle(1, 0, color, outline, true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false);
135  QImage const pixmap = QImage( MarbleDirs::path( "bitmaps/poi/" + bitmap + ".png" ) );
136  style->setIconStyle( GeoDataIconStyle( pixmap ) );
137  style->setLabelStyle( GeoDataLabelStyle( font, Qt::black ) );
138  return style;
139  }
140 
141  static GeoDataStyle* createHighwayStyle( const QString &bitmap, const QColor& color, qreal width = 1, qreal realWidth = 0.0,
142  Qt::PenStyle penStyle = Qt::SolidLine,
143  Qt::PenCapStyle capStyle = Qt::RoundCap )
144  {
145  GeoDataStyle *style = createStyle( width, realWidth, color, color, true, true, Qt::SolidPattern, penStyle, capStyle, false );
146  if( !bitmap.isEmpty() ) {
147  QImage const pixmap = QImage( MarbleDirs::path( "bitmaps/" + bitmap + ".png" ) );
148  style->setIconStyle( GeoDataIconStyle( pixmap ) );
149  }
150  return style;
151  }
152 
153  static GeoDataStyle* createWayStyle( const QColor& color, const QColor& outlineColor,
154  bool fill = true, bool outline = true,
155  Qt::BrushStyle brushStyle = Qt::SolidPattern )
156  {
157  return createStyle( 1, 0, color, outlineColor, fill, outline, brushStyle, Qt::SolidLine, Qt::RoundCap, false );
158  }
159 
160  static GeoDataStyle* createStyle( qreal width, qreal realWidth, const QColor& color,
161  const QColor& outlineColor, bool fill, bool outline,
162  Qt::BrushStyle brushStyle, Qt::PenStyle penStyle,
163  Qt::PenCapStyle capStyle, bool lineBackground,
164  const QVector< qreal >& dashPattern = QVector< qreal >()
165  )
166  {
167  GeoDataStyle *style = new GeoDataStyle;
168  GeoDataLineStyle lineStyle( outlineColor );
169  lineStyle.setCapStyle( capStyle );
170  lineStyle.setPenStyle( penStyle );
171  lineStyle.setWidth( width );
172  lineStyle.setPhysicalWidth( realWidth );
173  lineStyle.setBackground( lineBackground );
174  lineStyle.setDashPattern( dashPattern );
175  GeoDataPolyStyle polyStyle( color );
176  polyStyle.setOutline( outline );
177  polyStyle.setFill( fill );
178  polyStyle.setBrushStyle( brushStyle );
179  style->setLineStyle( lineStyle );
180  style->setPolyStyle( polyStyle );
181  return style;
182  }
183 
184  QString m_name; // Name of the feature. Is shown on screen
185  GeoDataSnippet m_snippet; // Snippet of the feature.
186  QString m_description; // A longer textual description
187  bool m_descriptionCDATA; // True if description should be considered CDATA
188  QString m_address; // The address. Optional
189  QString m_phoneNumber; // Phone Optional
190  QString m_styleUrl; // styleUrl Url#tag to a document wide style
191  GeoDataAbstractView* m_abstractView; // AbstractView Optional
192  qint64 m_popularity; // Population/Area/Altitude depending on placemark(!)
193  int m_zoomLevel; // Zoom Level of the feature
194 
195  bool m_visible; // True if this feature should be shown.
196  GeoDataFeature::GeoDataVisualCategory m_visualCategory; // the visual category
197 
198 
199  QString m_role;
200 
201  const GeoDataStyle* m_style;
202  const GeoDataStyleMap* m_styleMap;
203 
204  GeoDataExtendedData m_extendedData;
205 
206  GeoDataTimeSpan m_timeSpan;
207  GeoDataTimeStamp m_timeStamp;
208 
209  GeoDataRegion m_region;
210 
211  QAtomicInt ref;
212 
213  // Static members
214  static QFont s_defaultFont;
215  static QColor s_defaultLabelColor;
216 
217  static GeoDataStyle* s_defaultStyle[GeoDataFeature::LastIndex];
218  static bool s_defaultStyleInitialized;
219 
220  static QMap<QString, GeoDataFeature::GeoDataVisualCategory> s_visualCategories;
221 };
222 
223 } // namespace Marble
224 
225 #endif
226 
Marble::GeoDataIconStyle
Definition: GeoDataIconStyle.h:29
Marble::GeoDataLineStyle
specifies the style how lines are drawn
Definition: GeoDataLineStyle.h:36
Marble::GeoDataFeature::LastIndex
Definition: GeoDataFeature.h:271
Marble::GeoDataFeaturePrivate::initializeDefaultStyles
static void initializeDefaultStyles()
Definition: GeoDataFeature.cpp:168
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:30
GeoDataAbstractView.h
Marble::GeoDataTimeStamp
Definition: GeoDataTimeStamp.h:27
Marble::GeoDataFeaturePrivate::s_defaultStyleInitialized
static bool s_defaultStyleInitialized
Definition: GeoDataFeature_p.h:218
Marble::MarbleDirs::path
static QString path(const QString &relativePath)
Definition: MarbleDirs.cpp:59
Marble::GeoDataLineStyle::setBackground
void setBackground(bool background)
Set whether to draw the solid background.
Definition: GeoDataLineStyle.cpp:140
Marble::GeoDataFeaturePrivate::GeoDataFeaturePrivate
GeoDataFeaturePrivate()
Definition: GeoDataFeature_p.h:34
Marble::GeoDataFeaturePrivate::m_name
QString m_name
Definition: GeoDataFeature_p.h:184
Marble::GeoDataFeaturePrivate::m_role
QString m_role
Definition: GeoDataFeature_p.h:199
QFont
Marble::GeoDataStyle::setIconStyle
void setIconStyle(const GeoDataIconStyle &style)
set the icon style
Definition: GeoDataStyle.cpp:101
GeoDataTimeStamp.h
QMap
GeoDataStyle.h
Marble::GeoDataFeaturePrivate::m_region
GeoDataRegion m_region
Definition: GeoDataFeature_p.h:209
Marble::GeoDataFeaturePrivate::m_timeSpan
GeoDataTimeSpan m_timeSpan
Definition: GeoDataFeature_p.h:206
Marble::GeoDataStyleMap
a class to map different styles to one style
Definition: GeoDataStyleMap.h:38
GeoDataExtendedData.h
Marble::GeoDataFeaturePrivate::m_style
const GeoDataStyle * m_style
Definition: GeoDataFeature_p.h:201
Marble::GeoDataFeaturePrivate::m_timeStamp
GeoDataTimeStamp m_timeStamp
Definition: GeoDataFeature_p.h:207
GeoDataTimeSpan.h
Marble::GeoDataExtendedData
a class which allows to add custom data to KML Feature.
Definition: GeoDataExtendedData.h:35
Marble::GeoDataFeaturePrivate::m_phoneNumber
QString m_phoneNumber
Definition: GeoDataFeature_p.h:189
Marble::GeoDataFeaturePrivate::m_styleUrl
QString m_styleUrl
Definition: GeoDataFeature_p.h:190
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::GeoDataLineStyle::setPhysicalWidth
void setPhysicalWidth(const float &realWidth)
Set the physical width of the line (in meters)
Definition: GeoDataLineStyle.cpp:110
GeoDataFeature.h
GeoDataRegion.h
Marble::GeoDataFeaturePrivate::GeoDataFeaturePrivate
GeoDataFeaturePrivate(const GeoDataFeaturePrivate &other)
Definition: GeoDataFeature_p.h:58
Marble::GeoDataFeaturePrivate
Definition: GeoDataFeature_p.h:31
Marble::GeoDataFeaturePrivate::m_description
QString m_description
Definition: GeoDataFeature_p.h:186
Marble::GeoDataFeaturePrivate::m_abstractView
GeoDataAbstractView * m_abstractView
Definition: GeoDataFeature_p.h:191
Marble::GeoDataFeaturePrivate::initializeOsmVisualCategories
static void initializeOsmVisualCategories()
Definition: GeoDataFeature.cpp:883
MarbleDirs.h
QString::isEmpty
bool isEmpty() const
Marble::GeoDataLineStyle::setWidth
void setWidth(const float &width)
Set the width of the line.
Definition: GeoDataLineStyle.cpp:95
Marble::GeoDataPolyStyle::setFill
void setFill(const bool &fill)
Set whether to fill the polygon.
Definition: GeoDataPolyStyle.cpp:90
Marble::GeoDataFeaturePrivate::s_defaultStyle
static GeoDataStyle * s_defaultStyle[GeoDataFeature::LastIndex]
Definition: GeoDataFeature_p.h:217
Marble::GeoDataFeaturePrivate::featureId
virtual EnumFeatureId featureId() const
Definition: GeoDataFeature_p.h:113
Marble::GeoDataFeaturePrivate::m_snippet
GeoDataSnippet m_snippet
Definition: GeoDataFeature_p.h:185
Marble::GeoDataFeaturePrivate::nodeType
virtual const char * nodeType() const
Definition: GeoDataFeature_p.h:122
Marble::GeoDataLineStyle::setPenStyle
void setPenStyle(Qt::PenStyle style)
Set pen cap style.
Definition: GeoDataLineStyle.cpp:130
Marble::GeoDataFeaturePrivate::s_defaultLabelColor
static QColor s_defaultLabelColor
Definition: GeoDataFeature_p.h:215
Marble::GeoDataLineStyle::setCapStyle
void setCapStyle(Qt::PenCapStyle style)
Set pen cap style.
Definition: GeoDataLineStyle.cpp:120
QAtomicInt
Marble::GeoDataFeaturePrivate::createOsmPOIStyle
static GeoDataStyle * createOsmPOIStyle(const QFont &font, const QString &bitmap, const QColor &color=QColor(0xBE, 0xAD, 0xAD), const QColor &outline=QColor(0xBE, 0xAD, 0xAD).darker())
Definition: GeoDataFeature_p.h:130
QString
QColor
Marble::GeoDataFeaturePrivate::m_extendedData
GeoDataExtendedData m_extendedData
Definition: GeoDataFeature_p.h:204
Marble::GeoDataFeaturePrivate::m_visualCategory
GeoDataFeature::GeoDataVisualCategory m_visualCategory
Definition: GeoDataFeature_p.h:196
Marble::GeoDataFeaturePrivate::createHighwayStyle
static GeoDataStyle * createHighwayStyle(const QString &bitmap, const QColor &color, qreal width=1, qreal realWidth=0.0, Qt::PenStyle penStyle=Qt::SolidLine, Qt::PenCapStyle capStyle=Qt::RoundCap)
Definition: GeoDataFeature_p.h:141
Marble::GeoDataFeaturePrivate::ref
QAtomicInt ref
Definition: GeoDataFeature_p.h:211
Marble::EnumFeatureId
EnumFeatureId
Definition: Serializable.h:30
QImage
Marble::GeoDataLabelStyle
specifies how the name of a GeoDataFeature is drawn
Definition: GeoDataLabelStyle.h:36
Marble::GeoDataTimeSpan
Definition: GeoDataTimeSpan.h:28
Marble::GeoDataStyle::setLineStyle
void setLineStyle(const GeoDataLineStyle &style)
set the line style
Definition: GeoDataStyle.cpp:107
Marble::GeoDataFeaturePrivate::s_visualCategories
static QMap< QString, GeoDataFeature::GeoDataVisualCategory > s_visualCategories
Definition: GeoDataFeature_p.h:220
Marble::GeoDataTypes::GeoDataFeatureType
const char * GeoDataFeatureType
Definition: GeoDataTypes.cpp:40
Marble::GeoDataFeaturePrivate::operator=
GeoDataFeaturePrivate & operator=(const GeoDataFeaturePrivate &other)
Definition: GeoDataFeature_p.h:82
QVector< qreal >
Marble::GeoDataFeaturePrivate::m_popularity
qint64 m_popularity
Definition: GeoDataFeature_p.h:192
Marble::GeoDataFeaturePrivate::m_styleMap
const GeoDataStyleMap * m_styleMap
Definition: GeoDataFeature_p.h:202
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:57
Marble::GeoDataFeaturePrivate::s_defaultFont
static QFont s_defaultFont
Definition: GeoDataFeature_p.h:214
Marble::GeoDataLineStyle::setDashPattern
void setDashPattern(const QVector< qreal > &pattern)
Sets the dash pattern.
Definition: GeoDataLineStyle.cpp:150
Marble::InvalidFeatureId
Definition: Serializable.h:31
Marble::GeoDataFeaturePrivate::m_visible
bool m_visible
Definition: GeoDataFeature_p.h:195
Marble::GeoDataFeaturePrivate::~GeoDataFeaturePrivate
virtual ~GeoDataFeaturePrivate()
Definition: GeoDataFeature_p.h:118
Marble::GeoDataRegion
GeoDataRegion describes the visibility and extent of a feature.
Definition: GeoDataRegion.h:49
GeoDataSnippet.h
Marble::GeoDataSnippet
Definition: GeoDataSnippet.h:20
Marble::GeoDataPolyStyle::setBrushStyle
void setBrushStyle(const Qt::BrushStyle style)
Set brush style.
Definition: GeoDataPolyStyle.cpp:110
Marble::GeoDataFeaturePrivate::m_descriptionCDATA
bool m_descriptionCDATA
Definition: GeoDataFeature_p.h:187
Marble::GeoDataFeature::GeoDataVisualCategory
GeoDataVisualCategory
A categorization of a placemark as defined by ...FIXME.
Definition: GeoDataFeature.h:77
Marble::GeoDataStyle::setLabelStyle
void setLabelStyle(const GeoDataLabelStyle &style)
set the label style
Definition: GeoDataStyle.cpp:112
GeoDataTypes.h
Marble::GeoDataPolyStyle::setOutline
void setOutline(const bool &outline)
Set whether to draw the outline.
Definition: GeoDataPolyStyle.cpp:100
Marble::GeoDataFeaturePrivate::createStyle
static GeoDataStyle * createStyle(qreal width, qreal realWidth, const QColor &color, const QColor &outlineColor, bool fill, bool outline, Qt::BrushStyle brushStyle, Qt::PenStyle penStyle, Qt::PenCapStyle capStyle, bool lineBackground, const QVector< qreal > &dashPattern=QVector< qreal >())
Definition: GeoDataFeature_p.h:160
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
Marble::GeoDataFeaturePrivate::copy
virtual GeoDataFeaturePrivate * copy()
Definition: GeoDataFeature_p.h:106
Marble::GeoDataFeaturePrivate::createWayStyle
static GeoDataStyle * createWayStyle(const QColor &color, const QColor &outlineColor, bool fill=true, bool outline=true, Qt::BrushStyle brushStyle=Qt::SolidPattern)
Definition: GeoDataFeature_p.h:153
Marble::GeoDataStyle::setPolyStyle
void setPolyStyle(const GeoDataPolyStyle &style)
set the poly style
Definition: GeoDataStyle.cpp:117
Marble::GeoDataFeaturePrivate::m_address
QString m_address
Definition: GeoDataFeature_p.h:188
Marble::GeoDataFeaturePrivate::m_zoomLevel
int m_zoomLevel
Definition: GeoDataFeature_p.h:193
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