DIRECTORY Graphics USING [Box], PETypes; PEHitTest: CEDAR DEFINITIONS = BEGIN OPEN PETypes; VertexHitTest: PROCEDURE [segmentList: SegmentList, point: Point] RETURNS [hitVertex: VertexNode, hitSegment: SegmentNode]; SegmentHitTest: PROCEDURE [segmentList: SegmentList, point: Point] RETURNS [hitSegment: SegmentNode, hitPoint: Point, hitT: REAL]; TrajectoryHitTest: PROCEDURE [trajectoryList: TrajectoryList, point: Point] RETURNS [hitTrajectory: TrajectoryNode, hitPoint: Point]; BoundingBox: PROCEDURE [segment: Segment] RETURNS [box: Graphics.Box]; BoxesIntersect: PROCEDURE [box1, box2: Graphics.Box] RETURNS [boxesIntersect: BOOLEAN]; END. ¼PEHitTest.mesa Copyright (C) 1984 by Xerox Corporation. All rights reserved. Written by Darlene Plebon on August 15, 1983 4:21 pm Routines for hit testing on a path segment. This routine returns the vertex node in the specified segment list that is closest to the specified point along with the segment node containing that vertex. If the specified point is not within a threshold distance of any vertex, NIL is returned for the closest vertex node. This routine determines whether the specified point is "close" to one of the segments in the specified segment list. This routine returns the segment that the point is closest to (or NIL if the point is close to no segment), the point on that segment to which it is closest, and the value of the parameter t at that point. This routines determines whether the specified point is "close" to one of the trajectories in the specified trajectory list. This routine returns the trajectory that the point is closest to (or NIL if the point is close to no trajectory) and the point on that trajectory to which it is closest. This routine determines a bounding box for the specified path segment. This routine determines whether two bounding boxes intersect. ʘJšœ™J™>Jšœ4™4J˜J™+J˜šÏk ˜ Jšœ œ˜Jšœ˜J˜—Jšœ œ˜J˜Jšœœ ˜J˜šÏn œ œ*œ2˜{J™”—J˜šžœ œ*œ2œ˜‚J™Ã—J˜šžœ œ0œ2˜…J™§—J˜šž œ œœ˜FJ™F—J˜šžœ œœœ˜WJ™=—J˜Jšœ˜J˜—…—’O