Package com.google.common.geometry
Class S2ContainsVertexQuery
- java.lang.Object
-
- com.google.common.geometry.S2ContainsVertexQuery
-
@GwtCompatible public class S2ContainsVertexQuery extends Object
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 modelis 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.
-
-
Constructor Summary
Constructors Constructor Description S2ContainsVertexQuery(S2Point target)Creates a contains vertex query to determine containment of 'target'.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIncoming(S2Point v)Adds an edge from 'v' incoming to 'target'.voidaddOutgoing(S2Point v)Adds an edge outgoing from 'target' to 'v'.intcontainsSign()Returns +1 if the vertex is contained, -1 if it is not contained, and 0 if the incident edges consisted of matched sibling pairs.
-
-
-
Constructor Detail
-
S2ContainsVertexQuery
public S2ContainsVertexQuery(S2Point target)
Creates a contains vertex query to determine containment of 'target'.
-
-
Method Detail
-
addOutgoing
public void addOutgoing(S2Point v)
Adds an edge outgoing from 'target' to 'v'.
-
addIncoming
public void addIncoming(S2Point v)
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.
-
-