26 #ifndef QCP_PLOTTABLE_COLORMAP_H
27 #define QCP_PLOTTABLE_COLORMAP_H
29 #include "../global.h"
31 #include "../plottable.h"
32 #include "../colorgradient.h"
33 #include "../layoutelements/layoutelement-colorscale.h"
48 int keySize()
const {
return mKeySize; }
49 int valueSize()
const {
return mValueSize; }
50 QCPRange keyRange()
const {
return mKeyRange; }
51 QCPRange valueRange()
const {
return mValueRange; }
52 QCPRange dataBounds()
const {
return mDataBounds; }
53 double data(
double key,
double value);
54 double cell(
int keyIndex,
int valueIndex);
57 void setSize(
int keySize,
int valueSize);
58 void setKeySize(
int keySize);
59 void setValueSize(
int valueSize);
61 void setKeyRange(
const QCPRange &keyRange);
62 void setValueRange(
const QCPRange &valueRange);
63 void setData(
double key,
double value,
double z);
64 void setCell(
int keyIndex,
int valueIndex,
double z);
67 void recalculateDataBounds();
71 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
72 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
76 int mKeySize, mValueSize;
92 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
93 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
94 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
95 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
96 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
97 Q_PROPERTY(
QCPColorScale* colorScale READ colorScale WRITE setColorScale)
105 QCPRange dataRange()
const {
return mDataRange; }
107 bool interpolate()
const {
return mInterpolate; }
108 bool tightBoundary()
const {
return mTightBoundary; }
110 QCPColorScale *colorScale()
const {
return mColorScale.data(); }
114 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
117 void setInterpolate(
bool enabled);
118 void setTightBoundary(
bool enabled);
122 void rescaleDataRange(
bool recalculateDataBounds=
false);
123 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
127 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
130 void dataRangeChanged(
QCPRange newRange);
142 QPointer<QCPColorScale> mColorScale;
146 bool mMapImageInvalidated;
149 virtual void updateMapImage();
161 #endif // QCP_PLOTTABLE_COLORMAP_H
bool isEmpty() const
Definition: plottable-colormap.h:70
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
Represents the range an axis is encompassing.
Definition: range.h:31
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
Defines a color gradient for use with e.g. QCPColorMap.
Definition: colorgradient.h:32
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
virtual void draw(QCPPainter *painter)=0
Manages a legend inside a QCustomPlot.
Definition: layoutelement-legend.h:126
QPainter subclass used internally.
Definition: painter.h:111
A color scale for use with color coding data such as QCPColorMap.
Definition: layoutelement-colorscale.h:65
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
QCPColorMapData * data() const
Definition: plottable-colormap.h:104
ScaleType
Definition: axis.h:186
Holds the two-dimensional data of a QCPColorMap plottable.
Definition: plottable-colormap.h:39
The abstract base class for all data representing objects in a plot.
Definition: plottable.h:36
A plottable representing a two-dimensional color map in a plot.
Definition: plottable-colormap.h:88
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
virtual void clearData()=0