An object arr of the class Arrangement_2<Traits,Dcel> represents the planar subdivision induced by a set of -monotone curves and isolated points into maximally connected cells. The arrangement is represented as a doubly-connected edge-list (DCEL) such that each DCEL vertex is associated with a point of the plane and each edge is associated with an -monotone curve whose interior is disjoint from all other edges and vertices. Recall that an arrangement edge is always comprised of a pair of twin DCEL halfedges.
The Arrangement_2<Traits,Dcel> template has two parameters:
Self is an abbreviation of the Arrangement_2<Traits,Dcel> type hereafter.
#include <CGAL/Arrangement_2.h>
| |
the traits class in use.
| |
| |
the DCEL representation of the arrangement.
|
| ||
|
||
| ||
| the point type, as defined by the traits class. | |
| ||
| the -monotone curve type, as defined by the traits class. | |
| ||
| the size type (equivalent to size_t). |
| |
represents a -dimensional cell in the subdivision.
A vertex is always associated with a point.
| |
| |
represents (together with its twin - see below)
a -dimensional cell in the subdivision.
A halfedge is always associated with an -monotone curve.
| |
| |
represents a -dimensional cell in the subdivision.
|
The following handles, iterators, and circulators all have respective constant counterparts (for example, in addition to Vertex_iterator the type Vertex_const_iterator is also defined). See [MS96] for a discussion of constant versus mutable iterator types. The mutable types are assignable to their constant counterparts.
Vertex_iterator, Halfedge_iterator, and Face_iterator are equivalent to the respective handle types (namely, Vertex_handle, Halfedge_handle, and Face_handle). Thus, wherever the handles appear in function parameter lists, the respective iterators can be passed as well.
| |
a handle for an arrangement vertex.
| |
| |
a handle for a halfedge.
The halfedge and its twin form together an arrangement edge.
| |
| |
a handle for an arrangement face.
| |
| |
a bidirectional iterator over the
vertices of the arrangement. Its value-type is Vertex.
| |
| |
a bidirectional iterator over the
halfedges of the arrangement. Its value-type is Halfedge.
| |
| |
a bidirectional iterator over the
edges of the arrangement. (That is, it skips every other halfedge.)
Its value-type is Halfedge.
| |
| |
a bidirectional iterator over the
faces of arrangement. Its value-type is Face.
| |
| |
a bidirectional circulator
over the halfedges that have a given vertex as their target.
Its value-type is Halfedge.
| |
| |
a bidirectional circulator over the
halfedges of a CCB (connected component of the boundary).
Its value-type is Halfedge. Each
bounded face has a single CCB representing it outer boundary, and may
have several inner CCBs representing its holes.
| |
| |
a bidirectional iterator over the holes
(i.e., inner CCBs) contained inside a given face.
Its value type is Ccb_halfedge_circulator.
| |
| |
a bidirectional iterator over the
isolated vertices contained inside a given face.
Its value type is Vertex.
|
| |
constructs an empty arrangement containing one unbounded face,
which corresponds to the
entire plane.
| |
| |
copy constructor.
| |
| |
constructs an empty arrangement that uses the given traits
instance for performing the geometric predicates.
|
|
| assignment operator. |
|
| |
assigns the contents of another arrangement. | ||
|
| clears the arrangement. |
All _begin() and _end() methods listed below also have const counterparts, returning constant iterators instead of mutable ones:
Accessing the Arrangement Vertices:
Accessing the Arrangement Edges:
Accessing the Arrangement Faces:
advanced |
It is sometime necessary to convert a constant (non-mutable) handle to a mutable handle. For example, the result of a point-location query is a non-mutable handle for the arrangement cell containing the query point. Assume that the query point lies on a edge, so we obtain a Halfedge_const_handle; if we wish to use this handle and remove the edge, we first need to cast away its ``constness''.
advanced |
Specialized Insertion Methods:
|
| |||
inserts the point p into the arrangement as an isolated vertex in
the interior of the face f and returns a handle for the newly
created vertex. Precondition: p lies in the interior of the face f. | ||||
|
| |||
inserts the curve c as a new hole (inner component) of the face
f. As a result, two new vertices that correspond to c's
endpoints are created and connected with a newly created halfedge pair.
The function returns a handle for one of the new halfedges
corresponding to the inserted curve, directed in lexicographic
increasing order (from left to right). Precondition: c lies entirely in the interior of the face f and is disjoint from all existing arrangement vertices and edges (in particular, both its endpoints are not already associated with existing arrangement vertices). | ||||
|
| |||
inserts the curve c into the arrangement, such that its left
endpoint corresponds to a given arrangement vertex. As a result, a new
vertex that correspond to c's right endpoint is created and
connected to v with a newly created halfedge pair.
The function returns a handle for one of the new halfedges corresponding
to the inserted curve, directed towards the newly created vertex -
that is, directed in lexicographic increasing order (from left to right). Precondition: The interior of c is disjoint from all existing arrangement vertices and edges. Precondition: v is associated with the left endpoint of c. Precondition: The right endpoint of c is not already associated with an existing arrangement vertex. | ||||
|
| |||
inserts the curve c into the arrangement, such that its right
endpoint corresponds to a given arrangement vertex. As a result, a new
vertex that correspond to c's left endpoint is created and
connected to v with a newly created halfedge pair.
The function returns a handle for one of the new halfedges corresponding
to the inserted curve, directed to the newly created vertex -
that is, directed in lexicographic decreasing order (from right to left). Precondition: The interior of c is disjoint from all existing arrangement vertices and edges. Precondition: v is associated with the right endpoint of c. Precondition: The left endpoint of c is not already associated with an existing arrangement vertex. | ||||
|
| |||
inserts the curve c into the arrangement, such that both c's
endpoints correspond to existing arrangement vertices, given by v1
and v2. The function creates a new halfedge pair that connects the
two vertices, and returns a handle for the halfedge directed from v1
to v2. Precondition: The interior of c is disjoint from all existing arrangement vertices and edges. Precondition: v1 and v2 are associated with c's endpoints. Precondition: If v1 and v2 are already connected by an edge, this edge represents an -monotone curve that is interior-disjoint from c). |
advanced |
advanced |
Modifying Vertices and Edges:
|
| |||
sets p to be the point associated with the vertex v.
The function returns a handle for the modified vertex (same as v). Precondition: p is geometrically equivalent to the point currently associated with v. | ||||
|
| |||
removes the isolated vertex v from the arrangement. The function
returns the face f that used to contain the isolated vertex. Precondition: v is an isolated vertex (has no incident edges). | ||||
|
| |||
sets c to be the -monotone curve associated with the edge e.
The function returns a handle for the modified edge (same as e). Precondition: c is geometrically equivalent to the curve currently associated with e. | ||||
|
| |||
splits the edge e into two edges (more precisely, into two halfedge
pairs), associated with the given subcurves c1 and c2, and
creates a vertex that corresponds to the split point.
The function returns a handle for the halfedge, whose source is the same
as e->source() and whose target vertex is the split point. Precondition: Either c1's left endpoint and c2's right endpoint correspond to e's end-vertices such that c1's right endpoint and c2's left endpoint are equal and define the split point - or vice-versa (with change of roles between c1 and c2). | ||||
|
| |||
merges the edges represented by e1 and e2 into
a single edge, associated with the given merged curve c.
Denote e1's end-vertices as and , while e2's
end-vertices are denoted and . The function removes the
common vertex returns a handle for one of the merged halfedges,
directed from to . Precondition: e1 and e2 share a common end-vertex, such that the two other end-vertices of the two edges are associated with c's endpoints. | ||||
|
| |||
removes the edge e from the arrangement. Since the e may be the only edge incident to its source vertex (or its target vertex), this vertex can be removed as well. The flags remove_source and remove_target indicate whether the endpoints of e should be removed, or whether they should be left as isolated vertices in the arrangement. If the operation causes two faces to merge, the merged face is returned. Otherwise, the face to which the edge was incident is returned. |
|
| returns true if arr represents a valid instance of Arrangement_2<Traits,Dcel>. In particular, the functions checks the topological structure of the arrangement and assures that it is valid. In addition, the function performs several simple geometric tests to ensure the validity of some of the geometric properties of the arrangement. Namely, it checks that all arrangement vertices are associated with distinct points, and that the halfedges around every vertex are ordered clockwise. |