35 #ifndef OPENMS_VISUAL_SPECTRUM1DCANVAS_H 36 #define OPENMS_VISUAL_SPECTRUM1DCANVAS_H 39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> 100 virtual void showCurrentLayerPreferences();
103 virtual void saveCurrentLayer(
bool visible);
106 bool flippedLayersExist();
109 void flipLayer(
Size index);
112 bool mirrorModeActive();
115 void setMirrorModeActive(
bool b);
118 void dataToWidget(
const PeakType & peak, QPoint & point,
bool flipped =
false,
bool percentage =
true);
121 void dataToWidget(
double x,
double y, QPoint & point,
bool flipped =
false,
bool percentage =
false);
124 PointType widgetToData(
const QPoint & pos,
bool percentage =
false);
127 PointType widgetToData(
double x,
double y,
bool percentage =
false);
135 void drawAnnotations(
Size layer_index, QPainter & painter);
140 void performAlignment(
Size layer_index_1,
Size layer_index_2,
const Param & param);
143 void resetAlignment();
146 void drawAlignment(QPainter & painter);
149 Size getAlignmentSize();
152 double getAlignmentScore();
155 std::vector<std::pair<Size, Size> > getAlignedPeaksIndices();
158 void activateSpectrum(
Size index,
bool repaint =
true);
161 void setSwappedAxis(
bool swapped);
164 void setCurrentLayerPeakPenStyle(Qt::PenStyle ps);
167 void paint(QPainter * paint_device, QPaintEvent * e);
170 void showCurrentPeaksAs2D();
172 void showCurrentPeaksAs3D();
176 void activateLayer(
Size layer_index);
178 void removeLayer(
Size layer_index);
180 virtual void updateLayer(
Size i);
190 virtual void horizontalScrollBarChange(
int value);
195 void currentLayerParamtersChanged_();
199 bool finishAdding_();
202 void drawCoordinates_(QPainter & painter,
const PeakIndex & peak);
211 void changeVisibleArea_(
double lo,
double hi,
bool repaint =
true,
bool add_to_stack =
false);
214 void drawHighlightedPeak_(
Size layer_index,
const PeakIndex & peak, QPainter & painter,
bool draw_elongation =
false);
217 void drawDashedLine_(
const QPoint & from,
const QPoint & to, QPainter & painter);
220 void updatePercentageFactor_(
Size layer_index);
232 virtual void changeVisibleArea_(
const AreaType & new_area,
bool repaint =
true,
bool add_to_stack =
false);
234 virtual void recalculateSnapFactor_();
236 virtual void updateScrollbars_();
238 virtual void intensityModeChange_();
273 void addUserLabelAnnotation_(
const QPoint & screen_position);
275 void addLabelAnnotation_(
const QPoint & screen_position, QString label_text);
277 void addUserPeakAnnotation_(
PeakIndex near_peak);
280 void ensureAnnotationsWithinDataRange_();
284 void paintEvent(QPaintEvent * e);
285 void mousePressEvent(QMouseEvent * e);
286 void mouseReleaseEvent(QMouseEvent * e);
287 void mouseMoveEvent(QMouseEvent * e);
288 void keyPressEvent(QKeyEvent * e);
289 void contextMenuEvent(QContextMenuEvent * e);
293 virtual void zoomForward_();
295 virtual void zoom_(
int x,
int y,
bool zoom_in);
297 virtual void translateLeft_();
299 virtual void translateRight_();
301 virtual void paintGridLines_(QPainter & painter);
An abstract class acting as an interface for the different 1D annotation items.
Definition: Annotation1DItem.h:60
bool moving_annotations_
Indicates whether annotation items are just being moved on the canvas.
Definition: Spectrum1DCanvas.h:251
std::vector< DrawModes > draw_modes_
Draw modes (for each spectrum)
Definition: Spectrum1DCanvas.h:241
Size alignment_layer_2_
Layer index of the second alignment layer.
Definition: Spectrum1DCanvas.h:258
LabelMode
Label modes (percentage or absolute) of x axis and y axis.
Definition: Spectrum1DCanvas.h:73
DrawModes
Enumerate all available paint styles.
Definition: Spectrum1DCanvas.h:87
Definition: Spectrum1DCanvas.h:89
Definition: Spectrum1DCanvas.h:75
Base class for visualization canvas classes.
Definition: SpectrumCanvas.h:96
std::vector< Qt::PenStyle > peak_penstyle_
Draw style.
Definition: Spectrum1DCanvas.h:243
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
SpectrumType::PeakType PeakType
Peak type.
Definition: SpectrumCanvas.h:124
bool is_swapped_
is this widget showing data with swapped m/z and RT axis? (for drawCoordinates_ only) ...
Definition: Spectrum1DCanvas.h:267
bool show_alignment_
Indicates whether an alignment is currently visualized.
Definition: Spectrum1DCanvas.h:254
Size alignment_layer_1_
Layer index of the first alignment layer.
Definition: Spectrum1DCanvas.h:256
bool mirror_mode_
Indicates whether this widget is currently in mirror mode.
Definition: Spectrum1DCanvas.h:248
Canvas for visualization of one or several spectra.
Definition: Spectrum1DCanvas.h:66
Management and storage of parameters / INI files.
Definition: Param.h:75
double alignment_score_
Stores the score of the last alignment.
Definition: Spectrum1DCanvas.h:265
Definition: Spectrum1DCanvas.h:77
QPoint measurement_start_point_
start point of "ruler" for measure mode
Definition: Spectrum1DCanvas.h:246
std::vector< std::pair< double, double > > aligned_peaks_mz_delta_
Stores the alignment as MZ values of pairs of aligned peaks in both spectra.
Definition: Spectrum1DCanvas.h:260
std::vector< std::pair< Size, Size > > aligned_peaks_indices_
Stores the peak indices of pairs of aligned peaks in both spectra.
Definition: Spectrum1DCanvas.h:262
Definition: Spectrum1DCanvas.h:76
Index of a peak or feature.
Definition: PeakIndex.h:51