OpenMS  3.0.0
Area< N_DIM > Class Template Reference

#include <OpenMS/KERNEL/DimMapper.h>

Public Types

using AreaXYType = DRange< N_DIM >
 The Area in X,Y,(Z)... dimension (number of dimensions depends on N_DIM) More...
 

Public Member Functions

 Area ()=delete
 No default C'tor. More...
 
 Area (const DimMapper< N_DIM > *const dims)
 Custom C'tor with a mapper (non owning pointer) More...
 
 Area (const Area &range)=default
 Copy C'tor. More...
 
Areaoperator= (const Area &rhs)
 Assignment operator - which checks for identical DimMappers and throws otherwise. More...
 
bool operator== (const Area &rhs) const
 
bool operator!= (const Area &rhs) const
 
const AreasetArea (const RangeAllType &data)
 Set the area using unit data (RT, m/z, ...) More...
 
const AreasetArea (const AreaXYType &data)
 Set the area using axis data (X and Y) More...
 
const AreaXYTypegetAreaXY () const
 
const RangeAllTypegetAreaUnit () const
 
Area cloneWith (const AreaXYType &data) const
 Clone the current object, set the area of the clone using axis data (X and Y) and return the clone. More...
 
Area cloneWith (const RangeAllType &data) const
 Clone the current object, set the area of the clone using unit data (RT, m/z, ...) and return the clone. More...
 
void pushInto (const RangeAllType &sandbox)
 Push the area into a sandbox (if its outside the sandbox). See UnitRange::pushInto() More...
 
void clear ()
 empty all dimensions More...
 

Private Attributes

RangeAllType data_range_
 range in units More...
 
AreaXYType visible_area_ = AreaXYType::empty
 
const DimMapper< N_DIM > * mapper_
 and a mapper (non-owning pointer) to translate between the two More...
 

Detailed Description

template<int N_DIM>
class OpenMS::Area< N_DIM >

The data is stored in two members, one axis-related (X and Y; unit does not matter), and one unit-related (units; no mapping to axis) You can set either, and the other will be updated accordingly as long as you provide a DimMapper which translates between the two representations.

Member Typedef Documentation

◆ AreaXYType

using AreaXYType = DRange<N_DIM>

The Area in X,Y,(Z)... dimension (number of dimensions depends on N_DIM)

Constructor & Destructor Documentation

◆ Area() [1/3]

Area ( )
delete

No default C'tor.

◆ Area() [2/3]

Area ( const DimMapper< N_DIM > *const  dims)
inline

Custom C'tor with a mapper (non owning pointer)

◆ Area() [3/3]

Area ( const Area< N_DIM > &  range)
default

Copy C'tor.

Member Function Documentation

◆ clear()

void clear ( )
inline

empty all dimensions

◆ cloneWith() [1/2]

Area cloneWith ( const AreaXYType data) const
inline

Clone the current object, set the area of the clone using axis data (X and Y) and return the clone.

Parameters
dataNew area as displayed on the axis

◆ cloneWith() [2/2]

Area cloneWith ( const RangeAllType data) const
inline

Clone the current object, set the area of the clone using unit data (RT, m/z, ...) and return the clone.

Parameters
dataNew area in units

◆ getAreaUnit()

const RangeAllType& getAreaUnit ( ) const
inline

◆ getAreaXY()

const AreaXYType& getAreaXY ( ) const
inline

◆ operator!=()

bool operator!= ( const Area< N_DIM > &  rhs) const
inline

◆ operator=()

Area& operator= ( const Area< N_DIM > &  rhs)
inline

Assignment operator - which checks for identical DimMappers and throws otherwise.

◆ operator==()

bool operator== ( const Area< N_DIM > &  rhs) const
inline

Referenced by Area< 2 >::operator!=().

◆ pushInto()

void pushInto ( const RangeAllType sandbox)
inline

Push the area into a sandbox (if its outside the sandbox). See UnitRange::pushInto()

Parameters
sandboxThe sandbox which delimits the range of this area

◆ setArea() [1/2]

const Area& setArea ( const RangeAllType data)
inline

Set the area using unit data (RT, m/z, ...)

Parameters
dataArea in units

Referenced by Area< 2 >::clear(), Area< 2 >::cloneWith(), PlotCanvas::getPixelRange(), and Area< 2 >::pushInto().

◆ setArea() [2/2]

const Area& setArea ( const AreaXYType data)
inline

Set the area using axis data (X and Y)

Parameters
dataArea as displayed on the axis

Member Data Documentation

◆ data_range_

◆ mapper_

const DimMapper<N_DIM>* mapper_
private

and a mapper (non-owning pointer) to translate between the two

Referenced by Area< 2 >::operator=(), Area< 2 >::operator==(), and Area< 2 >::setArea().

◆ visible_area_

AreaXYType visible_area_ = AreaXYType::empty
private

range in terms of axis (X and Y axis)

Referenced by Area< 2 >::getAreaXY(), Area< 2 >::operator=(), Area< 2 >::operator==(), and Area< 2 >::setArea().