00001 /**************************************************************************** 00002 ** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Chart library. 00005 ** 00006 ** Licensees holding valid commercial KD Chart licenses may use this file in 00007 ** accordance with the KD Chart Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 00023 #include "KDChartAbstractThreeDAttributes.h" 00024 #include "KDChartAbstractThreeDAttributes_p.h" 00025 00026 #include <QDebug> 00027 00028 #include <KDABLibFakes> 00029 00030 #define d d_func() 00031 00032 00033 using namespace KDChart; 00034 00035 00036 AbstractThreeDAttributes::Private::Private() 00037 : enabled( false ), 00038 depth( 20 ) 00039 { 00040 } 00041 00042 00043 AbstractThreeDAttributes::AbstractThreeDAttributes() 00044 : _d( new Private() ) 00045 { 00046 } 00047 00048 AbstractThreeDAttributes::AbstractThreeDAttributes( const AbstractThreeDAttributes& r ) 00049 : _d( new Private( *r.d ) ) 00050 { 00051 } 00052 00053 AbstractThreeDAttributes& AbstractThreeDAttributes::operator= ( const AbstractThreeDAttributes& r ) 00054 { 00055 if( this == &r ) 00056 return *this; 00057 00058 *d = *r.d; 00059 00060 return *this; 00061 } 00062 00063 AbstractThreeDAttributes::~AbstractThreeDAttributes() 00064 { 00065 delete _d; _d = 0; 00066 } 00067 00068 00069 bool AbstractThreeDAttributes::operator==( const AbstractThreeDAttributes& r ) const 00070 { 00071 if( isEnabled() == r.isEnabled() && 00072 depth() == r.depth() ) 00073 return true; 00074 else 00075 return false; 00076 } 00077 00078 00079 void AbstractThreeDAttributes::init( ) 00080 { 00081 00082 } 00083 00084 void AbstractThreeDAttributes::setEnabled( bool enabled ) 00085 { 00086 d->enabled = enabled; 00087 } 00088 00089 bool AbstractThreeDAttributes::isEnabled() const 00090 { 00091 return d->enabled; 00092 } 00093 00094 void AbstractThreeDAttributes::setDepth( double depth ) 00095 { 00096 d->depth = depth; 00097 } 00098 00099 00100 double AbstractThreeDAttributes::depth() const 00101 { 00102 return d->depth; 00103 } 00104 00105 00106 double AbstractThreeDAttributes::validDepth() const 00107 { 00108 return isEnabled() ? d->depth : 0.0; 00109 } 00110 00111 00112 #if !defined(QT_NO_DEBUG_STREAM) 00113 QDebug operator<<(QDebug dbg, const KDChart::AbstractThreeDAttributes& a) 00114 { 00115 dbg << "enabled="<<a.isEnabled() 00116 << "depth="<<a.depth(); 00117 return dbg; 00118 } 00119 #endif /* QT_NO_DEBUG_STREAM */