KChart

KChartPaintContext.cpp
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 #include "KChartPaintContext.h"
21 #include "KChartAbstractCoordinatePlane.h"
22 
23 #include "KChartMath_p.h"
24 
25 #include <QRectF>
26 #include <QPainter>
27 
28 using namespace KChart;
29 
30 #define d (d_func())
31 
32 class Q_DECL_HIDDEN PaintContext::Private {
33 
34 public:
35  QPainter* painter;
36  QRectF rect;
38 
39  Private()
40  : painter( nullptr )
41  , plane ( nullptr )
42  {}
43 };
44 
45 PaintContext::PaintContext()
46  : _d ( new Private() )
47 {
48 }
49 
50 PaintContext::~PaintContext()
51 {
52  delete _d;
53 }
54 
55 const QRectF PaintContext::rectangle() const
56 {
57  return d->rect;
58 }
59 
60 void PaintContext::setRectangle ( const QRectF& rect )
61 {
62  d->rect = rect;
63 }
64 
65 QPainter* PaintContext::painter() const
66 {
67  return d->painter;
68 }
69 
70 void PaintContext::setPainter( QPainter* painter )
71 {
72  d->painter = painter;
73 }
74 
75 AbstractCoordinatePlane* PaintContext::coordinatePlane() const
76 {
77  return d->plane;
78 }
79 
80 void PaintContext::setCoordinatePlane( AbstractCoordinatePlane* plane)
81 {
82  d->plane = plane;
83 }
Stores information about painting diagrams.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 22:39:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.