KChart

KChartPolarDiagram.h
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 #ifndef KCHARTPOLARDIAGRAM_H
10 #define KCHARTPOLARDIAGRAM_H
11 
12 
13 #include "KChartPosition.h"
14 #include "KChartAbstractPolarDiagram.h"
15 
16 QT_BEGIN_NAMESPACE
17 class QPolygonF;
18 QT_END_NAMESPACE
19 
20 namespace KChart {
21 
22 /**
23  * @brief PolarDiagram defines a common polar diagram
24  */
25 class KCHART_EXPORT PolarDiagram : public AbstractPolarDiagram
26 {
27  Q_OBJECT
28 
29  Q_DISABLE_COPY( PolarDiagram )
30  KCHART_DECLARE_DERIVED_DIAGRAM( PolarDiagram, PolarCoordinatePlane )
31 
32 public:
33  explicit PolarDiagram(
34  QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
35  virtual ~PolarDiagram();
36 
37 protected:
38  // Implement AbstractDiagram
39  /** \reimpl */
40  void paint ( PaintContext* paintContext ) override;
41 
42 public:
43  /** \reimpl */
44  void resize ( const QSizeF& area ) override;
45 
46  // Implement AbstractPolarDiagram
47  /** \reimpl */
48  qreal valueTotals () const override;
49  /** \reimpl */
50  qreal numberOfValuesPerDataset() const override;
51  /** \reimpl */
52  qreal numberOfGridRings() const override;
53 
54 
55  /**
56  * Creates an exact copy of this diagram.
57  */
58  virtual PolarDiagram * clone() const;
59 
60  /** \deprecated Use PolarCoordinatePlane::setStartPosition( qreal degrees ) instead. */
61  void setZeroDegreePosition( int degrees );
62  /** \deprecated Use qreal PolarCoordinatePlane::startPosition instead. */
63  int zeroDegreePosition() const;
64 
65  void setRotateCircularLabels( bool rotateCircularLabels );
66  bool rotateCircularLabels() const;
67 
68  /** Close each of the data series by connecting the last point to its
69  * respective start point
70  */
71  void setCloseDatasets( bool closeDatasets );
72  bool closeDatasets() const;
73 
74  void setShowDelimitersAtPosition( Position position,
75  bool showDelimiters );
76  void setShowLabelsAtPosition( Position position,
77  bool showLabels );
78 
79  bool showDelimitersAtPosition( Position position ) const;
80 
81  bool showLabelsAtPosition( Position position ) const;
82 
83  virtual void paint ( PaintContext* paintContext,
84  bool calculateListAndReturnScale,
85  qreal& newZoomX, qreal& newZoomY ); // KChart 3: references -> pointers
86 
87 protected:
88  /** \reimpl */
89  const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
90  void paintEvent ( QPaintEvent* ) override;
91  void resizeEvent ( QResizeEvent* ) override;
92  virtual void paintPolarMarkers( PaintContext* ctx, const QPolygonF& polygon );
93 
94 }; // End of class PolarDiagram
95 
96 }
97 
98 
99 #endif // KCHARTPOLARDIAGRAM_H
Class only listed here to document inheritance of some KChart classes.
Defines a position, using compass terminology.
Stores information about painting diagrams.
Base class for diagrams based on a polar coordinate system.
Global namespace.
PolarDiagram defines a common polar diagram.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Oct 21 2021 22:37:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.