<> <> <> <> DIRECTORY Imager, ImagerPath, ImagerTransformation, Rope, Rosary; GGModelTypes: CEDAR DEFINITIONS = BEGIN <> jointSize: REAL = 6; <<>> <> MaxSegments: NAT = 100; <<>> <> <<>> Angle: TYPE = REAL; Point: TYPE = ARRAY[1..2] OF REAL; Matrix3by3: TYPE = ARRAY [1..3] OF ARRAY [1..3] OF REAL; Vector: TYPE = ARRAY[1..2] OF REAL; Edge: TYPE = REF EdgeObj; EdgeObj: TYPE = RECORD [ line: Line, -- the line which passes through the endpoints of this edge startIsFirst: BOOL, start, end: Point]; Line: TYPE = REF LineObj; LineObj: TYPE = RECORD [ <> <> theta: REAL, -- angle in (-pi..pi] d: REAL, -- distance from line to origin c: REAL, -- cos(theta). Cached for convenience. s: REAL, -- sin(theta). Cached for convenience. slope: REAL, yInt: REAL -- for historical (Solidviews) reasons ]; Circle: TYPE = REF CircleObj; CircleObj: TYPE = RECORD [ origin: Point, radius: REAL ]; Arc: TYPE = REF ArcObj; ArcObj: TYPE = RECORD [ circle: Circle, startIsFirst: BOOL, start, end: Point]; Ray: TYPE = REF RayObj; RayObj: TYPE = RECORD [ p: Point, d: Vector]; <<>> <> Camera: TYPE = REF CameraObj; CameraObj: TYPE = RECORD [ cameraWorld: Vector, scalar: REAL, cameraScreen: Vector ]; Scene: TYPE = REF SceneObj; SceneObj: TYPE = RECORD [ entities: LIST OF REF ANY _ NIL -- a list of clusters and outlines ]; SelectedObjectData: TYPE = RECORD [ normal: BOOL _ FALSE, copy: BOOL _ FALSE, hot: BOOL _ FALSE, active: BOOL _ FALSE ]; Cluster: TYPE = REF ClusterObj; ClusterObj: TYPE = RECORD [ children: LIST OF REF ANY, -- a list of clusters or outlines parent: Cluster, selected: SelectedObjectData, boundBox: BoundBox _ NIL ]; Outline: TYPE = REF OutlineObj; OutlineObj: TYPE = RECORD [ fillColor: Imager.Color, lineEnds: Imager.StrokeEnd, children: LIST OF Traj, parent: Cluster, boundBox: BoundBox, onOverlay: BOOL _ FALSE, whyOnOverlay: REF ANY, -- the selected piece of the outline selected: SelectedObjectData ]; Traj: TYPE = REF TrajObj; TrajObj: TYPE = RECORD [ role: FenceHoleOpen, segCount: NAT, -- the number of segments currently in this trajectory segments: Rosary.ROSARY, -- the segments themselves <> joints: Rosary.ROSARY, -- the segCount+1 joints at which the segments meet <> extraPoints: LIST OF Point, outline: Outline, -- the parent outline of this trajectory, boundBox: BoundBox, visibleJoints: BOOL _ TRUE, strokeJoint: Imager.StrokeJoint _ round, selected: SelectedObjectData ]; BoundBox: TYPE = REF BoundBoxObj; BoundBoxObj: TYPE = RECORD [loX, loY, hiX, hiY: REAL]; FenceHoleOpen: TYPE = {fence, hole, open}; TrajEnd: TYPE = {lo, hi}; Joint: TYPE = REF JointObj; JointObj: TYPE = RECORD [ point: Point, selected: SelectedObjectData, touchItem: TouchItem ]; JointPair: TYPE = RECORD [ start, end: NAT ]; Sequence: TYPE = REF SequenceObj; SequenceObj: TYPE = RECORD [ traj: Traj, all: BOOL _ FALSE, -- does this sequence represent the whole trajectory? If so parts = LIST[0, 0] and all = TRUE parts: LIST OF JointPair, selected: SelectedObjectData, boundBox: BoundBox ]; <> Segment: TYPE = REF SegmentObj; SegmentObj: TYPE = RECORD [ class: SegmentClass, looks: Rope.ROPE, -- may be used later for the style machinery strokeWidth: REAL _ 1.0, -- for now color: Imager.Color, -- for now lo, hi: Point, hiTan, loTan: Point _ [0,0], --[0,0] is the undefined value for the tangents. selected: SelectedObjectData, boundBox: BoundBox, touchItemList: LIST OF TouchItem, data: REF ANY ]; SegmentClass: TYPE = REF SegmentClassObj; SegmentClassObj: TYPE = RECORD [ type: ATOM, copyData: CopyDataProc, reverse: ReverseProc, transform: TransformProc, endpointMoved: EndPointMovedProc, maskStroke: MaskStrokeProc, maskStrokeTransform: MaskStrokeTransformProc, buildPath: BuildPathProc, buildPathTransform: BuildPathTransformProc, closestPoint: ClosestPointProc, closestPointAndTangent: ClosestPointAndTangentProc, boundBox: BoundBoxProc ]; CopyDataProc: TYPE = PROC [seg: Segment] RETURNS [data: REF ANY]; <> ReverseProc: TYPE = PROC [seg: Segment]; <> TransformProc: TYPE = PROC [transform: ImagerTransformation.Transformation, seg: Segment]; <> EndPointMovedProc: TYPE = PROC [seg: Segment, lo: BOOL, newPoint: Point]; MaskStrokeProc: TYPE = PROC [dc: Imager.Context, seg: Segment]; <> MaskStrokeTransformProc: TYPE = PROC [dc: Imager.Context, seg: Segment, transform: ImagerTransformation.Transformation, entire, lo, hi: BOOL]; <> BuildPathProc: TYPE = PROC [seg: Segment, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc, conicTo: ImagerPath.ConicToProc, arcTo: ImagerPath.ArcToProc]; <> BuildPathTransformProc: TYPE = PROC [seg: Segment, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc, conicTo: ImagerPath.ConicToProc, arcTo: ImagerPath.ArcToProc, transform: ImagerTransformation.Transformation, entire, lo, hi: BOOL]; <> ClosestPointProc: TYPE = PROC [seg: Segment, testPoint: Point, tolerance: REAL] RETURNS [point: Point, success: BOOL]; <> ClosestPointAndTangentProc: TYPE = PROC [seg: Segment, testPoint: Point, tolerance: REAL] RETURNS [point: Point, tangent: Vector, success: BOOL]; <> BoundBoxProc: TYPE = PROC [seg: Segment]; <> <<>> <> <<>> EntityGenerator: TYPE = REF EntityGeneratorObj; EntityGeneratorObj: TYPE = RECORD [ list: LIST OF REF ANY ]; <<>> TrajGenerator: TYPE = REF TrajGeneratorObj; TrajGeneratorObj: TYPE = RECORD [ list: LIST OF Traj ]; SequenceGenerator: TYPE = REF SequenceGeneratorObj; SequenceGeneratorObj: TYPE = RECORD [ list: LIST OF Sequence ]; SegmentGenerator: TYPE = REF SegmentGeneratorObj; SegmentGeneratorObj: TYPE = RECORD [ traj: Traj, toGo: NAT, index: NAT _ 0, nextParts: LIST OF JointPair ]; JointGenerator: TYPE = REF JointGeneratorObj; JointGeneratorObj: TYPE = RECORD [ traj: Traj, toGo: NAT, index: NAT, nextParts: LIST OF JointPair ]; BoundBoxGenerator: TYPE = REF BoundBoxGeneratorObj; BoundBoxGeneratorObj: TYPE = RECORD [ list: LIST OF BoundBox ]; <<>> <> <<>> TouchGroup: TYPE = REF TouchGroupObj; TouchGroupObj: TYPE = RECORD [ list: LIST OF TouchItem, point: Point, updated: BOOL _ FALSE ]; TouchingPartType: TYPE = {joint, segment}; TouchItem: TYPE = REF TouchItemObj; TouchItemObj: TYPE = RECORD [ group: TouchGroup, traj: Traj, touchingPartType: TouchingPartType, joint: Joint, seg: Segment, segPoint: Point ]; <<>> END.