CGAL 6.3 - 1D Arrangements
Loading...
Searching...
No Matches
Free Functions

Functions

template<typename GeometryTraits, typename TopologyTraits>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits >::Vertex_descriptor CGAL::Arrangement_on_curve_1::insert (Arrangement_on_curve_1< GeometryTraits, TopologyTraits > &arr, const typename GeometryTraits::Point_1 &p)
 inserts a point into an arrangement.
template<typename GeometryTraits, typename TopologyTraits>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits >::Const_location_result CGAL::Arrangement_on_curve_1::locate (Arrangement_on_curve_1< GeometryTraits, TopologyTraits > &arr, const typename GeometryTraits::Point_1 &q)
 locates a query point in a given arrangement.
template<typename GeometryTraitsA, typename GeometryTraitsB, typename GeometryTraitsRes, typename TopologyTraitsA, typename TopologyTraitsB, typename TopologyTraitsRes, typename OverlayVisitor>
void CGAL::Arrangement_on_curve_1::overlay (const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA > &arr_a, const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB > &arr_b, Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes > &arr_r, OverlayVisitor &visitor)
 computes the overlay of two input 1D arrangement objects arr_a and arr_b, and sets the output arrangement arr_r to represent the overlaid arrangement.
template<typename GeometryTraitsA, typename GeometryTraitsB, typename GeometryTraitsRes, typename TopologyTraitsA, typename TopologyTraitsB, typename TopologyTraitsRes>
void CGAL::Arrangement_on_curve_1::overlay (const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA > &arr_a, const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB > &arr_b, Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes > &arr_r)
 computes the overlay of two input 1D arrangement objects arr_a and arr_b, and sets the output arrangement arr_r to represent the overlaid arrangement.

Function Documentation

◆ insert()

template<typename GeometryTraits, typename TopologyTraits>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits >::Vertex_descriptor CGAL::Arrangement_on_curve_1::insert ( Arrangement_on_curve_1< GeometryTraits, TopologyTraits > & arr,
const typename GeometryTraits::Point_1 & p )

#include <CGAL/insert.h>

inserts a point into an arrangement.

The function first calls locate(arr, p) internally to find where the point \(p\) is located. If \(p\) already matches an existing vertex, the descriptor of that vertex is returned. Otherwise, the function invokes insert_empty(), insert_before(), insert_after(), or split_edge() as needed to safely update the topology, and returns the newly created vertex.

Parameters
arrthe arrangement
pthe point to insert
Returns
the vertex descriptor that identifies the vertex associated with the p.
Examples
Arrangement_on_curve_1/arr_on_line_2.cpp, Arrangement_on_curve_1/arr_on_line_3.cpp, Arrangement_on_curve_1/arr_on_line_d.cpp, Arrangement_on_curve_1/overlay_line_3.cpp, and Arrangement_on_curve_1/simple.cpp.

◆ locate()

template<typename GeometryTraits, typename TopologyTraits>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits >::Const_location_result CGAL::Arrangement_on_curve_1::locate ( Arrangement_on_curve_1< GeometryTraits, TopologyTraits > & arr,
const typename GeometryTraits::Point_1 & q )

#include <CGAL/locate.h>

locates a query point in a given arrangement.

Parameters
arrthe arrangement
qthe query point
Returns
a discriminated union container of type Const_location_result (an instance of std::variant template) that identifies a cell (i.e., a vertex or an edge). In particular, the returned object is a Const_vertex_descriptor if the geometric embedding of the identified vertex coincides exactly with the query point q, or otherwise an Const_edge_desriptor, such that the geometric embedding of the identified edge contains q in its interior. The search is implemented via a linear topological walk from left to right starting at unbounded_left_edge(), using the geometry traits functor to locate the precise cell containing the query point parameter.

◆ overlay() [1/2]

template<typename GeometryTraitsA, typename GeometryTraitsB, typename GeometryTraitsRes, typename TopologyTraitsA, typename TopologyTraitsB, typename TopologyTraitsRes>
void CGAL::Arrangement_on_curve_1::overlay ( const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA > & arr_a,
const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB > & arr_b,
Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes > & arr_r )

#include <CGAL/overlay.h>

computes the overlay of two input 1D arrangement objects arr_a and arr_b, and sets the output arrangement arr_r to represent the overlaid arrangement.

All overlay template functions can be instantiated with different geometric traits instances and different topology traits instances. The geometry traits of the resulting arrangement is used to construct the resulting arrangement. The type GeometryTraitsRes::Point_2 of both input arrangements must be convertible to the point type in the resulting arrangement.

Precondition
arr_r does not refer to either arr_a or arr_b (that is, "self overlay" (or overlay in place) is not supported).

◆ overlay() [2/2]

template<typename GeometryTraitsA, typename GeometryTraitsB, typename GeometryTraitsRes, typename TopologyTraitsA, typename TopologyTraitsB, typename TopologyTraitsRes, typename OverlayVisitor>
void CGAL::Arrangement_on_curve_1::overlay ( const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA > & arr_a,
const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB > & arr_b,
Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes > & arr_r,
OverlayVisitor & visitor )

#include <CGAL/overlay.h>

computes the overlay of two input 1D arrangement objects arr_a and arr_b, and sets the output arrangement arr_r to represent the overlaid arrangement.

All overlay template functions can be instantiated with different geometric traits instances and different topology traits instances. The geometry traits of the resulting arrangement is used to construct the resulting arrangement. The type GeometryTraitsRes::Point_2 of both input arrangements must be convertible to the point type in the resulting arrangement.

Precondition
arr_r does not refer to either arr_a or arr_b (that is, overlay in place is not supported).
The overlay-visitor object visitor must model the OverlayVisitor concept; this object consists of callback functions that update the vertices and edges of the resulting arrangement based of the vertices and edges of the input arrangements that indice them.
See also
OverlayVisitor
Examples
Arrangement_on_curve_1/overlay_line_3.cpp.