#include <OpenMS/DATASTRUCTURES/DRange.h>
This class describes a range in D-dimensional space delimited by two points (i.e. a D-dimensional hyper-rectangle). The two points define the lower left and the upper right corner in 2D and analogous points in higer dimensions.
A range is a pair of positions in D-space represented by DPosition. The two limiting points are accessed as min() and max().
A range denotes a semi-open interval. A lower coordinate of each dimension is part the range, the higher coordinate is not.
Public Types | |
Type definitions | |
enum | { DIMENSION = D } |
Dimensions. More... | |
enum | DRangeIntersection { Disjoint, Intersects, Inside } |
Types that describe the kind of intersection between two ranges. More... | |
typedef Internal::DIntervalBase< D > | Base |
Base class type. | |
typedef Base::PositionType | PositionType |
Position type. | |
typedef Base::CoordinateType | CoordinateType |
Coordinate type of the positions. | |
Public Member Functions | |
Constructors and Destructor | |
DRange () | |
Default constructor. | |
DRange (const PositionType &lower, const PositionType &upper) | |
Constructor that takes two Points and constructs a range. | |
DRange (const DRange &range) | |
Copy constructor. | |
DRange (const Base &range) | |
Copy constructor for the base class. | |
DRange (CoordinateType minx, CoordinateType miny, CoordinateType maxx, CoordinateType maxy) | |
Convenient constructor for DRange<2>. | |
DRange & | operator= (const DRange &rhs) |
Assignement operator. | |
DRange & | operator= (const Base &rhs) |
Assignement operator for the base class. | |
~DRange () | |
Destuctor. | |
Predicates | |
bool | operator== (const DRange &rhs) const throw () |
Equality operator. | |
bool | operator== (const Base &rhs) const throw () |
Equality operator. | |
bool | encloses (const PositionType &position) const |
Checks whether this range contains a certain point. | |
bool | encloses (CoordinateType x, CoordinateType y) const |
2D-version of encloses for convenience only | |
DRangeIntersection | intersects (const DRange &range) const |
Checks how this range intersects with another range . | |
bool | isIntersected (const DRange &range) const |
Checks whether this range intersects with another range . | |
bool | isEmpty () const |
Checks if the range is empty. |
typedef Internal::DIntervalBase<D> Base |
Base class type.
typedef Base::PositionType PositionType |
typedef Base::CoordinateType CoordinateType |
enum DRangeIntersection |
DRange | ( | ) | [inline] |
Default constructor.
Creates a range with all coordinates zero.
DRange | ( | const PositionType & | lower, | |
const PositionType & | upper | |||
) | [inline] |
Constructor that takes two Points and constructs a range.
DRange | ( | CoordinateType | minx, | |
CoordinateType | miny, | |||
CoordinateType | maxx, | |||
CoordinateType | maxy | |||
) | [inline] |
Convenient constructor for DRange<2>.
~DRange | ( | ) | [inline] |
Destuctor.
bool operator== | ( | const DRange< D > & | rhs | ) | const throw () [inline] |
Equality operator.
bool operator== | ( | const Base & | rhs | ) | const throw () [inline] |
Equality operator.
bool encloses | ( | const PositionType & | position | ) | const [inline] |
Checks whether this range contains a certain point.
position | The point's position. |
bool encloses | ( | CoordinateType | x, | |
CoordinateType | y | |||
) | const [inline] |
2D-version of encloses for convenience only
DRangeIntersection intersects | ( | const DRange< D > & | range | ) | const [inline] |
Checks how this range intersects with another range
.
range | The max_ range. |
bool isIntersected | ( | const DRange< D > & | range | ) | const [inline] |
Checks whether this range intersects with another range
.
range | The max_ range. |
bool isEmpty | ( | ) | const [inline] |
Checks if the range is empty.
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |