Segment< N, T > Class Template Reference

A segment in N dimensional space. More...

#include <Segment.h>

Inheritance diagram for Segment< N, T >:
SegmentMath< N, T >

List of all members.

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.
Segmentoperator= (const Segment &other)
 Assignment operator.
 ~Segment ()
 Trivial destructor.
void make (const Point &source, const Point &target)
 Make from two points.
Accesors.

const PointgetSource () const
 Return the first point of the line segment.
const PointgetTarget () const
 Return the second point of the line segment.
Translations.

Segmentoperator+= (const Point &p)
 Translate by p.
Segmentoperator-= (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.

Detailed Description

template<int N, typename T = double>
class Segment< N, T >

A segment in N dimensional space.

Parameters:
N is the dimension.
T is the number type. By default it is double.

A segment is an ordered double of points.


Friends And Related Function Documentation

template<int N, typename T >
bool operator!= ( const Segment< N, T > &  x,
const Segment< N, T > &  y 
) [related]

Return true if the segments are not equal.

template<int N, typename T >
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().

template<int N, typename T >
const Segment< N, T > & operator+ ( const Segment< N, T > &  x  )  [related]

Return the segment.

template<int N, typename T >
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().

template<int N, typename T >
Segment< N, T > operator- ( const Segment< N, T > &  x  )  [related]

Return a segment with the opposite orientation.

References Segment< N, T >::getSource(), and Segment< N, T >::getTarget().

template<int N, typename T >
std::ostream & operator<< ( std::ostream &  out,
const Segment< N, T > &  x 
) [related]

Write the segment.

template<int N, typename T >
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().

template<int N, typename T >
std::istream & operator>> ( std::istream &  in,
Segment< N, T > &  x 
) [related]

Read a segment.

References Segment< N, T >::make().


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:58 2016 for Computational Geometry Package by  doxygen 1.6.3