KChart

KChartLeveyJenningsCoordinatePlane.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 "KChartLeveyJenningsCoordinatePlane.h"
21 #include "KChartLeveyJenningsCoordinatePlane_p.h"
22 
23 #include <QtDebug>
24 #include <QPainter>
25 
26 #include "KChartPaintContext.h"
27 #include "KChartPainterSaver_p.h"
28 #include "KChartCartesianAxis.h"
29 #include "KChartLeveyJenningsDiagram.h"
30 
31 using namespace KChart;
32 
33 #define d d_func()
34 
35 LeveyJenningsCoordinatePlane::Private::Private()
36  : CartesianCoordinatePlane::Private()
37 {
38 }
39 
40 LeveyJenningsCoordinatePlane::LeveyJenningsCoordinatePlane( Chart* parent )
41  : CartesianCoordinatePlane( new Private(), parent )
42 {
43 }
44 
45 LeveyJenningsCoordinatePlane::~LeveyJenningsCoordinatePlane()
46 {
47 }
48 
49 void LeveyJenningsCoordinatePlane::init()
50 {
51 }
52 
54 {
55  Q_ASSERT_X ( dynamic_cast<LeveyJenningsDiagram*>( diagram ),
56  "LeveyJenningsCoordinatePlane::addDiagram", "Only Levey Jennings "
57  "diagrams can be added to a ternary coordinate plane!" );
59 }
60 
61 LeveyJenningsGrid* LeveyJenningsCoordinatePlane::grid() const
62 {
63  LeveyJenningsGrid* leveyJenningsGrid = static_cast<LeveyJenningsGrid*>( d->grid );
64  Q_ASSERT( dynamic_cast<LeveyJenningsGrid*>( d->grid ) );
65  return leveyJenningsGrid;
66 }
67 
68 LeveyJenningsGridAttributes LeveyJenningsCoordinatePlane::gridAttributes() const
69 {
70  return d->gridAttributes;
71 }
72 
73 void LeveyJenningsCoordinatePlane::setGridAttributes( const LeveyJenningsGridAttributes& attr )
74 {
75  d->gridAttributes = attr;
76 }
77 
78 const QPointF LeveyJenningsCoordinatePlane::translateBack( const QPointF& screenPoint ) const
79 {
80  return CartesianCoordinatePlane::translateBack( screenPoint );
81 }
82 
83 #undef d
AbstractDiagram defines the interface for diagram classes.
void addDiagram(AbstractDiagram *diagram) override
Adds a diagram to this coordinate plane.
Class for the grid in a Levey Jennings plane.
A set of attributes controlling the appearance of grids.
void addDiagram(AbstractDiagram *diagram) override
Adds a diagram to this coordinate plane.
A chart with one or more diagrams.
Definition: KChartChart.h:95
Global namespace.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:36:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.