Marble

ViewParams.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
4// SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <jensmh@gmx.de>
5//
6
7#include "ViewParams.h"
8
9namespace Marble
10{
11
12class ViewParamsPrivate
13{
14public:
15 ViewParamsPrivate();
16 ~ViewParamsPrivate();
17
18 MapQuality m_stillQuality;
19 MapQuality m_animationQuality;
20
21 // The context that is active now.
22 ViewContext m_viewContext;
23
24 // The quality that we are painting right now.
25 MapQuality m_mapQuality;
26
27 // Parameters that determine the painting
28 // Show/don't show options
29
30 bool m_showAtmosphere;
31
32 bool m_showClouds;
33};
34
35ViewParamsPrivate::ViewParamsPrivate()
36 : m_stillQuality(HighQuality)
37 , m_animationQuality(LowQuality)
38 , m_viewContext(Still)
39 , m_mapQuality(m_stillQuality)
40 ,
41 // Show / don't show parameters
42 m_showAtmosphere(true)
43 , m_showClouds(false)
44{
45}
46
47ViewParamsPrivate::~ViewParamsPrivate() = default;
48
49ViewParams::ViewParams()
50 : d(new ViewParamsPrivate)
51{
52}
53
54ViewParams::~ViewParams()
55{
56 delete d;
57}
58
59MapQuality ViewParams::mapQuality(ViewContext viewContext) const
60{
61 if (viewContext == Still)
62 return d->m_stillQuality;
63
64 Q_ASSERT(viewContext == Animation);
65 return d->m_animationQuality;
66}
67
68MapQuality ViewParams::mapQuality() const
69{
70 return d->m_mapQuality;
71}
72
73void ViewParams::setMapQualityForViewContext(MapQuality quality, ViewContext viewContext)
74{
75 if (viewContext == Still) {
76 d->m_stillQuality = quality;
77 } else if (viewContext == Animation) {
78 d->m_animationQuality = quality;
79 }
80
81 if (d->m_viewContext == viewContext) {
82 d->m_mapQuality = quality;
83 }
84}
85
86ViewContext ViewParams::viewContext() const
87{
88 return d->m_viewContext;
89}
90
91void ViewParams::setViewContext(ViewContext viewContext)
92{
93 d->m_viewContext = viewContext;
94
95 if (viewContext == Still)
96 d->m_mapQuality = d->m_stillQuality;
97 if (viewContext == Animation)
98 d->m_mapQuality = d->m_animationQuality;
99}
100
101bool ViewParams::showAtmosphere() const
102{
103 return d->m_showAtmosphere;
104}
105
106void ViewParams::setShowAtmosphere(bool showAtmosphere)
107{
108 d->m_showAtmosphere = showAtmosphere;
109}
110
111bool ViewParams::showClouds() const
112{
113 return d->m_showClouds;
114}
115
116void ViewParams::setShowClouds(bool const showClouds)
117{
118 d->m_showClouds = showClouds;
119}
120
121}
This file contains the headers for ViewParameters.
Binds a QML item to a specific geodetic location in screen coordinates.
@ Still
still image
@ HighQuality
High quality (e.g. antialiasing for lines)
@ LowQuality
Low resolution (e.g. interlaced)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.