Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Related Functions | List of all members
DBoundingBox< D > Class Template Reference

A D-dimensional bounding box. More...

#include <OpenMS/DATASTRUCTURES/DBoundingBox.h>

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

Public Types

Type definitions
enum  { DIMENSION = D }
 Dimensions. More...
 
typedef
Internal::DIntervalBase< D > 
Base
 Base class type. More...
 
typedef Base::PositionType PositionType
 Position type. More...
 
typedef Base::CoordinateType CoordinateType
 Coordinate type of the positions. More...
 
- Public Types inherited from DIntervalBase< D >
enum  { DIMENSION = D }
 Dimensions. More...
 
typedef DPosition< D > PositionType
 Position type. More...
 
typedef
PositionType::CoordinateType 
CoordinateType
 Coordinate type of the positions. More...
 

Public Member Functions

Constructors and Destructor
 DBoundingBox ()
 Default constructor. More...
 
 DBoundingBox (const DBoundingBox &rhs)
 Copy constructor. More...
 
DBoundingBoxoperator= (const DBoundingBox &rhs)
 Assignement operator. More...
 
DBoundingBoxoperator= (const Base &rhs)
 Assignement operator for the base class. More...
 
 ~DBoundingBox ()
 Destructor. More...
 
 DBoundingBox (const PositionType &minimum, const PositionType &maximum)
 Constructor from two positions. More...
 
Accessors
void enlarge (const PositionType &p)
 Enlarges the bounding box such that it contains a position. More...
 
void enlarge (CoordinateType x, CoordinateType y)
 Enlarges the bounding box such that it contains a position specified by two coordinates. More...
 
Predicates
bool operator== (const DBoundingBox &rhs) const
 Equality operator. More...
 
bool operator== (const Base &rhs) const
 Equality operator. More...
 
bool encloses (const PositionType &position) const
 Checks whether this range contains a certain point. More...
 
bool encloses (CoordinateType x, CoordinateType y) const
 2D-version encloses(x,y) is for convenience only More...
 
bool intersects (const DBoundingBox &bounding_box) const
 
bool isEmpty () const
 Test if bounding box is empty. More...
 
- Public Member Functions inherited from DIntervalBase< D >
 DIntervalBase ()
 Default constructor. More...
 
 DIntervalBase (const DIntervalBase &rhs)
 Copy constructor. More...
 
DIntervalBaseoperator= (const DIntervalBase &rhs)
 Assignment operator. More...
 
 ~DIntervalBase ()
 Destructor. More...
 
 DIntervalBase (PositionType const &minimum, PositionType const &maximum)
 This constructor sets min_ and max_ directly. More...
 
PositionType const & minPosition () const
 Accessor to minimum position. More...
 
PositionType const & maxPosition () const
 Accessor to maximum position. More...
 
void setMin (PositionType const &position)
 Mutator for minimum position. More...
 
void setMax (PositionType const &position)
 Mutator for maximum position. More...
 
void setMinMax (PositionType const &min, PositionType const &max)
 Mutator for minimum and maximum position. More...
 
template<UInt D2>
void assign (const DIntervalBase< D2 > rhs)
 Assignment from a DIntervalBase of different dimensions. More...
 
bool operator== (const DIntervalBase &rhs) const
 Equality operator. More...
 
bool operator!= (const DIntervalBase &rhs) const
 Equality operator. More...
 
void clear ()
 Make the interval empty. More...
 
CoordinateType minX () const
 Accessor for min_ coordinate minimum. More...
 
CoordinateType minY () const
 Accessor for max_ coordinate minimum. More...
 
CoordinateType maxX () const
 Accessor for min_ coordinate maximum. More...
 
CoordinateType maxY () const
 Accessor for max_ coordinate maximum. More...
 
void setMinX (CoordinateType const c)
 Mutator for min_ coordinate of the smaller point. More...
 
void setMinY (CoordinateType const c)
 Mutator for max_ coordinate of the smaller point. More...
 
void setMaxX (CoordinateType const c)
 Mutator for min_ coordinate of the larger point. More...
 
void setMaxY (CoordinateType const c)
 Mutator for max_ coordinate of the larger point. More...
 
CoordinateType width () const
 Returns the width of the area i.e. the difference of dimension zero (X). More...
 
CoordinateType height () const
 Returns the height of the area i.e. the difference of dimension one (Y). More...
 
PositionType center () const
 Returns the center of the interval. More...
 
PositionType diagonal () const
 Returns the diagonal of the area, i.e. max_ - min_. More...
 

Related Functions

(Note that these are not member functions.)

template<UInt D>
std::ostream & operator<< (std::ostream &os, const DBoundingBox< D > &bounding_box)
 Print the contents to a stream. More...
 

Additional Inherited Members

- Static Public Attributes inherited from DIntervalBase< D >
static DIntervalBase const empty = DIntervalBase<D>(std::make_pair(DIntervalBase<D>::PositionType::maxPositive(), DIntervalBase<D>::PositionType::minNegative()))
 empty instance More...
 
static DIntervalBase const zero = DIntervalBase<D>(DIntervalBase<D>::PositionType::zero(), DIntervalBase<D>::PositionType::zero())
 instance with all positions zero More...
 
- Protected Member Functions inherited from DIntervalBase< D >
void normalize_ ()
 normalization to keep all dimensions in the right geometrical order (min_[X] < max_[X]) More...
 
 DIntervalBase (const std::pair< PositionType, PositionType > &pair)
 Protected constructor for the construction of static instances. More...
 
- Protected Attributes inherited from DIntervalBase< D >
PositionType min_
 lower left point More...
 
PositionType max_
 upper right point More...
 

Detailed Description

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

A D-dimensional bounding box.

A DBoundingBox denotes a closed interval. Upper and lower margins are both contained.

Member Typedef Documentation

Base class type.

Coordinate type of the positions.

Position type.

Member Enumeration Documentation

anonymous enum

Dimensions.

Enumerator
DIMENSION 

Constructor & Destructor Documentation

DBoundingBox ( )
inline

Default constructor.

DBoundingBox ( const DBoundingBox< D > &  rhs)
inline

Copy constructor.

~DBoundingBox ( )
inline

Destructor.

DBoundingBox ( const PositionType minimum,
const PositionType maximum 
)
inline

Constructor from two positions.

Member Function Documentation

bool encloses ( const PositionType position) const
inline

Checks whether this range contains a certain point.

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

Referenced by IDMapper::annotate(), DBoundingBox< 1 >::encloses(), and FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

bool encloses ( CoordinateType  x,
CoordinateType  y 
) const
inline

2D-version encloses(x,y) is for convenience only

void enlarge ( const PositionType p)
inline

Enlarges the bounding box such that it contains a position.

Referenced by DBoundingBox< 1 >::enlarge().

void enlarge ( CoordinateType  x,
CoordinateType  y 
)
inline

Enlarges the bounding box such that it contains a position specified by two coordinates.

bool intersects ( const DBoundingBox< D > &  bounding_box) const
inline

Checks whether this bounding box intersects with another bounding box

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::intersection_().

bool isEmpty ( ) const
inline

Test if bounding box is empty.

Referenced by FeatureMap< OpenMS::Feature >::updateRanges().

DBoundingBox& operator= ( const DBoundingBox< D > &  rhs)
inline

Assignement operator.

DBoundingBox& operator= ( const Base rhs)
inline

Assignement operator for the base class.

bool operator== ( const DBoundingBox< D > &  rhs) const
inline

Equality operator.

bool operator== ( const Base rhs) const
inline

Equality operator.

Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  os,
const DBoundingBox< D > &  bounding_box 
)
related

Print the contents to a stream.


OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:29 using doxygen 1.8.5