• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
ViewParams.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2007 Inge Wallin <ingwa@kde.org>
9 // Copyright 2008 Jens-Michael Hoffmann <jensmh@gmx.de>
10 //
11 
12 
13 #include "ViewParams.h"
14 
15 namespace Marble
16 {
17 
18 class ViewParamsPrivate
19 {
20 public:
21  ViewParamsPrivate();
22  ~ViewParamsPrivate();
23 
24  MapQuality m_stillQuality;
25  MapQuality m_animationQuality;
26 
27  // The context that is active now.
28  ViewContext m_viewContext;
29 
30  // The quality that we are painting right now.
31  MapQuality m_mapQuality;
32 
33 
34  // Parameters that determine the painting
35  // Show/don't show options
36 
37  bool m_showAtmosphere;
38 
39  bool m_showClouds;
40 };
41 
42 ViewParamsPrivate::ViewParamsPrivate()
43  : m_stillQuality( HighQuality ),
44  m_animationQuality( LowQuality ),
45  m_viewContext( Still ),
46  m_mapQuality( m_stillQuality ),
47  // Show / don't show parameters
48  m_showAtmosphere( true ),
49  m_showClouds( false )
50 {
51 }
52 
53 ViewParamsPrivate::~ViewParamsPrivate()
54 {
55 }
56 
57 
58 ViewParams::ViewParams()
59  : d( new ViewParamsPrivate )
60 {
61 }
62 
63 ViewParams::~ViewParams()
64 {
65  delete d;
66 }
67 
68 MapQuality ViewParams::mapQuality( ViewContext viewContext ) const
69 {
70  if ( viewContext == Still )
71  return d->m_stillQuality;
72 
73  Q_ASSERT( viewContext == Animation );
74  return d->m_animationQuality;
75 }
76 
77 MapQuality ViewParams::mapQuality() const
78 {
79  return d->m_mapQuality;
80 }
81 
82 void ViewParams::setMapQualityForViewContext( MapQuality quality, ViewContext viewContext )
83 {
84  if ( viewContext == Still ) {
85  d->m_stillQuality = quality;
86  }
87  else if ( viewContext == Animation ) {
88  d->m_animationQuality = quality;
89  }
90 
91  if ( d->m_viewContext == viewContext ) {
92  d->m_mapQuality = quality;
93  }
94 }
95 
96 ViewContext ViewParams::viewContext() const
97 {
98  return d->m_viewContext;
99 }
100 
101 void ViewParams::setViewContext( ViewContext viewContext )
102 {
103  d->m_viewContext = viewContext;
104 
105  if ( viewContext == Still )
106  d->m_mapQuality = d->m_stillQuality;
107  if ( viewContext == Animation )
108  d->m_mapQuality = d->m_animationQuality;
109 }
110 
111 bool ViewParams::showAtmosphere() const
112 {
113  return d->m_showAtmosphere;
114 }
115 
116 void ViewParams::setShowAtmosphere( bool showAtmosphere )
117 {
118  d->m_showAtmosphere = showAtmosphere;
119 }
120 
121 bool ViewParams::showClouds() const
122 {
123  return d->m_showClouds;
124 }
125 
126 void ViewParams::setShowClouds( bool const showClouds )
127 {
128  d->m_showClouds = showClouds;
129 }
130 
131 }
Marble::ViewContext
ViewContext
This enum is used to choose context in which map quality gets used.
Definition: MarbleGlobal.h:74
Marble::ViewParams::~ViewParams
~ViewParams()
Definition: ViewParams.cpp:63
Marble::MapQuality
MapQuality
This enum is used to choose the map quality shown in the view.
Definition: MarbleGlobal.h:82
Marble::ViewParams::setViewContext
void setViewContext(ViewContext viewContext)
Definition: ViewParams.cpp:101
Marble::LowQuality
Low resolution (e.g. interlaced)
Definition: MarbleGlobal.h:84
ViewParams.h
This file contains the headers for ViewParameters.
Marble::Animation
animated view (e.g. while rotating the globe)
Definition: MarbleGlobal.h:76
Marble::ViewParams::viewContext
ViewContext viewContext() const
Definition: ViewParams.cpp:96
Marble::Still
still image
Definition: MarbleGlobal.h:75
Marble::ViewParams::showAtmosphere
bool showAtmosphere() const
Definition: ViewParams.cpp:111
Marble::ViewParams::setShowClouds
void setShowClouds(bool const )
Definition: ViewParams.cpp:126
Marble::ViewParams::setShowAtmosphere
void setShowAtmosphere(bool)
Definition: ViewParams.cpp:116
Marble::ViewParams::setMapQualityForViewContext
void setMapQualityForViewContext(MapQuality quality, ViewContext viewContext)
Definition: ViewParams.cpp:82
Marble::ViewParams::mapQuality
MapQuality mapQuality() const
Definition: ViewParams.cpp:77
Marble::HighQuality
High quality (e.g. antialiasing for lines)
Definition: MarbleGlobal.h:86
Marble::ViewParams::showClouds
bool showClouds() const
Definition: ViewParams.cpp:121
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal