vtf-logo

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

A segment in N dimensional space designed for doing math operations. More...

#include <SegmentMath.h>

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

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

Public Types

typedef Base::Number Number
 The number type.
typedef Base::Point Point
 The point type.

Public Member Functions

Constructors etc.
 SegmentMath ()
 Default constructor. Uninitialized memory.
 SegmentMath (const Point &source, const Point &target)
 Construct from two points.
 SegmentMath (const Segment< N, T > &s)
 Construct from a Segment.
 SegmentMath (const SegmentMath &other)
 Copy constructor.
SegmentMathoperator= (const SegmentMath &other)
 Assignment operator.
 ~SegmentMath ()
 Trivial destructor.
void make (const Point &source, const Point &target)
 Make from two points.
Accesors.
const PointgetTangent () const
 Return the unit tangent to the line segment.
getLength () const
 Return the length of the line segment.
Translations.
SegmentMathoperator+= (const Point &p)
 Translate by p.
SegmentMathoperator-= (const Point &p)
 Translate by -p.
Validity.
bool isValid () const
 Return true if the segment is valid.

Related Functions

(Note that these are not member functions.)

const SegmentMath< N, T > & operator+ (const SegmentMath< N, T > &x)
 Return the segment.
SegmentMath< N, T > operator- (const SegmentMath< N, T > &x)
 Return a reversed segment.
SegmentMath< N, T > operator+ (const SegmentMath< N, T > &s, const typename SegmentMath< N, T >::Point &p)
 Translate by p.
SegmentMath< N, T > operator- (const SegmentMath< N, T > &s, const typename SegmentMath< N, T >::Point &p)
 Translate by -p.
bool operator== (const SegmentMath< N, T > &x, const SegmentMath< N, T > &y)
 Return true if the segments are equal.
bool operator!= (const SegmentMath< N, T > &x, const SegmentMath< N, T > &y)
 Return true if the segments are not equal.
computeDistance (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x)
 Compute the unsigned distance to the line segment.
void computeClosestPoint (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint)
 Compute closest point on the line segment.
computeDistanceAndClosestPoint (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint)
 Compute the unsigned distance to the line segment and the closest point on it.
computeUnsignedDistanceToSupportingLine (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x)
 Compute the unsigned distance to the supporting line of the segment.
computeUnsignedDistanceAndClosestPointToSupportingLine (const SegmentMath< N, T > &segment, const typename SegmentMath< N, T >::Point &x, typename SegmentMath< N, T >::Point *closestPoint)
 Compute the unsigned distance to the supporting line of the segment and the closest point on the line.
bool computeZIntersection (const SegmentMath< 3, T > &segment, T *x, T *y, T z)
 Return true if the segment intersects the plane of constant z.
bool computeIntersection (const SegmentMath< 2, T > &s1, const SegmentMath< 2, T > &s2, typename SegmentMath< 2, T >::Point *intersectionPoint)
 If the two Segments intersect, return true and the point of intersection. Otherwise return false.
std::istream & operator>> (std::istream &in, SegmentMath< N, T > &s)
 File input.
std::ostream & operator<< (std::ostream &out, const SegmentMath< N, T > &s)
 File output.

Detailed Description

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

A segment in N dimensional space designed for doing math operations.

Parameters:
N is the dimension.
T is the number type. By default it is double.
A segment is an ordered doublet of points. This class stores the length of the segment and its tangent.


Friends And Related Function Documentation

template<int N, typename T = double>
bool computeZIntersection ( const SegmentMath< 3, T > &  segment,
T *  x,
T *  y,
z 
) [related]

Return true if the segment intersects the plane of constant z.

Set x and y to the point of intersection.


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