Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /eXene/releases/release-110.74/graph-util/region-sig.sml
ViewVC logotype

Annotation of /eXene/releases/release-110.74/graph-util/region-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3683 - (view) (download)

1 : monnier 2 (* region-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1994 by AT&T Bell Laboratories
4 :     *
5 :     * Signature for regions.
6 :     *
7 :     *)
8 :    
9 :     signature REGION =
10 :     sig
11 :     structure G : GEOMETRY
12 :    
13 :     datatype fill_rule = EvenOdd | Winding
14 :     datatype rect_overlap = RectangleOut | RectangleIn | RectanglePart
15 :    
16 :     type region
17 :    
18 :     (* Empty region *)
19 :     val empty : region
20 :    
21 :     (* Returns list of rectangles composing the region.
22 :     * The rectangles are YX banded. Specifically, the rectangles
23 :     * are listed in non-decreasing y coordinates. Two rectangles
24 :     * with the same y coordinate are listed in increasing x coordinate.
25 :     * Additionally, if the y projections of any two rectangles overlap,
26 :     * then the projections are equal. (The rectangles lie in non-overlapping
27 :     * bands.) Within a band, the rectangles are non-contiguous.
28 :     *)
29 :     val rectsOf : region -> G.rect list
30 :    
31 :     (* Construct a region corresponding to the given rectangle.
32 :     *)
33 :     val rectangle : G.rect -> region
34 :    
35 :     (* Construct a region corresponding to the polygon described by
36 :     * the list of points and the fill rule.
37 :     *)
38 :     val polygon : G.point list * fill_rule -> region
39 :    
40 :     (* Translate a region by the given vector. *)
41 :     val offset : region * G.point -> region
42 :    
43 :     (* shrink (r,PT{x,y}) strips a band x pixels horizontally
44 :     * and y pixels vertically from the boundary of r. If x or y are
45 :     * negative, pixels are added rather than stripped in that dimension.
46 :     *)
47 :     val shrink : region * G.point -> region
48 :    
49 :     (* Return the smallest rectangle containing the region. *)
50 :     val clipBox : region -> G.rect
51 :    
52 :     (* Return the region corresponding to the given set operation
53 :     * applied to two argument regions.
54 :     *)
55 :     val intersect : region * region -> region
56 :     val union : region * region -> region
57 :     val subtract : region * region -> region
58 :     val xor : region * region -> region
59 :    
60 :     (* True if the region is empty. *)
61 :     val isEmpty : region -> bool
62 :    
63 :     (* True if the two regions are equal. *)
64 :     val equal : region * region -> bool
65 :    
66 :     (* True if the two regions have non-empty intersection. *)
67 :     val overlap : region * region -> bool
68 :    
69 :     (* True if the point lies within the region. *)
70 :     val pointIn : region * G.point -> bool
71 :    
72 :     (* Returns RectangleIn if the rectangle is entirely contained
73 :     * in the region.
74 :     * returns RectangleOut if the rectangle is entirely outside
75 :     * the region.
76 :     * returns RectanglePart if the rectangle is partly in and partly
77 :     * out of the region.
78 :     *)
79 :     val rectIn : region * G.rect -> rect_overlap
80 :     end
81 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0