class PRegion: public PObject

A class representing a region of the graphics system drawing plane.

Inheritance:


Public Methods

[more] PRegion ()
Create new region object.
[more] PRegion ( const PRegion & rgn )
Create a copy of the specified region.
[more]PRegion& operator= ( const PRegion & rgn )
Assign one region to another.
[more]virtual ~PRegion ()
Destroy the region.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine if the two regions are identical.
[more]void Add ( const PRect & rect )
Add the specified area of the drawing plane to the region.
[more]BOOL ContainsPoint ( const PPoint & pt ) const
Determine if the point is contined within the regions space.
[more]BOOL ContainsRect (const PRect & rect) const
Determine if the rectangle is wholly contiained within the region.
[more]BOOL OverlapsRect (const PRect & rect) const
Determine if any part of the rectangle overlapps any part of the region.
[more]BOOL IsEmpty () const
Determine if the region is empty.
[more]void Offset ( PORDINATE dx, PORDINATE dy )
Move the region the specified delta amount.
[more]PRect GetBounds () const
Calculate the smallest enclosing bounding box around the region.
[more]PRegion Intersection (const PRegion & rgn) const
Calculate the region that is the intersection of the object and the specified region.
[more]PRegion Union (const PRegion & rgn) const
Calcaulte the region that is the union of the object and the specified region.

Public

[more] Overrides from class PObject
[more] New functions for class


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

A class representing a region of the graphics system drawing plane. This is an arbitrary enclosed shape. It is often made up from a collection of rectangles.
o PRegion()
Create new region object. The first, parameterless, constructor creates an empty region. The second creates a region that initially encloses the specified rectangle.

o PRegion( const PRegion & rgn )
Create a copy of the specified region.
Parameters:
rgn - Region to copy.

oPRegion& operator=( const PRegion & rgn )
Assign one region to another.
Parameters:
rgn - Region to assign to the current region.

ovirtual ~PRegion()
Destroy the region.

o Overrides from class PObject

ovirtual Comparison Compare( const PObject & obj ) const
Determine if the two regions are identical.

Returns:
EqualTo if the regions enclose the identical part of the drawing plane, otherwise GreaterThan is returned.
Parameters:
obj - Region to compare against.

o New functions for class

ovoid Add( const PRect & rect )
Add the specified area of the drawing plane to the region. The region will include the area specified into its enclosed space.
Parameters:
rect - Rectangle to add to teh region.

oBOOL ContainsPoint( const PPoint & pt ) const
Determine if the point is contined within the regions space.

Returns:
TRUE if point is in region.
Parameters:
pt - Point to determine if is inside region.

oBOOL ContainsRect(const PRect & rect) const
Determine if the rectangle is wholly contiained within the region.

Returns:
TRUE if rectangle is in region.

oBOOL OverlapsRect(const PRect & rect) const
Determine if any part of the rectangle overlapps any part of the region.

Returns:
TRUE if rectangle intersect region.

oBOOL IsEmpty() const
Determine if the region is empty.

Returns:
TRUE if region encloses no space.

ovoid Offset( PORDINATE dx, PORDINATE dy )
Move the region the specified delta amount. The shape of the region does not change, only its origin.
Parameters:
dx - Amount to move region horizontally.
dy - Amount ot move region vertically.

oPRect GetBounds() const
Calculate the smallest enclosing bounding box around the region.

Returns:
rectangle that encloses the region.

oPRegion Intersection(const PRegion & rgn) const
Calculate the region that is the intersection of the object and the specified region.

Returns:
region that is inside both regions.

oPRegion Union(const PRegion & rgn) const
Calcaulte the region that is the union of the object and the specified region.

Returns:
region that is inside either region.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.