GraphOptions

This class is only needed by S2Builder::Layer implementations. A layer is responsible for assembling an S2Builder::Graph of snapped edges into the desired output format (e.g., an S2Polygon). The GraphOptions class allows each Layer type to specify requirements on its input graph: for example, if DegenerateEdges::DISCARD is specified, then S2Builder will ensure that all degenerate edges are removed before passing the graph to the S2Layer::Build method.

Constructors

this
this(EdgeType edge_type, DegenerateEdges degenerate_edges, DuplicateEdges duplicate_edges, SiblingPairs sibling_pairs)

All S2Builder::Layer subtypes should specify GraphOptions explicitly using this constructor, rather than relying on default values.

this
this()

The default options specify that all edges should be kept, since this produces the least surprising output and makes it easier to diagnose the problem when an option is left unspecified.

Members

Aliases

EdgeType
alias EdgeType = S2Builder.EdgeType
Undocumented in source.

Enums

DegenerateEdges
enum DegenerateEdges

Controls how degenerate edges (i.e., an edge from a vertex to itself) are handled. Such edges may be present in the input, or they may be created when both endpoints of an edge are snapped to the same output vertex. The options available are:

DuplicateEdges
enum DuplicateEdges

Controls how duplicate edges (i.e., edges that are present multiple times) are handled. Such edges may be present in the input, or they can be created when vertices are snapped together. When several edges are merged, the result is a single edge labelled with all of the original input edge ids.

SiblingPairs
enum SiblingPairs

Controls how sibling edge pairs (i.e., pairs consisting of an edge and its reverse edge) are handled. Layer types that define an interior (e.g., polygons) normally discard such edge pairs since they do not affect the result (i.e., they define a "loop" with no interior). The various options include:

Functions

allowVertexFiltering
bool allowVertexFiltering()

This is a specialized option that is only needed by clients want to work with the graphs for multiple layers at the same time (e.g., in order to check whether the same edge is present in two different graphs). [Note that if you need to do this, usually it is easier just to build a single graph with suitable edge labels.]

degenerateEdges
DegenerateEdges degenerateEdges()
Undocumented in source. Be warned that the author may not have intended to support it.
duplicateEdges
DuplicateEdges duplicateEdges()
Undocumented in source. Be warned that the author may not have intended to support it.
edgeType
EdgeType edgeType()

Specifies whether the S2Builder input edges should be treated as undirected. If true, then all input edges are duplicated into pairs consisting of an edge and a sibling (reverse) edge. The layer implementation is responsible for ensuring that exactly one edge from each pair is used in the output, i.e. *only half* of the graph edges will be used. (Note that some values of the sibling_pairs() option automatically take care of this issue by removing half of the edges and changing edge_type() to DIRECTED.)

opEquals
bool opEquals(Object other)
Undocumented in source. Be warned that the author may not have intended to support it.
setAllowVertexFiltering
void setAllowVertexFiltering(bool allow_vertex_filtering)
Undocumented in source. Be warned that the author may not have intended to support it.
setDegenerateEdges
void setDegenerateEdges(DegenerateEdges degenerate_edges)
Undocumented in source. Be warned that the author may not have intended to support it.
setDuplicateEdges
void setDuplicateEdges(DuplicateEdges duplicate_edges)
Undocumented in source. Be warned that the author may not have intended to support it.
setEdgeType
void setEdgeType(EdgeType edge_type)
Undocumented in source. Be warned that the author may not have intended to support it.
setSiblingPairs
void setSiblingPairs(SiblingPairs sibling_pairs)
Undocumented in source. Be warned that the author may not have intended to support it.
siblingPairs
SiblingPairs siblingPairs()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta