Extends Polygon by including information and constraints about the radial dimension.
More...
|
| GeoTessPolygon3D () |
|
| GeoTessPolygon3D (vector< double * > points, GeoTessHorizon *h_bottom, GeoTessHorizon *h_top) |
| Constructor that accepts a list of unit vectors that define the polygon. More...
|
|
| GeoTessPolygon3D (double *center, double radius, int nEdges, GeoTessHorizon *h_bottom, GeoTessHorizon *h_top) |
| Constructor that builds a circular polygon of a specified horizontal radius centered on position center. More...
|
|
| GeoTessPolygon3D (string filename) |
| Constructor that reads a Polygon from a file. More...
|
|
| ~GeoTessPolygon3D () |
|
virtual string | class_name () |
| Returns the class name. More...
|
|
bool | contains (const double *x, const double &radius, const int &layer, GeoTessProfile **profiles) |
| Returns true if this Polygon3D contains the specified position. More...
|
|
bool | contains (const double *x, const int &layer) |
| Returns true if this Polygon3D contains the specified position. More...
|
|
bool | contains (GeoTessPosition &position) |
| Returns true if this Polygon3D contains the specified position. More...
|
|
bool | containsAll (vector< double * > &points, vector< double > &radii, vector< int > &layers, vector< GeoTessProfile ** > &profiles) |
| Returns true if this Polygon contains all of the supplied unit vectors. More...
|
|
bool | containsAny (vector< double * > &points, vector< double > &radii, vector< int > &layers, vector< GeoTessProfile ** > &profiles) |
| Returns true if this Polygon contains any of the supplied unit vectors. More...
|
|
GeoTessHorizon * | getBottom () |
| Retrieve a reference to the Horizon that defines the bottom of the active region. More...
|
|
GeoTessHorizon * | getTop () |
| Retrieve a reference to the Horizon that defines the top of the active region. More...
|
|
virtual void | write (const string &outputFileName) |
|
| GeoTessPolygon () |
|
| GeoTessPolygon (vector< double * > &points) |
| Constructor that accepts a list of unit vectors that define the polygon. More...
|
|
| GeoTessPolygon (const double *center, double radius, int nEdges) |
| Constructor that builds a circular polygon of a specified horizontal radius centered on position center. More...
|
|
| GeoTessPolygon (string filename) |
| Constructor that reads a Polygon from a file. More...
|
|
virtual | ~GeoTessPolygon () |
|
void | addReference () |
| Add reference count;. More...
|
|
bool | contains (const double *x) |
| return true if point x is located inside the polygon More...
|
|
bool | containsAll (const vector< double * > &positions) |
| Returns true if this Polygon contains all of the supplied unit vectors. More...
|
|
bool | containsAny (const vector< double * > &points) |
| Returns true if this Polygon contains any of the supplied unit vectors. More...
|
|
double | getArea () |
| Retrieve the area of this polygon. More...
|
|
double | getAreaLarge () |
| Retrieve the area of this polygon. More...
|
|
double | getAreaSmall () |
| Retrieve the area of this polygon. More...
|
|
const double * | getPoint (int index) |
| Retrieve a reference to one point on the polygon boundary. More...
|
|
void | getPoints (vector< double * > &points, const bool &repeatFirstPoint) |
| Retrieve a deep copy of the points on the polygon. More...
|
|
void | getPoints (vector< double * > &points, const bool &repeatFirstPoint, const double &maxSpacing) |
| Retrieve a deep copy of the points on the polygon. More...
|
|
int | getRefCount () |
|
const double *const | getReferencePoint () |
| Retrieve a reference to the referencePoint. More...
|
|
const void | getReferencePoint (double *u) |
| Retrieve a copy to the referencePoint. More...
|
|
bool | getReferencePointIn () |
| Retrieve the value of referenceIn which indicates whether or not the referencePoint is inside or outside the Polygon. More...
|
|
void | invert () |
| Invert the current polygon. More...
|
|
bool | isNotReferenced () |
| Returns true if reference count is zero. More...
|
|
bool | onBoundary (GeoTessGreatCircle &gcRef) |
| Return true if evaluation point is very close to being on the boundary of the polygon. More...
|
|
bool | onBoundary (const double *x) |
| Return true if evaluation point is very close to being on the boundary of the polygon. More...
|
|
void | removeReference () |
| Remove reference count;. More...
|
|
void | setReferencePoint (const double *refPoint, const bool &inside) |
| Specify the reference point for this polygon and whether or not the specified point is inside or outside the polygon. More...
|
|
void | setReferencePoint (double lat, double lon, bool inside) |
| Specify the reference point for this polygon and whether or not the specified point is inside or outside the polygon. More...
|
|
int | size () |
| Returns the number of edges that define the polygon. More...
|
|
string | str (const bool &repeatFirstPoint, const bool &latFirst, const double &minLongitude=-180) |
| Returns a String containing all the points that define the polygon with one lon, lat pair per record. More...
|
|
Extends Polygon by including information and constraints about the radial dimension.
An ordered list of points on the surface of a unit sphere that define a closed polygon. Polygons have the ability to test whether or not an arbitrary test point on the sphere is inside or outside the polygon.
Besides the set of points that define the boundary of the polgon, a Polygon object has a single private instance of a reference point which is known to be either 'inside' or 'outside' the polygon. By default, the reference point is computed from the supplied boundary points in the following manner:
-
Compute the normalized vector mean of all the points that define the polygon and call it center.
-
set the referencePoint to the anti-pode of center.
-
set referencePointIn to false
-
test center to see if it is inside or outside the polygon and set the value of referencePointIn to this value.
-
change the value of referencePoint to center
This method will work fine provided that polygons are 'smaller' than approximately a hemisphere. It is possible to override this behavior. The first method is to call the invert() method which simply reverses the value of whether the reference point is 'inside' or 'outside' the polygon. There are also methods that allow applications to specify both the position of the reference point and whether it is 'inside' or 'outside' the polygon.
A test point that is located very close to a polygon boundary point is deemed to be 'inside' the polygon. This means that if two adjacent, non-overlapping polygons share a boundary point, a test point near that boundary point will be deemed to be 'inside' both polygons. In this context two points are 'very close' if they are separated by less than 1e-7 radians or 5.7e-6 degrees. For a sphere with the radius of the Earth (6371 km), this corresponds to a linear distance of about 60 cm.
Polygon implements reference counting. This means that when some other object obtains a reference to a Polygon object, it should increment the polygon's reference count. When it is done with the polygon it should decrement the polygon's reference count and delete the polygon if the reference count is equal to zero.
- Author
- sballar