| Class Overview |
bool Contains(BPoint point) const;
Returns true if point lies within the region,
and false if not.
BRect Frame() const;Returns the smallest rectangle that encloses all the rectangles in the region.
If the region is empty, the returned object will be invalid. Check the return thus:
rect=region.Frame(); if (rect.IsValid()) /* okay */ else /* nope */
bool Intersects(BRect rect) const;
Returns true if the BRegion
has any area in common with rect, and false
if not.
void OffsetBy(int32 horizontal,
int32 vertical);
Offsets all rectangles in the region by horizontal and
vertical deltas.
void PrintToStream() const;
Prints (to standard out) each rectangle in the BRegion in the form:
"BRect(left,top,right,bottom)"
The first string that's printed is the object's frame rectangle. Each
subsequent string describes a single rectangle in the BRegion.
BRect RectAt(int32 index);int32 CountRects();
CountRects() returns the total number of
rectangles in the BRegion;
RectAt() returns the rectangle at a particular
index. The order of the
rectangles is unimportant.
void Set(BRect rect);void Include(BRect rect);
void Include(const BRegion* region);
void Exclude(BRect rect);
void Exclude(const BRegion* region);
void IntersectWith(const BRegion* region);
Set() modifies the BRegion
so that it only contains rect.
Include() modifies the region to include (copies of)
the rectangles contained in rect or region.
Exclude() modifies the region to exclude all rectangles contained in
rect or region..
IntersectWith() modifies the region so that it includes only those areas
that it has in common with another region.