36 #ifndef OPENMS_VISUAL_SPECTRUM2DCANVAS_H
37 #define OPENMS_VISUAL_SPECTRUM2DCANVAS_H
80 virtual void showCurrentLayerPreferences();
83 virtual void saveCurrentLayer(
bool visible);
92 void mergeIntoLayer(
Size i, std::vector<PeptideIdentification>& peptides);
95 void recalculateCurrentLayerDotGradient();
103 void showProjectionInfo(
int,
double,
double);
105 void toggleProjections();
107 void showSpectrumAs1D(
int index);
108 void showSpectrumAs1D(std::vector<
int, std::allocator<int> > indices);
110 void showCurrentPeaksAs3D();
114 void activateLayer(
Size layer_index);
116 void removeLayer(
Size layer_index);
118 virtual void updateLayer(
Size i);
120 virtual void horizontalScrollBarChange(
int value);
122 virtual void verticalScrollBarChange(
int value);
133 void updateProjections();
138 void currentLayerParametersChanged_();
142 bool finishAdding_();
145 void drawCoordinates_(QPainter& painter,
const PeakIndex& peak);
151 void mousePressEvent(QMouseEvent* e);
152 void mouseReleaseEvent(QMouseEvent* e);
153 void mouseMoveEvent(QMouseEvent* e);
154 void paintEvent(QPaintEvent* e);
155 void contextMenuEvent(QContextMenuEvent* e);
156 void keyPressEvent(QKeyEvent* e);
157 void keyReleaseEvent(QKeyEvent* e);
158 void mouseDoubleClickEvent(QMouseEvent* e);
162 virtual void updateScrollbars_();
172 void paintDots_(
Size layer_index, QPainter& p);
174 void paintAllIntensities_(
Size layer_index,
DoubleReal pen_width, QPainter& painter);
187 void paintMaximumIntensities_(
Size layer_index,
Size rt_pixel_count,
Size mz_pixel_count, QPainter& p);
195 void paintPrecursorPeaks_(
Size layer_index, QPainter& painter);
203 void paintFeatureData_(
Size layer_index, QPainter& p);
211 void paintTraceConvexHulls_(
Size layer_index, QPainter& p);
219 void paintFeatureConvexHulls_(
Size layer_index, QPainter& p);
227 void paintIdentifications_(
Size layer_index, QPainter& p);
235 void paintConsensusElements_(
Size layer_index, QPainter& p);
245 void paintConsensusElement_(
Size layer_index,
const ConsensusFeature& cf, QPainter& p,
bool use_buffer);
261 void paintConvexHulls_(
const std::vector<ConvexHull2D>& hulls,
bool hasIdentifications, QPainter& p);
264 virtual void intensityModeChange_();
266 virtual void recalculateSnapFactor_();
281 switch (intensity_mode_)
288 gradientPos = val * percentage_factor_;
292 gradientPos = val * snap_factor;
296 gradientPos = std::log(val + 1);
327 point.setX(
int((y - visible_area_.minY()) / visible_area_.height() * width()));
328 point.setY(height() -
int((x - visible_area_.minX()) / visible_area_.width() * height()));
332 point.setX(
int((x - visible_area_.minX()) / visible_area_.width() * width()));
333 point.setY(height() -
int((y - visible_area_.minY()) / visible_area_.height() * height()));
338 void recalculateDotGradient_(
Size layer);
341 void highlightPeak_(QPainter& p,
const PeakIndex& peak);
344 PeakIndex findNearestPeak_(
const QPoint& pos);
347 void paintIcon_(
const QPoint& pos,
const QRgb& color,
const String& icon,
Size s, QPainter& p)
const;
358 virtual void translateLeft_();
360 virtual void translateRight_();
362 virtual void translateForward_();
364 virtual void translateBackward_();
367 void finishContextMenu_(QMenu* context_menu, QMenu* settings_menu);
LayerData::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: SpectrumCanvas.h:107
float Real
Real type.
Definition: Types.h:109
A more convenient string class.
Definition: String.h:56
PeakIndex measurement_start_
start peak/feature of measuring mode
Definition: Spectrum2DCanvas.h:352
DrawModes
Enumerate all avaiable paint styles.
Definition: Spectrum1DCanvas.h:84
LayerData::ConsensusMapSharedPtrType ConsensusMapSharedPtrType
Main managed data type (consensus features)
Definition: SpectrumCanvas.h:115
Base class for visualization canvas classes.
Definition: SpectrumCanvas.h:94
QColor heightColor_(Real val, const MultiGradient &gradient, DoubleReal snap_factor)
Returns the color associated with val for the gradient gradient.
Definition: Spectrum2DCanvas.h:310
Canvas for 2D-visualization of peak map, feature map and consensus map data.
Definition: Spectrum2DCanvas.h:67
Int precalculatedColorIndex_(Real val, const MultiGradient &gradient, DoubleReal snap_factor)
Returns the position on color gradient associated with given intensity.
Definition: Spectrum2DCanvas.h:278
void dataToWidget_(DoubleReal x, DoubleReal y, QPoint &point)
Convert chart to widget coordinates.
Definition: Spectrum2DCanvas.h:323
Management and storage of parameters / INI files.
Definition: Param.h:69
ExperimentType projection_rt_
RT projection data.
Definition: Spectrum2DCanvas.h:271
Int precalculatedColorIndex(DoubleReal position) const
index of color in precalculated table by position in gradient
Definition: MultiGradient.h:134
LayerData::FeatureMapSharedPtrType FeatureMapSharedPtrType
Main managed data type (features)
Definition: SpectrumCanvas.h:111
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
ExperimentType projection_mz_
m/z projection data
Definition: Spectrum2DCanvas.h:269
QColor precalculatedColorByIndex(Int index) const
precalculated color by its index in the table
Definition: MultiGradient.h:145
PeakIndex selected_peak_
the nearest peak/feature to the mouse cursor
Definition: Spectrum2DCanvas.h:350
A gradient of multiple colors and arbitrary distances between colors.
Definition: MultiGradient.h:65
int Int
Signed integer type.
Definition: Types.h:100
Not implemented exception.
Definition: Exception.h:437
A 2-dimensional consensus feature.
Definition: ConsensusFeature.h:59
Index of a peak or feature.
Definition: PeakIndex.h:51