OpenMS
LayerStack Class Reference

#include <OpenMS/VISUAL/PlotCanvas.h>

Collaboration diagram for LayerStack:
[legend]

Public Member Functions

void addLayer (LayerDataBaseUPtr new_layer)
 
const LayerDataBasegetLayer (const Size index) const
 
LayerDataBasegetLayer (const Size index)
 
const LayerDataBasegetCurrentLayer () const
 
LayerDataBasegetCurrentLayer ()
 
void setCurrentLayer (Size index)
 throws Exception::IndexOverflow unless index is smaller than getLayerCount() More...
 
Size getCurrentLayerIndex () const
 
bool empty () const
 
Size getLayerCount () const
 
void removeLayer (Size layer_index)
 
void removeCurrentLayer ()
 

Protected Attributes

std::vector< LayerDataBaseUPtrlayers_
 

Private Attributes

Size current_layer_ = -1
 

Detailed Description

A class to manage a stack of layers as shown in the layer widget in TOPPView. The order of layers is automatically determined based on LayerDataBase::type (in short: peak data below, ID data on top).

Member Function Documentation

◆ addLayer()

void addLayer ( LayerDataBaseUPtr  new_layer)

adds a new layer and makes it the current layer

Parameters
new_layerTakes ownership of the layer!

◆ empty()

bool empty ( ) const

◆ getCurrentLayer() [1/2]

LayerDataBase& getCurrentLayer ( )

◆ getCurrentLayer() [2/2]

const LayerDataBase& getCurrentLayer ( ) const

◆ getCurrentLayerIndex()

Size getCurrentLayerIndex ( ) const

◆ getLayer() [1/2]

LayerDataBase& getLayer ( const Size  index)

◆ getLayer() [2/2]

const LayerDataBase& getLayer ( const Size  index) const

◆ getLayerCount()

Size getLayerCount ( ) const

◆ removeCurrentLayer()

void removeCurrentLayer ( )

◆ removeLayer()

void removeLayer ( Size  layer_index)

◆ setCurrentLayer()

void setCurrentLayer ( Size  index)

throws Exception::IndexOverflow unless index is smaller than getLayerCount()

Member Data Documentation

◆ current_layer_

Size current_layer_ = -1
private

◆ layers_

std::vector<LayerDataBaseUPtr> layers_
protected