S2ClippedShape

S2ClippedShape represents the part of a shape that intersects an S2Cell. It consists of the set of edge ids that intersect that cell, and a boolean indicating whether the center of the cell is inside the shape (for shapes that have an interior).

Note that the edges themselves are not clipped; we always use the original edges for intersection tests so that the results will be the same as the original shape.

Members

Functions

containsCenter
bool containsCenter()

Returns true if the center of the S2CellId is inside the shape. Returns false for shapes that do not have an interior.

containsEdge
bool containsEdge(int id)

Returns true if the clipped shape contains the given edge id.

destruct
void destruct()
Undocumented in source. Be warned that the author may not have intended to support it.
edge
int edge(int i)

Returns the edge id of the given edge in this clipped shape. Edges are sorted in increasing order of edge id.

initialize
void initialize(int shape_id, int num_edges)
Undocumented in source. Be warned that the author may not have intended to support it.
isInline
bool isInline()
Undocumented in source. Be warned that the author may not have intended to support it.
numEdges
int numEdges()

The number of edges that intersect the S2CellId.

setContainsCenter
void setContainsCenter(bool contains_center)
Undocumented in source. Be warned that the author may not have intended to support it.
setEdge
void setEdge(int i, int edge)
Undocumented in source. Be warned that the author may not have intended to support it.
shapeId
int shapeId()

The shape id of the clipped shape.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta