KChart

KChartThreeDBarAttributes.cpp
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #include "KChartThreeDBarAttributes.h"
21 #include "KChartThreeDBarAttributes_p.h"
22 
23 #include "KChartMath_p.h"
24 
25 #include <QDebug>
26 
27 #define d d_func()
28 
29 using namespace KChart;
30 
31 ThreeDBarAttributes::Private::Private()
32  : useShadowColors( true ),
33  angle( 45 )
34 {
35 }
36 
37 
38 ThreeDBarAttributes::ThreeDBarAttributes()
39  : AbstractThreeDAttributes( new Private() )
40 {
41 
42 }
43 
44 ThreeDBarAttributes::ThreeDBarAttributes( const ThreeDBarAttributes& r )
45  : AbstractThreeDAttributes( new Private( *r.d) )
46 {
47 }
48 
49 ThreeDBarAttributes& ThreeDBarAttributes::operator= ( const ThreeDBarAttributes& r )
50 {
51  if ( this == &r )
52  return *this;
53 
54  *d = *r.d;
55 
56  return *this;
57 }
58 
59 ThreeDBarAttributes::~ThreeDBarAttributes()
60 {
61 }
62 
63 void ThreeDBarAttributes::init()
64 {
65 }
66 
67 
68 bool ThreeDBarAttributes::operator==( const ThreeDBarAttributes& r ) const
69 {
70  return ( useShadowColors() == r.useShadowColors() &&
71  angle() == r.angle() &&
72  AbstractThreeDAttributes::operator==(r));
73 }
74 
75 
76 
77 void ThreeDBarAttributes::setUseShadowColors( bool shadowColors )
78 {
79  d->useShadowColors = shadowColors;
80 }
81 
82 bool ThreeDBarAttributes::useShadowColors() const
83 {
84  return d->useShadowColors;
85 }
86 
87 void ThreeDBarAttributes::setAngle( uint threeDAngle )
88 {
89  d->angle = threeDAngle;
90 }
91 
92 uint ThreeDBarAttributes::angle() const
93 {
94  return d->angle;
95 }
96 
97 
98 #if !defined(QT_NO_DEBUG_STREAM)
100 {
101  dbg << "KChart::ThreeDBarAttributes(";
102  dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
103  dbg << "useShadowColors="<< a.useShadowColors()
104  << "angle=" << a.angle() << ")";
105  return dbg;
106 }
107 #endif /* QT_NO_DEBUG_STREAM */
108 
109 
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Global namespace.
A set of 3D bar attributes.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Sep 19 2020 22:36:26 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.