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

KDE's Doxygen guidelines are available online.