|
| GeoTessPolygon3D () |
|
| GeoTessPolygon3D (vector< double * > points, GeoTessHorizon *h_bottom, GeoTessHorizon *h_top) |
|
| GeoTessPolygon3D (double *center, double radius, int nEdges, GeoTessHorizon *h_bottom, GeoTessHorizon *h_top) |
|
| GeoTessPolygon3D (string filename) |
|
| ~GeoTessPolygon3D () |
|
virtual string | class_name () |
|
bool | contains (const double *x, const double &radius, const int &layer, GeoTessProfile **profiles) |
|
bool | contains (const double *x, const int &layer) |
|
bool | contains (GeoTessPosition &position) |
|
bool | containsAll (vector< double * > &points, vector< double > &radii, vector< int > &layers, vector< GeoTessProfile ** > &profiles) |
|
bool | containsAny (vector< double * > &points, vector< double > &radii, vector< int > &layers, vector< GeoTessProfile ** > &profiles) |
|
GeoTessHorizon * | getBottom () |
|
GeoTessHorizon * | getTop () |
|
virtual void | write (const string &outputFileName) |
|
| GeoTessPolygon () |
|
| GeoTessPolygon (vector< double * > &points) |
|
| GeoTessPolygon (const double *center, double radius, int nEdges) |
|
| GeoTessPolygon (string filename) |
|
virtual | ~GeoTessPolygon () |
|
void | addReference () |
|
bool | contains (const double *x) |
|
bool | containsAll (const vector< double * > &positions) |
|
bool | containsAny (const vector< double * > &points) |
|
double | getArea () |
|
double | getAreaLarge () |
|
double | getAreaSmall () |
|
const double * | getPoint (int index) |
|
void | getPoints (vector< double * > &points, const bool &repeatFirstPoint) |
|
void | getPoints (vector< double * > &points, const bool &repeatFirstPoint, const double &maxSpacing) |
|
int | getRefCount () |
|
const double *const | getReferencePoint () |
|
const void | getReferencePoint (double *u) |
|
bool | getReferencePointIn () |
|
void | invert () |
|
bool | isNotReferenced () |
|
bool | onBoundary (GeoTessGreatCircle &gcRef) |
|
bool | onBoundary (const double *x) |
|
void | removeReference () |
|
void | setReferencePoint (const double *refPoint, const bool &inside) |
|
void | setReferencePoint (double lat, double lon, bool inside) |
|
int | size () |
|
string | str (const bool &repeatFirstPoint, const bool &latFirst, const double &minLongitude=-180) |
|
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