DIRECTORY COGCart USING [Box], COGDiagram USING [DEdge], Process USING [Milliseconds], COGVoronoi USING [VertexRec], COGDrawing USING [Drawing, Color, Size, black]; COGVorTest: CEDAR DEFINITIONS = BEGIN OPEN Cart: COGCart, Draw: COGDrawing, Diag: COGDiagram, Vor: COGVoronoi; drBox: Cart.Box = [min: [-1, -1], max: [1, 1]]; -- Bounding box for data points theDrawing: READONLY Draw.Drawing; -- The drawing where the Delaunay is being displayed ShowEdge: PROC [e: Diag.DEdge, color: Draw.Color _ Draw.black, width: Draw.Size _ 0]; ShowRegion: PROC [e: Diag.DEdge, color: Draw.Color _ Draw.black, side: Draw.Size _ 0]; ShowVertex: PROC [v: REF Vor.VertexRec, color: Draw.Color _ Draw.black, side: Draw.Size _ 0]; ShowDelay: Process.Milliseconds; -- Extra delay after each Show operation. CleanTheDrawing: PROC [repaint: BOOL _ FALSE]; END. n-- COGVorTest.mesa: definitions for Voronoi test programs -- last modified by Stolfi - October 16, 1982 5:23 pm -- The property $DelObj of theDrawing will be "the" Delaunay object; its parms.data.field is "the" Delaunay. -- The delaunay will have three points at the Mercedes infinities, and the edge dlau.dg will connect the the bottom two of these, from left to right. -- DEBUGGING AIDS FOR DELAUNAY DIAGRAMS - - - - - - - - - - - - - - - - - - - - - - - - - -- The procedures below are useful for debugging voronoi algorithms. They add to theDrawing individual edges, vertices and regions, as "temporary" objects to be drawn on top of the current diagram. All these objects can be removed in a single swoop by calling CleanTheDrawing. -- NOTE: The client must have or acquire write access to theDrawing before invoking these procedures. -- Makes an isolated Delaunay edge e into a temporary object that will paint itself in dual or primal form, depending on whether $Voronoi is in the drawData list. The width is in pixels (0 or 1 gives the "thin" line of CedarGraphics). -- The object's parms.data field points to the whole edge record; parms.style tells which of the four quarters of e is to be considered. It should always be a Delaunay edge (Org[e] :: DVertex), even when $Voronoi is on. -- The edge e must have a DVertex as origin. The resulting object will normally paint Org[e] as a small square; however, if $Voronoi is in the drawData list, the corresponding Voronoi region will be painted instead. -- Makes an isolated DVertex or VVertex d into a Drawing object that will paint itself as a square with given side (in pixels). -- Removes from dr all "temporary" objects (i.e., those with paintOrder # 3) that were added by ShowEdge, ShowVertex, etc.. If repaint = TRUE, repaints the remaining objects from scratch; otherwise, merely erases the removed ones (by painting them white). ÊÀ– "Mesa" style˜IprocšÏcÐbc'™9Kš5™5Kš œÏk œ ŸœŸœŸœŸœŸœ#˜³KšÏb œŸœŸ œ˜KšŸœŸœD˜PKš œ+˜Oš  œŸœ4˜WKšl™lKš•™•—K˜šY™YK™KšQž ©ž™”Kšœ œ" œ ž œ"™e—šÏnœŸœG˜UKš #žžœ Lž ž ž>™êKšœ  œ(  œ% œ; œ œ œ  œ™Û—š¡ œŸœF˜VKšVžž!žS™×—š¡ œŸœŸœE˜]Kš(žžG™—Kš  œž ˜Jš¡œŸœ ŸœŸœ˜.Kš žNžž  œ r™ÿ—KšŸœ˜J˜—…—\ Š