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

Functions

template<typename GeometryTraits, typename TopologyTraits, bool BinarySearch>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch >::Vertex_descriptor CGAL::Arrangement_on_curve_1::insert (Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch > &arr, const typename GeometryTraits::Point_1 &p)
 inserts a point into an arrangement.
template<typename GeometryTraits, typename TopologyTraits, bool BinarySearch>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch >::Location_result CGAL::Arrangement_on_curve_1::locate (Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch > &arr, const typename GeometryTraits::Point_1 &q)
 locates a query point in a given arrangement.
template<typename GeometryTraits, typename TopologyTraits, bool BinarySearch>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch >::Const_location_result CGAL::Arrangement_on_curve_1::locate (const Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch > &arr, const typename GeometryTraits::Point_1 &q)
 locates a query point in a given arrangement (const version).
template<typename GeometryTraitsA, typename GeometryTraitsB, typename GeometryTraitsRes, typename TopologyTraitsA, typename TopologyTraitsB, typename TopologyTraitsRes, bool BinarySearchA, bool BinarySearchB, bool BinarySearchRes, typename OverlayVisitor>
void CGAL::Arrangement_on_curve_1::overlay (const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA, BinarySearchA > &arr_a, const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB, BinarySearchB > &arr_b, Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes, BinarySearchRes > &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, bool BinarySearchA, bool BinarySearchB, bool BinarySearchRes>
void CGAL::Arrangement_on_curve_1::overlay (const Arrangement_on_curve_1< GeometryTraitsA, TopologyTraitsA, BinarySearchA > &arr_a, const Arrangement_on_curve_1< GeometryTraitsB, TopologyTraitsB, BinarySearchB > &arr_b, Arrangement_on_curve_1< GeometryTraitsRes, TopologyTraitsRes, BinarySearchRes > &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, bool BinarySearch>
Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch >::Vertex_descriptor CGAL::Arrangement_on_curve_1::insert ( Arrangement_on_curve_1< GeometryTraits, TopologyTraits, BinarySearch > & arr,
const typename GeometryTraits::Point_1 & p )

#include <CGAL/Arrangement_on_curve_1/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 creates a new vertex and returns it. Depending on where \(p\) lies, it invokes one of the following:

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_algebraic_curve.cpp, Arrangement_on_curve_1/arr_on_circle_segment.cpp, 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() [1/2]

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

#include <CGAL/Arrangement_on_curve_1/locate.h>

locates a query point in a given arrangement.

Parameters
arrthe arrangement
qthe query point
Returns
a discriminated union of type ArrangementOnCurve_1::Location_result (an instance of the std::variant template) that identifies a cell, that is, a vertex or an edge. In particular, the returned object is a ArrangementOnCurve_1::Vertex_descriptor if the point associated with the identified vertex coincides with the query point q, or otherwise an ArrangementOnCurve_1::Edge_descriptor of the edge that contains q in its interior.

If BinarySearch is true, the search is a binary search over the vertices, which takes \(O(\log n)\) time. Otherwise, it is a walk from left to right that starts at left_boundary_edge(), which takes \(O(n)\) time.

Examples
Arrangement_on_curve_1/arr_on_algebraic_curve.cpp, and Arrangement_on_curve_1/arr_on_circle_segment.cpp.

◆ locate() [2/2]

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

#include <CGAL/Arrangement_on_curve_1/locate.h>

locates a query point in a given arrangement (const version).

Parameters
arrthe arrangement
qthe query point
Returns
a discriminated union of type ArrangementOnCurve_1::Const_location_result (an instance of the std::variant template) that identifies a cell, that is, a vertex or an edge. In particular, the returned object is a ArrangementOnCurve_1::Vertex_const_descriptor if the point associated with the identified vertex coincides with the query point q, or otherwise an ArrangementOnCurve_1::Edge_const_descriptor of the edge that contains q in its interior.

◆ overlay() [1/2]

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

#include <CGAL/Arrangement_on_curve_1/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.

The three arrangements can have different geometry traits and different topology traits, as long as the side categories of their geometry traits are the same. The geometry traits of the resulting arrangement is used to construct the resulting arrangement. The point types GeometryTraitsA::Point_1 and GeometryTraitsB::Point_1 of the input arrangements must be convertible to the point type GeometryTraitsRes::Point_1 of the resulting arrangement.

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

The function uses Default_overlay_visitor, so the data of the cells of the resulting arrangement, if any, is not set.

◆ overlay() [2/2]

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

#include <CGAL/Arrangement_on_curve_1/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.

The three arrangements can have different geometry traits and different topology traits, as long as the side categories of their geometry traits are the same. The geometry traits of the resulting arrangement is used to construct the resulting arrangement. The point types GeometryTraitsA::Point_1 and GeometryTraitsB::Point_1 of the input arrangements must be convertible to the point type GeometryTraitsRes::Point_1 of the resulting arrangement.

Precondition
arr_r is empty. In particular, arr_r does not refer to either arr_a or arr_b (that is, overlay in place is not supported).
Template Parameters
OverlayVisitora model of the concept OverlayVisitor; its callback functions update the vertices and edges of the resulting arrangement based on the vertices and edges of the input arrangements that induce them.
See also
OverlayVisitor
Examples
Arrangement_on_curve_1/overlay_line_3.cpp.