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

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 #ifndef KCHARTABSTRACTCOORDINATEPLANE_P_H
0021 #define KCHARTABSTRACTCOORDINATEPLANE_P_H
0022 
0023 //
0024 //  W A R N I N G
0025 //  -------------
0026 //
0027 // This file is not part of the KD Chart API.  It exists purely as an
0028 // implementation detail.  This header file may change from version to
0029 // version without notice, or even be removed.
0030 //
0031 // We mean it.
0032 //
0033 
0034 #include "KChartAbstractArea_p.h"
0035 #include <KChartAbstractCoordinatePlane.h>
0036 #include <KChartGridAttributes.h>
0037 #include <KChartAbstractGrid.h>
0038 #include <KChartZoomParameters.h>
0039 #include "KChartMath_p.h"
0040 
0041 #include <QStack>
0042 
0043 QT_BEGIN_NAMESPACE
0044 class QRubberBand;
0045 QT_END_NAMESPACE
0046 
0047 namespace KChart {
0048 
0049 
0050 /**
0051  * \internal
0052  */
0053 class Q_DECL_HIDDEN AbstractCoordinatePlane::Private : public AbstractArea::Private
0054 {
0055     friend class AbstractCoordinatePlane;
0056 protected:
0057     explicit Private();
0058     virtual ~Private() {
0059         delete grid;
0060     };
0061 
0062     virtual void initialize()
0063     {
0064         qDebug("ERROR: Calling AbstractCoordinatePlane::Private::initialize()");
0065         // can not call the base class: grid = new AbstractGrid();
0066     }
0067 
0068     virtual bool isVisiblePoint(
0069         const AbstractCoordinatePlane * plane,
0070         const QPointF& point ) const
0071     {
0072         Q_UNUSED( plane );
0073         Q_UNUSED( point );
0074         return true;
0075     }
0076 
0077     KChart::Chart* parent;
0078     AbstractGrid* grid;
0079     QRect geometry;
0080     AbstractDiagramList diagrams;
0081     GridAttributes gridAttributes;
0082     AbstractCoordinatePlane *referenceCoordinatePlane;
0083 
0084     bool enableCornerSpacers;
0085 
0086     bool enableRubberBandZooming;
0087     QRubberBand* rubberBand;
0088     QPoint rubberBandOrigin;
0089 
0090     QStack< ZoomParameters > rubberBandZoomConfigHistory;
0091 };
0092 
0093 
0094 inline AbstractCoordinatePlane::AbstractCoordinatePlane( Private * p, KChart::Chart* parent )
0095     : AbstractArea( p )
0096 {
0097     if ( p )
0098         p->parent = parent;
0099     init();
0100 }
0101 inline AbstractCoordinatePlane::Private * AbstractCoordinatePlane::d_func()
0102 {
0103     return static_cast<Private*>( AbstractArea::d_func() );
0104 }
0105 inline const AbstractCoordinatePlane::Private * AbstractCoordinatePlane::d_func() const
0106 {
0107     return static_cast<const Private*>( AbstractArea::d_func() );
0108 }
0109 
0110 
0111 }
0112 
0113 #endif /* KCHARTABSTRACTCOORDINATEPLANE_P_H*/