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

DRange Class Template Reference
[Datastructures]

#include <OpenMS/DATASTRUCTURES/DRange.h>

Inheritance diagram for DRange:

DIntervalBase

List of all members.


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 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>.
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 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.


Member Typedef Documentation

typedef Internal::DIntervalBase<D> Base

Base class type.

typedef Base::PositionType PositionType

Position type.

Reimplemented from DIntervalBase.

Reimplemented in GridCell.

typedef Base::CoordinateType CoordinateType

Coordinate type of the positions.

Reimplemented from DIntervalBase.

Reimplemented in GridCell.


Member Enumeration Documentation

anonymous enum

Dimensions.

Enumerator:
DIMENSION 

enum DRangeIntersection

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

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

Assignement operator.

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

Assignement operator for the base class.

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.

Parameters:
position The point's position.
Returns:
true if point lies inside this area.

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 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).

bool isEmpty (  )  const [inline]

Checks if the range is empty.


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:43 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1