A segment in N dimensional space. More...
#include <Segment.h>
Public Types | |
typedef T | Number |
The number type. | |
typedef ads::FixedArray< N, T > | Point |
The representation of a point. | |
Public Member Functions | |
Constructors etc. | |
Segment () | |
Default constructor. Uninitialized memory. | |
Segment (const Point &source, const Point &target) | |
Construct from two points. | |
Segment (const Segment &other) | |
Copy constructor. | |
Segment & | operator= (const Segment &other) |
Assignment operator. | |
~Segment () | |
Trivial destructor. | |
void | make (const Point &source, const Point &target) |
Make from two points. | |
Accesors. | |
const Point & | getSource () const |
Return the first point of the line segment. | |
const Point & | getTarget () const |
Return the second point of the line segment. | |
Translations. | |
Segment & | operator+= (const Point &p) |
Translate by p. | |
Segment & | operator-= (const Point &p) |
Translate by -p. | |
Related Functions | |
(Note that these are not member functions.) | |
template<int N, typename T > | |
bool | operator== (const Segment< N, T > &x, const Segment< N, T > &y) |
Return true if the segments are equal. | |
template<int N, typename T > | |
bool | operator!= (const Segment< N, T > &x, const Segment< N, T > &y) |
Return true if the segments are not equal. | |
template<int N, typename T > | |
const Segment< N, T > & | operator+ (const Segment< N, T > &x) |
Return the segment. | |
template<int N, typename T > | |
Segment< N, T > | operator- (const Segment< N, T > &x) |
Return a segment with the opposite orientation. | |
template<int N, typename T > | |
Segment< N, T > | operator+ (const Segment< N, T > &s, const typename Segment< N, T >::Point &p) |
Return a segment translated by p. | |
template<int N, typename T > | |
Segment< N, T > | operator- (const Segment< N, T > &s, const typename Segment< N, T >::Point &p) |
Return a segment translated by -p. | |
template<int N, typename T > | |
std::istream & | operator>> (std::istream &in, Segment< N, T > &x) |
Read a segment. | |
template<int N, typename T > | |
std::ostream & | operator<< (std::ostream &out, const Segment< N, T > &x) |
Write the segment. |
A segment in N dimensional space.
N | is the dimension. | |
T | is the number type. By default it is double. |
A segment is an ordered double of points.
bool operator!= | ( | const Segment< N, T > & | x, | |
const Segment< N, T > & | y | |||
) | [related] |
Return true if the segments are not equal.
Segment< N, T > operator+ | ( | const Segment< N, T > & | s, | |
const typename Segment< N, T >::Point & | p | |||
) | [related] |
Return a segment translated by p.
References Segment< N, T >::getSource(), and Segment< N, T >::getTarget().
const Segment< N, T > & operator+ | ( | const Segment< N, T > & | x | ) | [related] |
Return the segment.
Segment< N, T > operator- | ( | const Segment< N, T > & | s, | |
const typename Segment< N, T >::Point & | p | |||
) | [related] |
Return a segment translated by -p.
References Segment< N, T >::getSource(), and Segment< N, T >::getTarget().
Return a segment with the opposite orientation.
References Segment< N, T >::getSource(), and Segment< N, T >::getTarget().
std::ostream & operator<< | ( | std::ostream & | out, | |
const Segment< N, T > & | x | |||
) | [related] |
Write the segment.
bool operator== | ( | const Segment< N, T > & | x, | |
const Segment< N, T > & | y | |||
) | [related] |
Return true if the segments are equal.
References Segment< N, T >::getSource(), and Segment< N, T >::getTarget().
std::istream & operator>> | ( | std::istream & | in, | |
Segment< N, T > & | x | |||
) | [related] |
Read a segment.
References Segment< N, T >::make().