such that no curve intersects the interior of any other curve. The available traits and dcel classes will be described later.
#include <CGAL/Planar_map_2.h>
The modifying functions insert_in_face_interior, insert_from_vertex , insert_at_vertices, split_edge, merge_edge and remove_edge overwrite the inherited functions and make use of the geometric information of the planar map.
| ||
|
| |
traits class.
| |
| |
DCEL class.
|
| ||
| a curve of the planar map. | |
| ||
| a point of the planar map. |
| |
enumeration of the features of the planar map. This specifies the
result of point location and ray shooting operations.
|
| |
construct an ``empty map'' containing one unbounded face, which
corresponds to the whole plane.
|
The CGAL_Planar_map<Dcel,Traits> class has a point location function (namely, the locate function that determines which feature of the map contains a given query point) which is also used internally in the insert function. There are several known algorithms for solving a point location query. We have implemented two - the randomized incremental algorithm introduced by Mulmuley [Mul90], [Sei91], [dBvKOS97], and the naive algorithm (which goes over all vertices and edges). The former uses a trapezoidal map structure for achieving an expected query time of for a map with edges. The randomized algorithm is the one used by default in our implementation. However, the users can choose to use the naive algorithm (trading time for memory efficiency) or can implement their own point location algorithm. This is done with a class derived from the CGAL_Point_location_base<Planar_map> class which is passed as a parameter in the constructor. The description of the class is given in Section .
|
|
| |
insert the curve cv into the map.
Precondition: No curve cv1 of pm intersects cv in the interiors of cv and cv1. |
The following functions enable the usage of information about the map which was acquired beforehand, to save time in insertions. It is recommended to use these functions with the naive point location strategy.
|
| |||
insert cv as a new edge between v1 and v2, where v1 and v2 are vertices of the map. v1 and v2 represent the source and target of the returned halfedge. | ||||
|
| |||
insert a new edge for which one endpoint, v1, is already in
the map. The returned halfedge is the one that has v1 as
it's source. If source is true (resp. false)
then the target of the returned halfedge holds the point
which is cv's target (resp. source).
| ||||
|
| |||
insert cv as a new inner component of f.
Precondition: cv is contained completely in the interior of f (no vertex of cv meets any vertex on the map). |
The following two functions are query functions. Their time complexity depends on the point location strategy used.
|
| |||
return the location in pm where p lies; If lt returns VERTEX then p lies on the vertex which is the target of the returned Halfedge. If lt returns EDGE then p lies on the returned Halfedge. If lt returns FACE then p lies on the face which is on the left of the returned Halfedge . If lt returns UNBOUNDED_FACE then p lies on the unbounded face, and the returned Halfedge is on the boundary of a hole in the unbounded face. | ||||
|
| |||
if up_direction is true (resp. false) return
the first edge of pm that intersects the upward (resp.
downward) vertical ray emanating from p. If several edges
intersect the vertical ray in the same (end)point ,
the function returns the first halfedge pointing at ,
that is encountered when moving clockwise from
around . In that case the value of lt will be
VERTEX . If the ray does not intersect any edge, the value of
lt will be UNBOUNDED_FACE and the Halfedge returned
will be null valued. Otherwise the value of lt will be EDGE.
Precondition: p lies in the interior of a face of pm Postcondition: the returned edge belongs to one of the CCB's of the face in which p is found, null valued if none is found. |
|
| |||
split the edge e into e1 and e2 , and add a
vertex in the splitting point. If the source point of e is
identical to the source of the curve c1 then c1 will
be assigned to e1 and c2 to e2. Otherwise, the
opposite will take place. The returned halfedge will be e1.
Precondition: the preconditions of CGAL_Topological_map<Dcel>::split_edge. Precondition: the target of the curve is identical to the source of the curve . Precondition: the source of the curve is identical to the source point of e and the target of the curve is identical to the target point of e, or the source of the curve is identical to the target point of e and the target of the curve is identical to the source point of e. | ||||
|
| |||
merge the edges e1 and e2 into one edge which will
hold the curve cv. The return value is the halfedge with the
same source vertex that e1 had and the same target e2
had. Precondition: the preconditions of CGAL_Topological_map<Dcel>::merge_edge. Precondition: the source of the curve is identical to the source point of e1 and the target of the curve is identical to the target point of e2, or the target of the curve is identical to the source point of e1 and the source of the curve is identical to the target point of e2 . | ||||
|
| |||
remove the edge e from pm. If the operation causes two faces to merge, the merged face is returned. Otherwise, the face to which the edge was incident is returned. |