libprop: RegionArea Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# RegionArea Class Reference

Define a square region across the surface of the Earth, defined using two corner points. Can turn its defined region into a series of discrete points, and check if a given point is inside the region. More...

`#include <geom.h>`

Inheritance diagram for RegionArea:

List of all members.

## Public Member Functions
| RegionArea ()
| RegionArea (Point *bottomLeft, Point *topRight)
| RegionArea (Point *center, double radius)
| ~RegionArea ()
vector< Point * > | discrete (double resolution)
bool | contains (Point *p)
void | add (Point *p)
## Public Attributes
Point * | bottomLeft
| Describe the bottom left corner of this square region.
Point * | topRight
| Describe the top right corner of this square region.
## Friends
ostream & | operator<< (ostream &output, const RegionArea &r)
| Output region in "[(lat,long),(lat,long]" format.

## Detailed Description

Define a square region across the surface of the Earth, defined using two corner points. Can turn its defined region into a series of discrete points, and check if a given point is inside the region.

## Constructor & Destructor Documentation

RegionArea::RegionArea | ( |  | ) |

RegionArea::RegionArea | ( | Point * | bottomLeft,
|  | Point * | topRight |
| ) |  |  |

Create new square region using the given points as the bottom-left and top-right corners.

Parameters:

  | bottomLeft | Bottom-left corner point of the new region
  | topRight | Top-right corner point of the new region

RegionArea::RegionArea | ( | Point * | center,
|  | double | radius |
| ) |  |  |

Create new square region using the given point as the region center and distance of radius to each corner.

Parameters:

  | center | Point to center the square region around
  | radius | Radius in kilometers from the center point to each corner of the square region

RegionArea::~RegionArea | ( |  | ) |

## Member Function Documentation

vector<Point*> RegionArea::discrete | ( | double | resolution | ) | `[virtual]`

Turn the defined square region into a discrete set of points, using resolution to describe the level of detail. Effectively builds a grid across the square with resolution spacing.

Parameters:

  | resolution | Level of spacing (detail) between the discrete points to be created. Value in kilometers.

Returns:
  List of points that describe this region using the level of resolution requested

Implements Region.

bool RegionArea::contains | ( | Point * | p | ) | `[virtual]`

Check if this region contains the given point.

Parameters:

  | p | Point to check against

Returns:
  True if point is inside this region, false otherwise

Implements Region.

void RegionArea::add | ( | Point * | p | ) | `[virtual]`

Add the given Point to this Region, expanding the region as needed so that contains(p) returns true. Will expand the nearest square corner so that this region covers the given point.

Parameters:

  | p | The point to include in this region

Implements Region.

## Friends And Related Function Documentation

ostream& operator<< | ( | ostream & | output,
|  | const RegionArea & | r |
| ) |  |  | `[friend]`

Output region in "[(lat,long),(lat,long]" format.

## Member Data Documentation

Point* RegionArea::bottomLeft

Describe the bottom left corner of this square region.

Point* RegionArea::topRight

Describe the top right corner of this square region.

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

- geom.h