INTERFACE Face; (* A face from a model *) IMPORT Vertex, Cell; TYPE T = RECORD v: Corners; (* Buried vertex and face corners *) t: CornerTags; (* Persistent corner labels. *) c: SideCells; (* Adjacent cells *) p: SidePoints; (* Opposed vertices in those cells *) s: SideTags; (* Corner tags of those vertices in those cells. *) END; Corners = ARRAY [0..2] OF Vertex.Num; (* The vertices at the face corners, in any order. *) CornerTag = CHAR; CornerTags = ARRAY [0..2] OF CornerTag; (* Persistent labels for the corners of a face. When corners are permuted, these labels are carried along. The tag of a corner also labels implicitly the opposite edge of the face. *) SideCells = ARRAY [0..1] OF Cell.Num; SidePoints = ARRAY [0..1] OF Vertex.Num; SideTags = ARRAY [0..1] OF Cell.CornerTag; (* The two cells separated by a face, their vertices opposite to that face, and the corresponding tags in those cells. If the face is exposed, only element "[0]" is defined, and element "[1]" is "None". *) TYPE List = ARRAY OF T; Num = CARDINAL; (* Index in a "List" *) Name = TEXT; CONST None = LAST(CARDINAL); (* NIL value for "Num" *) PROCEDURE Copy(READONLY face: List; extra: CARDINAL := 0): REF List; (* Makes a copy of "face", with extra room at the end for "extra" new vertices. *) PROCEDURE GetFreeFaces(READONLY cell: Cell.List): REF List; (* Returns an array with all free (unshared) faces in the given set of cells. The name of each face will be the cell name, posfixed with ":" and the label of the the opposite corner. If the cells corners are positioned so as to form a positive screw, the face corners will be sorted counterclockwise as seen from the outside. *) PROCEDURE GetStar(READONLY edge: List; v: Vertex.Num): REF ARRAY OF Vertex.Num; (* Returns a list of the vertex "v" and all vertices that are adjacent to "v" in the graph "G" defined by the given "edge" list. The subgraph of "G" induced by those those neighbors MUST be a simple circuit. The vertices will be listed in order along this circuit, from an arbitrary starting vertex and in an arbitrary direction. *) END Face.