RRegion Class Reference

class RRegion : public TRegion

Expandable region.

This class provides for the construction and destruction of a TRegion, including a granularity for expanding the region. A region;s granularity represents the number of memory slots allocated when the object is created, and the number of new memory slots allocated each time an RRegion is expanded beyond the number of free slots. The default granularity is five.

Inherits from

Public Member Functions
RRegion()
RRegion(TInt)
RRegion(const RRegion &)
RRegion(const TRect &, TInt)
RRegion(TInt, TRect *, TInt)
TInt CheckSpare()
IMPORT_C voidClose()
IMPORT_C voidDestroy()
Protected Member Functions
RRegion(TInt, TInt)
Inherited Functions
TRegion::AddRect(const TRect &)
TRegion::AppendRect(const TRect &)
TRegion::AppendRegion(TRegion &)
TRegion::BoundingRect()const
TRegion::CheckError()const
TRegion::Clear()
TRegion::ClipRect(const TRect &)
TRegion::Contains(const TPoint &)const
TRegion::Copy(const TRegion &)
TRegion::Count()const
TRegion::DeleteRect(TRect *)
TRegion::ExpandRegion(TInt)
TRegion::ForceError()
TRegion::Intersect(const TRegion &)
TRegion::Intersection(const TRegion &,const TRegion &)
TRegion::Intersects(const TRect &)const
TRegion::IsContainedBy(const TRect &)const
TRegion::IsEmpty()const
TRegion::MergeRect(const TRect &,TBool)
TRegion::Offset(TInt,TInt)
TRegion::Offset(const TPoint &)
TRegion::RectangleList()const
TRegion::RectangleListW()
TRegion::SetListSize(TInt)
TRegion::ShrinkRegion()
TRegion::Sort()
TRegion::Sort(const TPoint &)
TRegion::SubRect(const TRect &,TRegion *)
TRegion::SubRegion(const TRegion &,TRegion *)
TRegion::SubtractRegion(const TRegion &,TRegion *)
TRegion::TRegion()
TRegion::TRegion(TInt)
TRegion::Tidy()
TRegion::Union(const TRegion &)
TRegion::operator[](TInt)const
Inherited Enumerations
TRegion:@20
Private Attributes
TInt iGranularity
TRect *iRectangleList
Inherited Attributes
TRegion::iAllocedRects
TRegion::iCount
TRegion::iError

Constructor & Destructor Documentation

RRegion(TInt, TInt)

IMPORT_CRRegion(TIntaBuf,
TIntaGran
)[protected]

Parameters

TInt aBuf
TInt aGran

RRegion()

IMPORT_CRRegion()

Default constructor.

Initialises its granularity to five.

RRegion(TInt)

IMPORT_CRRegion(TIntaGran)

Constructs the object with the specified granularity.

Parameters

TInt aGranThe initial value for the region's granularity. This value must not be negative.

RRegion(const RRegion &)

IMPORT_CRRegion(const RRegion &aRegion)

Copy constructor.

Constructs a new region from an existing one by performing a bit-wise copy. Both the new and existing regions are left containing pointers to the same data, so Close() must only be called on one of them.

Use of this method is not recommended.

Parameters

const RRegion & aRegionThe region to be copied.

RRegion(const TRect &, TInt)

IMPORT_CRRegion(const TRect &aRect,
TIntaGran = EDefaultGranularity
)

Constructs the object with the specified rectangle and granularity.

The resulting region consists of the specified single rectangle.

Parameters

const TRect & aRectThe single rectangle with which to initialise the region
TInt aGran = EDefaultGranularityThe initial value for the region's granularity. By default, this is five.

RRegion(TInt, TRect *, TInt)

IMPORT_CRRegion(TIntaCount,
TRect *aRectangleList,
TIntaGran = EDefaultGranularity
)

Constructor that takes ownership of an already created rectangle list.

Parameters

TInt aCountThe number of rectangles in the region.
TRect * aRectangleListA pointer to the set of rectangles.
TInt aGran = EDefaultGranularityThe region's granularity.

Member Functions Documentation

CheckSpare()

TInt CheckSpare()const [inline]

Gets the number of free memory slots in the region.

This is the number of slots which have been allocated, minus the number in use.

Close()

IMPORT_C voidClose()

Closes the region.

Frees up any memory which has been allocated, and unsets the error flag, if set.

The region can be re-used after calling this method. Its granularity is preserved.

Destroy()

IMPORT_C voidDestroy()

Deletes the region.

Frees all memory.

Note this method will delete the RRegion object and therefore it should not be invoked on RRegion objects that are not allocated on the heap. RRegion::Close() should be used for RRegion objects stored on the stack.

panic
USER 42 if the RRegion object is stored on the stack.

Member Data Documentation

TInt iGranularity

TInt iGranularity[private]

TRect * iRectangleList

TRect *iRectangleList[private]