The AreaCon Library  1.0
A C++ library for area-constrained partitioning operations
 All Classes Namespaces Files Functions Variables Pages
AreaCon::Poly Class Reference

#include <areacon.h>

Public Member Functions

void SetVertices (const std::vector< Point > Vertices, const bool GetExtrema=true)
 
std::vector< PointGetVertices (void) const
 
int GetNVertices (void) const
 
bool pnpoly (const Point Test) const
 
void GetExtrema (double &minx, double &miny, double &maxx, double &maxy) const
 
 Poly (std::vector< Point > Vertices={})
 

Private Member Functions

void InitializePoly (void)
 

Private Attributes

double minx
 
double miny
 
double maxx
 
double maxy
 
std::vector< PointVertices
 
int NPoly
 

Detailed Description

The base class for defining (convex) polygons.

Author
Jeffrey R. Peters

Constructor & Destructor Documentation

AreaCon::Poly::Poly ( std::vector< Point Vertices = {})

Default Constructor

Parameters
[in]VerticesThe points defining the vertices of the polygon in counter-clockwise order (the first vertex is not repeated).

Member Function Documentation

void AreaCon::Poly::GetExtrema ( double &  minx,
double &  miny,
double &  maxx,
double &  maxy 
) const

Returns the extreme x and y values.

Parameters
[out]minx,miny,maxx,maxy
int AreaCon::Poly::GetNVertices ( void  ) const
Returns
The number of vertices.
std::vector< Point > AreaCon::Poly::GetVertices ( void  ) const
Returns
The list of Vertices
void AreaCon::Poly::InitializePoly ( void  )
private

A function used to initialize the polygon by calculating extrema and running checks for dimensional consistency.

bool AreaCon::Poly::pnpoly ( const Point  Test) const

Determines if the point Test lies within the polygon.

Parameters
[in]TestThe test point
Returns
Indicator of whether or not Test is inside the polygon
void AreaCon::Poly::SetVertices ( const std::vector< Point Vertices,
const bool  GetExtrema = true 
)

A function used for setting the vertices of the polygon.

Parameters
[in]VerticesThe points defining the vertices of the polygon in counter-clockwise order (the first vertex is not repeated).
[in]GetExtremaFlag that determines whether the extrema should be calculated and re-set

Member Data Documentation

double AreaCon::Poly::maxx
private

The maximum x coordinate of the polygon

double AreaCon::Poly::maxy
private

The maximum y coordinate of the polygon

double AreaCon::Poly::minx
private

The minimum x coordinate of the polygon

double AreaCon::Poly::miny
private

The minimum y coordinate of the polygon

int AreaCon::Poly::NPoly
private

The number of vertices that the polygon has

std::vector<Point> AreaCon::Poly::Vertices
private

The Vertices of the polygon


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