KChart

KChartAbstractCartesianDiagram.h
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 KCHARTABSTRACTCARTESIANDIAGRAM_H
21 #define KCHARTABSTRACTCARTESIANDIAGRAM_H
22 
23 #include "KChartCartesianCoordinatePlane.h"
24 #include "KChartAbstractDiagram.h"
25 #include "KChartCartesianAxis.h"
26 
27 namespace KChart {
28 
29  class GridAttributes;
30 
38  class KCHART_EXPORT AbstractCartesianDiagram : public AbstractDiagram
39  {
40  Q_OBJECT
41  Q_DISABLE_COPY( AbstractCartesianDiagram )
42  KCHART_DECLARE_DERIVED_DIAGRAM( AbstractCartesianDiagram, CartesianCoordinatePlane )
43 
44  public:
45  explicit AbstractCartesianDiagram( QWidget* parent = nullptr, CartesianCoordinatePlane* plane = nullptr );
46  virtual ~AbstractCartesianDiagram();
47 
51  bool compare( const AbstractCartesianDiagram* other ) const;
52 
53 #if defined(Q_COMPILER_MANGLES_RETURN_TYPE)
54  virtual const int numberOfAbscissaSegments() const = 0;
55  virtual const int numberOfOrdinateSegments() const = 0;
56 #else
57  virtual int numberOfAbscissaSegments() const = 0;
58  virtual int numberOfOrdinateSegments() const = 0;
59 #endif
60 
69  virtual void addAxis( CartesianAxis * axis );
78  virtual void takeAxis( CartesianAxis * axis );
82  virtual KChart::CartesianAxisList axes() const;
83 
88  virtual void layoutPlanes();
90  void setCoordinatePlane( AbstractCoordinatePlane* plane ) override;
91 
99  virtual void setReferenceDiagram( AbstractCartesianDiagram* diagram, const QPointF& offset = QPointF() );
104  virtual AbstractCartesianDiagram* referenceDiagram() const;
109  virtual QPointF referenceDiagramOffset() const;
110 
111  /* reimpl */
112  void setModel( QAbstractItemModel* model ) override;
113  /* reimpl */
114  void setRootIndex( const QModelIndex& index ) override;
115  /* reimpl */
116  void setAttributesModel( AttributesModel* model ) override;
117 
118  protected Q_SLOTS:
119  void connectAttributesModel( AttributesModel* );
120 
121  protected:
123  virtual qreal threeDItemDepth( const QModelIndex& index ) const = 0;
125  virtual qreal threeDItemDepth( int column ) const = 0;
126  };
127 }
128 
129 #endif
Class only listed here to document inheritance of some KChart classes.
AbstractDiagram defines the interface for diagram classes.
The class for cartesian axes.
Base class for diagrams based on a cartesian coordianate system.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
A proxy model used for decorating data with attributes.
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 22:36:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.