KChart

KChartPolarDiagram.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 KCHARTPOLARDIAGRAM_H
21 #define KCHARTPOLARDIAGRAM_H
22 
23 
24 #include "KChartPosition.h"
25 #include "KChartAbstractPolarDiagram.h"
26 
27 QT_BEGIN_NAMESPACE
28 class QPolygonF;
29 QT_END_NAMESPACE
30 
31 namespace KChart {
32 
36 class KCHART_EXPORT PolarDiagram : public AbstractPolarDiagram
37 {
38  Q_OBJECT
39 
40  Q_DISABLE_COPY( PolarDiagram )
41  KCHART_DECLARE_DERIVED_DIAGRAM( PolarDiagram, PolarCoordinatePlane )
42 
43 public:
44  explicit PolarDiagram(
45  QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
46  virtual ~PolarDiagram();
47 
48 protected:
49  // Implement AbstractDiagram
51  void paint ( PaintContext* paintContext ) override;
52 
53 public:
55  void resize ( const QSizeF& area ) override;
56 
57  // Implement AbstractPolarDiagram
59  qreal valueTotals () const override;
61  qreal numberOfValuesPerDataset() const override;
63  qreal numberOfGridRings() const override;
64 
65 
69  virtual PolarDiagram * clone() const;
70 
72  void setZeroDegreePosition( int degrees );
74  int zeroDegreePosition() const;
75 
76  void setRotateCircularLabels( bool rotateCircularLabels );
77  bool rotateCircularLabels() const;
78 
82  void setCloseDatasets( bool closeDatasets );
83  bool closeDatasets() const;
84 
85  void setShowDelimitersAtPosition( Position position,
86  bool showDelimiters );
87  void setShowLabelsAtPosition( Position position,
88  bool showLabels );
89 
90  bool showDelimitersAtPosition( Position position ) const;
91 
92  bool showLabelsAtPosition( Position position ) const;
93 
94  virtual void paint ( PaintContext* paintContext,
95  bool calculateListAndReturnScale,
96  qreal& newZoomX, qreal& newZoomY ); // KChart 3: references -> pointers
97 
98 protected:
100  const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
101  void paintEvent ( QPaintEvent* ) override;
102  void resizeEvent ( QResizeEvent* ) override;
103  virtual void paintPolarMarkers( PaintContext* ctx, const QPolygonF& polygon );
104 
105 }; // End of class PolarDiagram
106 
107 }
108 
109 
110 #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-2020 The KDE developers.
Generated on Tue Sep 22 2020 22:36:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.