KD Chart API Documentation 3.1
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
KDChart::AbstractGrid Class Referenceabstract

#include <KDChartAbstractGrid.h>

Inheritance diagram for KDChart::AbstractGrid:
Inheritance graph
Collaboration diagram for KDChart::AbstractGrid:
Collaboration graph

Public Member Functions

virtual ~AbstractGrid ()
virtual void drawGrid (PaintContext *context)=0
void setNeedRecalculate ()
DataDimensionsList updateData (AbstractCoordinatePlane *plane)
 Returns the cached result of data calculation.

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 Member Functions

 AbstractGrid ()

Protected Attributes

DataDimensionsList mDataDimensions
AbstractCoordinatePlanemPlane = nullptr

Detailed Description

Definition at line 34 of file KDChartAbstractGrid.h.

Constructor & Destructor Documentation

◆ ~AbstractGrid()

AbstractGrid::~AbstractGrid ( )

Definition at line 31 of file KDChartAbstractGrid.cpp.

◆ AbstractGrid()

AbstractGrid::AbstractGrid ( )

Definition at line 26 of file KDChartAbstractGrid.cpp.

Member Function Documentation

◆ adjustedLowerUpperRange()

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

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

See also

Definition at line 92 of file KDChartAbstractGrid.cpp.

References adjustLowerUpperRange(), KDChart::DataDimension::end, KDChart::DataDimension::start, and KDChart::DataDimension::stepWidth.

◆ adjustLowerUpperRange()

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

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

Definition at line 79 of file KDChartAbstractGrid.cpp.

References _trunc().

Referenced by adjustedLowerUpperRange(), calculateSteps(), calculateSteps(), and KDChart::CartesianGrid::drawGrid().

◆ drawGrid()

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

Doing the actual drawing.

Every derived class must implement this.

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 KDChart::CartesianGrid, KDChart::LeveyJenningsGrid, KDChart::PolarGrid, KDChart::RadarGrid, and KDChart::TernaryGrid.

◆ isBoundariesValid() [1/3]

bool AbstractGrid::isBoundariesValid ( const DataDimensionsList l)

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

See also

Definition at line 66 of file KDChartAbstractGrid.cpp.

References QList::at(), isValueValid(), and QList::size().

◆ isBoundariesValid() [2/3]

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

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

See also

Definition at line 61 of file KDChartAbstractGrid.cpp.

References isValueValid().

◆ isBoundariesValid() [3/3]

bool AbstractGrid::isBoundariesValid ( const QRectF r)

◆ isValueValid()

bool AbstractGrid::isValueValid ( const qreal &  r)

Checks if r is neither NaN nor infinity.

Definition at line 74 of file KDChartAbstractGrid.cpp.

Referenced by isBoundariesValid(), and isBoundariesValid().

◆ setNeedRecalculate()

void AbstractGrid::setNeedRecalculate ( )

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

See also

Definition at line 36 of file KDChartAbstractGrid.cpp.

References QList::clear().

◆ 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 41 of file KDChartAbstractGrid.cpp.

References QList::empty(), KDChart::AbstractCoordinatePlane::getDataDimensionsList(), mDataDimensions, and mPlane.

Referenced by KDChart::CartesianGrid::drawGrid(), and KDChart::LeveyJenningsGrid::drawGrid().

Member Data Documentation

◆ gridAttributes

GridAttributes KDChart::AbstractGrid::gridAttributes

Definition at line 119 of file KDChartAbstractGrid.h.

◆ mDataDimensions

DataDimensionsList KDChart::AbstractGrid::mDataDimensions

◆ mPlane

AbstractCoordinatePlane* KDChart::AbstractGrid::mPlane = nullptr

Definition at line 123 of file KDChartAbstractGrid.h.

Referenced by KDChart::LeveyJenningsGrid::drawGrid(), and updateData().

The documentation for this class was generated from the following files:

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
Generated on Thu Apr 11 2024 00:04:50 for KD Chart API Documentation by doxygen 1.9.8