| 592 | } |
| 593 | |
| 594 | GLuint Plot3DOpenGLCanvas::makeDataAsStick_() |
| 595 | { |
| 596 | GLuint list = glGenLists(1); |
| 597 | glNewList(list, GL_COMPILE); |
| 598 | |
| 599 | for (Size i = 0; i < canvas_3d_.getLayerCount(); i++) |
| 600 | { |
| 601 | LayerDataPeak& layer = dynamic_cast<LayerDataPeak&>(canvas_3d_.getLayer(i)); |
| 602 | if (layer.visible) |
| 603 | { |
| 604 | recalculateDotGradient_(layer); |
| 605 | |
| 606 | if ((Int)layer.param.getValue("dot:shade_mode")) |
| 607 | { |
| 608 | glShadeModel(GL_SMOOTH); |
| 609 | } |
| 610 | else |
| 611 | { |
| 612 | glShadeModel(GL_FLAT); |
| 613 | } |
| 614 | |
| 615 | glLineWidth(layer.param.getValue("dot:line_width")); |
| 616 | |
| 617 | const auto area = canvas_3d_.visible_area_.getAreaUnit(); |
| 618 | auto begin_it = layer.getPeakData()->areaBeginConst(area.getMinRT(), area.getMaxRT(), area.getMinMZ(), area.getMaxMZ()); |
| 619 | auto end_it = layer.getPeakData()->areaEndConst(); |
| 620 | // count peaks in area |
| 621 | int count = std::distance(begin_it, end_it); |
| 622 | |
| 623 | int max_displayed_peaks = 100000; |
| 624 | int step = 1; |
| 625 | if (count > max_displayed_peaks) |
| 626 | { |
| 627 | step = 1 + count / max_displayed_peaks; |
| 628 | } |
| 629 | |
| 630 | for (auto it = begin_it; it != end_it; ++it) |
| 631 | { |
| 632 | if (step > 1) |
| 633 | { |
| 634 | for (int i = 0; i < step - 1; ++i) |
| 635 | { |
| 636 | ++it; |
| 637 | } |
| 638 | } |
| 639 | if (it == end_it) |
| 640 | { |
| 641 | glEndList(); |
| 642 | return list; |
| 643 | } |
| 644 | |
| 645 | PeakIndex pi = it.getPeakIndex(); |
| 646 | if (layer.filters.passes((*layer.getPeakData())[pi.spectrum], pi.peak)) |
| 647 | { |
| 648 | glBegin(GL_LINES); |
| 649 | double intensity = 0; |
| 650 | switch (canvas_3d_.intensity_mode_) |
| 651 | { |
nothing calls this directly
no test coverage detected