BRect Class Reference

#include <BRect.h>

Inheritance diagram for BRect:

Inheritance graph
[legend]

List of all members.


Detailed Description

A rectangle represented by the lower left and upper right corner points.

Public Member Functions

 BRect (const BRect &r)
 Copy constructor.
 BRect (double xmin, double ymin, double xmax, double ymax)
 Constructor.
 BRect ()
 Default constructor.
void Clear (void)
 Reset the rectangle to an uninitialized state.
virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual bool Contains (const BRect &area) const
 Determines if this BRect completely contains this specified BRect.
virtual bool Contains (const double &x, const double &y) const
 Determines if this BRect contains the specified point.
virtual bool Contains (const BPoint &point) const
 Determines if this BRect contains the specified BPoint.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
BPoint GetBottomLeft (void) const
 Gets the BPoint that represents the bottom left corner of this BRect.
BPoint GetBottomRight (void) const
 Gets the BPoint that represents the bottom right corner of this BRect.
BPoint GetCenter (void) const
 Gets the center point of this BRect.
double GetDiagonal () const
 Gets the distance from the top left corner to the bottom right corner.
double GetHeight (void) const
 Gets the height of this BRect.
double GetMaxX (void) const
 Gets the maximum X value.
double GetMaxY (void) const
 Gets the maximum Y value.
double GetMinX (void) const
 Gets the minimum X value.
double GetMinY (void) const
 Gets the minimum Y value.
BPoint GetTopLeft (void) const
 Gets the BPoint that represents the top left corner of this BRect.
BPoint GetTopRight (void) const
 Gets the BPoint that represents the top right corner of this BRect.
double GetWidth (void) const
 Gets the width of this BRect.
virtual bool Intersects (const BRect &rect) const
 Determines whether or not the specified BRect intersects this BRect.
bool IsValid (void) const
 Indicates whether or not this BRect is valid.
void Normalize ()
 Ensures that this BRect is valid, and swaps the minimum and maximum values if it is necessary to make this BRect valid.
bool operator!= (const BRect &rhs)
 Inequality operator.
BRectoperator= (const BRect &rhs)
 Assignment operator.
bool operator== (const BRect &rhs)
 Equality operator.
void SetMaxX (double val)
 Sets the maximum X value.
void SetMaxY (double val)
 Sets the maximum Y value.
void SetMinX (double val)
 Sets the minimum X value.
void SetMinY (double val)
 Sets the minimum Y value.
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual void Transform (const BTransform &cst)
 Transforms the coordinates in this BRect to a different coordinate system.
virtual void TransformReverse (const BTransform &cst)
 Transforms the coordinates in this BRect to a different coordinate system using the "reverse" of the BTransform.
void Union (double x, double y)
 If the specified point does not lie within the extents of this BRect, the extents will be expanded to ensure that the point is contained within this BRect.
void Union (const BRect &rect)
 If the specified BRect does not lie completely within the extents of this BRect, the extents will be expanded to ensure that the BRect is completely contained in this BRect.
void Union (const BPoint &pt)
 If the specified BPoint does not lie within the extents of this BRect, the extents will be expanded to ensure that the BPoint is contained within this BRect.
virtual ~BRect ()
 Destructor.

Static Public Member Functions

static size_t SizeOf (void)
 Returns the size of a BRect in bytes.

Constructor & Destructor Documentation

BRect (  )  [inline]

Default constructor.

This constructor will create an invalid BRect. The corner points must be set before the BRect can be used.

BRect ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
) [inline]

Constructor.

Parameters:
xmin The minimum X value.
ymin The minimum Y value.
xmax The maximum X value.
ymax The maximum Y value.

BRect ( const BRect r  )  [inline]

Copy constructor.

Parameters:
r The BRect to copy.

virtual ~BRect (  )  [inline, virtual]

Destructor.


Member Function Documentation

void Clear ( void   ) 

Reset the rectangle to an uninitialized state.

This will make this BRect invalid until the corner points are set.

virtual size_t ComputeSize ( void   )  const [inline, virtual]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

Implements BByteStreamable.

virtual bool Contains ( const BRect area  )  const [virtual]

Determines if this BRect completely contains this specified BRect.

Parameters:
area The BRect to test for containment.
Returns:
True if the BRect is completely contained within this BRect and false otherwise.

virtual bool Contains ( const double &  x,
const double &  y 
) const [virtual]

Determines if this BRect contains the specified point.

Parameters:
x The x-coordinate of the point to test for containment.
y The y-coordinate of the point to test for containment.
Returns:
True if the point is contained within this BRect and false otherwise.

virtual bool Contains ( const BPoint point  )  const [virtual]

Determines if this BRect contains the specified BPoint.

Parameters:
point The BPoint to test for containment.
Returns:
True if the BPoint is contained within this BRect and false otherwise.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [virtual]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation of the object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

Implements BByteStreamable.

BPoint GetBottomLeft ( void   )  const [inline]

Gets the BPoint that represents the bottom left corner of this BRect.

Returns:
A BPoint representing the bottom left corner of this BRect.

BPoint GetBottomRight ( void   )  const [inline]

Gets the BPoint that represents the bottom right corner of this BRect.

Returns:
A BPoint representing the bottom right corner of this BRect.

BPoint GetCenter ( void   )  const [inline]

Gets the center point of this BRect.

Returns:
A BPoint representing the center point of this BRect.

double GetDiagonal (  )  const [inline]

Gets the distance from the top left corner to the bottom right corner.

Returns:
The length of the diagonal of this BRect. The units used to express this length are the same as the units used to express the location of this BRect.

double GetHeight ( void   )  const [inline]

Gets the height of this BRect.

Returns:
The height of this BRect.

double GetMaxX ( void   )  const [inline]

Gets the maximum X value.

Returns:
The maximum X value.

double GetMaxY ( void   )  const [inline]

Gets the maximum Y value.

Returns:
The maximum Y value.

double GetMinX ( void   )  const [inline]

Gets the minimum X value.

Returns:
The minimum X value.

double GetMinY ( void   )  const [inline]

Gets the minimum Y value.

Returns:
The minimum Y value.

BPoint GetTopLeft ( void   )  const [inline]

Gets the BPoint that represents the top left corner of this BRect.

Returns:
A BPoint representing the top left corner of this BRect.

BPoint GetTopRight ( void   )  const [inline]

Gets the BPoint that represents the top right corner of this BRect.

Returns:
A BPoint representing the top right corner of this BRect.

double GetWidth ( void   )  const [inline]

Gets the width of this BRect.

Returns:
The width of this BRect.

virtual bool Intersects ( const BRect rect  )  const [virtual]

Determines whether or not the specified BRect intersects this BRect.

Parameters:
rect The BRect to test for intersection.
Returns:
True if the specified BRect intersects this BRect and false otherwise.

bool IsValid ( void   )  const [inline]

Indicates whether or not this BRect is valid.

A BRect is said to be valid if the minimum x value is less than or equal to the maximum x value and the minimum y value is less than or equal to the maximum y value.

Returns:
True if this BRect is valid and false otherwise.

void Normalize (  ) 

Ensures that this BRect is valid, and swaps the minimum and maximum values if it is necessary to make this BRect valid.

bool operator!= ( const BRect rhs  )  [inline]

Inequality operator.

Parameters:
rhs The BRect to compare to this one.
Returns:
True if the specified BRect does not have the same value as this one and false otherwise.

BRect& operator= ( const BRect rhs  )  [inline]

Assignment operator.

Parameters:
rhs The BRect whose value will be copied into this one.
Returns:
A reference to this BRect.

bool operator== ( const BRect rhs  )  [inline]

Equality operator.

Parameters:
rhs The BRect to compare to this one.
Returns:
True if the specified BRect has the same value as this one and false otherwise.

void SetMaxX ( double  val  )  [inline]

Sets the maximum X value.

Parameters:
val The new maximum X value.

void SetMaxY ( double  val  )  [inline]

Sets the maximum Y value.

Parameters:
val The new maximum Y value.

void SetMinX ( double  val  )  [inline]

Sets the minimum X value.

Parameters:
val The new minimum X value.

void SetMinY ( double  val  )  [inline]

Sets the minimum Y value.

Parameters:
val The new minimum Y value.

static size_t SizeOf ( void   )  [inline, static]

Returns the size of a BRect in bytes.

Returns:
The size of a BRect in bytes.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

Implements BByteStreamable.

virtual void Transform ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BRect to a different coordinate system.

Parameters:
cst The BTransform that describes the transformation.

virtual void TransformReverse ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BRect to a different coordinate system using the "reverse" of the BTransform.

Parameters:
cst The BTransform that describes the transformation.

void Union ( double  x,
double  y 
)

If the specified point does not lie within the extents of this BRect, the extents will be expanded to ensure that the point is contained within this BRect.

Parameters:
x The x-coordinate of the point to union with this BRect.
y The y-coordinate of the point to union with this BRect.

void Union ( const BRect rect  ) 

If the specified BRect does not lie completely within the extents of this BRect, the extents will be expanded to ensure that the BRect is completely contained in this BRect.

Parameters:
rect The BRect to union with this BRect.

void Union ( const BPoint pt  ) 

If the specified BPoint does not lie within the extents of this BRect, the extents will be expanded to ensure that the BPoint is contained within this BRect.

Parameters:
pt The BPoint to union with this BRect.


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

GeoTranslate 5.0 From Blue Marble Geographics