libprop: RegionLine Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# RegionLine Class Reference

Define a linear region across the surface of the Earth, defined as a series of 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 RegionLine:

List of all members.

## Public Member Functions
| RegionLine ()
| RegionLine (vector< Point * > list)
| RegionLine (Point *p, Point *q)
| RegionLine (string filename)
| ~RegionLine ()
double | length ()
vector< Point * > | discrete (double resolution)
bool | contains (Point *p)
void | add (Point *p)
## Private Attributes
vector< Point * > | list
| List of all points contained in this linear region.
## Friends
ofstream & | operator<< (ofstream &output, const RegionLine &r)
| Output region in "lat\tlon\n..." format.

## Detailed Description

Define a linear region across the surface of the Earth, defined as a series of 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

RegionLine::RegionLine | ( |  | ) |

RegionLine::RegionLine | ( | vector< Point * > | list | ) |

Create new linear region that will contain the given list of points.

Parameters:

  | list | List of points to include in the new linear region

RegionLine::RegionLine | ( | Point * | p,
|  | Point * | q |
| ) |  |  |

Create new linear region that contains only the two given points. Additional points can still be added later if needed.

Parameters:

  | p | Starting point for new line
  | q | Ending point for new line

RegionLine::RegionLine | ( | string | filename | ) |

Create a new linear region by reading a list of points from a file. Usually used for reading in description of a roadway. Expecting file format to be "lat\tlon\n...-1\t-1\n".

Parameters:

  | filename | Filename to open and read list of points from

RegionLine::~RegionLine | ( |  | ) |

## Member Function Documentation

double RegionLine::length | ( |  | ) |

Calcuate the total length of this linear region

Returns:
  Length of linear region in kilometers

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

Turn the defined linear region into a discrete set of points, using resolution to describe the level of detail. Effectively steps along the line defined in resolution-length steps.

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 RegionLine::contains | ( | Point * | p | ) | `[virtual]`

Check if this region contains the given point. Always returns false for line segments.

Parameters:

  | p | Point to check against

Returns:
  Always returns false.

Implements Region.

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

Add the given Point to this Region. Will append given point to the end of this line segment.

Parameters:

  | p | The point to include in this region

Implements Region.

## Friends And Related Function Documentation

ofstream& operator<< | ( | ofstream & | output,
|  | const RegionLine & | r |
| ) |  |  | `[friend]`

Output region in "lat\tlon\n..." format.

## Member Data Documentation

vector<Point*> RegionLine::list`[private]`

List of all points contained in this linear region.

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

- geom.h