<> <> <> <<>> DIRECTORY IO, EuclideanGraphs, ConvexEuclideanGraphs; ConvexCombiner: CEDAR DEFINITIONS <> = BEGIN OPEN EG: EuclideanGraphs, CEG: ConvexEuclideanGraphs; <> <<>> Vertex: TYPE = EG.Vertex; -- A single (outline) vertex is sufficient representation for a combiner database, since ConvexEuclideanGraphs are assumed to be connected, so a single vertex is sufficient entree into the graph. Point: TYPE = EG.Point; Verbosity: TYPE = CEG.Verbosity; <<>> <> <<>> ClientDataCombiner: TYPE = PROC[currentClientdata, inputClientdata: REF] RETURNS [resultClientData: REF]; -- note well the order of input parameters. <> <> ClientDataEqual: TYPE = PROC [clientData1, clientData2: REF] RETURNS [BOOL]; <> <<>> IsAProc: TYPE = CEG.IsAProc; <<>> <
> Combiner: PROC[currentEnd, inputEnd: Vertex, inputClientData: REF, clientDataCombiner: ClientDataCombiner, verbosity: Verbosity _ NIL] RETURNS [combinedEnd: Vertex]; <> <<>> CombineGeometry: PROC[currentEnd, inputEnd: Vertex, setIntersectionPolygonEdges: BOOL _ TRUE, verbosity: Verbosity _ NIL] RETURNS [combinedEnd, intersectionPolyStart, intersectionPolyEnd: Vertex]; <> <> <<>> CombineClientData: PROC[ intersectionPolyStart, intersectionPolyEnd: Vertex, inputClientData: REF, clientDataCombiner: ClientDataCombiner, verbosity: Verbosity _ NIL]; <<[intersectionPolyStart, intersectionPolyEnd] is a counterclockwise oriented (directed) edge in the current (i.e. combined) geometry which is contained in the intersection polygon (of current figure and input polygon), and such that the interior of the intersection polygon lies to its left. inputClientData is the state of the input polygon. clientDataCombiner is the rule for state combination.>> <> <> <<>> <> <<>> InputIntersectsCurrent: PROC [inputStart, inputEnd, currentVertex: Vertex, verbosity: Verbosity _ NIL] RETURNS [outlineStart, outlineEnd: Vertex _ NIL, intersectionPolyStart, intersectionPolyEnd: Vertex]; <> <> <> <<>> InputExternalToCurrent: PROC[ currentStart, currentEnd, inputStart, inputEnd: Vertex, currentOutlineCOM, inputCOM: Point, verbosity: Verbosity _ NIL] RETURNS [outlineStart, outlineEnd: Vertex]; <<[currentStart, currentEnd] is a counterclockwise oriented edge on the (convex) outline of the current figure. [inputStart, inputEnd] is a counterclockwise oriented edge on the input polygon. [currentStart, currentEnd] defines a sector of the current figure in (the closure of) which inputStart lies. [outlineStart, outlineEnd] is a counterclockwise oriented edge on the outline which results from joining currentStart and currentEnd to inputStart with edges.>> <> <> <<>> PolygonEnclosesPolygon: PROC[ innerCOM: Point, innerStart, innerEnd, outerStart, outerEnd: Vertex, verbosity: Verbosity _ NIL]; <<[innerStart, innerEnd] is a counterclockwise oriented edge on the inner polygon. [outerStart, outerEnd] is a counterclockwise oriented edge on the outer polygon.>> <> <> HandleVertexContact: PROC [firstIntersection, inputStart, inputEnd, currentVertex: Vertex, verbosity: Verbosity _ NIL] RETURNS [returnedToFirstIntersection: BOOL, nextLensInExterior: BOOL _ FALSE, currentCommonVertex, nextCurrentVertex, nextInputVertex: Vertex _ NIL]; <> << [inputStart, inputEnd] is outgoing edge of input polygon. It is assumed that inputStart and currentVertex have same coordinates and have not yet been merged.>> <> <<>> LensDecomposition: PROC[firstIntersection, lensStart, innerEnd, outerEnd: Vertex, lensInExterior: BOOL, setIntersectionPolygonEdges: BOOL _ TRUE, verbosity: Verbosity _ NIL] RETURNS [returnedToFirstIntersection: BOOL, innerPrevious, innerCommon, outerPrevious, outerCommon: Vertex]; <> <> <> <<>> BoundaryContactOnly: PROC[inputStart, inputEnd, currentVertex: Vertex, verbosity: Verbosity _ NIL]; <> <> <> <<>> SimpleCleaner: PROC [currentEnd: Vertex, clientDataEqual: ClientDataEqual, verbosity: Verbosity _ NIL]; END. <<>>