KChart
9#ifndef PLOTTERDIAGRAMCOMPRESSOR_H
10#define PLOTTERDIAGRAMCOMPRESSOR_H
13#include <QAbstractItemModel>
25class PlotterDiagramCompressor :
public QObject
30 enum CompressionMode{ SLOPE = 0, DISTANCE, BOTH };
40 inline qreal distance(
const DataPoint &
other )
42 const qreal dx = key -
other.key;
43 const qreal dy = value -
other.value;
44 return std::sqrt( dx * dx + dy * dy );
47 inline bool operator==(
const DataPoint &
other )
49 return key ==
other.key && value ==
other.value;
52 inline bool operator!=(
const DataPoint &
other )
54 return !( *
this ==
other );
65 friend class PlotterDiagramCompressor;
70 Iterator& operator++();
71 Iterator operator++(
int );
72 Iterator& operator += (
int value );
73 Iterator& operator--();
74 Iterator operator--(
int );
75 Iterator& operator-=(
int value );
76 DataPoint operator*();
77 bool operator==(
const Iterator &
other )
const;
78 bool operator!=(
const Iterator &
other )
const;
83 void handleSlopeForward(
const DataPoint &
dp );
100 CachePosition(
int first,
int second )
107 bool operator==(
const CachePosition&
rhs )
const
109 return first ==
rhs.first &&
110 second ==
rhs.second;
113 explicit PlotterDiagramCompressor(
QObject *
parent =
nullptr);
114 ~PlotterDiagramCompressor()
override;
117 void setMergeRadius( qreal radius );
118 void setMergeRadiusPercentage( qreal radius );
121 DataPoint data(
const CachePosition& pos )
const;
122 int rowCount()
const;
123 int datasetCount()
const;
124 void setCompressionModel( CompressionMode value );
125 void setMaxSlopeChange( qreal value );
126 qreal maxSlopeChange()
const;
131 void boundariesChanged();
132 void rowCountChanged();
QObject * parent() const const
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:24 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.