comparison view/Pane.cpp @ 1543:35c7b7a592f0

Debug output
author Chris Cannam
date Wed, 16 Oct 2019 13:01:23 +0100
parents bfacecf7ea7e
children e6362cf5ff1d
comparison
equal deleted inserted replaced
1542:10fe8124dc17 1543:35c7b7a592f0
533 bool includeColourScale = m_manager->shouldShowVerticalColourScale(); 533 bool includeColourScale = m_manager->shouldShowVerticalColourScale();
534 534
535 Layer *scaleLayer = nullptr; 535 Layer *scaleLayer = nullptr;
536 int scaleWidth = 0; 536 int scaleWidth = 0;
537 537
538 #ifdef DEBUG_PANE_SCALE_CHOICE
539 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Have "
540 << getLayerCount() << " layer(s)" << endl;
541 #endif
542
538 // If the topmost layer is prepared to draw a scale, then use it. 543 // If the topmost layer is prepared to draw a scale, then use it.
539 // 544 //
540 // Otherwise: find the topmost layer that has value extents, 545 // Otherwise: find the topmost layer that has value extents,
541 // i.e. for which a scale is relevant at all. 546 // i.e. for which a scale is relevant at all.
542 // 547 //
555 scaleWidth = topLayer->getVerticalScaleWidth 560 scaleWidth = topLayer->getVerticalScaleWidth
556 (this, includeColourScale, paint); 561 (this, includeColourScale, paint);
557 562
558 #ifdef DEBUG_PANE_SCALE_CHOICE 563 #ifdef DEBUG_PANE_SCALE_CHOICE
559 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Top layer (" 564 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Top layer ("
560 << topLayer << ") offers vertical scale width of " << scaleWidth 565 << topLayer << ", " << topLayer->getLayerPresentationName()
566 << ") offers vertical scale width of " << scaleWidth
561 << endl; 567 << endl;
562 #endif 568 #endif
563 } 569 }
564 570
565 if (scaleWidth > 0) { 571 if (scaleWidth > 0) {
566 scaleLayer = topLayer; 572 scaleLayer = topLayer;
573
574 #ifdef DEBUG_PANE_SCALE_CHOICE
575 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Accepting that"
576 << endl;
577 #endif
567 } else { 578 } else {
568 579
569 for (auto i = m_layerStack.rbegin(); i != m_layerStack.rend(); ++i) { 580 for (auto i = m_layerStack.rbegin(); i != m_layerStack.rend(); ++i) {
570 Layer *layer = *i; 581 Layer *layer = *i;
571 582
572 if (layer->isLayerDormant(this)) { 583 if (layer->isLayerDormant(this)) {
573 #ifdef DEBUG_PANE_SCALE_CHOICE 584 #ifdef DEBUG_PANE_SCALE_CHOICE
574 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: " 585 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: "
575 << "Layer " << layer << " is dormant, skipping" << endl; 586 << "Layer " << layer << ", "
587 << layer->getLayerPresentationName()
588 << " is dormant, skipping" << endl;
576 #endif 589 #endif
577 continue; 590 continue;
578 } 591 }
579 592
580 if (layer->getValueExtents(min, max, log, unit)) { 593 if (layer->getValueExtents(min, max, log, unit)) {
581 scaleLayer = layer; 594 scaleLayer = layer;
582 595
583 #ifdef DEBUG_PANE_SCALE_CHOICE 596 #ifdef DEBUG_PANE_SCALE_CHOICE
584 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: " 597 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: "
585 << "Layer " << layer << " has value extents (unit = " 598 << "Layer " << layer
599 << ", " << layer->getLayerPresentationName()
600 << " has value extents (unit = "
586 << unit << "), using this layer or unit" << endl; 601 << unit << "), using this layer or unit" << endl;
587 #endif 602 #endif
588 break; 603 break;
589 } 604 }
590 605
591 if (layer->isLayerOpaque()) { 606 if (layer->isLayerOpaque()) {
592 #ifdef DEBUG_PANE 607 #ifdef DEBUG_PANE
593 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: " 608 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: "
594 << "Layer " << layer 609 << "Layer " << layer
610 << ", " << layer->getLayerPresentationName()
595 << " is opaque, searching no further" << endl; 611 << " is opaque, searching no further" << endl;
596 #endif 612 #endif
597 break; 613 break;
598 } 614 }
599 } 615 }
602 scaleWidth = scaleLayer->getVerticalScaleWidth 618 scaleWidth = scaleLayer->getVerticalScaleWidth
603 (this, includeColourScale, paint); 619 (this, includeColourScale, paint);
604 620
605 #ifdef DEBUG_PANE_SCALE_CHOICE 621 #ifdef DEBUG_PANE_SCALE_CHOICE
606 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Layer " 622 SVCERR << "Pane[" << getId() << "]::drawVerticalScale: Layer "
607 << topLayer << " offers vertical scale width of " 623 << scaleLayer << ", "
624 << scaleLayer->getLayerPresentationName()
625 << " offers vertical scale width of "
608 << scaleWidth << endl; 626 << scaleWidth << endl;
609 #endif 627 #endif
610 } 628 }
611 629
612 if (scaleWidth == 0 && unit != "") { 630 if (scaleWidth == 0 && unit != "") {
613 #ifdef DEBUG_PANE_SCALE_CHOICE 631 #ifdef DEBUG_PANE_SCALE_CHOICE
614 SVDEBUG << "Pane[" << getId() 632 SVDEBUG << "Pane[" << getId()
615 << "]::drawVerticalScale: No good scale layer, then, " 633 << "]::drawVerticalScale: No good scale layer, "
616 << "but we have a unit of " << unit 634 << "but we have a unit of " << unit
617 << " - seeking scale-providing layer for that" << endl; 635 << " - seeking scale-providing layer for that" << endl;
618 #endif 636 #endif
619 637
620 scaleLayer = getScaleProvidingLayerForUnit(unit); 638 scaleLayer = getScaleProvidingLayerForUnit(unit);
621 639
622 #ifdef DEBUG_PANE_SCALE_CHOICE 640 #ifdef DEBUG_PANE_SCALE_CHOICE
623 SVDEBUG << "Pane[" << getId() 641 SVDEBUG << "Pane[" << getId()
624 << "]::drawVerticalScale: That returned " 642 << "]::drawVerticalScale: That returned layer "
625 << scaleLayer << endl; 643 << scaleLayer << ", "
644 << (scaleLayer ? scaleLayer->getLayerPresentationName()
645 : "(none)")
646 << endl;
626 #endif 647 #endif
627 } 648 }
628 } 649 }
629 650
630 if (scaleWidth > 0) { 651 if (scaleWidth > 0) {