35 #ifndef OPENMS_DATASTRUCTURES_DBOUNDINGBOX_H 36 #define OPENMS_DATASTRUCTURES_DBOUNDINGBOX_H 111 DBoundingBox(
const PositionType& minimum,
const PositionType& maximum) :
112 Base(minimum, maximum)
132 void enlarge(CoordinateType x, CoordinateType y)
164 if (position[i] <
min_[i] || position[i] >
max_[i])
173 bool encloses(CoordinateType x, CoordinateType y)
const 185 if (bounding_box.
min_[i] >
max_[i])
return false;
187 if (bounding_box.
max_[i] <
min_[i])
return false;
195 for (
UInt i = 0; i != D; i++)
215 std::ostream& operator<<(std::ostream& os, const DBoundingBox<D>& bounding_box)
217 os <<
"--DBOUNDINGBOX BEGIN--" << std::endl;
218 os <<
"MIN --> " << bounding_box.minPosition() << std::endl;
219 os <<
"MAX --> " << bounding_box.maxPosition() << std::endl;
220 os <<
"--DBOUNDINGBOX END--" << std::endl;
226 #endif // OPENMS_KERNEL_DBOUNDINGBOX_H Internal::DIntervalBase< D > Base
Base class type.
Definition: DBoundingBox.h:65
PositionType min_
lower left point
Definition: DIntervalBase.h:309
void enlarge(const PositionType &p)
Enlarges the bounding box such that it contains a position.
Definition: DBoundingBox.h:122
Definition: DBoundingBox.h:63
DIntervalBase & operator=(const DIntervalBase &rhs)
Assignment operator.
Definition: DIntervalBase.h:94
DBoundingBox & operator=(const Base &rhs)
Assignment operator for the base class.
Definition: DBoundingBox.h:99
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
DBoundingBox()
Default constructor.
Definition: DBoundingBox.h:80
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool intersects(const DBoundingBox &bounding_box) const
Definition: DBoundingBox.h:181
Base::PositionType PositionType
Position type.
Definition: DBoundingBox.h:67
bool encloses(CoordinateType x, CoordinateType y) const
2D-version encloses(x,y) is for convenience only
Definition: DBoundingBox.h:173
DBoundingBox & operator=(const DBoundingBox &rhs)
Assignment operator.
Definition: DBoundingBox.h:92
bool isEmpty() const
Test if bounding box is empty.
Definition: DBoundingBox.h:193
bool operator==(const Base &rhs) const
Equality operator.
Definition: DBoundingBox.h:149
bool operator==(const DBoundingBox &rhs) const
Equality operator.
Definition: DBoundingBox.h:143
PositionType max_
upper right point
Definition: DIntervalBase.h:312
A base class for D-dimensional interval.
Definition: DIntervalBase.h:56
DBoundingBox(const DBoundingBox &rhs)
Copy constructor.
Definition: DBoundingBox.h:86
bool encloses(const PositionType &position) const
Checks whether this range contains a certain point.
Definition: DBoundingBox.h:160
~DBoundingBox()
Destructor.
Definition: DBoundingBox.h:106
Base::CoordinateType CoordinateType
Coordinate type of the positions.
Definition: DBoundingBox.h:69
void enlarge(CoordinateType x, CoordinateType y)
Enlarges the bounding box such that it contains a position specified by two coordinates.
Definition: DBoundingBox.h:132
A D-dimensional bounding box.
Definition: DBoundingBox.h:52
DBoundingBox(const PositionType &minimum, const PositionType &maximum)
Constructor from two positions.
Definition: DBoundingBox.h:111
bool operator==(const DIntervalBase &rhs) const
Equality operator.
Definition: DIntervalBase.h:193