File indexing completed on 2024-12-15 04:02:31

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 KCHARTLEVEYJENNINGSCOORDINATEPLANE_H
0010 #define KCHARTLEVEYJENNINGSCOORDINATEPLANE_H
0011 
0012 #include "KChartCartesianCoordinatePlane.h"
0013 
0014 #include "KChartLeveyJenningsGridAttributes.h"
0015 
0016 namespace KChart {
0017 
0018     class LeveyJenningsGrid;
0019 
0020     /**
0021       * @brief Levey Jennings coordinate plane
0022       * This is actually nothing real more than a plain cartesian
0023       * coordinate plane. The difference is, that only Levey Jennings
0024       * Diagrams can be added to it.
0025       */
0026     class KCHART_EXPORT LeveyJenningsCoordinatePlane
0027         : public CartesianCoordinatePlane
0028     {
0029         Q_OBJECT
0030         Q_DISABLE_COPY( LeveyJenningsCoordinatePlane )
0031         KCHART_DECLARE_PRIVATE_DERIVED_PARENT( LeveyJenningsCoordinatePlane, Chart* )
0032 
0033         friend class LeveyJenningsGrid;
0034 
0035     public:
0036         explicit LeveyJenningsCoordinatePlane( Chart* parent = nullptr );
0037         ~LeveyJenningsCoordinatePlane() override;
0038 
0039         void addDiagram( AbstractDiagram* diagram ) override;
0040 
0041         LeveyJenningsGridAttributes gridAttributes() const;
0042         void setGridAttributes( const LeveyJenningsGridAttributes& attr );
0043    
0044     protected: 
0045         const QPointF translateBack( const QPointF& screenPoint ) const;
0046 
0047     private:
0048         LeveyJenningsGrid* grid() const;
0049     };
0050 
0051 }
0052 
0053 #endif