00001 /**************************************************************************** 00002 ** Copyright (C) 2001-2010 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 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 "KDChartLeveyJenningsCoordinatePlane.h" 00024 #include "KDChartLeveyJenningsCoordinatePlane_p.h" 00025 00026 #include <QtDebug> 00027 #include <QPainter> 00028 00029 #include "KDChartPaintContext.h" 00030 #include "KDChartPainterSaver_p.h" 00031 #include "KDChartCartesianAxis.h" 00032 #include "KDChartLeveyJenningsDiagram.h" 00033 00034 using namespace KDChart; 00035 00036 #define d d_func() 00037 00038 LeveyJenningsCoordinatePlane::Private::Private() 00039 : CartesianCoordinatePlane::Private() 00040 { 00041 } 00042 00043 LeveyJenningsCoordinatePlane::LeveyJenningsCoordinatePlane( Chart* parent ) 00044 : CartesianCoordinatePlane( new Private(), parent ) 00045 { 00046 } 00047 00048 LeveyJenningsCoordinatePlane::~LeveyJenningsCoordinatePlane() 00049 { 00050 } 00051 00052 void LeveyJenningsCoordinatePlane::init() 00053 { 00054 } 00055 00056 void LeveyJenningsCoordinatePlane::addDiagram( AbstractDiagram* diagram ) 00057 { 00058 Q_ASSERT_X ( dynamic_cast<LeveyJenningsDiagram*>( diagram ), 00059 "LeveyJenningsCoordinatePlane::addDiagram", "Only Levey Jennings " 00060 "diagrams can be added to a ternary coordinate plane!" ); 00061 CartesianCoordinatePlane::addDiagram ( diagram ); 00062 } 00063 00064 LeveyJenningsGrid* LeveyJenningsCoordinatePlane::grid() const 00065 { 00066 LeveyJenningsGrid* leveyJenningsGrid = static_cast<LeveyJenningsGrid*>( d->grid ); 00067 Q_ASSERT( dynamic_cast<LeveyJenningsGrid*>( d->grid ) ); 00068 return leveyJenningsGrid; 00069 } 00070 00071 LeveyJenningsGridAttributes LeveyJenningsCoordinatePlane::gridAttributes() const 00072 { 00073 return d->gridAttributes; 00074 } 00075 00076 void LeveyJenningsCoordinatePlane::setGridAttributes( const LeveyJenningsGridAttributes& attr ) 00077 { 00078 d->gridAttributes = attr; 00079 } 00080 00081 const QPointF LeveyJenningsCoordinatePlane::translateBack( const QPointF& screenPoint ) const 00082 { 00083 return CartesianCoordinatePlane::translateBack( screenPoint ); 00084 } 00085 00086 #undef d