KD Chart 2  [rev.2.7]
KDChartAbstractCartesianDiagram.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTABSTRACTCARTESIANDIAGRAM_H
24 #define KDCHARTABSTRACTCARTESIANDIAGRAM_H
25 
27 #include "KDChartAbstractDiagram.h"
28 #include "KDChartCartesianAxis.h"
29 
30 namespace KDChart {
31 
32  class GridAttributes;
33 
41  class KDCHART_EXPORT AbstractCartesianDiagram : public AbstractDiagram
42  {
43  Q_OBJECT
44  Q_DISABLE_COPY( AbstractCartesianDiagram )
46 
47  public:
48  explicit AbstractCartesianDiagram( QWidget* parent = 0, CartesianCoordinatePlane* plane = 0 );
49  ~AbstractCartesianDiagram() override;
50 
54  bool compare( const AbstractCartesianDiagram* other ) const;
55 
56 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
57  virtual const int numberOfAbscissaSegments() const = 0;
58  virtual const int numberOfOrdinateSegments() const = 0;
59 #else
60  virtual int numberOfAbscissaSegments() const = 0;
61  virtual int numberOfOrdinateSegments() const = 0;
62 #endif
63 
72  virtual void addAxis( CartesianAxis * axis );
81  virtual void takeAxis( CartesianAxis * axis );
85  virtual KDChart::CartesianAxisList axes() const;
86 
91  virtual void layoutPlanes();
93  void setCoordinatePlane( AbstractCoordinatePlane* plane ) override;
94 
102  virtual void setReferenceDiagram( AbstractCartesianDiagram* diagram, const QPointF& offset = QPointF() );
107  virtual AbstractCartesianDiagram* referenceDiagram() const;
112  virtual QPointF referenceDiagramOffset() const;
113 
114  /* reimpl */
115  void setModel( QAbstractItemModel* model ) override;
116  /* reimpl */
117  void setRootIndex( const QModelIndex& index ) override;
118  /* reimpl */
119  void setAttributesModel( AttributesModel* model ) override;
120 
121  protected Q_SLOTS:
122  void connectAttributesModel( AttributesModel* );
123 
124  protected:
126  virtual qreal threeDItemDepth( const QModelIndex& index ) const = 0;
128  virtual qreal threeDItemDepth( int column ) const = 0;
129  };
130 }
131 
132 #endif
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
AbstractDiagram defines the interface for diagram classes.
The class for cartesian axes.
A proxy model used for decorating data with attributes.
Base class for diagrams based on a cartesian coordianate system.
A set of attributes controlling the appearance of grids.
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Class only listed here to document inheritance of some KDChart classes.

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/