MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / findPeakAtPosition_

Method findPeakAtPosition_

src/openms_gui/source/VISUAL/Plot1DCanvas.cpp:535–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533 }
534
535 PeakIndex Plot1DCanvas::findPeakAtPosition_(QPoint p)
536 {
537 //no layers => return invalid peak index
538 if (layers_.empty())
539 {
540 return PeakIndex();
541 }
542 // mirror mode and p not on same half as active layer => return invalid peak index
543 if (mirror_mode_ && (getCurrentLayer().flipped ^ (p.y() > height() / 2)))
544 {
545 return PeakIndex();
546 }
547 recalculatePercentageFactor_(getCurrentLayerIndex());
548
549 RangeAllType search_area = unit_mapper_.fromXY(widgetToData(p - QPoint(2, 2)));
550 search_area.extend(unit_mapper_.fromXY(widgetToData(p + QPoint(2, 2))));
551 return getCurrentLayer().findClosestDataPoint(search_area);
552 }
553
554 //////////////////////////////////////////////////////////////////////////////////
555 // SLOTS

Callers

nothing calls this directly

Calls 7

getCurrentLayerIndexFunction · 0.85
fromXYMethod · 0.80
extendMethod · 0.80
PeakIndexClass · 0.50
QPointClass · 0.50
emptyMethod · 0.45
findClosestDataPointMethod · 0.45

Tested by

no test coverage detected