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
bool operator==(const GfLineSeg2d &l) const
Component-wise equality test.
GfVec2d GetPoint(double t) const
Return the point on the segment specified by the parameter t.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
GfLineSeg2d(const GfVec2d &p0, const GfVec2d &p1)
Construct a line segment that spans two points.
GF_API GfVec2d FindClosestPoint(const GfVec2d &point, double *t=NULL) const
Returns the point on the line that is closest to point.
GF_API bool GfFindClosestPoints(const GfLine &l1, const GfLine &l2, GfVec3d *p1=nullptr, GfVec3d *p2=nullptr, double *t1=nullptr, double *t2=nullptr)
Computes the closets points between two lines.
const GfVec2d & GetDirection() const
Return the normalized direction of the line.
Basic type for a vector of 2 double components.
double GetLength() const
Return the length of the line.
GfVec2d GetPoint(double t) const
Return the point on the line at ( p0 + t * dir ).
GF_API friend bool GfFindClosestPoints(const GfLine2d &, const GfLineSeg2d &, GfVec2d *, GfVec2d *, double *t1, double *t2)
Computes the closets points on line and seg.
GfLineSeg2d()
The default constructor leaves line parameters undefined.
bool operator!=(const GfLineSeg2d &r) const
Component-wise inequality test.
Basic type: 2D line segment.