Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

DRange< D > Class Template Reference
[Datastructures]

A D-dimensional half-open interval. More...

#include <OpenMS/DATASTRUCTURES/DRange.h>

Inheritance diagram for DRange< D >:
DIntervalBase< D >

List of all members.

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>
DRangeoperator= (const DRange &rhs)
 Assignement operator.
DRangeoperator= (const Base &rhs)
 Assignement operator for the base class.
 ~DRange ()
 Destuctor.
Predicates

bool operator== (const DRange &rhs) const
 Equality operator.
bool operator== (const Base &rhs) const
 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
DRange united (const DRange< D > &other_range) const
 Returns the smallest range containing this range and other_range.
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.

Detailed Description

template<UInt D>
class OpenMS::DRange< D >

A D-dimensional half-open interval.

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 minPosition() and maxPosition().

A range denotes a semi-open interval. A lower coordinate of each dimension is part the range, the higher coordinate is not.


Member Typedef Documentation

Base class type.

Coordinate type of the positions.

Reimplemented from DIntervalBase< D >.

Position type.

Reimplemented from DIntervalBase< D >.


Member Enumeration Documentation

anonymous enum

Dimensions.

Enumerator:
DIMENSION 

Types that describe the kind of intersection between two ranges.

Enumerator:
Disjoint 

No intersection.

Intersects 

Intersection.

Inside 

One contains the other.


Constructor & Destructor Documentation

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 ( const DRange< D > &  range  )  [inline]

Copy constructor.

DRange ( const Base range  )  [inline]

Copy constructor for the base class.

DRange ( CoordinateType  minx,
CoordinateType  miny,
CoordinateType  maxx,
CoordinateType  maxy 
) [inline]

Convenient constructor for DRange<2>

~DRange (  )  [inline]

Destuctor.


Member Function Documentation

bool encloses ( const PositionType position  )  const [inline]
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.

Parameters:
range The max_ range.
bool isEmpty (  )  const [inline]

Checks if the range is empty.

bool isIntersected ( const DRange< D > &  range  )  const [inline]

Checks whether this range intersects with another range.

Parameters:
range The max_ range.
Returns:
True if the areas intersect (i.e. they intersect or one contains the other).
DRange& operator= ( const DRange< D > &  rhs  )  [inline]

Assignement operator.

DRange& operator= ( const Base rhs  )  [inline]

Assignement operator for the base class.

bool operator== ( const Base rhs  )  const [inline]

Equality operator.

bool operator== ( const DRange< D > &  rhs  )  const [inline]

Equality operator.

DRange united ( const DRange< D > &  other_range  )  const [inline]

Returns the smallest range containing this range and other_range.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:52 using doxygen 1.7.1