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