Package com.google.common.geometry
Class S2ContainsVertexQuery
java.lang.Object
com.google.common.geometry.S2ContainsVertexQuery
This class determines whether a polygon contains one of its vertices given the edges incident to
that vertex. The result is +1 if the vertex is contained, -1 if it is not contained, and 0 if the
incident edges consist of matched sibling pairs (in which case the result cannot be determined
locally).
The "semi-open" boundary model
is used to
define point containment. This means that if several polygons tile the region around a vertex,
then exactly one of those polygons contains that vertex.
This class is not thread-safe.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionS2ContainsVertexQuery
(S2Point target) Creates a contains vertex query to determine containment of 'target'. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an edge from 'v' incoming to 'target'.void
Adds an edge outgoing from 'target' to 'v'.int
Returns +1 if the vertex is contained, -1 if it is not contained, and 0 if the incident edges consisted of matched sibling pairs.private static int
Returns the count of vertices equal to vertices[start].
-
Field Details
-
target
-
outgoing
-
incoming
-
-
Constructor Details
-
S2ContainsVertexQuery
Creates a contains vertex query to determine containment of 'target'.
-
-
Method Details
-
addOutgoing
Adds an edge outgoing from 'target' to 'v'. -
addIncoming
Adds an edge from 'v' incoming to 'target'. -
containsSign
public int containsSign()Returns +1 if the vertex is contained, -1 if it is not contained, and 0 if the incident edges consisted of matched sibling pairs. -
count
Returns the count of vertices equal to vertices[start].
-