KChart

KChartCartesianGrid.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 KCHARTCARTESIANGRID_H
21 #define KCHARTCARTESIANGRID_H
22 
23 #include "KChartCartesianCoordinatePlane.h"
24 #include "KChartAbstractGrid.h"
25 
26 namespace KChart {
27 
28  class PaintContext;
29  class CartesianCoordinatePlane;
30 
41  class CartesianGrid : public AbstractGrid
42  {
43  public:
44  CartesianGrid();
45  virtual ~CartesianGrid();
46 
47  int minimalSteps() const;
48  void setMinimalSteps(int minsteps);
49 
50  int maximalSteps() const;
51  void setMaximalSteps(int maxsteps);
52 
53  void drawGrid( PaintContext* context ) override;
54 
55  private:
56  int m_minsteps;
57  int m_maxsteps;
58 
59  DataDimensionsList calculateGrid(
60  const DataDimensionsList& rawDataDimensions ) const override;
61 
75  virtual DataDimension calculateGridXY(
76  const DataDimension& rawDataDimension,
77  Qt::Orientation orientation,
78  bool adjustLower, bool adjustUpper ) const;
79 
107  virtual void calculateStepWidth(
108  qreal start, qreal end,
109  const QList<qreal>& granularities,
110  Qt::Orientation orientation,
111  qreal& stepWidth, qreal& subStepWidth,
112  bool adjustLower, bool adjustUpper ) const;
113  };
114 
115 }
116 
117 #endif
Helper class for one dimension of data, e.g.
Stores information about painting diagrams.
Class for the grid in a cartesian plane.
void drawGrid(PaintContext *context) override
Doing the actual drawing.
Orientation
Global namespace.
Abstract base class for grid classes: cartesian, polar, ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jan 14 2021 22:38:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.