DIRECTORY GGBasicTypes, GGInterfaceTypes; GGMultiGravity: CEDAR DEFINITIONS = BEGIN Caret: TYPE = GGInterfaceTypes.Caret; FeatureData: TYPE = GGInterfaceTypes.FeatureData; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; TriggerBag: TYPE = REF TriggerBagObj; TriggerBagObj: TYPE = GGInterfaceTypes.TriggerBagObj; ObjectBag: TYPE = REF ObjectBagObj; ObjectBagObj: TYPE = GGInterfaceTypes.ObjectBagObj; NearFeatures: TYPE = REF NearFeaturesObj; NearFeaturesObj: TYPE = RECORD [ features: SEQUENCE len: NAT OF FeatureData]; NearPoints: TYPE = REF NearPointsObj; NearPointsObj: TYPE = RECORD [ points: SEQUENCE len: NAT OF Point]; NearDistances: TYPE = REF NearDistancesObj; NearDistancesObj: TYPE = RECORD [ distances: SEQUENCE len: NAT OF REAL]; Point: TYPE = GGBasicTypes.Point; Map: PROC [testPoint: Point, criticalR: REAL, currentObjects: ObjectBag, activeObjects: TriggerBag, gargoyleData: GargoyleData, intersections: BOOL] RETURNS [resultPoint: Point, feature: FeatureData]; StrictDistance: PROC [testPoint: Point, criticalR: REAL, objectBag: ObjectBag, sceneBag: TriggerBag, gargoyleData: GargoyleData] RETURNS [resultPoint: Point, feature: FeatureData]; InnerCircle: PROC [testPoint: Point, criticalR: REAL, innerR: REAL, currentObjects: ObjectBag, activeObjects: TriggerBag, gargoyleData: GargoyleData, intersections: BOOL] RETURNS [resultPoint: Point, feature: FeatureData]; GoodCurve: TYPE = REF GoodCurveObj; GoodCurveObj: TYPE = RECORD [ dist: REAL, -- the distance from point to testPoint point: Point, -- the best point on this curve featureData: FeatureData, -- this curve hitData: REF ANY -- a description of this segment ]; GoodPointType: TYPE = {outline, slice, anchor, intersectionPoint, midpoint, none}; GoodPoint: TYPE = REF GoodPointObj; GoodPointObj: TYPE = RECORD [ dist: REAL, point: Point, featureData: FeatureData, -- this point hitData: REF ANY, -- a description of this point type: GoodPointType _ none ]; NearPointsAndCurves: TYPE = REF NearPointsAndCurvesObj; NearPointsAndCurvesObj: TYPE = RECORD [ things: SEQUENCE len: NAT OF REF ANY]; MultiMap: PUBLIC PROC [testPoint: Point, criticalR: REAL, currentObjects: ObjectBag, activeObjects: TriggerBag, gargoyleData: GargoyleData, intersections: BOOL] RETURNS [nearPointsAndCurves: NearPointsAndCurves, count: NAT]; MultiStrictDistance: PROC [testPoint: Point, criticalR: REAL, currentObjects: ObjectBag, activeObjects: TriggerBag, gargoyleData: GargoyleData] RETURNS [nearPointsAndCurves: NearPointsAndCurves, count: NAT]; MultiInnerCircle: PROC [testPoint: Point, criticalR: REAL, innerR: REAL, currentObjects: ObjectBag, activeObjects: TriggerBag, gargoyleData: GargoyleData, intersections: BOOL] RETURNS [nearPointsAndCurves: NearPointsAndCurves, count: NAT]; NewMultiGravityPool: PROC [] RETURNS [REF]; -- stored in GargoyleData; temporary storage pool used by GGMultiGravityImpl END. ΤGGMultiGravity.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Bier, January 26, 1987 3:35:30 pm PST Contents: Performs hit testing similar to GGGravity. Instead of returning a single nearest feature, we return the N (or fewer) nearest features which are within a given tolerance distance from the test point. The algorithm used is described in [Cyan]Documentation>MultiGravity.tioga. Pier, November 21, 1986 10:40:42 am PST Dispatches to StrictDistance or InnerCircle as appropriate. Calls MultiStrictDistance and picks a single "best" feature. Calls MultiInnerCircle and picks a single "best" feature. Fields Shared with GoodPoint Fields Shared with GoodCurve Fields Describing the Point The REF ANY is either a GoodCurve or a GoodPoint Dispatches to MultiStrictDistance or MultiInnerCircle depending on the Gargoyle Gravity Type button in the user interface. Returns up to n closest features, their closest points, and their distances from the testpoint. Features outside of the critical radius, criticalR, may or may not be included. The results will be located in features[0] .. features[count-1], points[0] .. points[count-1], and distances[0] .. distances[count-1]. Returns up to n closest features, their closest points, and their distances from the testpoint. Features outside of the critical radius, criticalR, may or may not be included. The results will be located in features[0] .. features[count-1], points[0] .. points[count-1], and distances[0] .. distances[count-1]. If any points are within the critical radius criticalR, then only points (e.g. vertices, control points, and intersection points) will be mentioned. Otherwise, "features" will consist of a mixture of points and curves. Κ˜˜šœ™Icodešœ Οmœ1™