24 #ifndef PXR_BASE_GF_LINE_SEG2D_H 25 #define PXR_BASE_GF_LINE_SEG2D_H 33 #include "pxr/base/gf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
56 _length = _line.Set( p0, p1 - p0 );
78 return (_line == l._line && _length == l._length);
85 return ! (*
this == r);
92 double *t1,
double *t2 );
114 double *t1 =
nullptr,
double *t2 =
nullptr );
127 double *t1 =
nullptr,
double *t2 =
nullptr );
129 PXR_NAMESPACE_CLOSE_SCOPE
131 #endif // PXR_BASE_GF_LINE_SEG2D_H GfLineSeg2d(const GfVec2d &p0, const GfVec2d &p1)
Construct a line segment that spans two points.
bool operator !=(const GfLineSeg2d &r) const
Component-wise inequality test.
GfVec2d GetPoint(double t) const
Return the point on the line at ( p0 + t * dir ).
double GetLength() const
Return the length of the line.
Basic type for a vector of 2 double components.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
bool operator==(const GfLineSeg2d &l) const
Component-wise equality test.
GF_API friend bool GfFindClosestPoints(const GfLine2d &, const GfLineSeg2d &, GfVec2d *, GfVec2d *, double *t1, double *t2)
Computes the closets points on line and seg.
GfVec2d GetPoint(double t) const
Return the point on the segment specified by the parameter t.
GF_API bool GfFindClosestPoints(const GfLine2d &line, const GfLineSeg2d &seg, GfVec2d *p1=nullptr, GfVec2d *p2=nullptr, double *t1=nullptr, double *t2=nullptr)
Computes the closets points on line and seg.
GfLineSeg2d()
The default constructor leaves line parameters undefined.
GF_API GfVec2d FindClosestPoint(const GfVec2d &point, double *t=NULL) const
Returns the point on the line that is closest to point.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
Basic type: 2D line segment.