comparison layer/Colour3DPlotLayer.cpp @ 587:4806715f7a19

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:27:05 +0100
parents f4960f8ce798
children 5b72899d692b
comparison
equal deleted inserted replaced
586:1ae54a29e59e 587:4806715f7a19
491 Colour3DPlotLayer::setLayerDormant(const View *v, bool dormant) 491 Colour3DPlotLayer::setLayerDormant(const View *v, bool dormant)
492 { 492 {
493 if (dormant) { 493 if (dormant) {
494 494
495 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 495 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
496 DEBUG << "Colour3DPlotLayer::setLayerDormant(" << dormant << ")" 496 SVDEBUG << "Colour3DPlotLayer::setLayerDormant(" << dormant << ")"
497 << endl; 497 << endl;
498 #endif 498 #endif
499 499
500 if (isLayerDormant(v)) { 500 if (isLayerDormant(v)) {
501 return; 501 return;
586 void 586 void
587 Colour3DPlotLayer::setVerticalZoomStep(int step) 587 Colour3DPlotLayer::setVerticalZoomStep(int step)
588 { 588 {
589 if (!m_model) return; 589 if (!m_model) return;
590 590
591 // DEBUG << "Colour3DPlotLayer::setVerticalZoomStep(" <<step <<"): before: miny = " << m_miny << ", maxy = " << m_maxy << endl; 591 // SVDEBUG << "Colour3DPlotLayer::setVerticalZoomStep(" <<step <<"): before: miny = " << m_miny << ", maxy = " << m_maxy << endl;
592 592
593 int dist = m_model->getHeight() - step; 593 int dist = m_model->getHeight() - step;
594 if (dist < 1) dist = 1; 594 if (dist < 1) dist = 1;
595 float centre = m_miny + (float(m_maxy) - float(m_miny)) / 2.f; 595 float centre = m_miny + (float(m_maxy) - float(m_miny)) / 2.f;
596 m_miny = lrintf(centre - float(dist)/2); 596 m_miny = lrintf(centre - float(dist)/2);
597 if (m_miny < 0) m_miny = 0; 597 if (m_miny < 0) m_miny = 0;
598 m_maxy = m_miny + dist; 598 m_maxy = m_miny + dist;
599 if (m_maxy > m_model->getHeight()) m_maxy = m_model->getHeight(); 599 if (m_maxy > m_model->getHeight()) m_maxy = m_model->getHeight();
600 600
601 // DEBUG << "Colour3DPlotLayer::setVerticalZoomStep(" <<step <<"): after: miny = " << m_miny << ", maxy = " << m_maxy << endl; 601 // SVDEBUG << "Colour3DPlotLayer::setVerticalZoomStep(" <<step <<"): after: miny = " << m_miny << ", maxy = " << m_maxy << endl;
602 602
603 emit layerParametersChanged(); 603 emit layerParametersChanged();
604 } 604 }
605 605
606 RangeMapper * 606 RangeMapper *
916 size_t modelStart = m_model->getStartFrame(); 916 size_t modelStart = m_model->getStartFrame();
917 size_t modelEnd = m_model->getEndFrame(); 917 size_t modelEnd = m_model->getEndFrame();
918 size_t modelResolution = m_model->getResolution(); 918 size_t modelResolution = m_model->getResolution();
919 919
920 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 920 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
921 DEBUG << "Colour3DPlotLayer::fillCache: " << firstBin << " -> " << lastBin << endl; 921 SVDEBUG << "Colour3DPlotLayer::fillCache: " << firstBin << " -> " << lastBin << endl;
922 #endif 922 #endif
923 923
924 size_t modelStartBin = modelStart / modelResolution; 924 size_t modelStartBin = modelStart / modelResolution;
925 size_t modelEndBin = modelEnd / modelResolution; 925 size_t modelEndBin = modelEnd / modelResolution;
926 926
1150 void 1150 void
1151 Colour3DPlotLayer::paint(View *v, QPainter &paint, QRect rect) const 1151 Colour3DPlotLayer::paint(View *v, QPainter &paint, QRect rect) const
1152 { 1152 {
1153 /* 1153 /*
1154 if (m_model) { 1154 if (m_model) {
1155 DEBUG << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << endl; 1155 SVDEBUG << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << endl;
1156 } 1156 }
1157 */ 1157 */
1158 Profiler profiler("Colour3DPlotLayer::paint"); 1158 Profiler profiler("Colour3DPlotLayer::paint");
1159 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1159 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
1160 DEBUG << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << endl; 1160 SVDEBUG << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << endl;
1161 #endif 1161 #endif
1162 1162
1163 int completion = 0; 1163 int completion = 0;
1164 if (!m_model || !m_model->isOK() || !m_model->isReady(&completion)) { 1164 if (!m_model || !m_model->isOK() || !m_model->isReady(&completion)) {
1165 if (completion > 0) { 1165 if (completion > 0) {
1211 if (sx0 > 0) --sx0; 1211 if (sx0 > 0) --sx0;
1212 fillCache(sx0 < 0 ? 0 : sx0, 1212 fillCache(sx0 < 0 ? 0 : sx0,
1213 sx1 < 0 ? 0 : sx1); 1213 sx1 < 0 ? 0 : sx1);
1214 1214
1215 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1215 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
1216 DEBUG << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", modelStart = " << modelStart << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << " (zoom level = " << v->getZoomLevel() << ", srRatio = " << srRatio << ")" << endl; 1216 SVDEBUG << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", modelStart = " << modelStart << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << " (zoom level = " << v->getZoomLevel() << ", srRatio = " << srRatio << ")" << endl;
1217 #endif 1217 #endif
1218 1218
1219 if (m_opaque || 1219 if (m_opaque ||
1220 m_smooth || 1220 m_smooth ||
1221 int(m_model->getHeight()) >= v->height() || 1221 int(m_model->getHeight()) >= v->height() ||
1222 ((modelResolution * srRatio) / v->getZoomLevel()) < 2) { 1222 ((modelResolution * srRatio) / v->getZoomLevel()) < 2) {
1223 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1223 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
1224 DEBUG << "calling paintDense" << endl; 1224 SVDEBUG << "calling paintDense" << endl;
1225 #endif 1225 #endif
1226 paintDense(v, paint, rect); 1226 paintDense(v, paint, rect);
1227 return; 1227 return;
1228 } 1228 }
1229 1229
1230 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1230 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
1231 DEBUG << "Colour3DPlotLayer::paint: w " << x1-x0 << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sx1-sx0 << ", sh " << sh << endl; 1231 SVDEBUG << "Colour3DPlotLayer::paint: w " << x1-x0 << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sx1-sx0 << ", sh " << sh << endl;
1232 std::cerr << "Colour3DPlotLayer: sample rate is " << m_model->getSampleRate() << ", resolution " << m_model->getResolution() << std::endl; 1232 std::cerr << "Colour3DPlotLayer: sample rate is " << m_model->getSampleRate() << ", resolution " << m_model->getResolution() << std::endl;
1233 #endif 1233 #endif
1234 1234
1235 QPoint illuminatePos; 1235 QPoint illuminatePos;
1236 bool illuminate = v->shouldIlluminateLocalFeatures(this, illuminatePos); 1236 bool illuminate = v->shouldIlluminateLocalFeatures(this, illuminatePos);
1356 << ((modelResolution * srRatio * m_peakResolution) / zoomLevel) 1356 << ((modelResolution * srRatio * m_peakResolution) / zoomLevel)
1357 << std::endl; 1357 << std::endl;
1358 1358
1359 if (m_peaksCache) { 1359 if (m_peaksCache) {
1360 if (((modelResolution * srRatio * m_peakResolution) / zoomLevel) < 1) { 1360 if (((modelResolution * srRatio * m_peakResolution) / zoomLevel) < 1) {
1361 DEBUG << "using peaks cache" << endl; 1361 SVDEBUG << "using peaks cache" << endl;
1362 source = m_peaksCache; 1362 source = m_peaksCache;
1363 modelResolution *= m_peakResolution; 1363 modelResolution *= m_peakResolution;
1364 } else { 1364 } else {
1365 std::cerr << "not using peaks cache" << std::endl; 1365 std::cerr << "not using peaks cache" << std::endl;
1366 } 1366 }