comparison layer/Colour3DPlotLayer.cpp @ 519:43bd47468005

...
author Chris Cannam
date Fri, 06 Mar 2009 11:26:28 +0000
parents 4ba0476ebbb6
children 0bd0b517e795
comparison
equal deleted inserted replaced
518:fe134ec37a2a 519:43bd47468005
760 760
761 size_t modelStart = m_model->getStartFrame(); 761 size_t modelStart = m_model->getStartFrame();
762 size_t modelEnd = m_model->getEndFrame(); 762 size_t modelEnd = m_model->getEndFrame();
763 size_t modelResolution = m_model->getResolution(); 763 size_t modelResolution = m_model->getResolution();
764 764
765 // std::cerr << "Colour3DPlotLayer::fillCache: " << firstBin << " -> " << lastBin << std::endl; 765 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
766 std::cerr << "Colour3DPlotLayer::fillCache: " << firstBin << " -> " << lastBin << std::endl;
767 #endif
766 768
767 size_t modelStartBin = modelStart / modelResolution; 769 size_t modelStartBin = modelStart / modelResolution;
768 size_t modelEndBin = modelEnd / modelResolution; 770 size_t modelEndBin = modelEnd / modelResolution;
769 771
770 size_t cacheWidth = modelEndBin - modelStartBin + 1; 772 size_t cacheWidth = modelEndBin - modelStartBin + 1;
810 m_cacheValidStart = 0; 812 m_cacheValidStart = 0;
811 m_cacheValidEnd = 0; 813 m_cacheValidEnd = 0;
812 } 814 }
813 815
814 if (m_cacheValidStart <= firstBin && m_cacheValidEnd >= lastBin) { 816 if (m_cacheValidStart <= firstBin && m_cacheValidEnd >= lastBin) {
817 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
818 std::cerr << "Cache is valid in this region already" << std::endl;
819 #endif
815 return; 820 return;
816 } 821 }
817 822
818 size_t fillStart = firstBin; 823 size_t fillStart = firstBin;
819 size_t fillEnd = lastBin; 824 size_t fillEnd = lastBin;
843 848
844 m_cacheValidStart = fillStart; 849 m_cacheValidStart = fillStart;
845 m_cacheValidEnd = fillEnd; 850 m_cacheValidEnd = fillEnd;
846 } 851 }
847 852
848 // std::cerr << "Cache size " << cacheWidth << "x" << cacheHeight << " will be valid from " << m_cacheValidStart << " to " << m_cacheValidEnd << std::endl; 853 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
854 std::cerr << "Cache size " << cacheWidth << "x" << cacheHeight << " will be valid from " << m_cacheValidStart << " to " << m_cacheValidEnd << std::endl;
855 #endif
849 856
850 DenseThreeDimensionalModel::Column values; 857 DenseThreeDimensionalModel::Column values;
851 858
852 float min = m_model->getMinimumLevel(); 859 float min = m_model->getMinimumLevel();
853 float max = m_model->getMaximumLevel(); 860 float max = m_model->getMaximumLevel();
1122 paint.setPen(v->getForeground()); 1129 paint.setPen(v->getForeground());
1123 } 1130 }
1124 } 1131 }
1125 1132
1126 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1133 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
1127 std::cerr << "rect " << r.x() << "," << r.y() << " " 1134 // std::cerr << "rect " << r.x() << "," << r.y() << " "
1128 << r.width() << "x" << r.height() << std::endl; 1135 // << r.width() << "x" << r.height() << std::endl;
1129 #endif 1136 #endif
1130 1137
1131 paint.drawRect(r); 1138 paint.drawRect(r);
1132 1139
1133 if (showLabel) { 1140 if (showLabel) {