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 Private()31ThreeDBarAttributes::Private::Private() 32 : useShadowColors( true ), 33 angle( 45 ) 34 { 35 } 36 37 ThreeDBarAttributes()38ThreeDBarAttributes::ThreeDBarAttributes() 39 : AbstractThreeDAttributes( new Private() ) 40 { 41 42 } 43 ThreeDBarAttributes(const ThreeDBarAttributes & r)44ThreeDBarAttributes::ThreeDBarAttributes( const ThreeDBarAttributes& r ) 45 : AbstractThreeDAttributes( new Private( *r.d) ) 46 { 47 } 48 operator =(const ThreeDBarAttributes & r)49ThreeDBarAttributes& ThreeDBarAttributes::operator= ( const ThreeDBarAttributes& r ) 50 { 51 if ( this == &r ) 52 return *this; 53 54 *d = *r.d; 55 56 return *this; 57 } 58 ~ThreeDBarAttributes()59ThreeDBarAttributes::~ThreeDBarAttributes() 60 { 61 } 62 init()63void ThreeDBarAttributes::init() 64 { 65 } 66 67 operator ==(const ThreeDBarAttributes & r) const68bool ThreeDBarAttributes::operator==( const ThreeDBarAttributes& r ) const 69 { 70 return ( useShadowColors() == r.useShadowColors() && 71 angle() == r.angle() && 72 AbstractThreeDAttributes::operator==(r)); 73 } 74 75 76 setUseShadowColors(bool shadowColors)77void ThreeDBarAttributes::setUseShadowColors( bool shadowColors ) 78 { 79 d->useShadowColors = shadowColors; 80 } 81 useShadowColors() const82bool ThreeDBarAttributes::useShadowColors() const 83 { 84 return d->useShadowColors; 85 } 86 setAngle(uint threeDAngle)87void ThreeDBarAttributes::setAngle( uint threeDAngle ) 88 { 89 d->angle = threeDAngle; 90 } 91 angle() const92uint ThreeDBarAttributes::angle() const 93 { 94 return d->angle; 95 } 96 97 98 #if !defined(QT_NO_DEBUG_STREAM) operator <<(QDebug dbg,const KChart::ThreeDBarAttributes & a)99QDebug operator<<(QDebug dbg, const KChart::ThreeDBarAttributes& a) 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 110