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