! Goes through the data and updates the buffered minimum and maximum data values. Calling this method is only advised if you are about to call \ref QCPColorMap::rescaleDataRange and can not guarantee that the cells holding the maximum or minimum data haven't been overwritten with a smaller or larger value respectively, since the buffered maximum/minimum values have been updated the la
| 25289 | doing the rescale. |
| 25290 | */ |
| 25291 | void QCPColorMapData::recalculateDataBounds() |
| 25292 | { |
| 25293 | if (mKeySize > 0 && mValueSize > 0) |
| 25294 | { |
| 25295 | double minHeight = mData[0]; |
| 25296 | double maxHeight = mData[0]; |
| 25297 | const int dataCount = mValueSize*mKeySize; |
| 25298 | for (int i=0; i<dataCount; ++i) |
| 25299 | { |
| 25300 | if (mData[i] > maxHeight) |
| 25301 | maxHeight = mData[i]; |
| 25302 | if (mData[i] < minHeight) |
| 25303 | minHeight = mData[i]; |
| 25304 | } |
| 25305 | mDataBounds.lower = minHeight; |
| 25306 | mDataBounds.upper = maxHeight; |
| 25307 | } |
| 25308 | } |
| 25309 | |
| 25310 | /*! |
| 25311 | Frees the internal data memory. |