Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Spectrum1DCanvas Class Reference
[Spectrum visualizaion widgets]

#include <OpenMS/VISUAL/Spectrum1DCanvas.h>

Inheritance diagram for Spectrum1DCanvas:

SpectrumCanvas QWidget DefaultParamHandler

List of all members.


Detailed Description

Canvas for visualization of one or several spectra.

Spectrum1DCanvas.png

The example image shows Spectrum1DCanvas displaying a raw data layer and a peak data layer.

Spectrum1DCanvas Parameters are explained on a separate page.

Public Types

enum  LabelMode { LM_XABSOLUTE_YABSOLUTE, LM_XPERCENT_YABSOLUTE, LM_XABSOLUTE_YPERCENT, LM_XPERCENT_YPERCENT }
 Label modes (percentage or absolut) of x axis and y axis. More...
enum  DrawModes { DM_PEAKS, DM_CONNECTEDLINES }
 Enumerate all avaiable paint styles. More...

Public Slots

void activateLayer (int layer_index)
 change the active layer (the one that is used for selecting and so on)
void removeLayer (int layer_index)
 removes the layer with index layer_index
Int finishAdding ()
 Finish adding data after call to addEmptyPeakLayer().
void setVisibleArea (DRange< 2 > range)
 Sets the visible area.
virtual void horizontalScrollBarChange (int value)
 Notifies the canvas that the horizontal scollbar has been moved.

Public Member Functions

 Spectrum1DCanvas (const Param &preferences, QWidget *parent=0)
 Default constructor.
virtual ~Spectrum1DCanvas ()
 Destructor.
void setPeakIcon (unsigned int index, unsigned int icon)
 Function to mark a peak with an icon.
std::vector< SpectrumIteratorTypegetSelectedPeaks ()
 Returns selected peaks.
DrawModes getDrawMode () const
 Returns the draw mode of the current layer.
void setDrawMode (DrawModes mode)
 Sets draw mode of the current layer.
virtual void showCurrentLayerPreferences ()
 Shows the preferences dialog of the active layer.
virtual void saveCurrentLayer (bool visible)
 Saves the current layer data.

Protected Member Functions

void changeVisibleArea_ (double lo, double hi, bool add_to_stack=false)
 Changes visible area interval.
void dataToWidget_ (const PeakType &peak, QPoint &point)
 Calls dataToWidget_(const PointType&, QPoint& point) but takes snap_factor_ and percentage_factor_ into account.
virtual void changeVisibleArea_ (const AreaType &new_area, bool add_to_stack=false)
 Sets the visible area.
virtual void currentLayerParamtersChanged_ ()
 Change of layer parameters.
virtual void recalculateSnapFactor_ ()
 REcalculates the intensity scaling factor for 'snap to maximum intensity mode'.
virtual void updateScrollbars_ ()
 Updates the scroll bars.
SpectrumIteratorType findPeakAtPosition_ (QPoint)
 Find peak next to the given position.
Reimplemented QT events


void paintEvent (QPaintEvent *e)
void mousePressEvent (QMouseEvent *e)
void mouseDoubleClickEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void wheelEvent (QWheelEvent *e)
void contextMenuEvent (QContextMenuEvent *e)

Protected Attributes

std::vector< SpectrumIteratorTypeselected_peaks_
 Array of selected peak iterators.
std::vector< DrawModesdraw_modes_
 Draw modes (for each spectrum).
SpectrumIteratorType selected_peak_
 Iterator on peak next to mouse position.
bool draw_metainfo_


Member Enumeration Documentation

enum LabelMode

Label modes (percentage or absolut) of x axis and y axis.

Enumerator:
LM_XABSOLUTE_YABSOLUTE 
LM_XPERCENT_YABSOLUTE 
LM_XABSOLUTE_YPERCENT 
LM_XPERCENT_YPERCENT 

enum DrawModes

Enumerate all avaiable paint styles.

Enumerator:
DM_PEAKS 
DM_CONNECTEDLINES 


Constructor & Destructor Documentation

Spectrum1DCanvas ( const Param preferences,
QWidget parent = 0 
)

Default constructor.

virtual ~Spectrum1DCanvas (  )  [virtual]

Destructor.


Member Function Documentation

void setPeakIcon ( unsigned int  index,
unsigned int  icon 
) [inline]

Function to mark a peak with an icon.

std::vector<SpectrumIteratorType> getSelectedPeaks (  ) 

Returns selected peaks.

The actual selected peaks are framed by the first and last peak

DrawModes getDrawMode (  )  const

Returns the draw mode of the current layer.

void setDrawMode ( DrawModes  mode  ) 

Sets draw mode of the current layer.

virtual void showCurrentLayerPreferences (  )  [virtual]

Shows the preferences dialog of the active layer.

Implements SpectrumCanvas.

virtual void saveCurrentLayer ( bool  visible  )  [virtual]

Saves the current layer data.

Parameters:
visible If true, only the visible data is stored. Otherwise the whole data is stored.

Implements SpectrumCanvas.

void activateLayer ( int  layer_index  )  [virtual, slot]

change the active layer (the one that is used for selecting and so on)

Implements SpectrumCanvas.

void removeLayer ( int  layer_index  )  [virtual, slot]

removes the layer with index layer_index

Implements SpectrumCanvas.

Int finishAdding (  )  [virtual, slot]

Finish adding data after call to addEmptyPeakLayer().

You can use this method instead of addLayer (add by copy). First call addEmptyPeakLayer(),then fill returned reference and finally call finishAdding(float).

Returns:
the index of the new layer

Implements SpectrumCanvas.

void setVisibleArea ( DRange< 2 >  range  )  [slot]

Sets the visible area.

Sets the visible area to a new value. Note that it does not emit visibleAreaChanged()

Parameters:
range the new visible area

Reimplemented from SpectrumCanvas.

virtual void horizontalScrollBarChange ( int  value  )  [virtual, slot]

Notifies the canvas that the horizontal scollbar has been moved.

Reimplement this slot to react on scrollbar events.

Reimplemented from SpectrumCanvas.

void changeVisibleArea_ ( double  lo,
double  hi,
bool  add_to_stack = false 
) [protected]

Changes visible area interval.

This method is for convenience only. It calls changeVisibleArea_(const AreaType&) .

void dataToWidget_ ( const PeakType peak,
QPoint &  point 
) [protected]

Calls dataToWidget_(const PointType&, QPoint& point) but takes snap_factor_ and percentage_factor_ into account.

virtual void changeVisibleArea_ ( const AreaType new_area,
bool  add_to_stack = false 
) [protected, virtual]

Sets the visible area.

Changes the visible area, adjustes the zoom stack and notifies interested clients about the change. If parts of the area are outside of the data area, the new area will be adjusted.

Parameters:
new_area The new visible area.
add_to_stack If the new area is to add to the zoom_stack_

Reimplemented from SpectrumCanvas.

virtual void currentLayerParamtersChanged_ (  )  [protected, virtual]

Change of layer parameters.

This method is called whenever the paramters of the current layer change. Reimplement if you need to react on such changes.

Reimplemented from SpectrumCanvas.

virtual void recalculateSnapFactor_ (  )  [protected, virtual]

REcalculates the intensity scaling factor for 'snap to maximum intensity mode'.

See also:
snap_factor_

Reimplemented from SpectrumCanvas.

virtual void updateScrollbars_ (  )  [protected, virtual]

Updates the scroll bars.

Updates the scrollbars after a change of the visible area.

Reimplemented from SpectrumCanvas.

SpectrumIteratorType findPeakAtPosition_ ( QPoint   )  [protected]

Find peak next to the given position.

void paintEvent ( QPaintEvent *  e  )  [protected]

void mousePressEvent ( QMouseEvent *  e  )  [protected]

void mouseDoubleClickEvent ( QMouseEvent *  e  )  [protected]

void mouseReleaseEvent ( QMouseEvent *  e  )  [protected]

void mouseMoveEvent ( QMouseEvent *  e  )  [protected]

void wheelEvent ( QWheelEvent *  e  )  [protected]

void contextMenuEvent ( QContextMenuEvent *  e  )  [protected]


Member Data Documentation

std::vector<SpectrumIteratorType> selected_peaks_ [protected]

Array of selected peak iterators.

std::vector<DrawModes> draw_modes_ [protected]

Draw modes (for each spectrum).

SpectrumIteratorType selected_peak_ [protected]

Iterator on peak next to mouse position.

bool draw_metainfo_ [protected]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:48 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1