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
8#include "ViewParams.h"
9
10namespace Marble
11{
12
13class ViewParamsPrivate
14{
15public:
16 ViewParamsPrivate();
17 ~ViewParamsPrivate();
18
19 MapQuality m_stillQuality;
20 MapQuality m_animationQuality;
21
22 // The context that is active now.
23 ViewContext m_viewContext;
24
25 // The quality that we are painting right now.
26 MapQuality m_mapQuality;
27
28
29 // Parameters that determine the painting
30 // Show/don't show options
31
32 bool m_showAtmosphere;
33
34 bool m_showClouds;
35};
36
37ViewParamsPrivate::ViewParamsPrivate()
38 : m_stillQuality( HighQuality ),
39 m_animationQuality( LowQuality ),
40 m_viewContext( Still ),
41 m_mapQuality( m_stillQuality ),
42 // Show / don't show parameters
43 m_showAtmosphere( true ),
44 m_showClouds( false )
45{
46}
47
48ViewParamsPrivate::~ViewParamsPrivate()
49{
50}
51
52
53ViewParams::ViewParams()
54 : d( new ViewParamsPrivate )
55{
56}
57
58ViewParams::~ViewParams()
59{
60 delete d;
61}
62
63MapQuality ViewParams::mapQuality( ViewContext viewContext ) const
64{
65 if ( viewContext == Still )
66 return d->m_stillQuality;
67
68 Q_ASSERT( viewContext == Animation );
69 return d->m_animationQuality;
70}
71
72MapQuality ViewParams::mapQuality() const
73{
74 return d->m_mapQuality;
75}
76
77void ViewParams::setMapQualityForViewContext( MapQuality quality, ViewContext viewContext )
78{
79 if ( viewContext == Still ) {
80 d->m_stillQuality = quality;
81 }
82 else if ( viewContext == Animation ) {
83 d->m_animationQuality = quality;
84 }
85
86 if ( d->m_viewContext == viewContext ) {
87 d->m_mapQuality = quality;
88 }
89}
90
91ViewContext ViewParams::viewContext() const
92{
93 return d->m_viewContext;
94}
95
96void ViewParams::setViewContext( ViewContext viewContext )
97{
98 d->m_viewContext = viewContext;
99
100 if ( viewContext == Still )
101 d->m_mapQuality = d->m_stillQuality;
102 if ( viewContext == Animation )
103 d->m_mapQuality = d->m_animationQuality;
104}
105
106bool ViewParams::showAtmosphere() const
107{
108 return d->m_showAtmosphere;
109}
110
111void ViewParams::setShowAtmosphere( bool showAtmosphere )
112{
113 d->m_showAtmosphere = showAtmosphere;
114}
115
116bool ViewParams::showClouds() const
117{
118 return d->m_showClouds;
119}
120
121void ViewParams::setShowClouds( bool const showClouds )
122{
123 d->m_showClouds = showClouds;
124}
125
126}
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 Jun 14 2024 11:54:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.