18 Aug 2021 11:38:55 UTC
- Distribution: Tickit
- Module version: 0.72
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (11)
- Testers (11 / 0 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Perl: v5.14.0
- Activity24 month
- Download (121.95KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Tickit::RectSet- store a set of rectangular regions
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.
New regions can be added using the
rectsmethod returns a list of non-overlapping Tickit::Rect regions, in top-to-bottom, left-to-right order.
$rectset = Tickit::RectSet->new
Returns a new
Tickit::RectSetinstance, initially empty.
@rects = $rectset->rects
Returns a list of the covered regions, in order first top to bottom, then left to right.
$rectset->add( $rect )
Adds the region covered by
$rectto the stored region list.
$rectset->subtract( $rect )
Removes any covered region that intersects with
$rectfrom the stored region list.
Remove all the regions from the set.
$bool = $rectset->intersects( $rect )
Returns true if
$rectintersects with any region in the set.
$bool = $rectset->contains( $rect )
Returns true if
$rectis 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.
Paul Evans <email@example.com>