An axes-oriented interval in the specified dimension. More...
#include <Interval.h>
Public Types | |
typedef T | Number |
The number type. | |
typedef ads::FixedArray< N, T > | Point |
The point type. | |
Public Member Functions | |
Constructors etc. | |
Interval () | |
Default constructor. Memory is uninitialized. | |
Interval (const Point &min, const Point &max) | |
Construct an interval from the min and max points. | |
Interval (const Number xmin, const Number xmax) | |
Construct a 1-D interval from the min and max coordinates. | |
Interval (const Number xmin, const Number ymin, const Number xmax, const Number ymax) | |
Construct an 2-D interval from the min and max coordinates. | |
Interval (const Number xmin, const Number ymin, const Number zmin, const Number xmax, const Number ymax, const Number zmax) | |
Construct a 3-D interval from the min and max coordinates. | |
Interval (const Number *coordinates) | |
Construct an interval from an array of the min and max coordinates. | |
Interval (const Interval &other) | |
Copy Constructor. | |
Interval & | operator= (const Interval &other) |
Assignment operator. | |
void | add (const Point &p) |
Make the interval expand to contain the new point. | |
~Interval () | |
Trivial destructor. No need for virtual. | |
The bound operation. | |
void | add (const Interval &x) |
Make the interval expand to contain the new interval. | |
template<class InputIterator > | |
void | bound (InputIterator first, InputIterator last) |
Bound a range of points. | |
void | bound (const Point &p) |
Bound a single point. | |
void | bound (const Point &p, const Point &q) |
Bound two points. | |
void | bound (const Point &p, const Point &q, const Point &r) |
Bound three points. | |
Accessors. | |
const Point & | getLowerCorner () const |
Return the min point. | |
const Point & | getUpperCorner () const |
Return the max point. | |
Number | computeContent () const |
Return the content (length, area, volume, etc.) of the interval. | |
Manipulators. | |
void | setLowerCorner (const Point &lowerCorner) |
Set the lower corner. | |
void | setUpperCorner (const Point &upperCorner) |
Set the upper corner. | |
void | setCorners (const Point &lowerCorner, const Point &upperCorner) |
Set the lower and upper corners. | |
void | setLowerCoordinate (const int index, const Number value) |
Set a coordinate of the lower corner. | |
void | setUpperCoordinate (const int index, const Number value) |
Set a coordinate of the upper corner. | |
Static Public Member Functions | |
Static member functions. | |
static int | getDimension () |
Return the dimension of the interval. | |
Related Functions | |
(Note that these are not member functions.) | |
template<int N, typename T > | |
void | printFormatted (std::ostream &out, const Interval< N, T > &x) |
Print in a nice format. | |
template<int N, typename T > | |
std::istream & | operator>> (std::istream &in, Interval< N, T > &x) |
Read the ranges. | |
template<int N, typename T > | |
std::ostream & | operator<< (std::ostream &out, const Interval< N, T > &x) |
Write the ranges. | |
template<int N, typename T > | |
bool | operator== (const Interval< N, T > &a, const Interval< N, T > &b) |
Equality. | |
template<int N, typename T > | |
bool | operator!= (const Interval< N, T > &a, const Interval< N, T > &b) |
Inequality. | |
template<int N, typename T > | |
bool | doOverlap (const Interval< N, T > &a, const Interval< N, T > &b) |
Return true if the open intervals overlap. | |
template<int N, typename T > | |
Interval< N, T > | computeIntersection (const Interval< N, T > &a, const Interval< N, T > &b) |
Return the intersection of the intervals. | |
template<int N, typename T > | |
void | computeIntersection (const Interval< N, T > &a, const Interval< N, T > &b, Interval< N, T > *x) |
Compute the intersection of the intervals. |
An axes-oriented interval in the specified dimension.
N | is the dimension. | |
T | is the number type. By default it is double. |
Interval< N, T >::Interval | ( | const Number * | coordinates | ) | [inline] |
Construct an interval from an array of the min and max coordinates.
The coordinates should be in the same order as for the above constructors.
void computeIntersection | ( | const Interval< N, T > & | a, | |
const Interval< N, T > & | b, | |||
Interval< N, T > * | x | |||
) | [related] |
Compute the intersection of the intervals.
Interval< N, T > computeIntersection | ( | const Interval< N, T > & | a, | |
const Interval< N, T > & | b | |||
) | [related] |
Return the intersection of the intervals.
bool doOverlap | ( | const Interval< N, T > & | a, | |
const Interval< N, T > & | b | |||
) | [related] |
Return true if the open intervals overlap.
bool operator!= | ( | const Interval< N, T > & | a, | |
const Interval< N, T > & | b | |||
) | [related] |
Inequality.
std::ostream & operator<< | ( | std::ostream & | out, | |
const Interval< N, T > & | x | |||
) | [related] |
Write the ranges.
bool operator== | ( | const Interval< N, T > & | a, | |
const Interval< N, T > & | b | |||
) | [related] |
Equality.
References Interval< N, T >::getLowerCorner(), and Interval< N, T >::getUpperCorner().
std::istream & operator>> | ( | std::istream & | in, | |
Interval< N, T > & | x | |||
) | [related] |
Read the ranges.
References Interval< N, T >::setLowerCorner(), and Interval< N, T >::setUpperCorner().
void printFormatted | ( | std::ostream & | out, | |
const Interval< N, T > & | x | |||
) | [related] |
Print in a nice format.