• 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
VectorComposer.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 2005-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 
13 //
14 // The VectorComposer maps the data stored as polylines onto the
15 // respective projection.
16 //
17 // Author: Torsten Rahn
18 //
19 
20 #ifndef MARBLE_VECTORCOMPOSER_H
21 #define MARBLE_VECTORCOMPOSER_H
22 
23 
24 #include <QObject>
25 #include <QVector>
26 #include <QBrush>
27 #include <QPen>
28 
29 class QColor;
30 
31 namespace Marble
32 {
33 
34 class GeoPainter;
35 class PntMap;
36 class VectorMap;
37 class ViewportParams;
38 
39 
40 class VectorComposer : public QObject
41 {
42  Q_OBJECT
43  public:
44  explicit VectorComposer( QObject * parent = 0 );
45  virtual ~VectorComposer();
46 
47  void drawTextureMap( GeoPainter *painter, const ViewportParams *viewport );
48  void paintBaseVectorMap( GeoPainter *, const ViewportParams * );
49  void paintVectorMap( GeoPainter *, const ViewportParams * );
50 
51  void setShowWaterBodies( bool show );
52  void setShowLakes( bool show );
53  void setShowIce( bool show );
54  void setShowCoastLines( bool show );
55  void setShowRivers( bool show );
56  void setShowBorders( bool show );
57 
62  void setOceanColor( const QColor& color ){
63  m_oceanBrush = QBrush( color );
64  m_oceanPen = QPen( Qt::NoPen );
65  }
66 
71  void setLandColor( const QColor& color ){
72  m_landBrush = QBrush( color );
73  }
74 
79  void setCoastColor( const QColor& color ){
80  m_landPen = QPen( color );
81  }
82 
87  void setLakeColor( const QColor& color ){
88  m_lakeBrush = QBrush( color );
89  m_lakePen = QPen( Qt::NoPen );
90  }
91 
96  void setRiverColor( const QColor& color ){
97  m_riverBrush = QBrush( Qt::NoBrush );
98  m_riverPen = QPen( color );
99  }
100 
105  void setCountryBorderColor( const QColor& color ){
106  m_countryBrush = QBrush( Qt::NoBrush );
107  m_countryPen = QPen( color );
108  }
109 
114  void setStateBorderColor( const QColor& color ){
115  m_stateBrush = QBrush( Qt::NoBrush );
116  m_statePen = QPen( color );
117  m_statePen.setStyle( Qt::DotLine );
118  }
119 
120  Q_SIGNALS:
121  void datasetLoaded();
122 
123  private:
124  // This method contains all the polygons that define the coast lines.
125  static inline void loadCoastlines();
126 
127  // This method contains all the other polygons
128  static inline void loadOverlays();
129 
130  private:
131  Q_DISABLE_COPY( VectorComposer )
132  VectorMap *m_vectorMap;
133 
134  bool m_showWaterBodies;
135  bool m_showLakes;
136  bool m_showIce;
137  bool m_showCoastLines;
138  bool m_showRivers;
139  bool m_showBorders;
140 
141  static QAtomicInt refCounter;
142 
143  static PntMap *s_coastLines;
144 
145  static PntMap *s_islands;
146  static PntMap *s_lakeislands;
147  static PntMap *s_lakes;
148  static PntMap *s_glaciers;
149  static PntMap *s_rivers;
150 
151  static PntMap *s_countries; // The country borders
152  static PntMap *s_usaStates; // The states of the USA
153 
154  static PntMap *s_dateLine;
155 
156  QPen m_oceanPen;
157  QBrush m_oceanBrush;
158 
159  QPen m_landPen;
160  QBrush m_landBrush;
161 
162  QPen m_lakePen;
163  QBrush m_lakeBrush;
164 
165  QPen m_countryPen;
166  QBrush m_countryBrush;
167 
168  QPen m_statePen;
169  QBrush m_stateBrush;
170 
171  QPen m_riverPen;
172  QBrush m_riverBrush;
173 
174  QPen m_textureLandPen;
175  QBrush m_textureLandBrush;
176  QPen m_textureBorderPen;
177  QBrush m_textureGlacierBrush;
178  QBrush m_textureLakeBrush;
179 
180  QPen m_dateLinePen;
181  QBrush m_dateLineBrush;
182 
183  QVector<qreal> m_dashes;
184 
185  static bool s_coastLinesLoaded;
186  static bool s_overlaysLoaded;
187 };
188 
189 }
190 
191 #endif
Marble::VectorComposer::setCountryBorderColor
void setCountryBorderColor(const QColor &color)
Set color of the country borders.
Definition: VectorComposer.h:105
Marble::VectorComposer::setShowLakes
void setShowLakes(bool show)
Definition: VectorComposer.cpp:162
Marble::VectorComposer::~VectorComposer
virtual ~VectorComposer()
Definition: VectorComposer.cpp:91
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
QObject
Marble::VectorComposer::drawTextureMap
void drawTextureMap(GeoPainter *painter, const ViewportParams *viewport)
Definition: VectorComposer.cpp:187
Marble::VectorComposer::setLandColor
void setLandColor(const QColor &color)
Set color of the land.
Definition: VectorComposer.h:71
Marble::PntMap
Definition: GeoPolygon.h:95
Marble::VectorComposer
Definition: VectorComposer.h:40
Marble::VectorComposer::setShowBorders
void setShowBorders(bool show)
Definition: VectorComposer.cpp:182
Marble::VectorComposer::paintBaseVectorMap
void paintBaseVectorMap(GeoPainter *, const ViewportParams *)
Definition: VectorComposer.cpp:240
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
Marble::VectorComposer::setShowWaterBodies
void setShowWaterBodies(bool show)
Definition: VectorComposer.cpp:157
Marble::VectorComposer::VectorComposer
VectorComposer(QObject *parent=0)
Definition: VectorComposer.cpp:42
Marble::VectorComposer::datasetLoaded
void datasetLoaded()
Marble::VectorComposer::setShowCoastLines
void setShowCoastLines(bool show)
Definition: VectorComposer.cpp:172
Marble::VectorComposer::setRiverColor
void setRiverColor(const QColor &color)
Set color of the rivers.
Definition: VectorComposer.h:96
Marble::VectorComposer::setShowIce
void setShowIce(bool show)
Definition: VectorComposer.cpp:167
Marble::VectorMap
Definition: VectorMap.h:34
Marble::VectorComposer::setLakeColor
void setLakeColor(const QColor &color)
Set color of the lakes.
Definition: VectorComposer.h:87
Marble::VectorComposer::setCoastColor
void setCoastColor(const QColor &color)
Set color of the land.
Definition: VectorComposer.h:79
Marble::VectorComposer::setShowRivers
void setShowRivers(bool show)
Definition: VectorComposer.cpp:177
Marble::VectorComposer::paintVectorMap
void paintVectorMap(GeoPainter *, const ViewportParams *)
Definition: VectorComposer.cpp:306
Marble::VectorComposer::setStateBorderColor
void setStateBorderColor(const QColor &color)
Set color of the state borders.
Definition: VectorComposer.h:114
Marble::VectorComposer::setOceanColor
void setOceanColor(const QColor &color)
Set color of the oceans.
Definition: VectorComposer.h:62
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