A base class containing the logic for computes the contains
and covers
spatial relationship predicates for a PreparedPolygon relative to all other Geometry classes.
More...
#include <AbstractPreparedPolygonContains.h>
Public Member Functions | |
AbstractPreparedPolygonContains (const PreparedPolygon *const prepPoly) | |
AbstractPreparedPolygonContains (const PreparedPolygon *const prepPoly, bool requireSomePointInInterior) | |
Protected Member Functions | |
bool | eval (const geom::Geometry *geom) |
virtual bool | fullTopologicalPredicate (const geom::Geometry *geom)=0 |
Protected Attributes | |
bool | requireSomePointInInterior |
A base class containing the logic for computes the contains
and covers
spatial relationship predicates for a PreparedPolygon relative to all other Geometry classes.
Uses short-circuit tests and indexing to improve performance.
Contains and covers are very similar, and differ only in how certain cases along the boundary are handled. These cases require full topological evaluation to handle, so all the code in this class is common to both predicates.
It is not possible to short-circuit in all cases, in particular in the case where line segments of the test geometry touches the polygon linework. In this case full topology must be computed. (However, if the test geometry consists of only points, this can be evaluated in an optimized fashion.
bool geos::geom::prep::AbstractPreparedPolygonContains::eval | ( | const geom::Geometry * | geom | ) | [protected] |
Evaluate the contains
or covers
relationship for the given geometry.
geom | the test geometry |
Referenced by geos::geom::prep::PreparedPolygonContains::contains(), and geos::geom::prep::PreparedPolygonCovers::covers().
virtual bool geos::geom::prep::AbstractPreparedPolygonContains::fullTopologicalPredicate | ( | const geom::Geometry * | geom | ) | [protected, pure virtual] |
Computes the full topological predicate. Used when short-circuit tests are not conclusive.
geom | the test geometry |
Implemented in geos::geom::prep::PreparedPolygonContains, and geos::geom::prep::PreparedPolygonCovers.
This flag controls a difference between contains and covers.
For contains the value is true. For covers the value is false.