HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GfLineSeg Class Reference

#include <lineSeg.h>

Public Member Functions

 GfLineSeg ()
 The default constructor leaves line parameters undefined. More...
 
 GfLineSeg (const GfVec3d &p0, const GfVec3d &p1)
 Construct a line segment that spans two points. More...
 
GfVec3d GetPoint (double t) const
 
const GfVec3dGetDirection () const
 Return the normalized direction of the line. More...
 
double GetLength () const
 Return the length of the line. More...
 
GF_API GfVec3d FindClosestPoint (const GfVec3d &point, double *t=NULL) const
 
bool operator== (const GfLineSeg &l) const
 
bool operator!= (const GfLineSeg &r) const
 

Friends

GF_API friend bool GfFindClosestPoints (const GfLine &, const GfLineSeg &, GfVec3d *, GfVec3d *, double *, double *)
 
GF_API friend bool GfFindClosestPoints (const GfLineSeg &, const GfLineSeg &, GfVec3d *, GfVec3d *, double *, double *)
 

Detailed Description

Basic type: 3D line segment

This class represents a three-dimensional line segment in space.

Definition at line 47 of file lineSeg.h.

Constructor & Destructor Documentation

GfLineSeg::GfLineSeg ( )
inline

The default constructor leaves line parameters undefined.

Definition at line 52 of file lineSeg.h.

GfLineSeg::GfLineSeg ( const GfVec3d p0,
const GfVec3d p1 
)
inline

Construct a line segment that spans two points.

Definition at line 56 of file lineSeg.h.

Member Function Documentation

GF_API GfVec3d GfLineSeg::FindClosestPoint ( const GfVec3d point,
double *  t = NULL 
) const

Returns the point on the line that is closest to point. If t is not NULL, it will be set to the parametric distance along the line of the closest point.

const GfVec3d& GfLineSeg::GetDirection ( ) const
inline

Return the normalized direction of the line.

Definition at line 65 of file lineSeg.h.

double GfLineSeg::GetLength ( ) const
inline

Return the length of the line.

Definition at line 68 of file lineSeg.h.

GfVec3d GfLineSeg::GetPoint ( double  t) const
inline

Return the point on the segment specified by the parameter t. p = p0 + t * (p1 - p0)

Definition at line 62 of file lineSeg.h.

bool GfLineSeg::operator!= ( const GfLineSeg r) const
inline

Component-wise inequality test. The starting points, and directions must match exactly for lines to be considered equal.

Definition at line 85 of file lineSeg.h.

bool GfLineSeg::operator== ( const GfLineSeg l) const
inline

Component-wise equality test. The starting points and directions, must match exactly for lines to be considered equal.

Definition at line 78 of file lineSeg.h.

Friends And Related Function Documentation

GF_API friend bool GfFindClosestPoints ( const GfLine ,
const GfLineSeg ,
GfVec3d ,
GfVec3d ,
double *  ,
double *   
)
friend

Computes the closets points on line and seg.

The two points are returned in p1 and p2. The parametric distances of p1 and p2 along the line and segment are returned in t1 and t2.

This returns false if the lines were close enough to parallel that no points could be computed; in this case, the other return values are undefined.

GF_API friend bool GfFindClosestPoints ( const GfLineSeg ,
const GfLineSeg ,
GfVec3d ,
GfVec3d ,
double *  ,
double *   
)
friend

Computes the closets points on two line segments, seg1 and seg2. The two points are returned in p1 and p2. The parametric distances of p1 and p2 along the segments are returned in t1 and t2.

This returns false if the lines were close enough to parallel that no points could be computed; in this case, the other return values are undefined.


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