PROCEDURE LocatePointRelativeToBorder(p: Point; b: Border) : Sign = (* ------------------------------------------------------------------ *) (* Returns +1 if the point "p" is on the left side of the border "b"; *) (* that is, if "p" is "inside" the border "b". If "p" is on the *) (* border "b" then returns 0 and if "p" is on the right side of "b" *) (* then returns -1. *) (* ------------------------------------------------------------------ *) VAR s : Sign; PROCEDURE SideOfPointRelativeToCorner(c: Corner) = VAR saux : Sign; BEGIN Wr.PutText(Stdio.stdout," Em SideOfPointRelativeToCorner --> carc = "); SMGeo.PrintArc(Stdio.stdout,GetArcGeometry(c)); Wr.Flush(Stdio.stdout); IF c.isIsolatedVertex() THEN IF SMGeo.AreSamePoints(p,GetVertexGeometry(c)) THEN s:=0 END ELSIF s = 1 THEN (* it's not decided yet *) WITH circ = GetEdgeGeometry(c), s2 = SMGeo.SidePointCircle(p,circ) DO IF s2 = 0 THEN IF SMGeo.IsPointInArc(p,GetArcGeometry(c),saux) THEN s:=0 END ELSIF s2 = -1 THEN s := -1 END END END; Wr.PutText(Stdio.stdout," Em SideOfPointRelativeToCorner --> s = "&Fmt.Int(s)&"\n"); Wr.Flush(Stdio.stdout); END SideOfPointRelativeToCorner; BEGIN s:=1; b.walkOn(SideOfPointRelativeToCorner, NotGetFaces); Wr.PutText(Stdio.stdout,"Em LocatePointRelativeToBorder --- s = "&Fmt.Int(s)&"\n"); Wr.Flush(Stdio.stdout); RETURN s; END LocatePointRelativeToBorder;