OpenMS
Area< N_DIM > Class Template Reference

#include <OpenMS/KERNEL/DimMapper.h>

Inheritance diagram for Area< N_DIM >:
[legend]
Collaboration diagram for Area< N_DIM >:
[legend]

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

References Area< N_DIM >::setArea().

◆ 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

References Area< N_DIM >::setArea().

◆ 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

References Area< N_DIM >::setArea().

◆ 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.

References Area< N_DIM >::data_range_, Area< N_DIM >::mapper_, and Area< N_DIM >::visible_area_.

◆ operator==()

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

◆ 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

References Area< N_DIM >::data_range_, RangeManager< RangeBases >::pushInto(), and Area< N_DIM >::setArea().

◆ setArea() [1/2]

const Area& setArea ( const AreaXYType data)
inline

Set the area using axis data (X and Y)

Parameters
dataArea as displayed on the axis

References Area< N_DIM >::data_range_, Area< N_DIM >::mapper_, and Area< N_DIM >::visible_area_.

◆ setArea() [2/2]

const Area& setArea ( const RangeAllType data)
inline

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< N_DIM >::operator=(), Area< N_DIM >::operator==(), and Area< N_DIM >::setArea().

◆ visible_area_

AreaXYType visible_area_ = AreaXYType::empty
private