1Tickit::RectSet(3pm) User Contributed Perl Documentation Tickit::RectSet(3pm)
2
3
4
6 "Tickit::RectSet" - store a set of rectangular regions
7
9 Objects in this class store a set of rectangular regions. The object
10 tracks which areas are covered, to ensure that overlaps are avoided,
11 and that neighbouring regions are merged where possible. The order in
12 which they are added is not important.
13
14 New regions can be added using the "add" method. The "rects" method
15 returns a list of non-overlapping Tickit::Rect regions, in top-to-
16 bottom, left-to-right order.
17
19 new
20 $rectset = Tickit::RectSet->new
21
22 Returns a new "Tickit::RectSet" instance, initially empty.
23
25 rects
26 @rects = $rectset->rects
27
28 Returns a list of the covered regions, in order first top to bottom,
29 then left to right.
30
31 add
32 $rectset->add( $rect )
33
34 Adds the region covered by $rect to the stored region list.
35
36 subtract
37 $rectset->subtract( $rect )
38
39 Removes any covered region that intersects with $rect from the stored
40 region list.
41
42 clear
43 $rectset->clear
44
45 Remove all the regions from the set.
46
47 intersects
48 $bool = $rectset->intersects( $rect )
49
50 Returns true if $rect intersects with any region in the set.
51
52 contains
53 $bool = $rectset->contains( $rect )
54
55 Returns true if $rect is entirely covered by the regions in the set.
56 Note that it may be that the rect requires two or more regions in the
57 set to completely cover it.
58
60 Paul Evans <leonerd@leonerd.org.uk>
61
62
63
64perl v5.38.0 2023-07-21 Tickit::RectSet(3pm)