Marble

ViewParams.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2007 Inge Wallin <[email protected]>
4 // SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <[email protected]>
5 //
6 
7 
8 #include "ViewParams.h"
9 
10 namespace Marble
11 {
12 
13 class ViewParamsPrivate
14 {
15 public:
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 
37 ViewParamsPrivate::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 
48 ViewParamsPrivate::~ViewParamsPrivate()
49 {
50 }
51 
52 
53 ViewParams::ViewParams()
54  : d( new ViewParamsPrivate )
55 {
56 }
57 
58 ViewParams::~ViewParams()
59 {
60  delete d;
61 }
62 
63 MapQuality 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 
72 MapQuality ViewParams::mapQuality() const
73 {
74  return d->m_mapQuality;
75 }
76 
77 void 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 
91 ViewContext ViewParams::viewContext() const
92 {
93  return d->m_viewContext;
94 }
95 
96 void 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 
106 bool ViewParams::showAtmosphere() const
107 {
108  return d->m_showAtmosphere;
109 }
110 
111 void ViewParams::setShowAtmosphere( bool showAtmosphere )
112 {
113  d->m_showAtmosphere = showAtmosphere;
114 }
115 
116 bool ViewParams::showClouds() const
117 {
118  return d->m_showClouds;
119 }
120 
121 void ViewParams::setShowClouds( bool const showClouds )
122 {
123  d->m_showClouds = showClouds;
124 }
125 
126 }
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:66
@ LowQuality
Low resolution (e.g. interlaced)
Definition: MarbleGlobal.h:76
@ Animation
animated view (e.g. while rotating the globe)
Definition: MarbleGlobal.h:68
@ Still
still image
Definition: MarbleGlobal.h:67
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:74
Binds a QML item to a specific geodetic location in screen coordinates.
@ HighQuality
High quality (e.g. antialiasing for lines)
Definition: MarbleGlobal.h:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.