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