File indexing completed on 2024-12-15 04:02:33

0001 /*
0002  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #include "KChartThreeDBarAttributes.h"
0010 #include "KChartThreeDBarAttributes_p.h"
0011 
0012 #include "KChartMath_p.h"
0013 
0014 #include <QDebug>
0015 
0016 #define d d_func()
0017 
0018 using namespace KChart;
0019 
0020 ThreeDBarAttributes::Private::Private()
0021     : useShadowColors( true ),
0022       angle( 45 )
0023 {
0024 }
0025 
0026 
0027 ThreeDBarAttributes::ThreeDBarAttributes()
0028     : AbstractThreeDAttributes( new Private() )
0029 {
0030 
0031 }
0032 
0033 ThreeDBarAttributes::ThreeDBarAttributes( const ThreeDBarAttributes& r )
0034     : AbstractThreeDAttributes( new Private( *r.d) )
0035 {
0036 }
0037 
0038 ThreeDBarAttributes& ThreeDBarAttributes::operator= ( const ThreeDBarAttributes& r )
0039 {
0040     if ( this == &r )
0041         return *this;
0042 
0043     *d = *r.d;
0044 
0045     return *this;
0046 }
0047 
0048 ThreeDBarAttributes::~ThreeDBarAttributes()
0049 {
0050 }
0051 
0052 void ThreeDBarAttributes::init()
0053 {
0054 }
0055 
0056 
0057 bool ThreeDBarAttributes::operator==( const ThreeDBarAttributes& r ) const
0058 {
0059     return ( useShadowColors() == r.useShadowColors() &&
0060              angle() == r.angle() &&
0061              AbstractThreeDAttributes::operator==(r));
0062 }
0063 
0064 
0065 
0066 void ThreeDBarAttributes::setUseShadowColors( bool shadowColors )
0067 {
0068     d->useShadowColors = shadowColors;
0069 }
0070 
0071 bool ThreeDBarAttributes::useShadowColors() const
0072 {
0073     return d->useShadowColors;
0074 }
0075 
0076 void ThreeDBarAttributes::setAngle( uint threeDAngle )
0077 {
0078     d->angle = threeDAngle;
0079 }
0080 
0081 uint ThreeDBarAttributes::angle() const
0082 {
0083     return d->angle;
0084 }
0085 
0086 
0087 #if !defined(QT_NO_DEBUG_STREAM)
0088 QDebug operator<<(QDebug dbg, const KChart::ThreeDBarAttributes& a)
0089 {
0090     dbg << "KChart::ThreeDBarAttributes(";
0091     dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
0092     dbg << "useShadowColors="<< a.useShadowColors()
0093         << "angle=" << a.angle() << ")";
0094     return dbg;
0095 }
0096 #endif /* QT_NO_DEBUG_STREAM */
0097 
0098