KChart

KChartLeveyJenningsCoordinatePlane.cpp
1 /*
2  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #include "KChartLeveyJenningsCoordinatePlane.h"
10 #include "KChartLeveyJenningsCoordinatePlane_p.h"
11 
12 #include <QtDebug>
13 #include <QPainter>
14 
15 #include "KChartPaintContext.h"
16 #include "KChartPainterSaver_p.h"
17 #include "KChartCartesianAxis.h"
18 #include "KChartLeveyJenningsDiagram.h"
19 
20 using namespace KChart;
21 
22 #define d d_func()
23 
24 LeveyJenningsCoordinatePlane::Private::Private()
25  : CartesianCoordinatePlane::Private()
26 {
27 }
28 
29 LeveyJenningsCoordinatePlane::LeveyJenningsCoordinatePlane( Chart* parent )
30  : CartesianCoordinatePlane( new Private(), parent )
31 {
32 }
33 
34 LeveyJenningsCoordinatePlane::~LeveyJenningsCoordinatePlane()
35 {
36 }
37 
38 void LeveyJenningsCoordinatePlane::init()
39 {
40 }
41 
43 {
44  Q_ASSERT_X ( dynamic_cast<LeveyJenningsDiagram*>( diagram ),
45  "LeveyJenningsCoordinatePlane::addDiagram", "Only Levey Jennings "
46  "diagrams can be added to a ternary coordinate plane!" );
48 }
49 
50 LeveyJenningsGrid* LeveyJenningsCoordinatePlane::grid() const
51 {
52  LeveyJenningsGrid* leveyJenningsGrid = static_cast<LeveyJenningsGrid*>( d->grid );
53  Q_ASSERT( dynamic_cast<LeveyJenningsGrid*>( d->grid ) );
54  return leveyJenningsGrid;
55 }
56 
57 LeveyJenningsGridAttributes LeveyJenningsCoordinatePlane::gridAttributes() const
58 {
59  return d->gridAttributes;
60 }
61 
62 void LeveyJenningsCoordinatePlane::setGridAttributes( const LeveyJenningsGridAttributes& attr )
63 {
64  d->gridAttributes = attr;
65 }
66 
67 const QPointF LeveyJenningsCoordinatePlane::translateBack( const QPointF& screenPoint ) const
68 {
69  return CartesianCoordinatePlane::translateBack( screenPoint );
70 }
71 
72 #undef d
void addDiagram(AbstractDiagram *diagram) override
Adds a diagram to this coordinate plane.
A set of attributes controlling the appearance of grids.
Class for the grid in a Levey Jennings plane.
LeveyDiagram defines a Levey Jennings chart.
AbstractDiagram defines the interface for diagram classes.
A chart with one or more diagrams.
Definition: KChartChart.h:84
void addDiagram(AbstractDiagram *diagram) override
Adds a diagram to this coordinate plane.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Jul 1 2022 05:09:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.