Marble

GeoDataPolyStyle.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
4 //
5 
6 
7 #ifndef MARBLE_GEODATAPOLYSTYLE_H
8 #define MARBLE_GEODATAPOLYSTYLE_H
9 
10 #include "GeoDataColorStyle.h"
11 
12 #include "geodata_export.h"
13 
14 namespace Marble
15 {
16 
17 class GeoDataPolyStylePrivate;
18 
19 /**
20  * @short specifies the style how polygons are drawn
21  *
22  * A GeoDataPolyStyle specifies how Polygons are drawn in the viewer.
23  * A custom color, color mode (both inherited from GeoDataColorStyle)
24  * and two boolean values whether to fill and whether to draw the outline.
25  */
26 class GEODATA_EXPORT GeoDataPolyStyle : public GeoDataColorStyle
27 {
28  public:
29  /// Construct a new GeoDataPolyStyle
31  GeoDataPolyStyle( const GeoDataPolyStyle& other );
32  /**
33  * @brief Construct a new GeoDataPolyStyle
34  * @param color the color to use when showing the name @see GeoDataColorStyle
35  */
36  explicit GeoDataPolyStyle( const QColor &color );
37 
38  ~GeoDataPolyStyle() override;
39 
40  /**
41  * @brief assignment operator
42  */
43  GeoDataPolyStyle& operator=( const GeoDataPolyStyle& other );
44 
45  bool operator==( const GeoDataPolyStyle &other ) const;
46  bool operator!=( const GeoDataPolyStyle &other ) const;
47 
48  /// Provides type information for downcasting a GeoNode
49  const char* nodeType() const override;
50 
51  /**
52  * @brief Set whether to fill the polygon
53  * @param fill
54  */
55  void setFill(bool fill);
56  /**
57  * @brief Return true if polygons get filled
58  * @return whether to fill
59  */
60  bool fill() const;
61 
62  /**
63  * @brief Set whether to draw the outline
64  * @param outline
65  */
66  void setOutline(bool outline);
67  /**
68  * @brief Return true if outlines of polygons get drawn
69  * @return whether outline is drawn
70  */
71  bool outline() const;
72 
73  /**
74  * @brief Set brush style
75  * @param style
76  */
77  void setBrushStyle( const Qt::BrushStyle style );
78  /**
79  * @brief Return brush style
80  * @return brush style.
81  */
82  Qt::BrushStyle brushStyle() const;
83 
84  /**
85  * @brief Set the color index which will be used to assign color to brush
86  * @param colorIndex The value of color index
87  */
88  void setColorIndex( quint8 colorIndex );
89 
90  /**
91  * @brief Return the value of color index
92  * @return Color index
93  */
94  quint8 colorIndex() const;
95 
96  void setTexturePath( const QString &path );
97 
98  QString texturePath() const;
99 
100  QImage textureImage() const;
101 
102  /**
103  * @brief Serialize the style to a stream.
104  * @param stream the stream
105  */
106  void pack( QDataStream& stream ) const override;
107  /**
108  * @brief Unserialize the style from a stream
109  * @param stream the stream
110  */
111  void unpack( QDataStream& stream ) override;
112 
113  private:
114  GeoDataPolyStylePrivate * const d;
115 };
116 
117 }
118 
119 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
an abstract base class for various style classes
specifies the style how polygons are drawn
BrushStyle
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 29 2023 03:52:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.