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

DIntervalBase Class Template Reference

#include <OpenMS/DATASTRUCTURES/DIntervalBase.h>

Inheritance diagram for DIntervalBase:

DBoundingBox DRange DRange< 2 > GridCell

List of all members.


Detailed Description

template<UInt D>
class OpenMS::Internal::DIntervalBase< D >

A base class for D-dimensional interval.

See DIntervalBase for a closed interval and DRange for a half-open interval class.

Invariant:
All methods maintain the invariant that min() is geometrically less or equal max() i.e. min()[x] <= max()[x].

Misc



static DIntervalBase const empty = DIntervalBase<D>(std::make_pair(DIntervalBase<D>::PositionType::max, DIntervalBase<D>::PositionType::min_negative))
 empty instance
static DIntervalBase const zero
 instance with all positions zero
PositionType center () const
 Returns the center of the interval.
PositionType diagonal () const
 Returns the diagonal of the area, i.e. max_ - min_.

Public Types

Type definitions
enum  { DIMENSION = D }
 Dimensions. More...
typedef DPosition< D > PositionType
 Position type.
typedef
PositionType::CoordinateType 
CoordinateType
 Coordinate type of the positions.

Public Member Functions

Constructors and Destructor


 DIntervalBase ()
 Default constructor.
 DIntervalBase (const DIntervalBase &rhs)
 Copy constructor.
DIntervalBaseoperator= (const DIntervalBase &rhs)
 Assignment operator.
 ~DIntervalBase ()
 Destructor.
 DIntervalBase (PositionType const &minimum, PositionType const &maximum)
 This constructor sets min_ and max_ directly.
Accessors


PositionType const & min () const
 Accessor to minimum position.
PositionType const & max () const
 Accessor to maximum position.
void setMin (PositionType const &position)
 Mutator for minimum position.
void setMax (PositionType const &position)
 Mutator for maximum position.
void setMinMax (PositionType const &min, PositionType const &max)
 Mutator for minimum and maximum position.
template<UInt D2>
void assign (const DIntervalBase< D2 > rhs)
 Assignment from a DIntervalBase of different dimensions.
Predicates


bool operator== (const DIntervalBase &rhs) const throw ()
 Equality operator.
bool operator!= (const DIntervalBase &rhs) const throw ()
 Equality operator.
void clear ()
 Make the interval empty.
Accessors for 2D-intervals (for convenience)


CoordinateType minX () const
 Accessor for min_ coordinate minimum.
CoordinateType minY () const
 Accessor for max_ coordinate minimum.
CoordinateType maxX () const
 Accessor for min_ coordinate maximum.
CoordinateType maxY () const
 Accessor for max_ coordinate maximum.
void setMinX (CoordinateType const c)
 Mutator for min_ coordinate of the smaller point.
void setMinY (CoordinateType const c)
 Mutator for max_ coordinate of the smaller point.
void setMaxX (CoordinateType const c)
 Mutator for min_ coordinate of the larger point.
void setMaxY (CoordinateType const c)
 Mutator for max_ coordinate of the larger point.
CoordinateType width () const
 Returns the width of the area i.e. the difference of dimension zero (X).
CoordinateType height () const
 Returns the height of the area i.e. the difference of dimension one (Y).

Protected Member Functions

void normalize_ ()
 normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X])
 DIntervalBase (const std::pair< PositionType, PositionType > &pair)
 Protected constructor for the construction of static instances.

Protected Attributes

PositionType min_
 lower left point
PositionType max_
 upper right point

Member Typedef Documentation

typedef DPosition<D> PositionType

Position type.

Reimplemented in GridCell, DBoundingBox, DRange, DRange< 1 >, DRange< 2 >, and DRange< 3 >.

typedef PositionType::CoordinateType CoordinateType

Coordinate type of the positions.

Reimplemented in GridCell, DBoundingBox, DRange, DRange< 1 >, DRange< 2 >, and DRange< 3 >.


Member Enumeration Documentation

anonymous enum

Dimensions.

Enumerator:
DIMENSION 


Constructor & Destructor Documentation

DIntervalBase (  )  [inline]

Default constructor.

Creates an empty interval with corners at infinity.

DIntervalBase ( const DIntervalBase< D > &  rhs  )  [inline]

Copy constructor.

~DIntervalBase (  )  [inline]

Destructor.

DIntervalBase ( PositionType const &  minimum,
PositionType const &  maximum 
) [inline]

This constructor sets min_ and max_ directly.

DIntervalBase ( const std::pair< PositionType, PositionType > &  pair  )  [inline, protected]

Protected constructor for the construction of static instances.


Member Function Documentation

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

Assignment operator.

PositionType const& min (  )  const [inline]

Accessor to minimum position.

PositionType const& max (  )  const [inline]

Accessor to maximum position.

void setMin ( PositionType const &  position  )  [inline]

Mutator for minimum position.

Note:
The minimum position given here will be returned my min() after the method. If necessary the value returned by max() will be adjusted.

void setMax ( PositionType const &  position  )  [inline]

Mutator for maximum position.

Note:
The maximum position given here will be returned my max() after the method. If necessary the value returned by min() will be adjusted.

void setMinMax ( PositionType const &  min,
PositionType const &  max 
) [inline]

Mutator for minimum and maximum position.

void assign ( const DIntervalBase< D2 >  rhs  )  [inline]

Assignment from a DIntervalBase of different dimensions.

Only the dimensions 0 upto min(D,D2)-1 are copied.

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

Equality operator.

bool operator!= ( const DIntervalBase< D > &  rhs  )  const throw () [inline]

Equality operator.

void clear (  )  [inline]

Make the interval empty.

PositionType center (  )  const [inline]

Returns the center of the interval.

PositionType diagonal (  )  const [inline]

Returns the diagonal of the area, i.e. max_ - min_.

CoordinateType minX (  )  const [inline]

Accessor for min_ coordinate minimum.

CoordinateType minY (  )  const [inline]

Accessor for max_ coordinate minimum.

CoordinateType maxX (  )  const [inline]

Accessor for min_ coordinate maximum.

CoordinateType maxY (  )  const [inline]

Accessor for max_ coordinate maximum.

void setMinX ( CoordinateType const   c  )  [inline]

Mutator for min_ coordinate of the smaller point.

void setMinY ( CoordinateType const   c  )  [inline]

Mutator for max_ coordinate of the smaller point.

void setMaxX ( CoordinateType const   c  )  [inline]

Mutator for min_ coordinate of the larger point.

void setMaxY ( CoordinateType const   c  )  [inline]

Mutator for max_ coordinate of the larger point.

CoordinateType width (  )  const [inline]

Returns the width of the area i.e. the difference of dimension zero (X).

CoordinateType height (  )  const [inline]

Returns the height of the area i.e. the difference of dimension one (Y).

void normalize_ (  )  [inline, protected]

normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X])


Member Data Documentation

DIntervalBase< D > const empty = DIntervalBase<D>(std::make_pair(DIntervalBase<D>::PositionType::max, DIntervalBase<D>::PositionType::min_negative)) [inline, static]

empty instance

DIntervalBase< D > const zero [inline, static]

Initial value:

 DIntervalBase<D>( DIntervalBase<D>::PositionType::zero,
                                     DIntervalBase<D>::PositionType::zero )
instance with all positions zero

PositionType min_ [protected]

lower left point

PositionType max_ [protected]

upper right point


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