Cortex  10.0.0-a4
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
IECore::LineSegment< T > Class Template Reference

#include <LineSegment.h>

Public Types

typedef T Point
 
typedef VectorTraits< T >::BaseType BaseType
 

Public Member Functions

 LineSegment ()
 Uninitialised.
 
 LineSegment (const T &P0, const T &P1)
 
template<class S >
bool operator== (const S &other) const
 Equality.
 
template<class S >
bool operator!= (const S &other) const
 
template<class S >
const LineSegmentoperator*= (const S &m)
 
template<class S >
LineSegment operator* (const S &m) const
 
operator() (BaseType t) const
 
direction () const
 p1 - p0
 
normalizedDirection () const
 (p1 - p0).normalized()
 
BaseType length () const
 Distance between p0 and p1.
 
BaseType length2 () const
 Distance squared between p0 and p1.
 
closestPointTo (const T &point) const
 Returns the point on this LineSeqment which is closest to the specified point.
 
closestPointTo (const T &point, BaseType &t) const
 As above but also fills in t with the parameter value at the point.
 
closestPoints (const LineSegment &line, T &otherPoint) const
 
BaseType distanceTo (const T &point) const
 
BaseType distance2To (const T &point) const
 Returns the shortest squared distance to the point.
 
BaseType distanceTo (const LineSegment &line) const
 
BaseType distance2To (const LineSegment &line) const
 Returns the shortest squared distance to the line.
 
template<class S >
bool intersect (const Imath::Plane3< S > &plane, T &intersection) const
 
template<class S >
bool intersectT (const Imath::Plane3< S > &plane, BaseType &t) const
 

Static Public Member Functions

static unsigned int dimensions ()
 Simply returns the dimensions of the underlying point type.
 

Public Attributes

p0
 Line endpoints can be accessed directly.
 
p1
 

Detailed Description

template<class T>
class IECore::LineSegment< T >

The LineSegment class represents the portion of a line bounded by two endpoints - this is in contrast to the Imath::Line class which represents a line with infinite extent.

Member Function Documentation

template<class T >
T IECore::LineSegment< T >::closestPoints ( const LineSegment< T > &  line,
T &  otherPoint 
) const

Returns the point on this LineSeqment which is closest to line, and places the corresponding point on line in otherPoint.

template<class T >
T IECore::LineSegment< T >::operator() ( BaseType  t) const

Returns the point on the line at parameter t. t ranges from 0 at p0 to 1 at p1.

template<class T >
template<class S >
const LineSegment& IECore::LineSegment< T >::operator*= ( const S &  m)

Matrix multiplication. These functions transform both endpoints.


The documentation for this class was generated from the following file: