KChart::AbstractGrid

#include <KChartAbstractGrid.h>

Inheritance diagram for KChart::AbstractGrid:

Public Member Functions

virtual void drawGrid (PaintContext *context)=0
 
void setNeedRecalculate ()
 
DataDimensionsList updateData (AbstractCoordinatePlane *plane)
 

Static Public Member Functions

static const DataDimension adjustedLowerUpperRange (const DataDimension &dim, bool adjustLower, bool adjustUpper)
 
static void adjustLowerUpperRange (qreal &start, qreal &end, qreal stepWidth, bool adjustLower, bool adjustUpper)
 
static bool isBoundariesValid (const QRectF &r)
 
static bool isBoundariesValid (const QPair< QPointF, QPointF > &b)
 
static bool isBoundariesValid (const DataDimensionsList &l)
 
static bool isValueValid (const qreal &r)
 

Public Attributes

GridAttributes gridAttributes
 

Protected Attributes

DataDimensionsList mDataDimensions
 
AbstractCoordinatePlanemPlane
 

Detailed Description

Abstract base class for grid classes: cartesian, polar, ...

The AbstractGrid interface is the base class used by AbstractCoordinatePlane, for calculating and for drawing the grid lines of the plane.

Definition at line 44 of file KChartAbstractGrid.h.

Member Function Documentation

const DataDimension AbstractGrid::adjustedLowerUpperRange ( const DataDimension dim,
bool  adjustLower,
bool  adjustUpper 
)
static

Adjusts dim so that dim.start and/or dim.end are a multiple of dim.stepWidth.

See also
adjustLowerUpperRange

Definition at line 106 of file KChartAbstractGrid.cpp.

void AbstractGrid::adjustLowerUpperRange ( qreal &  start,
qreal &  end,
qreal  stepWidth,
bool  adjustLower,
bool  adjustUpper 
)
static

Adjusts start and/or end so that they are a multiple of stepWidth.

Definition at line 93 of file KChartAbstractGrid.cpp.

virtual void KChart::AbstractGrid::drawGrid ( PaintContext context)
pure virtual

Doing the actual drawing.

Every derived class must implement this.

Note
When implementing drawGrid(): Before you start drawing, make sure to call updateData(), to get the data boundaries recalculated. For an example, see the implementation of CartesianGrid:drawGrid().

Implemented in KChart::CartesianGrid, KChart::PolarGrid, KChart::RadarGrid, and KChart::LeveyJenningsGrid.

bool AbstractGrid::isBoundariesValid ( const QRectF r)
static

Checks whether both coordinates of r are valid according to isValueValid.

See also
isValueValid

Definition at line 69 of file KChartAbstractGrid.cpp.

bool AbstractGrid::isBoundariesValid ( const QPair< QPointF, QPointF > &  b)
static

Checks whether both coordinates of both points are valid according to isValueValid.

See also
isValueValid

Definition at line 74 of file KChartAbstractGrid.cpp.

bool AbstractGrid::isBoundariesValid ( const DataDimensionsList l)
static

Checks whether all start and end properties of every DataDimension in the list l are valid according to isValueValid().

See also
isValueValid

Definition at line 80 of file KChartAbstractGrid.cpp.

bool AbstractGrid::isValueValid ( const qreal &  r)
static

Checks if r is neither NaN nor infinity.

Definition at line 88 of file KChartAbstractGrid.cpp.

void AbstractGrid::setNeedRecalculate ( )

Causes grid to be recalculated upon the next call of updateData().

See also
calculateGrid

Definition at line 49 of file KChartAbstractGrid.cpp.

DataDimensionsList AbstractGrid::updateData ( AbstractCoordinatePlane plane)

Returns the cached result of data calculation.

For this, all derived classes need to implement the pure-virtual calculateGrid() method.

Definition at line 54 of file KChartAbstractGrid.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 22:38:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.