Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
RRegion Class Reference

Expandable region. More...

#include <e32std.h>

Inheritance diagram for RRegion:
TRegion RRegionBuf< S >

Public Member Functions

IMPORT_C RRegion ()
 Default constructor.
 
IMPORT_C RRegion (TInt aGran)
 Constructs the object with the specified granularity.
 
IMPORT_C RRegion (const RRegion &aRegion)
 Copy constructor.
 
IMPORT_C RRegion (const TRect &aRect, TInt aGran=EDefaultGranularity)
 Constructs the object with the specified rectangle and granularity.
 
IMPORT_C RRegion (TInt aCount, TRect *aRectangleList, TInt aGran=EDefaultGranularity)
 Constructor that takes ownership of an already created rectangle list.
 
IMPORT_C void Close ()
 Closes the region.
 
IMPORT_C void Destroy ()
 Deletes the region.
 
TInt CheckSpare () const
 Gets the number of free memory slots in the region.
 
- Public Member Functions inherited from TRegion
TInt Count () const
 Gets the number of rectangles in this region.
 
const TRect * RectangleList () const
 Gets a pointer to the array of rectangles defining this region.
 
TBool CheckError () const
 Tests whether the region's error flag is set.
 
IMPORT_C TBool IsEmpty () const
 Tests whether the region is empty.
 
IMPORT_C TRect BoundingRect () const
 Gets the minimal rectangle that bounds the entire region.
 
IMPORT_C const TRect & operator[] (TInt aIndex) const
 Gets a rectangle from the region.
 
IMPORT_C void Copy (const TRegion &aRegion)
 Copies another region to this region.
 
IMPORT_C void AddRect (const TRect &aRect)
 Adds a rectangle to this region.
 
IMPORT_C void SubRect (const TRect &aRect, TRegion *aSubtractedRegion=NULL)
 Removes a rectangle from this region.
 
IMPORT_C void Offset (TInt aXoffset, TInt aYoffset)
 Moves the region by adding X and Y offsets to the co-ordinates of its corners.
 
IMPORT_C void Offset (const TPoint &aOffset)
 Moves the region by adding a TPoint offset to the co-ordinates of its corners.
 
IMPORT_C void Union (const TRegion &aRegion)
 Replaces this region with the union of it and the specified region.
 
IMPORT_C void Intersection (const TRegion &aRegion, const TRegion &aRegion2)
 Replaces this region with the area of intersection between two specified regions.
 
IMPORT_C void Intersect (const TRegion &aRegion)
 Replaces this region with the area of intersection between it and the specified region.
 
IMPORT_C void SubRegion (const TRegion &aRegion, TRegion *aSubtractedRegion=NULL)
 Removes a region.
 
IMPORT_C void ClipRect (const TRect &aRect)
 Clips the region to the specified rectangle.
 
IMPORT_C void Clear ()
 Clears this region.
 
IMPORT_C void Tidy ()
 Merges all rectangles within this region which share an adjacent edge of the same length.
 
IMPORT_C TInt Sort ()
 Sorts the region's array of rectangles according to their vertical position on the screen.
 
IMPORT_C TInt Sort (const TPoint &aOffset)
 Sorts the region's array of rectangles according to a specified sort order.
 
IMPORT_C void ForceError ()
 Sets the error flag, and clears the region.
 
IMPORT_C TBool IsContainedBy (const TRect &aRect) const
 Tests whether the region is fully enclosed within the specified rectangle.
 
IMPORT_C TBool Contains (const TPoint &aPoint) const
 Tests whether a point is located within the region.
 
IMPORT_C TBool Intersects (const TRect &aRect) const
 Tests whether where there is any intersection between this region and the specified rectangle.
 

Protected Member Functions

IMPORT_C RRegion (TInt aBuf, TInt aGran)
 
- Protected Member Functions inherited from TRegion
IMPORT_C TRect * RectangleListW ()
 
IMPORT_C TRegion (TInt aAllocedRects)
 
 TRegion ()
 
TBool SetListSize (TInt aCount)
 Ensure that the region is big enough to hold aCount rectangles.
 
void AppendRect (const TRect &aRect)
 
void DeleteRect (TRect *aRect)
 
void AppendRegion (TRegion &aRegion)
 
void MergeRect (const TRect &aRect, TBool aEnclosed)
 Merges a rectangle with this region.
 
void SubtractRegion (const TRegion &aRegion, TRegion *aSubtractedRegion=NULL)
 Removes a region.
 
void ShrinkRegion ()
 After an RRegion's iCount has reduced try to release some memory.
 
TRect * ExpandRegion (TInt aCount)
 Ensure that the region is big enough to hold aCount rectangles.
 

Friends

class TRegion
 

Additional Inherited Members

- Protected Types inherited from TRegion
enum  { ERRegionBuf =0x40000000 }
 
- Protected Attributes inherited from TRegion
TInt iCount
 
TBool iError
 
TInt iAllocedRects
 

Detailed Description

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.

API status
Published to all clients. Released API.

Definition at line 2837 of file e32std.h.

Constructor & Destructor Documentation

◆ RRegion() [1/6]

IMPORT_C RRegion::RRegion ( TInt  aBuf,
TInt  aGran 
)
protected

◆ RRegion() [2/6]

IMPORT_C RRegion::RRegion ( )

Default constructor.

Initialises its granularity to five.

(generated from Symbian Developer Library)

◆ RRegion() [3/6]

IMPORT_C RRegion::RRegion ( TInt  aGran)

Constructs the object with the specified granularity.

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

(generated from Symbian Developer Library)

◆ RRegion() [4/6]

IMPORT_C RRegion::RRegion ( 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
aRegionThe region to be copied.

(generated from Symbian Developer Library)

◆ RRegion() [5/6]

IMPORT_C RRegion::RRegion ( const TRect &  aRect,
TInt  aGran = EDefaultGranularity 
)

Constructs the object with the specified rectangle and granularity.

The resulting region consists of the specified single rectangle.

Parameters
aRectThe single rectangle with which to initialise the region
aGranThe initial value for the region's granularity. By default, this is five.

(generated from Symbian Developer Library)

◆ RRegion() [6/6]

IMPORT_C RRegion::RRegion ( TInt  aCount,
TRect *  aRectangleList,
TInt  aGran = EDefaultGranularity 
)

Constructor that takes ownership of an already created rectangle list.

Parameters
aCountThe number of rectangles in the region.
aRectangleListA pointer to the set of rectangles.
aGranThe region's granularity.

(generated from Symbian Developer Library)

Member Function Documentation

◆ CheckSpare()

TInt RRegion::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.

(generated from Symbian Developer Library)

◆ Close()

IMPORT_C void RRegion::Close ( )

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.

(generated from Symbian Developer Library)

◆ Destroy()

IMPORT_C void RRegion::Destroy ( )

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 condition: USER 42 if the RRegion object is stored on the stack.

(generated from Symbian Developer Library)

Friends And Related Symbol Documentation

◆ TRegion

friend class TRegion
friend

Definition at line 2855 of file e32std.h.


The documentation for this class was generated from the following files: