OpenMS
2.8.0
|
A base class for D-dimensional interval. More...
#include <OpenMS/DATASTRUCTURES/DIntervalBase.h>
Public Types | |
Type definitions | |
enum | { DIMENSION = D } |
Dimensions. More... | |
typedef DPosition< D > | PositionType |
Position type. More... | |
typedef PositionType::CoordinateType | CoordinateType |
Coordinate type of the positions. More... | |
Public Member Functions | |
Constructors and Destructor | |
DIntervalBase () | |
Default constructor. More... | |
DIntervalBase (const DIntervalBase &rhs) | |
Copy constructor. More... | |
DIntervalBase (DIntervalBase &&) noexcept=default | |
Move constructor. More... | |
DIntervalBase & | operator= (const DIntervalBase &rhs) |
Assignment operator. More... | |
~DIntervalBase () | |
Destructor. More... | |
DIntervalBase (PositionType const &minimum, PositionType const &maximum) | |
This constructor sets min_ and max_ directly. More... | |
Accessors | |
PositionType const & | minPosition () const |
Accessor to minimum position. More... | |
PositionType const & | maxPosition () const |
Accessor to maximum position. More... | |
void | setMin (PositionType const &position) |
Mutator for minimum position. More... | |
void | setMax (PositionType const &position) |
Mutator for maximum position. More... | |
void | setMinMax (PositionType const &min, PositionType const &max) |
Mutator for minimum and maximum position. More... | |
template<UInt D2> | |
void | assign (const DIntervalBase< D2 > rhs) |
Assignment from a DIntervalBase of different dimensions. More... | |
Predicates | |
bool | operator== (const DIntervalBase &rhs) const |
Equality operator. More... | |
bool | operator!= (const DIntervalBase &rhs) const |
Equality operator. More... | |
void | clear () |
Make the interval empty. More... | |
Misc | |
static DIntervalBase const | empty = DIntervalBase<D>(std::make_pair(DIntervalBase<D>::PositionType::maxPositive(), DIntervalBase<D>::PositionType::minNegative())) |
empty instance More... | |
static DIntervalBase const | zero = DIntervalBase<D>(DIntervalBase<D>::PositionType::zero(), DIntervalBase<D>::PositionType::zero()) |
instance with all positions zero More... | |
PositionType | center () const |
Returns the center of the interval. More... | |
PositionType | diagonal () const |
Returns the diagonal of the area, i.e. max_ - min_. More... | |
Accessors for 2D-intervals (for convenience) | |
PositionType | min_ |
lower left point More... | |
PositionType | max_ |
upper right point More... | |
CoordinateType | minX () const |
Accessor for min_ coordinate minimum. More... | |
CoordinateType | minY () const |
Accessor for max_ coordinate minimum. More... | |
CoordinateType | maxX () const |
Accessor for min_ coordinate maximum. More... | |
CoordinateType | maxY () const |
Accessor for max_ coordinate maximum. More... | |
void | setMinX (CoordinateType const c) |
Mutator for min_ coordinate of the smaller point. More... | |
void | setMinY (CoordinateType const c) |
Mutator for max_ coordinate of the smaller point. More... | |
void | setMaxX (CoordinateType const c) |
Mutator for min_ coordinate of the larger point. More... | |
void | setMaxY (CoordinateType const c) |
Mutator for max_ coordinate of the larger point. More... | |
CoordinateType | width () const |
Returns the width of the area i.e. the difference of dimension zero (X). More... | |
CoordinateType | height () const |
Returns the height of the area i.e. the difference of dimension one (Y). More... | |
void | normalize_ () |
normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X]) More... | |
DIntervalBase (const std::pair< PositionType, PositionType > &pair) | |
Protected constructor for the construction of static instances. More... | |
A base class for D-dimensional interval.
See DIntervalBase for a closed interval and DRange for a half-open interval class.
typedef PositionType::CoordinateType CoordinateType |
Coordinate type of the positions.
typedef DPosition<D> PositionType |
Position type.
|
inline |
Default constructor.
Creates an empty interval with corners at infinity.
|
inline |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
inline |
Destructor.
|
inline |
This constructor sets min_ and max_ directly.
References DIntervalBase< D >::normalize_().
|
inlineprotected |
Protected constructor for the construction of static instances.
|
inline |
Assignment from a DIntervalBase of different dimensions.
Only the dimensions 0 upto min(D,D2)-1 are copied.
References DIntervalBase< D >::max_, DIntervalBase< D >::maxPosition(), DIntervalBase< D >::min_, and DIntervalBase< D >::minPosition().
|
inline |
Returns the center of the interval.
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Make the interval empty.
References DIntervalBase< D >::empty.
|
inline |
Returns the diagonal of the area, i.e. max_ - min_.
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Returns the height of the area i.e. the difference of dimension one (Y).
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Accessor to maximum position.
References DIntervalBase< D >::max_.
Referenced by DIntervalBase< D >::assign(), GridBasedClustering< Metric >::cluster(), DBoundingBox< D >::operator<<(), OpenMS::Internal::operator<<(), and DRange< D >::united().
|
inline |
Accessor for min_ coordinate maximum.
References DIntervalBase< D >::max_.
|
inline |
Accessor for max_ coordinate maximum.
References DIntervalBase< D >::max_.
Referenced by GridBasedClustering< Metric >::removeSmallClustersY().
|
inline |
Accessor to minimum position.
References DIntervalBase< D >::min_.
Referenced by DIntervalBase< D >::assign(), GridBasedClustering< Metric >::cluster(), DBoundingBox< D >::operator<<(), OpenMS::Internal::operator<<(), and DRange< D >::united().
|
inline |
Accessor for min_ coordinate minimum.
References DIntervalBase< D >::min_.
|
inline |
Accessor for max_ coordinate minimum.
References DIntervalBase< D >::min_.
Referenced by GridBasedClustering< Metric >::removeSmallClustersY().
|
inlineprotected |
normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X])
References DIntervalBase< D >::DIMENSION, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
Referenced by DIntervalBase< D >::DIntervalBase(), and DIntervalBase< D >::setMinMax().
|
inline |
Equality operator.
References DIntervalBase< D >::operator==().
|
inline |
Assignment operator.
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
Referenced by DBoundingBox< D >::operator=(), and DRange< D >::operator=().
|
inline |
Equality operator.
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
Referenced by DIntervalBase< D >::operator!=(), DBoundingBox< D >::operator==(), and DRange< D >::operator==().
|
inline |
Mutator for maximum position.
References DIntervalBase< D >::DIMENSION, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Mutator for min_ coordinate of the larger point.
References OpenMS::Constants::c, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Mutator for max_ coordinate of the larger point.
References OpenMS::Constants::c, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Mutator for minimum position.
References DIntervalBase< D >::DIMENSION, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Mutator for minimum and maximum position.
References DIntervalBase< D >::max_, DIntervalBase< D >::min_, and DIntervalBase< D >::normalize_().
Referenced by DRange< D >::united().
|
inline |
Mutator for min_ coordinate of the smaller point.
References OpenMS::Constants::c, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Mutator for max_ coordinate of the smaller point.
References OpenMS::Constants::c, DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
inline |
Returns the width of the area i.e. the difference of dimension zero (X).
References DIntervalBase< D >::max_, and DIntervalBase< D >::min_.
|
static |
empty instance
Referenced by DIntervalBase< D >::clear().
|
protected |
upper right point
Referenced by DIntervalBase< D >::assign(), DIntervalBase< D >::center(), DIntervalBase< D >::diagonal(), DIntervalBase< D >::height(), DIntervalBase< D >::maxPosition(), DIntervalBase< D >::maxX(), DIntervalBase< D >::maxY(), DIntervalBase< D >::normalize_(), DIntervalBase< D >::operator=(), DIntervalBase< D >::operator==(), DIntervalBase< D >::setMax(), DIntervalBase< D >::setMaxX(), DIntervalBase< D >::setMaxY(), DIntervalBase< D >::setMin(), DIntervalBase< D >::setMinMax(), DIntervalBase< D >::setMinX(), DIntervalBase< D >::setMinY(), and DIntervalBase< D >::width().
|
protected |
lower left point
Referenced by DIntervalBase< D >::assign(), DIntervalBase< D >::center(), DIntervalBase< D >::diagonal(), DIntervalBase< D >::height(), DIntervalBase< D >::minPosition(), DIntervalBase< D >::minX(), DIntervalBase< D >::minY(), DIntervalBase< D >::normalize_(), DIntervalBase< D >::operator=(), DIntervalBase< D >::operator==(), DIntervalBase< D >::setMax(), DIntervalBase< D >::setMaxX(), DIntervalBase< D >::setMaxY(), DIntervalBase< D >::setMin(), DIntervalBase< D >::setMinMax(), DIntervalBase< D >::setMinX(), DIntervalBase< D >::setMinY(), and DIntervalBase< D >::width().
|
static |
instance with all positions zero