35 #ifndef OPENMS_DATASTRUCTURES_DINTERVALBASE_H 36 #define OPENMS_DATASTRUCTURES_DINTERVALBASE_H 81 min_(PositionType::maxPositive()),
82 max_(PositionType::minNegative())
139 void setMin(PositionType
const& position)
154 void setMax(PositionType
const& position)
166 void setMinMax(PositionType
const& min, PositionType
const& max)
181 for (
UInt i = 0; i < std::min(D, D2); ++i)
241 inline CoordinateType
minX()
const 247 inline CoordinateType
minY()
const 253 inline CoordinateType
maxX()
const 259 inline CoordinateType
maxY()
const 319 if (min_[i] > max_[i])
321 std::swap(min_[i], max_[i]);
346 std::ostream& operator<<(std::ostream& os, const DIntervalBase<D>& rhs)
348 os <<
"--DIntervalBase BEGIN--" << std::endl;
349 os <<
"MIN --> " << rhs.
minPosition() << std::endl;
350 os <<
"MAX --> " << rhs.maxPosition() << std::endl;
351 os <<
"--DIntervalBase END--" << std::endl;
359 #endif // OPENMS_KERNEL_DINTERVALBASE_H DIntervalBase(const DIntervalBase &rhs)
Copy constructor.
Definition: DIntervalBase.h:87
void normalize_()
normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X]) ...
Definition: DIntervalBase.h:315
void setMaxX(CoordinateType const c)
Mutator for min_ coordinate of the larger point.
Definition: DIntervalBase.h:279
PositionType min_
lower left point
Definition: DIntervalBase.h:309
DIntervalBase(const std::pair< PositionType, PositionType > &pair)
Protected constructor for the construction of static instances.
Definition: DIntervalBase.h:327
~DIntervalBase()
Destructor.
Definition: DIntervalBase.h:102
void setMinY(CoordinateType const c)
Mutator for max_ coordinate of the smaller point.
Definition: DIntervalBase.h:272
CoordinateType maxX() const
Accessor for min_ coordinate maximum.
Definition: DIntervalBase.h:253
void setMin(PositionType const &position)
Mutator for minimum position.
Definition: DIntervalBase.h:139
DIntervalBase & operator=(const DIntervalBase &rhs)
Assignment operator.
Definition: DIntervalBase.h:94
void setMaxY(CoordinateType const c)
Mutator for max_ coordinate of the larger point.
Definition: DIntervalBase.h:286
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
CoordinateType height() const
Returns the height of the area i.e. the difference of dimension one (Y).
Definition: DIntervalBase.h:299
Definition: DIntervalBase.h:65
static DIntervalBase const zero
instance with all positions zero
Definition: DIntervalBase.h:233
void setMax(PositionType const &position)
Mutator for maximum position.
Definition: DIntervalBase.h:154
PositionType const & maxPosition() const
Accessor to maximum position.
Definition: DIntervalBase.h:128
DPosition< D > PositionType
Position type.
Definition: DIntervalBase.h:67
DIntervalBase()
Default constructor.
Definition: DIntervalBase.h:80
bool operator!=(const DIntervalBase &rhs) const
Equality operator.
Definition: DIntervalBase.h:199
PositionType center() const
Returns the center of the interval.
Definition: DIntervalBase.h:216
void assign(const DIntervalBase< D2 > rhs)
Assignment from a DIntervalBase of different dimensions.
Definition: DIntervalBase.h:179
static const DPosition zero()
all zero
Definition: DPosition.h:361
DIntervalBase(PositionType const &minimum, PositionType const &maximum)
This constructor sets min_ and max_ directly.
Definition: DIntervalBase.h:109
CoordinateType minY() const
Accessor for max_ coordinate minimum.
Definition: DIntervalBase.h:247
CoordinateType maxY() const
Accessor for max_ coordinate maximum.
Definition: DIntervalBase.h:259
CoordinateType width() const
Returns the width of the area i.e. the difference of dimension zero (X).
Definition: DIntervalBase.h:293
PositionType diagonal() const
Returns the diagonal of the area, i.e. max_ - min_.
Definition: DIntervalBase.h:225
PositionType max_
upper right point
Definition: DIntervalBase.h:312
A base class for D-dimensional interval.
Definition: DIntervalBase.h:56
CoordinateType minX() const
Accessor for min_ coordinate minimum.
Definition: DIntervalBase.h:241
void setMinX(CoordinateType const c)
Mutator for min_ coordinate of the smaller point.
Definition: DIntervalBase.h:265
void setMinMax(PositionType const &min, PositionType const &max)
Mutator for minimum and maximum position.
Definition: DIntervalBase.h:166
static DIntervalBase const empty
empty instance
Definition: DIntervalBase.h:231
bool operator==(const DIntervalBase &rhs) const
Equality operator.
Definition: DIntervalBase.h:193
void clear()
Make the interval empty.
Definition: DIntervalBase.h:205
PositionType::CoordinateType CoordinateType
Coordinate type of the positions.
Definition: DIntervalBase.h:69
PositionType const & minPosition() const
Accessor to minimum position.
Definition: DIntervalBase.h:122