# dpx::Block Struct Reference

Rectangle block definition defined by two points. More...

`#include <DPX.h>`

List of all members.

## Public Member Functions
| Block ()
| Constructor.
| Block (const int x1, const int y1, const int x2, const int y2)
| Constructor.
void | Set (const int x1, const int y1, const int x2, const int y2)
| Set the block coordinates.
bool | Inside (const int x, const int y) const
| Check to see if a point is within the block.
void | Check ()
| Rearrange coordinates if necessary so the first coordinate is upper left and the second is lower right.
## Public Attributes
int | x1
int | y1
int | x2
int | y2

## Detailed Description

Rectangle block definition defined by two points.

## Constructor & Destructor Documentation

dpx::Block::Block | ( |  | ) | `[inline]`

Constructor.

dpx::Block::Block | ( | const int | x1,
|  | const int | y1,
|  | const int | x2,
|  | const int | y2 |
| ) |  |  | `[inline]`

Constructor.

Parameters:

  | x1 | upper left x coordinate
  | y1 | upper left y coordinate
  | x2 | lower right x coordinate
  | y2 | lower right y coordinate

## Member Function Documentation

void dpx::Block::Check | ( |  | ) | `[inline]`

Rearrange coordinates if necessary so the first coordinate is upper left and the second is lower right.

bool dpx::Block::Inside | ( | const int | x,
|  | const int | y |
| ) |  |  | const`[inline]`

Check to see if a point is within the block.

Parameters:

  | x | x coordinate
  | y | y coordinate

Returns:
  true/false if coordinates within block

void dpx::Block::Set | ( | const int | x1,
|  | const int | y1,
|  | const int | x2,
|  | const int | y2 |
| ) |  |  | `[inline]`

Set the block coordinates.

Parameters:

  | x1 | upper left x coordinate
  | y1 | upper left y coordinate
  | x2 | lower right x coordinate
  | y2 | lower right y coordinate

## Member Data Documentation

int dpx::Block::x1

int dpx::Block::x2

int dpx::Block::y1

int dpx::Block::y2

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

- /Users/patrick/Development/DPX/svn/source/DPX.h