Ipelib

ipe::Segment Class Reference

A directed line segment. More...

#include <ipegeo.h>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

A directed line segment.


Constructor & Destructor Documentation

ipe::Segment::Segment ( ) [inline]

Create uninitialized segment.

ipe::Segment::Segment ( const Vector p,
const Vector q 
) [inline, explicit]

Member Function Documentation

Line ipe::Segment::line ( ) const [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

bool Segment::project ( const Vector v,
Vector projection 
) const

Project point v orthogonally on segment. Returns false if the point falls outside the segment.

bool Segment::intersects ( const Segment seg,
Vector pt 
) const

Compute intersection point. Return false if segs don't intersect.

bool Segment::intersects ( const Line l,
Vector pt 
) const

Compute intersection point. Return false if no intersection.

bool Segment::snap ( const Vector mouse,
Vector pos,
double &  bound 
) const

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.


Member Data Documentation

First endpoint.

Second endpoint.


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