Marble

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

KDE's Doxygen guidelines are available online.