OpenMS
Loading...
Searching...
No Matches
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)
 

Public Member Functions

 Area ()=delete
 No default C'tor.
 
 Area (const DimMapper< N_DIM > *const dims)
 Custom C'tor with a mapper (non owning pointer)
 
 Area (const Area &range)=default
 Copy C'tor.
 
Areaoperator= (const Area &rhs)
 Assignment operator - which checks for identical DimMappers and throws otherwise.
 
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, ...)
 
const AreasetArea (const AreaXYType &data)
 Set the area using axis data (X and Y)
 
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.
 
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.
 
void pushInto (const RangeAllType &sandbox)
 Push the area into a sandbox (if its outside the sandbox). See UnitRange::pushInto()
 
void clear ()
 empty all dimensions
 

Private Attributes

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

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

template<int N_DIM>
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]

template<int N_DIM>
Area ( )
delete

No default C'tor.

◆ Area() [2/3]

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

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

◆ Area() [3/3]

template<int N_DIM>
Area ( const Area< N_DIM > &  range)
default

Copy C'tor.

Member Function Documentation

◆ clear()

template<int N_DIM>
void clear ( )
inline

empty all dimensions

References Area< N_DIM >::setArea().

◆ cloneWith() [1/2]

template<int N_DIM>
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
[in]dataNew area as displayed on the axis

References Area< N_DIM >::setArea().

◆ cloneWith() [2/2]

template<int N_DIM>
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
[in]dataNew area in units

References Area< N_DIM >::setArea().

◆ getAreaUnit()

template<int N_DIM>
const RangeAllType & getAreaUnit ( ) const
inline

◆ getAreaXY()

template<int N_DIM>
const AreaXYType & getAreaXY ( ) const
inline

◆ operator!=()

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

◆ operator=()

template<int N_DIM>
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==()

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

◆ pushInto()

template<int N_DIM>
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]

template<int N_DIM>
const Area & setArea ( const AreaXYType data)
inline

Set the area using axis data (X and Y)

Parameters
[in]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]

template<int N_DIM>
const Area & setArea ( const RangeAllType data)
inline

Member Data Documentation

◆ data_range_

◆ mapper_

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

◆ visible_area_

template<int N_DIM>
AreaXYType visible_area_ = AreaXYType::empty
private