comparison layer/Colour3DPlotLayer.cpp @ 12:484e7320f59f

* Add more icons and rationalise menu options to the usual set (on the File menu) * Fixes to import/export of dense 3-D data sets and imported models
author Chris Cannam
date Thu, 19 Jan 2006 17:59:11 +0000
parents 37b110168acf
children 1deb5f87a18c
comparison
equal deleted inserted replaced
11:2d5005f2b3d9 12:484e7320f59f
97 97
98 size_t modelStart = m_model->getStartFrame(); 98 size_t modelStart = m_model->getStartFrame();
99 size_t modelEnd = m_model->getEndFrame(); 99 size_t modelEnd = m_model->getEndFrame();
100 size_t modelWindow = m_model->getWindowSize(); 100 size_t modelWindow = m_model->getWindowSize();
101 101
102 size_t cacheWidth = (modelEnd - modelStart) / modelWindow + 1;
103 size_t cacheHeight = m_model->getYBinCount();
104
105 if (m_cache &&
106 (m_cache->width() != cacheWidth ||
107 m_cache->height() != cacheHeight)) {
108
109 delete m_cache;
110 m_cache = 0;
111 }
112
102 if (!m_cache) { 113 if (!m_cache) {
103 114
104 m_cache = new QImage((modelEnd - modelStart) / modelWindow + 1, 115 m_cache = new QImage(cacheWidth, cacheHeight, QImage::Format_Indexed8);
105 m_model->getYBinCount(),
106 QImage::Format_Indexed8);
107 116
108 m_cache->setNumColors(256); 117 m_cache->setNumColors(256);
109 DenseThreeDimensionalModel::BinValueSet values; 118 DenseThreeDimensionalModel::BinValueSet values;
110 /* 119 /*
111 for (int pixel = 0; pixel < 256; ++pixel) { 120 for (int pixel = 0; pixel < 256; ++pixel) {