vtf-logo

geom::Interval< N, T > Class Template Reference

An axes-oriented interval in the specified dimension. More...

#include <Interval.h>

Inheritance diagram for geom::Interval< N, T >:

geom::BBox< N, T > geom::SemiOpenInterval< N, T > List of all members.

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.
Intervaloperator= (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 PointgetLowerCorner () const
 Return the min point.
const PointgetUpperCorner () 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.)

void printFormatted (std::ostream &out, const Interval< N, T > &x)
 Print in a nice format.
std::istream & operator>> (std::istream &in, Interval< N, T > &x)
 Read the ranges.
std::ostream & operator<< (std::ostream &out, const Interval< N, T > &x)
 Write the ranges.
bool operator== (const Interval< N, T > &a, const Interval< N, T > &b)
 Equality.
bool operator!= (const Interval< N, T > &a, const Interval< N, T > &b)
 Inequality.
bool doOverlap (const Interval< N, T > &a, const Interval< N, T > &b)
 Return true if the open intervals overlap.
Interval< N, T > computeIntersection (const Interval< N, T > &a, const Interval< N, T > &b)
 Return the intersection of the intervals.
void computeIntersection (const Interval< N, T > &a, const Interval< N, T > &b, Interval< N, T > *x)
 Compute the intersection of the intervals.

Detailed Description

template<int N, typename T = double>
class geom::Interval< N, T >

An axes-oriented interval in the specified dimension.

Parameters:
N is the dimension.
T is the number type. By default it is double.
Todo:
Use partial template specialization to get optimized versions for N = 1, 2 and 3.


Constructor & Destructor Documentation

template<int N, typename T = double>
geom::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.


The documentation for this class was generated from the following file:
Generated on Fri Aug 24 12:56:00 2007 for Computational Geometry Package by  doxygen 1.4.7