File indexing completed on 2024-05-12 15:54:20

0001 /*
0002  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB.  All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * This program is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU General Public License as
0008  * published by the Free Software Foundation; either version 2 of
0009  * the License, or (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
0018  */
0019 
0020 #include "KChartThreeDLineAttributes.h"
0021 #include "KChartThreeDLineAttributes_p.h"
0022 
0023 #include "KChartMath_p.h"
0024 
0025 #include <QDebug>
0026 
0027 #define d d_func()
0028 
0029 using namespace KChart;
0030 
0031 ThreeDLineAttributes::Private::Private()
0032     : lineXRotation( 15 ),
0033       lineYRotation( 15 )
0034 {
0035 }
0036 
0037 
0038 ThreeDLineAttributes::ThreeDLineAttributes()
0039     : AbstractThreeDAttributes( new Private() )
0040 {
0041 
0042 }
0043 
0044 ThreeDLineAttributes::ThreeDLineAttributes( const ThreeDLineAttributes& r )
0045     : AbstractThreeDAttributes( new Private( *r.d) )
0046 {
0047 }
0048 
0049 ThreeDLineAttributes& ThreeDLineAttributes::operator= ( const ThreeDLineAttributes& r )
0050 {
0051     if ( this == &r )
0052         return *this;
0053 
0054     *d = *r.d;
0055 
0056     return *this;
0057 }
0058 
0059 ThreeDLineAttributes::~ThreeDLineAttributes()
0060 {
0061 }
0062 
0063 void ThreeDLineAttributes::init()
0064 {
0065 }
0066 
0067 
0068 bool ThreeDLineAttributes::operator==( const ThreeDLineAttributes& r ) const
0069 {
0070     return ( lineXRotation() == r.lineXRotation() &&
0071              lineYRotation() == r.lineYRotation() &&
0072              AbstractThreeDAttributes::operator==(r));
0073 }
0074 
0075 
0076 
0077 void ThreeDLineAttributes::setLineXRotation( const uint degrees )
0078 {
0079     d->lineXRotation = degrees;
0080 }
0081 
0082 uint ThreeDLineAttributes::lineXRotation() const
0083 {
0084     return d->lineXRotation;
0085 }
0086 
0087 void ThreeDLineAttributes::setLineYRotation( const uint degrees )
0088 {
0089     d->lineYRotation = degrees;
0090 }
0091 
0092 uint ThreeDLineAttributes::lineYRotation() const
0093 {
0094     return d->lineYRotation;
0095 }
0096 
0097 
0098 #if !defined(QT_NO_DEBUG_STREAM)
0099 
0100 QDebug operator<<(QDebug dbg, const KChart::ThreeDLineAttributes& a)
0101 {
0102     dbg << "KChart::ThreeDLineAttributes(";
0103     dbg = operator <<( dbg, static_cast<const AbstractThreeDAttributes&>(a) );
0104     dbg << " lineXRotation="<< a.lineXRotation()
0105         << " lineYRotation="<< a.lineYRotation()
0106         << ")";
0107     return dbg;
0108 }
0109 #endif /* QT_NO_DEBUG_STREAM */
0110