|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.vectomatic.common.model.geometry.Segment
public abstract class Segment
Base class for path segments (line segment, bezier spline segments)
Field Summary | |
---|---|
protected BoundingBox |
_bbox
|
protected Point[] |
_pts
|
Constructor Summary | |
---|---|
Segment()
|
|
Segment(Point[] pts)
Constructor |
|
Segment(Segment segment)
Copy constuctor |
Method Summary | |
---|---|
abstract Segment |
clone()
|
BoundingBox |
getBoundingBox()
Gets the bounding box of the segment |
Point |
getEndPoint()
Return the segment last point |
Point |
getStartPoint()
Returns the segment first point |
Point[] |
getVertices()
|
abstract void |
nearestPointOnSegment(Point p,
Point dest)
Returns the closest point on the segment to the specified point |
float |
squaredDistanceToPoint(Point p)
Returns the squared distance from an arbitrary point p to the nearest point on the segment |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Point[] _pts
protected BoundingBox _bbox
Constructor Detail |
---|
public Segment()
public Segment(Point[] pts)
pts
- An array of points defining the segmentpublic Segment(Segment segment)
segment
- A segment to duplicateMethod Detail |
---|
public Point getStartPoint()
public Point getEndPoint()
public BoundingBox getBoundingBox()
public float squaredDistanceToPoint(Point p)
p
- An arbitrary point p
public abstract void nearestPointOnSegment(Point p, Point dest)
p
- An arbitrary point pdest
- The closest point on the segment to ppublic abstract Segment clone()
clone
in class Object
public Point[] getVertices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |