1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB.  All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTABSTRACTCOORDINATEPLANE_P_H
21 #define KCHARTABSTRACTCOORDINATEPLANE_P_H
22 
23 //
24 //  W A R N I N G
25 //  -------------
26 //
27 // This file is not part of the KD Chart API.  It exists purely as an
28 // implementation detail.  This header file may change from version to
29 // version without notice, or even be removed.
30 //
31 // We mean it.
32 //
33 
34 #include "KChartAbstractArea_p.h"
35 #include <KChartAbstractCoordinatePlane.h>
36 #include <KChartGridAttributes.h>
37 #include <KChartAbstractGrid.h>
38 #include <KChartZoomParameters.h>
39 #include "KChartMath_p.h"
40 
41 #include <QStack>
42 
43 QT_BEGIN_NAMESPACE
44 class QRubberBand;
45 QT_END_NAMESPACE
46 
47 namespace KChart {
48 
49 
50 /**
51  * \internal
52  */
53 class Q_DECL_HIDDEN AbstractCoordinatePlane::Private : public AbstractArea::Private
54 {
55     friend class AbstractCoordinatePlane;
56 protected:
57     explicit Private();
~Private()58     virtual ~Private() {
59         delete grid;
60     };
61 
initialize()62     virtual void initialize()
63     {
64         qDebug("ERROR: Calling AbstractCoordinatePlane::Private::initialize()");
65         // can not call the base class: grid = new AbstractGrid();
66     }
67 
isVisiblePoint(const AbstractCoordinatePlane * plane,const QPointF & point)68     virtual bool isVisiblePoint(
69         const AbstractCoordinatePlane * plane,
70         const QPointF& point ) const
71     {
72         Q_UNUSED( plane );
73         Q_UNUSED( point );
74         return true;
75     }
76 
77     KChart::Chart* parent;
78     AbstractGrid* grid;
79     QRect geometry;
80     AbstractDiagramList diagrams;
81     GridAttributes gridAttributes;
82     AbstractCoordinatePlane *referenceCoordinatePlane;
83 
84     bool enableCornerSpacers;
85 
86     bool enableRubberBandZooming;
87     QRubberBand* rubberBand;
88     QPoint rubberBandOrigin;
89 
90     QStack< ZoomParameters > rubberBandZoomConfigHistory;
91 };
92 
93 
AbstractCoordinatePlane(Private * p,KChart::Chart * parent)94 inline AbstractCoordinatePlane::AbstractCoordinatePlane( Private * p, KChart::Chart* parent )
95     : AbstractArea( p )
96 {
97     if ( p )
98         p->parent = parent;
99     init();
100 }
d_func()101 inline AbstractCoordinatePlane::Private * AbstractCoordinatePlane::d_func()
102 {
103     return static_cast<Private*>( AbstractArea::d_func() );
104 }
d_func()105 inline const AbstractCoordinatePlane::Private * AbstractCoordinatePlane::d_func() const
106 {
107     return static_cast<const Private*>( AbstractArea::d_func() );
108 }
109 
110 
111 }
112 
113 #endif /* KCHARTABSTRACTCOORDINATEPLANE_P_H*/
114