Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_Region Class Reference

A class to manage a platforms region data type.

List of all members.

Empty Region

OSRegion fRegion
void MakeEmptyPlatformRegion ()

Public Member Functions

void Set (RgnHandle inRegion)
RgnHandle GetAsQDRegion ()
 operator RgnHandle () const
RgnHandle Get ()
Constructor / Destructor
 CP_Region ()
 Constructor.
 CP_Region (float inLeft, float inTop, float inRight, float inBottom)
 CP_Region (const CP_Point &inLocation, const CP_Size &inSize)
 CP_Region (const CP_Rect &inRect)
 CP_Region (const CP_Region &inRegion)
 CP_Region (RgnHandle inRegion)
virtual ~CP_Region ()
 Destructor.
Comparers
bool operator== (const CP_Region &inRegion) const
bool operator!= (const CP_Region &inRegion) const
Getters
CP_Rect Bounds () const
Math - Region input
CP_Regionoperator+= (const CP_Region &inRegion)
CP_Regionoperator-= (const CP_Region &inRegion)
CP_Region operator+ (const CP_Region &inRegion)
CP_Region operator- (const CP_Region &inRegion)
CP_Regionoperator= (const CP_Region &inRegion)
Math - Point input
CP_Region operator+= (CP_Point &inPoint)
CP_Regionoperator-= (const CP_Point &inPoint)
CP_Region operator+ (CP_Point &inPoint)
CP_Region operator- (const CP_Point &inPoint)
Movement
void Offset (float inHorAmt, float inVerAmt)
void Offset (const CP_Point &amt)
Setters
void Set (float inLeft, float inTop, float inRight, float inBottom)
void Set (const CP_Point &inLocation, const CP_Size &inSize)
void Set (const CP_Rect &inRect)
void Intersect (const CP_Region &area)
void Union (CP_Region &area)
void Difference (CP_Region &inRegion)
Sizers
void Inset (float horAmt, float verAmt)
void Inset (const CP_Point &amt)
Testers
bool IsEmpty () const
bool IsValid () const
bool Contains (const CP_Rect &inRect)
bool Contains (const CP_Point &inPoint)
Utility
void MakeEmpty ()
float Width () const
float Height () const


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_Region::CP_Region  ) 
 

Constructor.

Exceptions:
none 

CP_Region::CP_Region float  inLeft,
float  inTop,
float  inRight,
float  inBottom
 

Constructor. Constructs the region from the passed in coordinates.

Parameters:
inLeft Left coordinate of the region.
inTop Top coordinate of the region.
inRight Right coordinate of the region.
inBottom Bottom coordinate of the region.
Exceptions:
none 

CP_Region::CP_Region const CP_Point inLocation,
const CP_Size inSize
 

Constructor. Constructs the region from the passed in CP_Point specifiying the top left corner, and the CP_Size specifying the size.

Parameters:
inLocation Top left corner of the region.
inSize Size of the region.
Exceptions:
none 

CP_Region::CP_Region const CP_Rect inRect  ) 
 

Constructor. Constructs the region from the passed in CP_Rect specifying the bounds of the region.

Parameters:
inRect CP_Rect specifying the bounds of the region.
Exceptions:
none 

CP_Region::CP_Region const CP_Region inRegion  ) 
 

Copy constructor. Creates a c copy of the passed in region in this object.

Parameters:
inRegion CP_Region to copy.
Exceptions:
none 

CP_Region::CP_Region RgnHandle  inRegion  ) 
 

Constructor. Constructs the region from an existing MacOS RgnHandle.

Exceptions:
none 
Parameters:
inRegion MacOS RgnHandle to set this region to.

CP_Region::~CP_Region  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

bool CP_Region::operator== const CP_Region inRegion  )  const
 

Equality operator. Checks is this region is equal to the passed in region, and returns true if they are.

Parameters:
inRegion Region to check for equality with.
Exceptions:
none 
Returns:
bool const Returns true if this region is equal to the passed in region.

CP_UseDepreciated_10_4_APIs

bool CP_Region::operator!= const CP_Region inRegion  )  const
 

Inequality operator. Checks is this region is not equal to the passed in region, and returns true if they are.

Parameters:
inRegion Region to check for inequality with.
Exceptions:
none 
Returns:
bool const Returns true if this region is not equal to the passed in region.

CP_Rect CP_Region::Bounds  )  const
 

Returns the bounds of this region.

Exceptions:
none 
Returns:
CP_Rect const The bounds of this region.

CP_Region & CP_Region::operator+= const CP_Region inRegion  ) 
 

Plus equals. Adds the passed in region to this region.

Parameters:
inRegion Region to add to this region.
Exceptions:
none 
Returns:
CP_Region& Returns a reference to ourselves.

CP_Region & CP_Region::operator-= const CP_Region inRegion  ) 
 

Minus equals. Subtracts the passed in region from this region.

Parameters:
inRegion Region to subtract from this region.
Exceptions:
Throws if an ERROR under Windows occurs
Returns:
CP_Region& Returns a reference to ourselves.

CP_Region CP_Region::operator+ const CP_Region inRegion  ) 
 

Addition operator. Adds the passed in region to this region.

Parameters:
nRegion Region to add to this region.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

CP_Region CP_Region::operator- const CP_Region inRegion  ) 
 

Subtraction operator. Subtracts the passed in region to this region.

Parameters:
inRegion Region to subtract from this region.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

CP_Region & CP_Region::operator= const CP_Region inRegion  ) 
 

Assignment operator. Copies the passed in region to this region.

Parameters:
inRegion Region to copy to this region.
Exceptions:
none 
Returns:
CP_Region& Returns a reference to ourselves.

CP_Region CP_Region::operator+= CP_Point inPoint  ) 
 

Addition equals operator. Offsets this region by the amount specified in the passed in point.

Parameters:
inPoint Distance to offset region by.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

CP_Region & CP_Region::operator-= const CP_Point inPoint  ) 
 

Minus equals operator. Offsets this region by the amount specified in the passed in point. This moves the negative of the points coordinates.

Parameters:
inPoint Distance to offset region by.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

CP_Region CP_Region::operator+ CP_Point inPoint  ) 
 

Addition operator. Calls operator += with this region and the passed in point.

Parameters:
inPoint Distance to add to region.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

CP_Region CP_Region::operator- const CP_Point inPoint  ) 
 

Subtraction operator. Calls operator -= with this region and the passed in point.

Parameters:
inPoint Distance to subtract from this region.
Exceptions:
none 
Returns:
CP_Region Returns a new region containing the result.

void CP_Region::Offset float  inHorAmt,
float  inVerAmt
 

Moves the region by the specified distance.

Parameters:
inHorAmt Horizontal distance to move region by.
inVerAmt Vertical distance to move region by.
Exceptions:
none 
Returns:
void

void CP_Region::Offset const CP_Point inAmt  ) 
 

Moves the region by the specified distance.

Parameters:
inAmt Distance to move region by.
Exceptions:
none 
Returns:
void

void CP_Region::Set float  inLeft,
float  inTop,
float  inRight,
float  inBottom
 

Sets the region to the bounds of the passed in coordinates.

Parameters:
inLeft Left coordinate of the region.
inTop Top coordinate of the region.
inRight Right coordinate of the region.
inBottom Bottom coordinate of the region.
Exceptions:
none 
Returns:
void

void CP_Region::Set const CP_Point inLocation,
const CP_Size inSize
 

Sets the region to the bounds of the passed in CP_Point and CP_Size.

Parameters:
inLocation Top left coordinate of the region.
inSize Size of the region.
Exceptions:
none 
Returns:
void

void CP_Region::Set const CP_Rect inRect  ) 
 

Sets the region to the bounds of the passed in CP_Rect.

Parameters:
inRect Coordinates of the region.
Exceptions:
none 
Returns:
void

void CP_Region::Intersect const CP_Region inRegion  ) 
 

Sets the region to the intersection of this region and the passed in region.

Parameters:
inRegion Region to intersect with.
Exceptions:
none 
Returns:
void

void CP_Region::Union CP_Region inRegion  ) 
 

Sets the region to the union of this region and the passed in region.

Parameters:
inRegion Region to union with.
Exceptions:
none 
Returns:
void

void CP_Region::Difference CP_Region inRegion  ) 
 

Sets the region to the difference of this region and the passed in region.

Parameters:
inRegion Region to difference with.
Exceptions:
none 
Returns:
void

void CP_Region::Inset float  inHorAmt,
float  inVerAmt
 

Insets (shrinks) the region by the specified distance.

Parameters:
inHorAmt Horizontal amount to inset region by.
inVerAmt Vertical amount to inset region by.
Exceptions:
none 
Returns:
void

void CP_Region::Inset const CP_Point inAmt  ) 
 

Insets (shrinks) the region by the specified distance.

Parameters:
inAmt Distance to inset region by.
Exceptions:
none 
Returns:
void

bool CP_Region::IsEmpty  )  const
 

Returns true if this region is empty.

Exceptions:
none 
Returns:
bool const True if this region is empty.

bool CP_Region::IsValid  )  const
 

Returns true if this region is valid.

Exceptions:
none 
Returns:
bool const True if this region is valid.

bool CP_Region::Contains const CP_Rect inRect  ) 
 

Returns true if this region contains the passed in CP_Rect.

Parameters:
inRect CP_Rect to test for containment.
Exceptions:
none 
Returns:
bool const True if this region contains the rect.

bool CP_Region::Contains const CP_Point inPoint  ) 
 

Returns true if this region contains the passed in CP_Point.

Parameters:
inPoint CP_Point to test for containment.
Exceptions:
none 
Returns:
bool const True if this region contains the point.

void CP_Region::MakeEmpty  ) 
 

Sets the bounds of this region to all 0's making it an empty region.

Exceptions:
none 
Returns:
void

float CP_Region::Width  )  const
 

Returns the width of this region.

Exceptions:
none 
Returns:
float const The width of the region.

float CP_Region::Height  )  const
 

Returns the height of this region.

Exceptions:
none 
Returns:
float const The height of the region.

void CP_Region::Set RgnHandle  inRegion  ) 
 

Sets the region from an existing MacOS RgnHandle.

Parameters:
inRegion MacOS RgnHandle to set this region to.
Exceptions:
none 
Returns:
void

RgnHandle CP_Region::GetAsQDRegion  ) 
 

Returns the HIShape maintained by this class as a RgnHandle for APIs that still need RgnHandles.

Exceptions:
none 
Returns:
RgnHandle

CP_Region::operator RgnHandle  )  const
 

operator RgnHandle. Converts and returns this object as a MacOS RgnHandle.

Exceptions:
none 
Returns:
RgnHandle A MacOS RgnHandle for this region.

RgnHandle CP_Region::Get  ) 
 

Returns this object as a MacOS RgnHandle.

Exceptions:
none 
Returns:
RgnHandle A MacOS RgnHandle for this region.

void CP_Region::MakeEmptyPlatformRegion  )  [private]
 

Makes a platforms region that is initially empty.

Exceptions:
none 
Returns:
void


Member Data Documentation

OSRegion CP_Region::fRegion [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:22:02 2005 for CPLAT_MacOS by  doxygen 1.4.0