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

Method mouseDoubleClickEvent

src/openms_gui/source/VISUAL/Plot2DCanvas.cpp:1446–1492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1444 }
1445
1446 void Plot2DCanvas::mouseDoubleClickEvent(QMouseEvent * e)
1447 {
1448 LayerDataBase& current_layer = getCurrentLayer();
1449 auto* lf = dynamic_cast<LayerDataFeature*>(&current_layer);
1450
1451 if (current_layer.modifiable && lf)
1452 {
1453 Feature tmp;
1454 if (selected_peak_.isValid()) //edit existing feature
1455 {
1456 FeatureEditDialog dialog(this);
1457 dialog.setFeature((*lf->getFeatureMap())[selected_peak_.peak]);
1458 if (dialog.exec())
1459 {
1460 tmp = dialog.getFeature();
1461 (*lf->getFeatureMap())[selected_peak_.peak] = tmp;
1462 }
1463 }
1464 else //create new feature
1465 {
1466 tmp.setRT(widgetToData_(e->pos())[1]);
1467 tmp.setMZ(widgetToData_(e->pos())[0]);
1468 FeatureEditDialog dialog(this);
1469 dialog.setFeature(tmp);
1470 if (dialog.exec())
1471 {
1472 tmp = dialog.getFeature();
1473 lf->getFeatureMap()->push_back(tmp);
1474 }
1475 }
1476
1477 // update gradient if the min/max intensity changes
1478 if (!lf->getFeatureMap()->getRange().containsIntensity(tmp.getIntensity()))
1479 {
1480 lf->getFeatureMap()->updateRanges();
1481 recalculateRanges_();
1482 intensityModeChange_();
1483 }
1484 else // just repaint to show the changes
1485 {
1486 update_buffer_ = true;
1487 update_(OPENMS_PRETTY_FUNCTION);
1488 }
1489
1490 modificationStatus_(getCurrentLayerIndex(), true);
1491 }
1492 }
1493
1494 void Plot2DCanvas::mergeIntoLayer(Size i, const FeatureMapSharedPtrType& map)
1495 {

Callers

nothing calls this directly

Calls 13

widgetToData_Function · 0.85
recalculateRanges_Function · 0.85
getCurrentLayerIndexFunction · 0.85
posMethod · 0.80
getRangeMethod · 0.80
isValidMethod · 0.45
setFeatureMethod · 0.45
getFeatureMethod · 0.45
setRTMethod · 0.45
setMZMethod · 0.45
push_backMethod · 0.45
getIntensityMethod · 0.45

Tested by

no test coverage detected