.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Tickit::RectSet 3pm" .TH Tickit::RectSet 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME "Tickit::RectSet" \- store a set of rectangular regions .SH DESCRIPTION .IX Header "DESCRIPTION" Objects in this class store a set of rectangular regions. The object tracks which areas are covered, to ensure that overlaps are avoided, and that neighbouring regions are merged where possible. The order in which they are added is not important. .PP New regions can be added using the \f(CW\*(C`add\*(C'\fR method. The \f(CW\*(C`rects\*(C'\fR method returns a list of non-overlapping Tickit::Rect regions, in top-to-bottom, left-to-right order. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .SS new .IX Subsection "new" .Vb 1 \& $rectset = Tickit::RectSet\->new .Ve .PP Returns a new \f(CW\*(C`Tickit::RectSet\*(C'\fR instance, initially empty. .SH METHODS .IX Header "METHODS" .SS rects .IX Subsection "rects" .Vb 1 \& @rects = $rectset\->rects .Ve .PP Returns a list of the covered regions, in order first top to bottom, then left to right. .SS add .IX Subsection "add" .Vb 1 \& $rectset\->add( $rect ) .Ve .PP Adds the region covered by \f(CW$rect\fR to the stored region list. .SS subtract .IX Subsection "subtract" .Vb 1 \& $rectset\->subtract( $rect ) .Ve .PP Removes any covered region that intersects with \f(CW$rect\fR from the stored region list. .SS clear .IX Subsection "clear" .Vb 1 \& $rectset\->clear .Ve .PP Remove all the regions from the set. .SS intersects .IX Subsection "intersects" .Vb 1 \& $bool = $rectset\->intersects( $rect ) .Ve .PP Returns true if \f(CW$rect\fR intersects with any region in the set. .SS contains .IX Subsection "contains" .Vb 1 \& $bool = $rectset\->contains( $rect ) .Ve .PP Returns true if \f(CW$rect\fR is entirely covered by the regions in the set. Note that it may be that the rect requires two or more regions in the set to completely cover it. .SH AUTHOR .IX Header "AUTHOR" Paul Evans