Marble

GeoDataLineStyle.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_GEODATALINESTYLE_H
7#define MARBLE_GEODATALINESTYLE_H
8
9#include <QList>
10
11#include "GeoDataColorStyle.h"
12
13#include "geodata_export.h"
14
15namespace Marble
16{
17
18class GeoDataLineStylePrivate;
19
20/**
21 * @short specifies the style how lines are drawn
22 *
23 * A GeoDataLineStyle specifies how the <b>name</b> of a
24 * GeoDataFeature is drawn in the viewer. A custom color, color mode
25 * (both inherited from GeoDataColorStyle) and width for the width
26 * of the line.
27 */
28class GEODATA_EXPORT GeoDataLineStyle : public GeoDataColorStyle
29{
30public:
31 /// Construct a new GeoDataLineStyle
34 /**
35 * @brief Construct a new GeoDataLineStyle
36 * @param color the color to use when showing the name @see GeoDataColorStyle
37 */
38 explicit GeoDataLineStyle(const QColor &color);
39
40 ~GeoDataLineStyle() override;
41
42 /**
43 * @brief assignment operator
44 */
45 GeoDataLineStyle &operator=(const GeoDataLineStyle &other);
46
47 bool operator==(const GeoDataLineStyle &other) const;
48 bool operator!=(const GeoDataLineStyle &other) const;
49
50 /// Provides type information for downcasting a GeoData
51 const char *nodeType() const override;
52
53 /**
54 * @brief Set the width of the line
55 * @param width the new width
56 */
57 void setWidth(float width);
58 /**
59 * @brief Return the current width of the line
60 * @return the current width
61 */
62 float width() const;
63
64 /**
65 * @brief Set the physical width of the line (in meters)
66 * @param realWidth the new width
67 */
68 void setPhysicalWidth(float realWidth);
69 /**
70 * @brief Return the current physical width of the line
71 * @return the current width
72 */
73 float physicalWidth() const;
74
75 /**
76 * @brief Set whether the line has a cosmetic 1 pixel outline
77 */
78 void setCosmeticOutline(bool enabled);
79 /**
80 * @brief Return whether the line has a cosmetic 1 pixel outline
81 */
82 bool cosmeticOutline() const;
83
84 /**
85 * @brief Set pen cap style
86 * @param style cap style
87 */
88 void setCapStyle(Qt::PenCapStyle style);
89
90 /**
91 * @brief Return the current pen cap style
92 * @return the current pen cap style
93 */
94 Qt::PenCapStyle capStyle() const;
95
96 /**
97 * @brief Set pen cap style
98 * @param style cap style
99 */
100 void setPenStyle(Qt::PenStyle style);
101
102 /**
103 * @brief Return the current pen cap style
104 * @return the current pen cap style
105 */
106 Qt::PenStyle penStyle() const;
107
108 /**
109 * @brief Set whether to draw the solid background
110 * @param background @c true if the background should be solid
111 */
112 void setBackground(bool background);
113
114 /**
115 * @brief Return true if background get drawn
116 * @return
117 */
118 bool background() const;
119
120 /**
121 * @brief Sets the dash pattern
122 * @param pattern dash pattern
123 */
124 void setDashPattern(const QList<qreal> &pattern);
125
126 /**
127 * @brief Return the current dash pattern
128 * @return the current dash pattern
129 */
130 QList<qreal> dashPattern() const;
131
132 /**
133 * @brief Serialize the style to a stream.
134 * @param stream the stream
135 */
136 void pack(QDataStream &stream) const override;
137 /**
138 * @brief Unserialize the style from a stream
139 * @param stream the stream
140 */
141 void unpack(QDataStream &stream) override;
142
143private:
144 GeoDataLineStylePrivate *const d;
145};
146
147}
148
149#endif
an abstract base class for various style classes
specifies the style how lines are drawn
Binds a QML item to a specific geodetic location in screen coordinates.
PenCapStyle
PenStyle
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.