Ipelib
|
#include <ipegeo.h>
Public Member Functions | |
Segment () | |
Segment (const Vector &p, const Vector &q) | |
Line | line () const |
double | distance (const Vector &v, double bound) const |
double | distance (const Vector &v) const |
bool | project (const Vector &v, Vector &projection) const |
bool | intersects (const Segment &seg, Vector &pt) const |
bool | intersects (const Line &l, Vector &pt) const |
bool | snap (const Vector &mouse, Vector &pos, double &bound) const |
Public Attributes | |
Vector | iP |
Vector | iQ |
A directed line segment.
|
inline |
Create uninitialized segment.
|
inline |
Return directed line supporting the segment.
double Segment::distance | ( | const Vector & | v, |
double | bound | ||
) | const |
Returns distance between segment and point v, but may just return bound when its larger than bound.
double Segment::distance | ( | const Vector & | v | ) | const |
Returns distance between segment and point v
Project point v orthogonally on segment. Returns false if the point falls outside the segment.
Compute intersection point. Return false
if segs don't intersect.
Compute intersection point. Return false
if no intersection.
Snap mouse position to this segment.
If distance between mouse and the segment is less than bound, then set pos to the point on the segment, bound to the distance, and return true.
Vector ipe::Segment::iP |
First endpoint.
Vector ipe::Segment::iQ |
Second endpoint.