INTERFACE Edge; (* A edge from a model *) IMPORT Vertex, Face; TYPE T = RECORD v: EndPoints; (* Endpoints indices in "T.vertex" *) f: SideFaces; (* Up to 2 faces incident to the edge *) END; (* The faces and endpoints are sorted so that "v[0]->v[1]" agrees with the corner order of face "f[0]", and is opposite to that of face "f[1]". *) EndPoints = ARRAY [0..1] OF Vertex.Num; (* Endpoints of an edge. *) SideFaces = ARRAY [0..1] OF Face.Num; (* Faces incident incident to an edge *) TYPE List = ARRAY OF T; Num = CARDINAL; (* Index in a "List" *) Name = TEXT; CONST None = LAST(CARDINAL); (* NIL value for "Num" *) PROCEDURE Copy(READONLY edge: List; extra: CARDINAL := 0): REF List; (* Makes a copy of the list, with room at the end for "extra" new edges. *) PROCEDURE GetVertices(READONLY edge: List): REF ARRAY OF Vertex.Num; (* Returns the numbers of the vertices which are endpoints of the given edges. *) PROCEDURE GetEdges(READONLY face: Face.List): REF List; (* Returns all the edges appearing in the given faces. If an edge is incident to "n" faces, it will be listed up to "(n+1) DIV 2" times; the "f" fields will list all faces, paired arbitrarily (but each pair with opposite orientation). When an entry in this list has only one incident face, "f[0]" is that face, and "f[1] = Face.None". *) END Edge.