KChart::AbstractGrid

Search for usage in LXR

#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 DataDimensionsList &l)
 
static bool isBoundariesValid (const QPair< QPointF, QPointF > &b)
 
static bool isBoundariesValid (const QRectF &r)
 
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 33 of file KChartAbstractGrid.h.

Constructor & Destructor Documentation

◆ ~AbstractGrid()

AbstractGrid::~AbstractGrid ( )
virtual

Definition at line 33 of file KChartAbstractGrid.cpp.

◆ AbstractGrid()

AbstractGrid::AbstractGrid ( )
protected

Definition at line 27 of file KChartAbstractGrid.cpp.

Member Function Documentation

◆ adjustedLowerUpperRange()

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 95 of file KChartAbstractGrid.cpp.

◆ adjustLowerUpperRange()

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 82 of file KChartAbstractGrid.cpp.

◆ drawGrid()

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::LeveyJenningsGrid, KChart::PolarGrid, and KChart::RadarGrid.

◆ isBoundariesValid() [1/3]

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 69 of file KChartAbstractGrid.cpp.

◆ isBoundariesValid() [2/3]

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 63 of file KChartAbstractGrid.cpp.

◆ isBoundariesValid() [3/3]

bool AbstractGrid::isBoundariesValid ( const QRectF & r)
static

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

See also
isValueValid

Definition at line 58 of file KChartAbstractGrid.cpp.

◆ isValueValid()

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

Checks if r is neither NaN nor infinity.

Definition at line 77 of file KChartAbstractGrid.cpp.

◆ setNeedRecalculate()

void AbstractGrid::setNeedRecalculate ( )

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

See also
calculateGrid

Definition at line 38 of file KChartAbstractGrid.cpp.

◆ updateData()

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 43 of file KChartAbstractGrid.cpp.

Member Data Documentation

◆ gridAttributes

GridAttributes KChart::AbstractGrid::gridAttributes

Definition at line 118 of file KChartAbstractGrid.h.

◆ mDataDimensions

DataDimensionsList KChart::AbstractGrid::mDataDimensions
protected

Definition at line 121 of file KChartAbstractGrid.h.

◆ mPlane

AbstractCoordinatePlane* KChart::AbstractGrid::mPlane
protected

Definition at line 122 of file KChartAbstractGrid.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.