mirror of https://github.com/CGAL/cgal
Change name of insert_curve and insert_curves to insert
This commit is contained in:
parent
7c1cdddcf5
commit
821b9fba55
|
|
@ -384,7 +384,7 @@ public:
|
||||||
Curve_list::const_iterator i;
|
Curve_list::const_iterator i;
|
||||||
Strategy strategy(arr);
|
Strategy strategy(arr);
|
||||||
for (i = m_curve_list.begin(); i != m_curve_list.end(); ++i)
|
for (i = m_curve_list.begin(); i != m_curve_list.end(); ++i)
|
||||||
insert_curve(arr, *i, strategy);
|
insert(arr, *i, strategy);
|
||||||
|
|
||||||
if (m_verbose_level > 0) { //print to cout
|
if (m_verbose_level > 0) { //print to cout
|
||||||
if (m_verbose_level > 1) {
|
if (m_verbose_level > 1) {
|
||||||
|
|
@ -429,7 +429,7 @@ public:
|
||||||
{
|
{
|
||||||
if (m_verbose_level > 0) std::cout << "Inserting Aggregate" << std::endl;
|
if (m_verbose_level > 0) std::cout << "Inserting Aggregate" << std::endl;
|
||||||
Arr arr(&m_traits);
|
Arr arr(&m_traits);
|
||||||
insert_curves(arr, m_curve_list.begin(), m_curve_list.end());
|
insert(arr, m_curve_list.begin(), m_curve_list.end());
|
||||||
if (m_verbose_level > 0) {
|
if (m_verbose_level > 0) {
|
||||||
if (m_verbose_level > 1) {
|
if (m_verbose_level > 1) {
|
||||||
if (!arr.is_valid()) std::cerr << "map invalid!" << std::endl;
|
if (!arr.is_valid()) std::cerr << "map invalid!" << std::endl;
|
||||||
|
|
@ -456,7 +456,7 @@ public:
|
||||||
void op()
|
void op()
|
||||||
{
|
{
|
||||||
Arr arr(&m_traits);
|
Arr arr(&m_traits);
|
||||||
insert_curves(arr, m_curve_list.begin(), m_curve_list.end());
|
insert(arr, m_curve_list.begin(), m_curve_list.end());
|
||||||
if (m_verbose_level > 0) {
|
if (m_verbose_level > 0) {
|
||||||
if (m_verbose_level > 1) {
|
if (m_verbose_level > 1) {
|
||||||
if (!arr.is_valid()) std::cerr << "map invalid!" << std::endl;
|
if (!arr.is_valid()) std::cerr << "map invalid!" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ int main()
|
||||||
cv[0] = Segment_2 (p1, p2);
|
cv[0] = Segment_2 (p1, p2);
|
||||||
cv[1] = Segment_2 (p2, p3);
|
cv[1] = Segment_2 (p2, p3);
|
||||||
cv[2] = Segment_2 (p3, p1);
|
cv[2] = Segment_2 (p3, p1);
|
||||||
CGAL::insert_curves (arr, &cv[0], &cv[3]);
|
CGAL::insert (arr, &cv[0], &cv[3]);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
\}
|
\}
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ associated with the existing halfedge as well) and associate new
|
||||||
edges with the resulting subcurves. Recall that an edge is represented
|
edges with the resulting subcurves. Recall that an edge is represented
|
||||||
by a pair of twin halfedges, so we split it into two halfedge pairs.
|
by a pair of twin halfedges, so we split it into two halfedge pairs.
|
||||||
|
|
||||||
The free function \ccc{insert_curve(arr, c, pl)} performs
|
The free function \ccc{insert(arr, c, pl)} performs
|
||||||
this insertion operation. It accepts an $x$-monotone curve $c$,
|
this insertion operation. It accepts an $x$-monotone curve $c$,
|
||||||
which may intersect some of the curves already in the arrangement
|
which may intersect some of the curves already in the arrangement
|
||||||
\ccc{arr}, and inserts it into the arrangement by computing its zone.
|
\ccc{arr}, and inserts it into the arrangement by computing its zone.
|
||||||
Users may supply a point-location object \ccc{pl}, or use the default
|
Users may supply a point-location object \ccc{pl}, or use the default
|
||||||
walk point-location strategy (namely, the variant
|
walk point-location strategy (namely, the variant
|
||||||
\ccc{insert_curve(arr, c)} is also available). The
|
\ccc{insert(arr, c)} is also available). The
|
||||||
running-time of this insertion function is proportional to the
|
running-time of this insertion function is proportional to the
|
||||||
complexity of the zone of the curve $c$.
|
complexity of the zone of the curve $c$.
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ In some cases users may have a prior knowledge of the location of the
|
||||||
left endpoint of the $x$-monotone curve \ccc{c} they wish to insert,
|
left endpoint of the $x$-monotone curve \ccc{c} they wish to insert,
|
||||||
so they can perform the insertion without issuing any point-location
|
so they can perform the insertion without issuing any point-location
|
||||||
queries. This can be done by calling
|
queries. This can be done by calling
|
||||||
\ccc{insert_curve(arr, c, obj)}, where \ccc{obj} is an
|
\ccc{insert(arr, c, obj)}, where \ccc{obj} is an
|
||||||
object represents the location of \ccc{c}'s left endpoint in the
|
object represents the location of \ccc{c}'s left endpoint in the
|
||||||
arrangement --- namely it wraps a \ccc{Vertex_const_handle}, a
|
arrangement --- namely it wraps a \ccc{Vertex_const_handle}, a
|
||||||
\ccc{Halfedge_const_handle} or a \ccc{Face_const_handle} (see
|
\ccc{Halfedge_const_handle} or a \ccc{Face_const_handle} (see
|
||||||
|
|
@ -102,7 +102,7 @@ also Section~\ref{arr_ssec:pl}).
|
||||||
So far all our examples were of arrangements of line segments,
|
So far all our examples were of arrangements of line segments,
|
||||||
where the \ccc{Arrangement_2} template was instantiated with the
|
where the \ccc{Arrangement_2} template was instantiated with the
|
||||||
\ccc{Arr_segment_traits_2} class. In this case, the fact that
|
\ccc{Arr_segment_traits_2} class. In this case, the fact that
|
||||||
\ccc{insert_curve()} accepts an $x$-monotone curve does not
|
\ccc{insert()} accepts an $x$-monotone curve does not
|
||||||
seem to be a restriction, as all line segments are $x$-monotone
|
seem to be a restriction, as all line segments are $x$-monotone
|
||||||
(note that we consider vertical line segments to be {\em weakly}
|
(note that we consider vertical line segments to be {\em weakly}
|
||||||
$x$-monotone).
|
$x$-monotone).
|
||||||
|
|
@ -110,13 +110,13 @@ $x$-monotone).
|
||||||
Suppose that we construct an arrangement of circles. A circle is
|
Suppose that we construct an arrangement of circles. A circle is
|
||||||
obviously not $x$-monotone, so we cannot insert it in the same way we
|
obviously not $x$-monotone, so we cannot insert it in the same way we
|
||||||
inserted $x$-monotone curves. \footnote{Note that a key
|
inserted $x$-monotone curves. \footnote{Note that a key
|
||||||
operation performed by \ccc{insert_curve()} is to locate the
|
operation performed by \ccc{insert()} is to locate the
|
||||||
left endpoint of the curve in the arrangement. A circle, however, does
|
left endpoint of the curve in the arrangement. A circle, however, does
|
||||||
not have any endpoints!} However, it is possible to subdivide each circle
|
not have any endpoints!} However, it is possible to subdivide each circle
|
||||||
into two $x$-monotone circular arcs (its upper half and its lower
|
into two $x$-monotone circular arcs (its upper half and its lower
|
||||||
half) and to insert each $x$-monotone arc separately.
|
half) and to insert each $x$-monotone arc separately.
|
||||||
|
|
||||||
The free function \ccc{insert_curve()} also supports general curve and
|
The free function \ccc{insert()} also supports general curve and
|
||||||
not necessarily $x$-monotone curves. In this case it requires that the
|
not necessarily $x$-monotone curves. In this case it requires that the
|
||||||
traits class used by the arrangement \ccc{arr} to be a model of the
|
traits class used by the arrangement \ccc{arr} to be a model of the
|
||||||
concept \ccc{ArrangementTraits_2}, which refines the
|
concept \ccc{ArrangementTraits_2}, which refines the
|
||||||
|
|
@ -124,12 +124,12 @@ concept \ccc{ArrangementTraits_2}, which refines the
|
||||||
additional \ccc{Curve_2} type (which may differ from the
|
additional \ccc{Curve_2} type (which may differ from the
|
||||||
\ccc{X_monotone_curve_2} type), and support the subdivision of curves
|
\ccc{X_monotone_curve_2} type), and support the subdivision of curves
|
||||||
of this new type into $x$-monotone curves (see the exact details in
|
of this new type into $x$-monotone curves (see the exact details in
|
||||||
Section~\ref{arr_sec:traits}). The \ccc{insert_curve(arr, c, pl)}
|
Section~\ref{arr_sec:traits}). The \ccc{insert(arr, c, pl)}
|
||||||
function performs the insertion of the curve $c$, which does not need
|
function performs the insertion of the curve $c$, which does not need
|
||||||
to be $x$-monotone, into the arrangement by subdividing it (if needed)
|
to be $x$-monotone, into the arrangement by subdividing it (if needed)
|
||||||
into $x$-monotone subcurves and inserting each one separately. Users
|
into $x$-monotone subcurves and inserting each one separately. Users
|
||||||
may supply a point-location object \ccc{pl}, or use the default walk
|
may supply a point-location object \ccc{pl}, or use the default walk
|
||||||
point-location strategy by calling \ccc{insert_curve(arr, c)}.
|
point-location strategy by calling \ccc{insert(arr, c)}.
|
||||||
|
|
||||||
\subsubsection{Inserting Points\label{arr_sssec:insert_point}}
|
\subsubsection{Inserting Points\label{arr_sssec:insert_point}}
|
||||||
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
@ -183,7 +183,7 @@ The program below constructs an arrangement of intersecting
|
||||||
line-segments. We know that $s_1$ and $s_2$ do not intersect, so
|
line-segments. We know that $s_1$ and $s_2$ do not intersect, so
|
||||||
we use \ccc{insert_non_intersecting_curve()} to insert them into the
|
we use \ccc{insert_non_intersecting_curve()} to insert them into the
|
||||||
empty arrangement. The rest of the segments are inserted using
|
empty arrangement. The rest of the segments are inserted using
|
||||||
\ccc{insert_curve()}. The resulting arrangement consists
|
\ccc{insert()}. The resulting arrangement consists
|
||||||
of $13$ vertices, $16$ edges, and $5$ faces, as can be seen in
|
of $13$ vertices, $16$ edges, and $5$ faces, as can be seen in
|
||||||
Figure~\ref{arr_fig:ex_8}.
|
Figure~\ref{arr_fig:ex_8}.
|
||||||
|
|
||||||
|
|
@ -253,7 +253,7 @@ a range of $x$-monotone curves given by the input iterators
|
||||||
curves should be pairwise disjoint in their interior and also
|
curves should be pairwise disjoint in their interior and also
|
||||||
interior-disjoint from all existing edges and vertices of \ccc{arr}.
|
interior-disjoint from all existing edges and vertices of \ccc{arr}.
|
||||||
%
|
%
|
||||||
\item \ccc{insert_curves(arr, begin, end)} inserts a range of general
|
\item \ccc{insert(arr, begin, end)} inserts a range of general
|
||||||
(not necessarily $x$-monotone) curves of type \ccc{Curve_2} or
|
(not necessarily $x$-monotone) curves of type \ccc{Curve_2} or
|
||||||
\ccc{X_monotone_curve_2} that may intersect one another, given by
|
\ccc{X_monotone_curve_2} that may intersect one another, given by
|
||||||
the input iterators \ccc{[begin, end)}, into the arrangement
|
the input iterators \ccc{[begin, end)}, into the arrangement
|
||||||
|
|
@ -291,7 +291,7 @@ The example below shows how to construct the arrangement of
|
||||||
line segments depicted in Figure~\ref{arr_fig:ex_8} and built
|
line segments depicted in Figure~\ref{arr_fig:ex_8} and built
|
||||||
incrementally in \ccc{incremental_insertion.cpp}, as shown in the previous
|
incrementally in \ccc{incremental_insertion.cpp}, as shown in the previous
|
||||||
section. We use the aggregated insertion function
|
section. We use the aggregated insertion function
|
||||||
\ccc{insert_curves()} as we deal with line segments.
|
\ccc{insert()} as we deal with line segments.
|
||||||
Note that no point-location object needs to be defined and attached to the
|
Note that no point-location object needs to be defined and attached to the
|
||||||
arrangement:
|
arrangement:
|
||||||
|
|
||||||
|
|
@ -329,7 +329,7 @@ Notice that the line segments of ${\mathcal S}_1$ are pairwise
|
||||||
interior-disjoint, so we use \ccc{insert_non_intersecting_curves()}.
|
interior-disjoint, so we use \ccc{insert_non_intersecting_curves()}.
|
||||||
${\mathcal S}_2$ also contain pairwise interior-disjoint segments,
|
${\mathcal S}_2$ also contain pairwise interior-disjoint segments,
|
||||||
but as they intersect the existing arrangement, we have to use
|
but as they intersect the existing arrangement, we have to use
|
||||||
\ccc{insert_curves()} to insert them. Also note that the
|
\ccc{insert()} to insert them. Also note that the
|
||||||
single segment $s$ we insert incrementally overlaps an existing
|
single segment $s$ we insert incrementally overlaps an existing
|
||||||
arrangement edge:
|
arrangement edge:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,14 @@ and the basic arrangement class is the way they handle their input curves.
|
||||||
\ccc{Arrangement_with_history_2} always stores the \ccc{Curve_2} objects
|
\ccc{Arrangement_with_history_2} always stores the \ccc{Curve_2} objects
|
||||||
that induce it, thus it is impossible to insert $x$-monotone curves into
|
that induce it, thus it is impossible to insert $x$-monotone curves into
|
||||||
an arrangement with history. The free \ccc{insert_non_intersecting_curve()}
|
an arrangement with history. The free \ccc{insert_non_intersecting_curve()}
|
||||||
and \ccc{insert_curve()} that receives $x$-monotone curve (as well as
|
and \ccc{insert()} that receives $x$-monotone curve (as well as
|
||||||
their aggregated versions) are therefore not available for
|
their aggregated versions) are therefore not available for
|
||||||
arrangement-with-history instances and only the free
|
arrangement-with-history instances and only the free
|
||||||
\ccc{insert_curve()} and \ccc{insert_curves()} functions that receive
|
\ccc{insert()} and \ccc{insert()} functions that receive
|
||||||
\ccc{Curve_2} (the incremental insertion function and the aggregated
|
\ccc{Curve_2} (the incremental insertion function and the aggregated
|
||||||
insertion function) are supported --- see also
|
insertion function) are supported --- see also
|
||||||
Section~\ref{arr_sssec:insert_gen}. Notice however that while the
|
Section~\ref{arr_sssec:insert_gen}. Notice however that while the
|
||||||
incremental insertion function \ccc{insert_curve(arr,c)} for an
|
incremental insertion function \ccc{insert(arr,c)} for an
|
||||||
\ccc{Arrangement_2} object \ccc{arr} does not have a return value, the
|
\ccc{Arrangement_2} object \ccc{arr} does not have a return value, the
|
||||||
corresponding arrangement-with-history function returns a
|
corresponding arrangement-with-history function returns a
|
||||||
\ccc{Curve_handle} to the inserted curve.
|
\ccc{Curve_handle} to the inserted curve.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ When the curves to be inserted into an arrangement are $x$-monotone
|
||||||
and pairwise disjoint in their interior to start with, then it is more
|
and pairwise disjoint in their interior to start with, then it is more
|
||||||
efficient (in running time) and less demanding (in traits-class
|
efficient (in running time) and less demanding (in traits-class
|
||||||
functionality) to use the non-intersection insertion-functions instead
|
functionality) to use the non-intersection insertion-functions instead
|
||||||
of the general ones; e.g., \ccc{insert_curve()}.
|
of the general ones; e.g., \ccc{insert()}.
|
||||||
|
|
||||||
\item
|
\item
|
||||||
When the curves to be inserted into an arrangement are segments that
|
When the curves to be inserted into an arrangement are segments that
|
||||||
|
|
@ -77,7 +77,7 @@ performed.
|
||||||
When the curves to be inserted into an arrangement are available in
|
When the curves to be inserted into an arrangement are available in
|
||||||
advance (as opposed to supplied on-line), it is advised to use the
|
advance (as opposed to supplied on-line), it is advised to use the
|
||||||
more efficient aggregate (sweep-based) insertion over the incremental
|
more efficient aggregate (sweep-based) insertion over the incremental
|
||||||
insertion; e.g., \ccc{insert_curves()}.
|
insertion; e.g., \ccc{insert()}.
|
||||||
|
|
||||||
|
|
||||||
\item
|
\item
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,8 @@ part and the lower part of the unit circle) and a single isolated
|
||||||
point.
|
point.
|
||||||
|
|
||||||
Note that the refined model \ccc{ArrangementTraits_2} is required
|
Note that the refined model \ccc{ArrangementTraits_2} is required
|
||||||
only when using the free \ccc{insert_curve()} and
|
only when using the free \ccc{insert()} and
|
||||||
\ccc{insert_curves()} functions (see Section~\ref{arr_sec:gl_funcs}),
|
\ccc{insert()} functions (see Section~\ref{arr_sec:gl_funcs}),
|
||||||
which accept a \ccc{Curve_2} object in the incremental version,
|
which accept a \ccc{Curve_2} object in the incremental version,
|
||||||
or a range of \ccc{Curve_2} objects in the aggregated version.
|
or a range of \ccc{Curve_2} objects in the aggregated version.
|
||||||
In all other cases it is sufficient to use a model of the
|
In all other cases it is sufficient to use a model of the
|
||||||
|
|
@ -599,8 +599,8 @@ type represents a bounded, not necessarily $x$-monotone, conic arc.
|
||||||
The \ccc{X_monotone_curve_2} type is derived from \ccc{Curve_2},
|
The \ccc{X_monotone_curve_2} type is derived from \ccc{Curve_2},
|
||||||
but its constructors are to be used only by the traits class.
|
but its constructors are to be used only by the traits class.
|
||||||
You should therefore construct only \ccc{Curve_2} objects and
|
You should therefore construct only \ccc{Curve_2} objects and
|
||||||
insert them into the arrangement using the \ccc{insert_curve()}
|
insert them into the arrangement using the \ccc{insert()}
|
||||||
or \ccc{insert_curves()} functions.
|
or \ccc{insert()} functions.
|
||||||
|
|
||||||
Conic arcs can be constructed from full ellipses or by specifying
|
Conic arcs can be constructed from full ellipses or by specifying
|
||||||
a supporting curve, two endpoints and an orientation. However,
|
a supporting curve, two endpoints and an orientation. However,
|
||||||
|
|
|
||||||
|
|
@ -214,8 +214,8 @@ curves and the edges they induce.
|
||||||
\ccc{Arrangement_2<Traits,Dcel>}\lcTex{
|
\ccc{Arrangement_2<Traits,Dcel>}\lcTex{
|
||||||
(\ccRefPage{CGAL::Arrangement_2<Traits,Dcel>})} \\
|
(\ccRefPage{CGAL::Arrangement_2<Traits,Dcel>})} \\
|
||||||
\ccc{insertion functions}\lcTex{
|
\ccc{insertion functions}\lcTex{
|
||||||
(\ccRefPage{CGAL::insert_curve},
|
(\ccRefPage{CGAL::insert},
|
||||||
\ccRefPage{CGAL::insert_curves})} \\
|
\ccRefPage{CGAL::insert})} \\
|
||||||
\ccc{removal functions}\lcTex{
|
\ccc{removal functions}\lcTex{
|
||||||
(\ccRefPage{CGAL::remove_curve})} \\
|
(\ccRefPage{CGAL::remove_curve})} \\
|
||||||
\ccc{overlaying arrangements}\lcTex{
|
\ccc{overlaying arrangements}\lcTex{
|
||||||
|
|
|
||||||
|
|
@ -567,12 +567,12 @@ $\bullet$ {\sl Modifying Vertices and Edges:}
|
||||||
\ccc{ArrangementBasicTraits_2}\lcTex{(\ccRefPage{ArrangementBasicTraits_2})}\\
|
\ccc{ArrangementBasicTraits_2}\lcTex{(\ccRefPage{ArrangementBasicTraits_2})}\\
|
||||||
\ccc{CGAL::is_valid}\lcTex{(\ccRefPage{CGAL::is_valid})}\\
|
\ccc{CGAL::is_valid}\lcTex{(\ccRefPage{CGAL::is_valid})}\\
|
||||||
Insertion functions\lcTex{
|
Insertion functions\lcTex{
|
||||||
(\ccRefPage{CGAL::insert_curve}, \ccRefPage{CGAL::insert_curves},
|
(\ccRefPage{CGAL::insert}, \ccRefPage{CGAL::insert},
|
||||||
\ccRefPage{CGAL::insert_non_intersecting_curve},
|
\ccRefPage{CGAL::insert_non_intersecting_curve},
|
||||||
\ccRefPage{CGAL::insert_non_intersecting_curves},
|
\ccRefPage{CGAL::insert_non_intersecting_curves},
|
||||||
\ccRefPage{CGAL::insert_point})}
|
\ccRefPage{CGAL::insert_point})}
|
||||||
\lcRawHtml{
|
\lcRawHtml{
|
||||||
(<I><A HREF="Function_insert_curve.html">CGAL::insert_curve</A></I>,
|
(<I><A HREF="Function_insert.html">CGAL::insert</A></I>,
|
||||||
<I><A HREF="Function_insert_non_intersecting_curve.html">CGAL::insert_non_intersecting_curve</A></I>,
|
<I><A HREF="Function_insert_non_intersecting_curve.html">CGAL::insert_non_intersecting_curve</A></I>,
|
||||||
<I><A HREF="Function_insert_non_intersecting_curves.html">CGAL::insert_non_intersecting_curves</A></I>,
|
<I><A HREF="Function_insert_non_intersecting_curves.html">CGAL::insert_non_intersecting_curves</A></I>,
|
||||||
<I><A HREF="Function_insert_point.html">CGAL::insert_point</A></I>)
|
<I><A HREF="Function_insert_point.html">CGAL::insert_point</A></I>)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
\ccRefPageBegin
|
\ccRefPageBegin
|
||||||
|
|
||||||
\begin{ccRefFunction}{insert_curve}
|
\begin{ccRefFunction}{insert}
|
||||||
|
|
||||||
\ccDefinition
|
\ccDefinition
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ class
|
||||||
|
|
||||||
\ccGlobalFunction{template<class Traits, class Dcel,
|
\ccGlobalFunction{template<class Traits, class Dcel,
|
||||||
class Curve, class PointLocation>
|
class Curve, class PointLocation>
|
||||||
void insert_curve (Arrangement_2<Traits,Dcel>& arr,
|
void insert (Arrangement_2<Traits,Dcel>& arr,
|
||||||
const Curve& c,
|
const Curve& c,
|
||||||
const PointLocation& pl = walk_pl);}
|
const PointLocation& pl = walk_pl);}
|
||||||
Inserts the given curve \ccc{c} into the arrangement \ccc{arr}.
|
Inserts the given curve \ccc{c} into the arrangement \ccc{arr}.
|
||||||
|
|
@ -41,7 +41,7 @@ Inserts the given curve \ccc{c} into the arrangement \ccc{arr}.
|
||||||
\ccGlobalFunction{template<typename Traits, typename Dcel,
|
\ccGlobalFunction{template<typename Traits, typename Dcel,
|
||||||
typename PointLocation>
|
typename PointLocation>
|
||||||
typename Arrangement_with_history_2<Traits,Dcel>::Curve_handle
|
typename Arrangement_with_history_2<Traits,Dcel>::Curve_handle
|
||||||
insert_curve (Arrangement_with_history_2<Traits,Dcel>& arr,
|
insert (Arrangement_with_history_2<Traits,Dcel>& arr,
|
||||||
const typename Traits::Curve_2& c,
|
const typename Traits::Curve_2& c,
|
||||||
const PointLocation& pl = walk_pl);}
|
const PointLocation& pl = walk_pl);}
|
||||||
Inserts the given curve \ccc{c} into the arrangement with history
|
Inserts the given curve \ccc{c} into the arrangement with history
|
||||||
|
|
@ -50,7 +50,7 @@ Inserts the given curve \ccc{c} into the arrangement with history
|
||||||
\ccc{arr}.}
|
\ccc{arr}.}
|
||||||
|
|
||||||
\ccGlobalFunction{template<typename Traits, typename Dcel>
|
\ccGlobalFunction{template<typename Traits, typename Dcel>
|
||||||
void insert_curve (Arrangement_2<Traits,Dcel>& arr,
|
void insert (Arrangement_2<Traits,Dcel>& arr,
|
||||||
const typename Traits::X_monotone_curve_2& xc,
|
const typename Traits::X_monotone_curve_2& xc,
|
||||||
const Object& obj);}
|
const Object& obj);}
|
||||||
Inserts the{\em $x$-monotone (only)} curve \ccc{xc} into the
|
Inserts the{\em $x$-monotone (only)} curve \ccc{xc} into the
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
\ccRefPageBegin
|
\ccRefPageBegin
|
||||||
|
|
||||||
\begin{ccRefFunction}{insert_curves}
|
\begin{ccRefFunction}{insert}
|
||||||
|
|
||||||
\ccDefinition
|
\ccDefinition
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ inserted into the arrangement using the sweep-line algorithm.
|
||||||
\ccInclude{CGAL/Arrangement_2.h}
|
\ccInclude{CGAL/Arrangement_2.h}
|
||||||
|
|
||||||
\ccGlobalFunction{template<class Traits, class Dcel, class InputIterator>
|
\ccGlobalFunction{template<class Traits, class Dcel, class InputIterator>
|
||||||
void insert_curves (Arrangement_2<Traits,Dcel>& arr,
|
void insert (Arrangement_2<Traits,Dcel>& arr,
|
||||||
InputIterator first, InputIterator last);}
|
InputIterator first, InputIterator last);}
|
||||||
Inserts the curves or $x$-monotone curves in the range
|
Inserts the curves or $x$-monotone curves in the range
|
||||||
\ccc{[first,last)} into the arrangement \ccc{arr}.
|
\ccc{[first,last)} into the arrangement \ccc{arr}.
|
||||||
|
|
@ -28,7 +28,7 @@ Inserts the curves or $x$-monotone curves in the range
|
||||||
\ccThree{Orientation~~}{}{\hspace*{8.5cm}}
|
\ccThree{Orientation~~}{}{\hspace*{8.5cm}}
|
||||||
|
|
||||||
\ccGlobalFunction{template<class Traits, class Dcel, InputIterator>
|
\ccGlobalFunction{template<class Traits, class Dcel, InputIterator>
|
||||||
void insert_curves (Arrangement_with_history_2<Traits,Dcel>& arr,
|
void insert (Arrangement_with_history_2<Traits,Dcel>& arr,
|
||||||
InputIterator first, InputIterator last);}
|
InputIterator first, InputIterator last);}
|
||||||
Inserts the curves in the range \ccc{[first,last)} into the
|
Inserts the curves in the range \ccc{[first,last)} into the
|
||||||
arrangement with history \ccc{arr}.
|
arrangement with history \ccc{arr}.
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,8 @@ implemented as peripheral classes or as free (global) functions.
|
||||||
\subsection*{Functions}
|
\subsection*{Functions}
|
||||||
|
|
||||||
\ccRefIdfierPage{CGAL::is_valid}\\
|
\ccRefIdfierPage{CGAL::is_valid}\\
|
||||||
\ccRefIdfierPage{CGAL::insert_curve}\\
|
\ccRefIdfierPage{CGAL::insert}\\
|
||||||
\ccRefIdfierPage{CGAL::insert_curves}\\
|
\ccRefIdfierPage{CGAL::insert}\\
|
||||||
\ccRefIdfierPage{CGAL::insert_non_intersecting_curve}\\
|
\ccRefIdfierPage{CGAL::insert_non_intersecting_curve}\\
|
||||||
\ccRefIdfierPage{CGAL::insert_non_intersecting_curves}\\
|
\ccRefIdfierPage{CGAL::insert_non_intersecting_curves}\\
|
||||||
\ccRefIdfierPage{CGAL::insert_point}\\
|
\ccRefIdfierPage{CGAL::insert_point}\\
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
// Construct the arrangement.
|
// Construct the arrangement.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
insert_curves (arr, curves.begin(), curves.end());
|
insert (arr, curves.begin(), curves.end());
|
||||||
|
|
||||||
// Print the arrangement size.
|
// Print the arrangement size.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ int main ()
|
||||||
segments.push_back (Segment_2 (Point_2(0, 2), Point_2(6, 0)));
|
segments.push_back (Segment_2 (Point_2(0, 2), Point_2(6, 0)));
|
||||||
segments.push_back (Segment_2 (Point_2(3, 0), Point_2(5, 5)));
|
segments.push_back (Segment_2 (Point_2(3, 0), Point_2(5, 5)));
|
||||||
|
|
||||||
insert_curves (arr, segments.begin(), segments.end());
|
insert (arr, segments.begin(), segments.end());
|
||||||
|
|
||||||
// Print the size of the arrangement.
|
// Print the size of the arrangement.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = ellipses.begin(); iter != ellipses.end(); ++iter)
|
for (iter = ellipses.begin(); iter != ellipses.end(); ++iter)
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -126,7 +126,7 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = ellipses.begin(); iter != ellipses.end(); ++iter)
|
for (iter = ellipses.begin(); iter != ellipses.end(); ++iter)
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +136,7 @@ int main (int argc, char *argv[])
|
||||||
<< n << " ellipses." << std::endl;
|
<< n << " ellipses." << std::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
insert_curves (arr, ellipses.begin(), ellipses.end());
|
insert (arr, ellipses.begin(), ellipses.end());
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ int main (int argc, char **argv)
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = polylines.begin(); iter != polylines.end(); ++iter)
|
for (iter = polylines.begin(); iter != polylines.end(); ++iter)
|
||||||
{
|
{
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +194,7 @@ int main (int argc, char **argv)
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = polylines.begin(); iter != polylines.end(); ++iter)
|
for (iter = polylines.begin(); iter != polylines.end(); ++iter)
|
||||||
{
|
{
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +206,7 @@ int main (int argc, char **argv)
|
||||||
<< n << " polylines." << std::endl;
|
<< n << " polylines." << std::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
insert_curves (arr, polylines.begin(), polylines.end());
|
insert (arr, polylines.begin(), polylines.end());
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ int main (int argc, char **argv)
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
||||||
{
|
{
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +194,7 @@ int main (int argc, char **argv)
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
||||||
{
|
{
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -210,7 +210,7 @@ int main (int argc, char **argv)
|
||||||
timer.start();
|
timer.start();
|
||||||
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
for (iter = segments.begin(); iter != segments.end(); ++iter)
|
||||||
{
|
{
|
||||||
insert_curve (arr, *iter, pl);
|
insert (arr, *iter, pl);
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +222,7 @@ int main (int argc, char **argv)
|
||||||
<< n << " segments." << std::endl;
|
<< n << " segments." << std::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
insert_curves (arr, segments.begin(), segments.end());
|
insert (arr, segments.begin(), segments.end());
|
||||||
timer.stop();
|
timer.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,13 +55,13 @@ int main ()
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
// Construct an arrangement of seven intersecting line segments.
|
// Construct an arrangement of seven intersecting line segments.
|
||||||
insert_curve (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1)));
|
insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (7, 1)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7)));
|
insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1)));
|
insert (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4)));
|
insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3)));
|
||||||
|
|
||||||
// Create a mapping of the arrangement faces to indices.
|
// Create a mapping of the arrangement faces to indices.
|
||||||
CGAL::Arr_face_index_map<Arrangement_2> index_map (arr);
|
CGAL::Arr_face_index_map<Arrangement_2> index_map (arr);
|
||||||
|
|
|
||||||
|
|
@ -109,12 +109,12 @@ int main()
|
||||||
insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1),
|
insert_non_intersecting_curve (arr, Segment_2 (Point_2 (1, 1),
|
||||||
Point_2 (7, 1)));
|
Point_2 (7, 1)));
|
||||||
Arrangement_2::Vertex_handle v0 = e->source();
|
Arrangement_2::Vertex_handle v0 = e->source();
|
||||||
insert_curve (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7)));
|
insert (arr, Segment_2 (Point_2 (1, 1), Point_2 (3, 7)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1)));
|
insert (arr, Segment_2 (Point_2 (1, 4), Point_2 (7, 1)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (9, 3)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4)));
|
insert (arr, Segment_2 (Point_2 (2, 2), Point_2 (4, 4)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (7, 1), Point_2 (9, 3)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3)));
|
insert (arr, Segment_2 (Point_2 (3, 7), Point_2 (9, 3)));
|
||||||
|
|
||||||
// Create a mapping of the arrangement vertices to indices.
|
// Create a mapping of the arrangement vertices to indices.
|
||||||
CGAL::Arr_vertex_index_map<Arrangement_2> index_map_tmp(arr);
|
CGAL::Arr_vertex_index_map<Arrangement_2> index_map_tmp(arr);
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ int main ()
|
||||||
// Construct the arrangement of the three circles.
|
// Construct the arrangement of the three circles.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
insert_curve (arr, cv1);
|
insert (arr, cv1);
|
||||||
insert_curve (arr, cv2);
|
insert (arr, cv2);
|
||||||
insert_curve (arr, cv3);
|
insert (arr, cv3);
|
||||||
|
|
||||||
// Locate the vertex with maximal degree.
|
// Locate the vertex with maximal degree.
|
||||||
Arrangement_2::Vertex_const_iterator vit;
|
Arrangement_2::Vertex_const_iterator vit;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ int main ()
|
||||||
// Construct the arrangement of the curves.
|
// Construct the arrangement of the curves.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
insert_curves (arr, curves.begin(), curves.end());
|
insert (arr, curves.begin(), curves.end());
|
||||||
|
|
||||||
// Print the size of the arrangement.
|
// Print the size of the arrangement.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ int main()
|
||||||
Point_location _pl(arr);
|
Point_location _pl(arr);
|
||||||
for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) {
|
for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) {
|
||||||
//insert(arr,_pl,*it);
|
//insert(arr,_pl,*it);
|
||||||
insert_curve(arr, *it, _pl);
|
insert(arr, *it, _pl);
|
||||||
};
|
};
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ int main ()
|
||||||
Point_2 pt1 (Rational(1,2), Rational(1,2));
|
Point_2 pt1 (Rational(1,2), Rational(1,2));
|
||||||
Conic_arc_2 cv1 (1, 0, 1, 0, -1, 0, CGAL::COUNTERCLOCKWISE, ps1, pt1);
|
Conic_arc_2 cv1 (1, 0, 1, 0, -1, 0, CGAL::COUNTERCLOCKWISE, ps1, pt1);
|
||||||
|
|
||||||
insert_curve (arr, cv1, pl);
|
insert (arr, cv1, pl);
|
||||||
|
|
||||||
// Insert the bottom half of the circle centered at (0, 1/2) whose radius
|
// Insert the bottom half of the circle centered at (0, 1/2) whose radius
|
||||||
// is 1/2 (therefore its squared radius is 1/4).
|
// is 1/2 (therefore its squared radius is 1/4).
|
||||||
|
|
@ -57,7 +57,7 @@ int main ()
|
||||||
Point_2 pt2 (Rational(1,2), Rational(1,2));
|
Point_2 pt2 (Rational(1,2), Rational(1,2));
|
||||||
Conic_arc_2 cv2 (circ2, CGAL::COUNTERCLOCKWISE, ps2, pt2);
|
Conic_arc_2 cv2 (circ2, CGAL::COUNTERCLOCKWISE, ps2, pt2);
|
||||||
|
|
||||||
insert_curve (arr, cv2, pl);
|
insert (arr, cv2, pl);
|
||||||
|
|
||||||
// Print the resulting arrangement.
|
// Print the resulting arrangement.
|
||||||
print_arrangement (arr);
|
print_arrangement (arr);
|
||||||
|
|
|
||||||
|
|
@ -41,21 +41,21 @@ int main ()
|
||||||
Point_2 pt1 (2, Rational(1,2));
|
Point_2 pt1 (2, Rational(1,2));
|
||||||
Conic_arc_2 c1 (0, 0, 1, 0, 0, -1, CGAL::COUNTERCLOCKWISE, ps1, pt1);
|
Conic_arc_2 c1 (0, 0, 1, 0, 0, -1, CGAL::COUNTERCLOCKWISE, ps1, pt1);
|
||||||
|
|
||||||
insert_curve (arr, c1);
|
insert (arr, c1);
|
||||||
|
|
||||||
// Insert a full ellipse, which is (x/4)^2 + (y/2)^2 = 0 rotated by
|
// Insert a full ellipse, which is (x/4)^2 + (y/2)^2 = 0 rotated by
|
||||||
// phi=36.87 degree (such that sin(phi) = 0.6, cos(phi) = 0.8),
|
// phi=36.87 degree (such that sin(phi) = 0.6, cos(phi) = 0.8),
|
||||||
// yielding: 58x^2 + 72y^2 - 48xy - 360 = 0.
|
// yielding: 58x^2 + 72y^2 - 48xy - 360 = 0.
|
||||||
Conic_arc_2 c2 (58, 72, -48, 0, 0, -360);
|
Conic_arc_2 c2 (58, 72, -48, 0, 0, -360);
|
||||||
|
|
||||||
insert_curve (arr, c2);
|
insert (arr, c2);
|
||||||
|
|
||||||
// Insert the segment (1, 1) -- (0, -3).
|
// Insert the segment (1, 1) -- (0, -3).
|
||||||
Rat_point_2 ps3 (1, 1);
|
Rat_point_2 ps3 (1, 1);
|
||||||
Rat_point_2 pt3 (0, -3);
|
Rat_point_2 pt3 (0, -3);
|
||||||
Conic_arc_2 c3 (Rat_segment_2 (ps3, pt3));
|
Conic_arc_2 c3 (Rat_segment_2 (ps3, pt3));
|
||||||
|
|
||||||
insert_curve (arr, c3);
|
insert (arr, c3);
|
||||||
|
|
||||||
// Insert a circular arc supported by the circle x^2 + y^2 = 5^2,
|
// Insert a circular arc supported by the circle x^2 + y^2 = 5^2,
|
||||||
// with (-3, 4) and (4, 3) as its endpoints. We want the arc to be
|
// with (-3, 4) and (4, 3) as its endpoints. We want the arc to be
|
||||||
|
|
@ -66,13 +66,13 @@ int main ()
|
||||||
Conic_arc_2 c4 (ps4, pm4, pt4);
|
Conic_arc_2 c4 (ps4, pm4, pt4);
|
||||||
|
|
||||||
CGAL_assertion (c4.is_valid());
|
CGAL_assertion (c4.is_valid());
|
||||||
insert_curve (arr, c4);
|
insert (arr, c4);
|
||||||
|
|
||||||
// Insert a full unit circle that is centered at (0, 4).
|
// Insert a full unit circle that is centered at (0, 4).
|
||||||
Rat_circle_2 circ5 (Rat_point_2(0,4), 1);
|
Rat_circle_2 circ5 (Rat_point_2(0,4), 1);
|
||||||
Conic_arc_2 c5 (circ5);
|
Conic_arc_2 c5 (circ5);
|
||||||
|
|
||||||
insert_curve (arr, c5);
|
insert (arr, c5);
|
||||||
|
|
||||||
// Insert a parabolic arc that is supported by a parabola y = -x^2
|
// Insert a parabolic arc that is supported by a parabola y = -x^2
|
||||||
// (or: x^2 + y = 0) and whose endpoints are (-sqrt(3), -3) ~ (-1.73, -3)
|
// (or: x^2 + y = 0) and whose endpoints are (-sqrt(3), -3) ~ (-1.73, -3)
|
||||||
|
|
@ -89,7 +89,7 @@ int main ()
|
||||||
0, 0, 0, 0, 1, 2); // The line: y = -2.
|
0, 0, 0, 0, 1, 2); // The line: y = -2.
|
||||||
|
|
||||||
CGAL_assertion (c6.is_valid());
|
CGAL_assertion (c6.is_valid());
|
||||||
insert_curve (arr, c6);
|
insert (arr, c6);
|
||||||
|
|
||||||
// Insert the right half of the circle centered at (4, 2.5) whose radius
|
// Insert the right half of the circle centered at (4, 2.5) whose radius
|
||||||
// is 1/2 (therefore its squared radius is 1/4).
|
// is 1/2 (therefore its squared radius is 1/4).
|
||||||
|
|
@ -98,7 +98,7 @@ int main ()
|
||||||
Point_2 pt7 (4, 2);
|
Point_2 pt7 (4, 2);
|
||||||
Conic_arc_2 c7 (circ7, CGAL::CLOCKWISE, ps7, pt7);
|
Conic_arc_2 c7 (circ7, CGAL::CLOCKWISE, ps7, pt7);
|
||||||
|
|
||||||
insert_curve (arr, c7);
|
insert (arr, c7);
|
||||||
|
|
||||||
// Print out the size of the resulting arrangement.
|
// Print out the size of the resulting arrangement.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -34,18 +34,18 @@ int main ()
|
||||||
Segment_2 s2 (Point_2(2, 0), Point_2(3, 3));
|
Segment_2 s2 (Point_2(2, 0), Point_2(3, 3));
|
||||||
Segment_2 s3 (Point_2(0, 3), Point_2(2, 5));
|
Segment_2 s3 (Point_2(0, 3), Point_2(2, 5));
|
||||||
|
|
||||||
insert_curve (arr, Colored_segment_2 (s1, RED), pl);
|
insert (arr, Colored_segment_2 (s1, RED), pl);
|
||||||
insert_curve (arr, Colored_segment_2 (s2, RED), pl);
|
insert (arr, Colored_segment_2 (s2, RED), pl);
|
||||||
insert_curve (arr, Colored_segment_2 (s3, RED), pl);
|
insert (arr, Colored_segment_2 (s3, RED), pl);
|
||||||
|
|
||||||
// Insert three BLUE line segments.
|
// Insert three BLUE line segments.
|
||||||
Segment_2 s4 (Point_2(-1, 3), Point_2(4, 1));
|
Segment_2 s4 (Point_2(-1, 3), Point_2(4, 1));
|
||||||
Segment_2 s5 (Point_2(-1, 0), Point_2(4, 1));
|
Segment_2 s5 (Point_2(-1, 0), Point_2(4, 1));
|
||||||
Segment_2 s6 (Point_2(-2, 1), Point_2(1, 4));
|
Segment_2 s6 (Point_2(-2, 1), Point_2(1, 4));
|
||||||
|
|
||||||
insert_curve (arr, Colored_segment_2 (s4, BLUE), pl);
|
insert (arr, Colored_segment_2 (s4, BLUE), pl);
|
||||||
insert_curve (arr, Colored_segment_2 (s5, BLUE), pl);
|
insert (arr, Colored_segment_2 (s5, BLUE), pl);
|
||||||
insert_curve (arr, Colored_segment_2 (s6, BLUE), pl);
|
insert (arr, Colored_segment_2 (s6, BLUE), pl);
|
||||||
|
|
||||||
// Go over all vertices and print just the ones corresponding to intersection
|
// Go over all vertices and print just the ones corresponding to intersection
|
||||||
// points between RED segments and BLUE segments. Note that we skip endpoints
|
// points between RED segments and BLUE segments. Note that we skip endpoints
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,18 @@ int main ()
|
||||||
|
|
||||||
// Insert s1, s2 and s3 incrementally:
|
// Insert s1, s2 and s3 incrementally:
|
||||||
Segment_2 s1 (Point_2 (0, 3), Point_2 (4, 3));
|
Segment_2 s1 (Point_2 (0, 3), Point_2 (4, 3));
|
||||||
Curve_handle c1 = insert_curve (arr, s1);
|
Curve_handle c1 = insert (arr, s1);
|
||||||
Segment_2 s2 (Point_2 (3, 2), Point_2 (3, 5));
|
Segment_2 s2 (Point_2 (3, 2), Point_2 (3, 5));
|
||||||
Curve_handle c2 = insert_curve (arr, s2);
|
Curve_handle c2 = insert (arr, s2);
|
||||||
Segment_2 s3 (Point_2 (2, 3), Point_2 (5, 3));
|
Segment_2 s3 (Point_2 (2, 3), Point_2 (5, 3));
|
||||||
Curve_handle c3 = insert_curve (arr, s3);
|
Curve_handle c3 = insert (arr, s3);
|
||||||
|
|
||||||
// Insert three additional segments aggregately:
|
// Insert three additional segments aggregately:
|
||||||
Segment_2 segs[3];
|
Segment_2 segs[3];
|
||||||
segs[0] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1));
|
segs[0] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1));
|
||||||
segs[1] = Segment_2 (Point_2 (0, 0), Point_2 (2, 6));
|
segs[1] = Segment_2 (Point_2 (0, 0), Point_2 (2, 6));
|
||||||
segs[2] = Segment_2 (Point_2 (3, 4), Point_2 (6, 4));
|
segs[2] = Segment_2 (Point_2 (3, 4), Point_2 (6, 4));
|
||||||
insert_curves (arr, segs, segs + 3);
|
insert (arr, segs, segs + 3);
|
||||||
|
|
||||||
// Print out the curves and the number of edges each one induces.
|
// Print out the curves and the number of edges each one induces.
|
||||||
Arr_with_hist_2::Curve_iterator cit;
|
Arr_with_hist_2::Curve_iterator cit;
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ int main ()
|
||||||
insert_non_intersecting_curve (arr, s1);
|
insert_non_intersecting_curve (arr, s1);
|
||||||
insert_non_intersecting_curve (arr, s2);
|
insert_non_intersecting_curve (arr, s2);
|
||||||
insert_non_intersecting_curve (arr, s3);
|
insert_non_intersecting_curve (arr, s3);
|
||||||
insert_curve (arr, s4);
|
insert (arr, s4);
|
||||||
insert_curve (arr, s5);
|
insert (arr, s5);
|
||||||
insert_curve (arr, s6);
|
insert (arr, s6);
|
||||||
|
|
||||||
// Go over all arrangement vertices and set their colors according to our
|
// Go over all arrangement vertices and set their colors according to our
|
||||||
// coloring convention.
|
// coloring convention.
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,9 @@ int main ()
|
||||||
insert_non_intersecting_curve (arr, s1);
|
insert_non_intersecting_curve (arr, s1);
|
||||||
insert_non_intersecting_curve (arr, s2);
|
insert_non_intersecting_curve (arr, s2);
|
||||||
insert_non_intersecting_curve (arr, s3);
|
insert_non_intersecting_curve (arr, s3);
|
||||||
insert_curve (arr, s4);
|
insert (arr, s4);
|
||||||
insert_curve (arr, s5);
|
insert (arr, s5);
|
||||||
insert_curve (arr, s6);
|
insert (arr, s6);
|
||||||
|
|
||||||
// Go over all arrangement vertices and set their colors.
|
// Go over all arrangement vertices and set their colors.
|
||||||
Arrangement_2::Vertex_iterator vit;
|
Arrangement_2::Vertex_iterator vit;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ int main (int argc, char *argv[])
|
||||||
// Construct the dual arrangement by aggragately inserting the lines.
|
// Construct the dual arrangement by aggragately inserting the lines.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
insert_curves (arr, dual_lines.begin(), dual_lines.end());
|
insert (arr, dual_lines.begin(), dual_lines.end());
|
||||||
|
|
||||||
std::cout << "The dual arrangement size:" << std::endl
|
std::cout << "The dual arrangement size:" << std::endl
|
||||||
<< "V = " << arr.number_of_vertices()
|
<< "V = " << arr.number_of_vertices()
|
||||||
|
|
@ -95,7 +95,7 @@ int main (int argc, char *argv[])
|
||||||
Number_type(-1),
|
Number_type(-1),
|
||||||
Number_type(-p_mid.y()));
|
Number_type(-p_mid.y()));
|
||||||
|
|
||||||
insert_curve (arr, dual_p_mid);
|
insert (arr, dual_p_mid);
|
||||||
|
|
||||||
// Make sure that we now have three collinear points.
|
// Make sure that we now have three collinear points.
|
||||||
found_collinear = false;
|
found_collinear = false;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ int main (int argc, char *argv[])
|
||||||
// Construct the dual arrangement by aggragately inserting the lines.
|
// Construct the dual arrangement by aggragately inserting the lines.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
insert_curves (arr, dual_lines.begin(), dual_lines.end());
|
insert (arr, dual_lines.begin(), dual_lines.end());
|
||||||
|
|
||||||
// Look for vertices whose degree is greater than 4.
|
// Look for vertices whose degree is greater than 4.
|
||||||
Arrangement_2::Vertex_const_iterator vit;
|
Arrangement_2::Vertex_const_iterator vit;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ int main ()
|
||||||
C[8] = Circle_2 (Rat_point_2 (2, 5), 1, CGAL::CLOCKWISE);
|
C[8] = Circle_2 (Rat_point_2 (2, 5), 1, CGAL::CLOCKWISE);
|
||||||
|
|
||||||
for (k = 0; k < 9; k++)
|
for (k = 0; k < 9; k++)
|
||||||
handles[k] = insert_curve (arr, C[k]);
|
handles[k] = insert (arr, C[k]);
|
||||||
|
|
||||||
std::cout << "The initial arrangement size:" << std::endl
|
std::cout << "The initial arrangement size:" << std::endl
|
||||||
<< " V = " << arr.number_of_vertices()
|
<< " V = " << arr.number_of_vertices()
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ int main ()
|
||||||
insert_non_intersecting_curve (arr, s1);
|
insert_non_intersecting_curve (arr, s1);
|
||||||
insert_non_intersecting_curve (arr, s2);
|
insert_non_intersecting_curve (arr, s2);
|
||||||
insert_non_intersecting_curve (arr, s3);
|
insert_non_intersecting_curve (arr, s3);
|
||||||
insert_curve (arr, s4);
|
insert (arr, s4);
|
||||||
insert_curve (arr, s5);
|
insert (arr, s5);
|
||||||
insert_curve (arr, s6);
|
insert (arr, s6);
|
||||||
|
|
||||||
// Go over all arrangement faces and print the index of each face and it
|
// Go over all arrangement faces and print the index of each face and it
|
||||||
// outer boundary. The face index is stored in its data field in our case.
|
// outer boundary. The face index is stored in its data field in our case.
|
||||||
|
|
|
||||||
|
|
@ -39,17 +39,17 @@ int main ()
|
||||||
|
|
||||||
Point_2 points1[5] = {Point_2(0,0), Point_2(2,4), Point_2(3,3),
|
Point_2 points1[5] = {Point_2(0,0), Point_2(2,4), Point_2(3,3),
|
||||||
Point_2(4,4), Point_2(6,0)};
|
Point_2(4,4), Point_2(6,0)};
|
||||||
insert_curve (arr, Curve_2 (Polyline_2 (points1, points1 + 5), "A"));
|
insert (arr, Curve_2 (Polyline_2 (points1, points1 + 5), "A"));
|
||||||
|
|
||||||
Point_2 points2[3] = {Point_2(1,5), Point_2(3,3), Point_2(5,5)};
|
Point_2 points2[3] = {Point_2(1,5), Point_2(3,3), Point_2(5,5)};
|
||||||
insert_curve (arr, Curve_2 (Polyline_2 (points2, points2 + 3), "B"));
|
insert (arr, Curve_2 (Polyline_2 (points2, points2 + 3), "B"));
|
||||||
|
|
||||||
Point_2 points3[4] = {Point_2(1,0), Point_2(2,2),
|
Point_2 points3[4] = {Point_2(1,0), Point_2(2,2),
|
||||||
Point_2(4,2), Point_2(5,0)};
|
Point_2(4,2), Point_2(5,0)};
|
||||||
insert_curve (arr, Curve_2 (Polyline_2 (points3, points3 + 4), "C"));
|
insert (arr, Curve_2 (Polyline_2 (points3, points3 + 4), "C"));
|
||||||
|
|
||||||
Point_2 points4[2] = {Point_2(0,2), Point_2(6,2)};
|
Point_2 points4[2] = {Point_2(0,2), Point_2(6,2)};
|
||||||
insert_curve (arr, Curve_2 (Polyline_2 (points4, points4 + 2), "D"));
|
insert (arr, Curve_2 (Polyline_2 (points4, points4 + 2), "D"));
|
||||||
|
|
||||||
// Print all edges that correspond to an overlapping polyline.
|
// Print all edges that correspond to an overlapping polyline.
|
||||||
Arrangement_2::Edge_iterator eit;
|
Arrangement_2::Edge_iterator eit;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ int main ()
|
||||||
// Perform an incremental insertion of a single overlapping segment.
|
// Perform an incremental insertion of a single overlapping segment.
|
||||||
Naive_pl pl (arr);
|
Naive_pl pl (arr);
|
||||||
|
|
||||||
insert_curve (arr, Segment_2 (Point_2 (0, 2.5), Point_2 (4, 2.5)), pl);
|
insert (arr, Segment_2 (Point_2 (0, 2.5), Point_2 (4, 2.5)), pl);
|
||||||
|
|
||||||
// Aggregately insert an additional set of five segments.
|
// Aggregately insert an additional set of five segments.
|
||||||
Segment_2 S2 [5];
|
Segment_2 S2 [5];
|
||||||
|
|
@ -46,7 +46,7 @@ int main ()
|
||||||
S2[3] = Segment_2 (Point_2 (0, 1), Point_2 (6, 0));
|
S2[3] = Segment_2 (Point_2 (0, 1), Point_2 (6, 0));
|
||||||
S2[4] = Segment_2 (Point_2 (6, 1), Point_2 (6, 4));
|
S2[4] = Segment_2 (Point_2 (6, 1), Point_2 (6, 4));
|
||||||
|
|
||||||
insert_curves (arr, S2, S2 + 5);
|
insert (arr, S2, S2 + 5);
|
||||||
|
|
||||||
// Print the size of the arrangement.
|
// Print the size of the arrangement.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ int main ()
|
||||||
Segment_2 s3 (Point_2 (1, 1), Point_2 (1, 6));
|
Segment_2 s3 (Point_2 (1, 1), Point_2 (1, 6));
|
||||||
Segment_2 s4 (Point_2 (4, 1), Point_2 (4, 6));
|
Segment_2 s4 (Point_2 (4, 1), Point_2 (4, 6));
|
||||||
|
|
||||||
insert_curve (arr, s3, pl);
|
insert (arr, s3, pl);
|
||||||
insert_curve (arr, s4, pl);
|
insert (arr, s4, pl);
|
||||||
|
|
||||||
std::cout << "The initial arrangement:" << std::endl;
|
std::cout << "The initial arrangement:" << std::endl;
|
||||||
print_arrangement (arr);
|
print_arrangement (arr);
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ int main ()
|
||||||
|
|
||||||
insert_non_intersecting_curve (arr, s1, pl);
|
insert_non_intersecting_curve (arr, s1, pl);
|
||||||
insert_non_intersecting_curve (arr, s2, pl);
|
insert_non_intersecting_curve (arr, s2, pl);
|
||||||
insert_curve (arr, s3, pl);
|
insert (arr, s3, pl);
|
||||||
insert_curve (arr, s4, pl);
|
insert (arr, s4, pl);
|
||||||
insert_curve (arr, s5, pl);
|
insert (arr, s5, pl);
|
||||||
|
|
||||||
// Print the size of the arrangement.
|
// Print the size of the arrangement.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ int main ()
|
||||||
segs[3] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1));
|
segs[3] = Segment_2 (Point_2 (2, 6), Point_2 (7, 1));
|
||||||
segs[4] = Segment_2 (Point_2 (0, 0), Point_2 (2, 6));
|
segs[4] = Segment_2 (Point_2 (0, 0), Point_2 (2, 6));
|
||||||
segs[5] = Segment_2 (Point_2 (3, 4), Point_2 (6, 4));
|
segs[5] = Segment_2 (Point_2 (3, 4), Point_2 (6, 4));
|
||||||
insert_curves (arr, segs, segs + 6);
|
insert (arr, segs, segs + 6);
|
||||||
|
|
||||||
std::cout << "Writing an arrangement of "
|
std::cout << "Writing an arrangement of "
|
||||||
<< arr.number_of_curves() << " input segments:" << std::endl
|
<< arr.number_of_curves() << " input segments:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ int main ()
|
||||||
|
|
||||||
Segment_2 s_horiz (Point_2(-1, 0), Point_2(1, 0));
|
Segment_2 s_horiz (Point_2(-1, 0), Point_2(1, 0));
|
||||||
|
|
||||||
insert_curve (arr, s_horiz);
|
insert (arr, s_horiz);
|
||||||
|
|
||||||
std::cout << "The initial arrangement size:" << std::endl
|
std::cout << "The initial arrangement size:" << std::endl
|
||||||
<< " V = " << arr.number_of_vertices()
|
<< " V = " << arr.number_of_vertices()
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ int main ()
|
||||||
// Construct the first arrangement, induced by two line y = x and y = -x.
|
// Construct the first arrangement, induced by two line y = x and y = -x.
|
||||||
ArrangementA_2 arr1;
|
ArrangementA_2 arr1;
|
||||||
|
|
||||||
insert_curve (arr1, Line_2 (Point_2(0, 0), Point_2(1, 1)));
|
insert (arr1, Line_2 (Point_2(0, 0), Point_2(1, 1)));
|
||||||
insert_curve (arr1, Line_2 (Point_2(0, 0), Point_2(1, -1)));
|
insert (arr1, Line_2 (Point_2(0, 0), Point_2(1, -1)));
|
||||||
|
|
||||||
// Label the four (unbounded) face of the arrangement as 'A' to 'D'.
|
// Label the four (unbounded) face of the arrangement as 'A' to 'D'.
|
||||||
// We do so by traversing the incident faces to the halfedges aroung the
|
// We do so by traversing the incident faces to the halfedges aroung the
|
||||||
|
|
@ -71,10 +71,10 @@ int main ()
|
||||||
// Construct the second arrangement, containing a single square-shaped face.
|
// Construct the second arrangement, containing a single square-shaped face.
|
||||||
ArrangementB_2 arr2;
|
ArrangementB_2 arr2;
|
||||||
|
|
||||||
insert_curve (arr2, Segment_2 (Point_2(-4, -4), Point_2(4, -4)));
|
insert (arr2, Segment_2 (Point_2(-4, -4), Point_2(4, -4)));
|
||||||
insert_curve (arr2, Segment_2 (Point_2(4, -4), Point_2(4, 4)));
|
insert (arr2, Segment_2 (Point_2(4, -4), Point_2(4, 4)));
|
||||||
insert_curve (arr2, Segment_2 (Point_2(4, 4), Point_2(-4, 4)));
|
insert (arr2, Segment_2 (Point_2(4, 4), Point_2(-4, 4)));
|
||||||
insert_curve (arr2, Segment_2 (Point_2(-4, 4), Point_2(-4, -4)));
|
insert (arr2, Segment_2 (Point_2(-4, 4), Point_2(-4, -4)));
|
||||||
|
|
||||||
// Give the unbounded face the index 1, and the bounded face the index 2.
|
// Give the unbounded face the index 1, and the bounded face the index 2.
|
||||||
CGAL_assertion (arr2.number_of_faces() == 2);
|
CGAL_assertion (arr2.number_of_faces() == 2);
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ int main ()
|
||||||
points3[3] = Point_2 (5, 2);
|
points3[3] = Point_2 (5, 2);
|
||||||
Polyline_2 pi3 (points3.begin(), points3.end());
|
Polyline_2 pi3 (points3.begin(), points3.end());
|
||||||
|
|
||||||
insert_curve (arr, pi1);
|
insert (arr, pi1);
|
||||||
insert_curve (arr, pi2);
|
insert (arr, pi2);
|
||||||
insert_curve (arr, pi3);
|
insert (arr, pi3);
|
||||||
|
|
||||||
print_arrangement (arr);
|
print_arrangement (arr);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ int main (int argc, char **argv)
|
||||||
<< n << " segments." << std::endl;
|
<< n << " segments." << std::endl;
|
||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
insert_curves (arr, segments.begin(), segments.end());
|
insert (arr, segments.begin(), segments.end());
|
||||||
timer.stop();
|
timer.stop();
|
||||||
|
|
||||||
// Print the arrangement dimensions.
|
// Print the arrangement dimensions.
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ int main ()
|
||||||
arcs.push_back (a2);
|
arcs.push_back (a2);
|
||||||
arcs.push_back (a3);
|
arcs.push_back (a3);
|
||||||
arcs.push_back (a4);
|
arcs.push_back (a4);
|
||||||
insert_curves (arr, arcs.begin(), arcs.end());
|
insert (arr, arcs.begin(), arcs.end());
|
||||||
|
|
||||||
// Print the arrangement size.
|
// Print the arrangement size.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ int main ()
|
||||||
// Construct the arrangement of the six arcs.
|
// Construct the arrangement of the six arcs.
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
insert_curves (arr, arcs.begin(), arcs.end());
|
insert (arr, arcs.begin(), arcs.end());
|
||||||
|
|
||||||
// Print the arrangement size.
|
// Print the arrangement size.
|
||||||
std::cout << "The arrangement size:" << std::endl
|
std::cout << "The arrangement size:" << std::endl
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ CGAL_BEGIN_NAMESPACE
|
||||||
// mpl_::bool_< true>)'
|
// mpl_::bool_< true>)'
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits, class PointLocation>
|
template <class GeomTraits, class TopTraits, class PointLocation>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const typename GeomTraits::Curve_2& c,
|
const typename GeomTraits::Curve_2& c,
|
||||||
const PointLocation& pl, boost::is_same<int, double>::type)
|
const PointLocation& pl, boost::is_same<int, double>::type)
|
||||||
{
|
{
|
||||||
|
|
@ -134,7 +134,7 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits, class PointLocation>
|
template <class GeomTraits, class TopTraits, class PointLocation>
|
||||||
void insert_curve(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const typename GeomTraits::X_monotone_curve_2& c,
|
const typename GeomTraits::X_monotone_curve_2& c,
|
||||||
const PointLocation& pl, boost::is_same<int, int>::type)
|
const PointLocation& pl, boost::is_same<int, int>::type)
|
||||||
{
|
{
|
||||||
|
|
@ -167,9 +167,9 @@ void insert_curve(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Common interface for the insert_curve of the Curve_2 and X_monotone_curve_2
|
// Common interface for the insert of the Curve_2 and X_monotone_curve_2
|
||||||
template <class GeomTraits, class TopTraits, class Curve, class PointLocation>
|
template <class GeomTraits, class TopTraits, class Curve, class PointLocation>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const Curve& c, const PointLocation& pl)
|
const Curve& c, const PointLocation& pl)
|
||||||
{
|
{
|
||||||
typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2;
|
typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2;
|
||||||
|
|
@ -177,7 +177,7 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
typedef typename boost::is_same<Curve, X_monotone_curve_2>::type
|
typedef typename boost::is_same<Curve, X_monotone_curve_2>::type
|
||||||
Is_x_monotone;
|
Is_x_monotone;
|
||||||
|
|
||||||
return insert_curve(arr, c, pl, Is_x_monotone());
|
return insert(arr, c, pl, Is_x_monotone());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -188,13 +188,13 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
// location.
|
// location.
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits, class Curve>
|
template <class GeomTraits, class TopTraits, class Curve>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const Curve& c)
|
const Curve& c)
|
||||||
{
|
{
|
||||||
// Create a default point-location object and use it to insert the curve.
|
// Create a default point-location object and use it to insert the curve.
|
||||||
typename TopTraits::Default_point_location_strategy def_pl (arr);
|
typename TopTraits::Default_point_location_strategy def_pl (arr);
|
||||||
|
|
||||||
insert_curve (arr, c, def_pl);
|
insert (arr, c, def_pl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,9 +214,9 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
// mpl_::bool_< true>)'
|
// mpl_::bool_< true>)'
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_curves (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end,
|
InputIterator begin, InputIterator end,
|
||||||
boost::is_same<int, double>::type)
|
boost::is_same<int, double>::type)
|
||||||
{
|
{
|
||||||
typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr;
|
typedef Arrangement_on_surface_2<GeomTraits, TopTraits> Arr;
|
||||||
typedef typename TopTraits::Sweep_line_construction_visitor
|
typedef typename TopTraits::Sweep_line_construction_visitor
|
||||||
|
|
@ -308,7 +308,7 @@ void insert_curves (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
// mpl_::bool_< true>)'
|
// mpl_::bool_< true>)'
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_curves(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end,
|
InputIterator begin, InputIterator end,
|
||||||
boost::is_same<int, int>::type)
|
boost::is_same<int, int>::type)
|
||||||
{
|
{
|
||||||
|
|
@ -383,10 +383,10 @@ void insert_curves(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Common interface for the insert_curves of the Curve_2 and X_monotone_curve_2
|
// Common interface for the inserts of the Curve_2 and X_monotone_curve_2
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_curves (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end)
|
InputIterator begin, InputIterator end)
|
||||||
{
|
{
|
||||||
typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2;
|
typedef typename GeomTraits::X_monotone_curve_2 X_monotone_curve_2;
|
||||||
typedef typename std::iterator_traits<InputIterator>::value_type
|
typedef typename std::iterator_traits<InputIterator>::value_type
|
||||||
|
|
@ -395,7 +395,7 @@ void insert_curves (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr,
|
||||||
typedef typename boost::is_same<Iterator_value_type,
|
typedef typename boost::is_same<Iterator_value_type,
|
||||||
X_monotone_curve_2>::type Is_x_monotone;
|
X_monotone_curve_2>::type Is_x_monotone;
|
||||||
|
|
||||||
return insert_curves (arr, begin, end, Is_x_monotone());
|
return insert (arr, begin, end, Is_x_monotone());
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -405,7 +405,7 @@ void insert_curves (Arrangement_on_surface_2<GeomTraits,TopTraits>& arr,
|
||||||
// The inserted x-monotone curve may intersect the existing arrangement.
|
// The inserted x-monotone curve may intersect the existing arrangement.
|
||||||
//
|
//
|
||||||
template <class GeomTraits, class TopTraits>
|
template <class GeomTraits, class TopTraits>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const typename GeomTraits::X_monotone_curve_2& c,
|
const typename GeomTraits::X_monotone_curve_2& c,
|
||||||
const Object& obj)
|
const Object& obj)
|
||||||
{
|
{
|
||||||
|
|
@ -445,21 +445,21 @@ void insert_x_monotone_curve
|
||||||
const typename GeomTraits::X_monotone_curve_2& c,
|
const typename GeomTraits::X_monotone_curve_2& c,
|
||||||
const PointLocation& pl)
|
const PointLocation& pl)
|
||||||
{
|
{
|
||||||
insert_curve(arr, c, pl);
|
insert(arr, c, pl);
|
||||||
}
|
}
|
||||||
template <class GeomTraits, class TopTraits>
|
template <class GeomTraits, class TopTraits>
|
||||||
void insert_x_monotone_curve
|
void insert_x_monotone_curve
|
||||||
(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const typename GeomTraits::X_monotone_curve_2& c)
|
const typename GeomTraits::X_monotone_curve_2& c)
|
||||||
{
|
{
|
||||||
insert_curve(arr, c);
|
insert(arr, c);
|
||||||
}
|
}
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_x_monotone_curves
|
void insert_x_monotone_curves
|
||||||
(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
(Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end)
|
InputIterator begin, InputIterator end)
|
||||||
{
|
{
|
||||||
insert_curves(arr, begin, end);
|
insert(arr, begin, end);
|
||||||
}
|
}
|
||||||
template <class GeomTraits, class TopTraits>
|
template <class GeomTraits, class TopTraits>
|
||||||
void insert_x_monotone_curve
|
void insert_x_monotone_curve
|
||||||
|
|
@ -467,7 +467,7 @@ void insert_x_monotone_curve
|
||||||
const typename GeomTraits::X_monotone_curve_2& c,
|
const typename GeomTraits::X_monotone_curve_2& c,
|
||||||
const Object& obj)
|
const Object& obj)
|
||||||
{
|
{
|
||||||
insert_curve(arr, c, obj);
|
insert(arr, c, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -2562,7 +2562,7 @@ protected:
|
||||||
* \param pl A point-location object associated with the arrangement.
|
* \param pl A point-location object associated with the arrangement.
|
||||||
*/
|
*/
|
||||||
template <class GeomTraits, class TopTraits, class Curve, class PointLocation>
|
template <class GeomTraits, class TopTraits, class Curve, class PointLocation>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const Curve& c, const PointLocation& pl);
|
const Curve& c, const PointLocation& pl);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -2575,7 +2575,7 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
* \param cv The curve to be inserted.
|
* \param cv The curve to be inserted.
|
||||||
*/
|
*/
|
||||||
template <class GeomTraits, class TopTraits, class Curve>
|
template <class GeomTraits, class TopTraits, class Curve>
|
||||||
void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
const Curve& c);
|
const Curve& c);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -2589,7 +2589,7 @@ void insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
* \pre The value type of the iterators must be Curve_2.
|
* \pre The value type of the iterators must be Curve_2.
|
||||||
*/
|
*/
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_curves (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end);
|
InputIterator begin, InputIterator end);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -2604,10 +2604,9 @@ void insert_curves (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class GeomTraits, class TopTraits>
|
template <class GeomTraits, class TopTraits>
|
||||||
void
|
void insert (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
||||||
insert_curve (Arrangement_on_surface_2<GeomTraits, TopTraits>& arr,
|
const typename GeomTraits::X_monotone_curve_2& c,
|
||||||
const typename GeomTraits::X_monotone_curve_2& c,
|
const Object& obj);
|
||||||
const Object& obj);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Insert an x-monotone curve into the arrangement, such that the curve
|
* Insert an x-monotone curve into the arrangement, such that the curve
|
||||||
|
|
|
||||||
|
|
@ -661,7 +661,7 @@ protected:
|
||||||
Data_curve_2 data_curve (cv, p_cv);
|
Data_curve_2 data_curve (cv, p_cv);
|
||||||
Base_arr_2& base_arr = *this;
|
Base_arr_2& base_arr = *this;
|
||||||
|
|
||||||
CGAL::insert_curve (base_arr, data_curve, pl);
|
CGAL::insert (base_arr, data_curve, pl);
|
||||||
|
|
||||||
// Return a handle to the inserted curve (the last in the list).
|
// Return a handle to the inserted curve (the last in the list).
|
||||||
Curve_handle ch = m_curves.end();
|
Curve_handle ch = m_curves.end();
|
||||||
|
|
@ -690,7 +690,7 @@ protected:
|
||||||
Data_curve_2 data_curve (cv, p_cv);
|
Data_curve_2 data_curve (cv, p_cv);
|
||||||
Base_arr_2& base_arr = *this;
|
Base_arr_2& base_arr = *this;
|
||||||
|
|
||||||
CGAL::insert_curve (base_arr, data_curve);
|
CGAL::insert (base_arr, data_curve);
|
||||||
|
|
||||||
// Return a handle to the inserted curve (the last in the list).
|
// Return a handle to the inserted curve (the last in the list).
|
||||||
Curve_handle ch = m_curves.end();
|
Curve_handle ch = m_curves.end();
|
||||||
|
|
@ -723,7 +723,7 @@ protected:
|
||||||
// Perform an aggregated insertion operation into the base arrangement.
|
// Perform an aggregated insertion operation into the base arrangement.
|
||||||
Base_arr_2& base_arr = *this;
|
Base_arr_2& base_arr = *this;
|
||||||
|
|
||||||
CGAL::insert_curves (base_arr, data_curves.begin(), data_curves.end());
|
CGAL::insert (base_arr, data_curves.begin(), data_curves.end());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -907,7 +907,7 @@ public:
|
||||||
template <class GeomTraits, class TopTraits, class PointLocation>
|
template <class GeomTraits, class TopTraits, class PointLocation>
|
||||||
typename Arrangement_on_surface_with_history_2<GeomTraits,
|
typename Arrangement_on_surface_with_history_2<GeomTraits,
|
||||||
TopTraits>::Curve_handle
|
TopTraits>::Curve_handle
|
||||||
insert_curve (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
insert (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
||||||
const typename GeomTraits::Curve_2& c,
|
const typename GeomTraits::Curve_2& c,
|
||||||
const PointLocation& pl)
|
const PointLocation& pl)
|
||||||
{
|
{
|
||||||
|
|
@ -930,7 +930,7 @@ insert_curve (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
||||||
template <class GeomTraits, class TopTraits>
|
template <class GeomTraits, class TopTraits>
|
||||||
typename Arrangement_on_surface_with_history_2<GeomTraits,
|
typename Arrangement_on_surface_with_history_2<GeomTraits,
|
||||||
TopTraits>::Curve_handle
|
TopTraits>::Curve_handle
|
||||||
insert_curve (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
insert (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
||||||
const typename GeomTraits::Curve_2& c)
|
const typename GeomTraits::Curve_2& c)
|
||||||
{
|
{
|
||||||
// Obtain an arrangement accessor and perform the insertion.
|
// Obtain an arrangement accessor and perform the insertion.
|
||||||
|
|
@ -952,7 +952,7 @@ insert_curve (Arrangement_on_surface_with_history_2<GeomTraits,TopTraits>& arr,
|
||||||
* \pre The value type of the iterators must be Curve_2.
|
* \pre The value type of the iterators must be Curve_2.
|
||||||
*/
|
*/
|
||||||
template <class GeomTraits, class TopTraits, class InputIterator>
|
template <class GeomTraits, class TopTraits, class InputIterator>
|
||||||
void insert_curves (Arrangement_on_surface_with_history_2<GeomTraits,
|
void insert (Arrangement_on_surface_with_history_2<GeomTraits,
|
||||||
TopTraits>& arr,
|
TopTraits>& arr,
|
||||||
InputIterator begin, InputIterator end)
|
InputIterator begin, InputIterator end)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ int main(int argc, char **argv)
|
||||||
out_file << std::endl;
|
out_file << std::endl;
|
||||||
std::cout << "Inserting the curves to the map ... \n";
|
std::cout << "Inserting the curves to the map ... \n";
|
||||||
|
|
||||||
CGAL::insert_curves(arr, curves.begin(), curves.end());
|
CGAL::insert(arr, curves.begin(), curves.end());
|
||||||
|
|
||||||
|
|
||||||
std::cout<< "Finished insertion...\n";
|
std::cout<< "Finished insertion...\n";
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ int main()
|
||||||
|
|
||||||
// Insert the curves into the Planar_map:
|
// Insert the curves into the Planar_map:
|
||||||
std::cout << "Inserting the curves to the map ... ";
|
std::cout << "Inserting the curves to the map ... ";
|
||||||
insert_curves(arr, &cv[0], &cv[5]);
|
insert(arr, &cv[0], &cv[5]);
|
||||||
std::cout << ((arr.is_valid()) ? "map valid!" : "map invalid!") << std::endl
|
std::cout << ((arr.is_valid()) ? "map valid!" : "map invalid!") << std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ int main()
|
||||||
|
|
||||||
// Insert the curves into the arrangement:
|
// Insert the curves into the arrangement:
|
||||||
std::cout << "Inserting the curves to the map ... ";
|
std::cout << "Inserting the curves to the map ... ";
|
||||||
insert_curves(arr, &cv[0], &cv[5]);
|
insert(arr, &cv[0], &cv[5]);
|
||||||
std::cout << ((arr.is_valid()) ? "map valid!" : "map invalid!") << std::endl
|
std::cout << ((arr.is_valid()) ? "map valid!" : "map invalid!") << std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ bool test(const char* curves_filename, const char* points_filename)
|
||||||
timer.reset();
|
timer.reset();
|
||||||
timer.start(); //START
|
timer.start(); //START
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
insert_curves (arr, curve_list.begin(), curve_list.end());
|
insert (arr, curve_list.begin(), curve_list.end());
|
||||||
timer.stop(); ///END
|
timer.stop(); ///END
|
||||||
std::cout << "Arrangement aggregate construction took "
|
std::cout << "Arrangement aggregate construction took "
|
||||||
<< timer.time() <<std::endl;
|
<< timer.time() <<std::endl;
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ bool test_one_file (std::ifstream& in_file,
|
||||||
for(CurveContainer::const_iterator it = curves.begin();
|
for(CurveContainer::const_iterator it = curves.begin();
|
||||||
it != curves.end(); ++it)
|
it != curves.end(); ++it)
|
||||||
{
|
{
|
||||||
CGAL::insert_curve(arr, *it);
|
CGAL::insert(arr, *it);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Point_2>::const_iterator poit;
|
std::vector<Point_2>::const_iterator poit;
|
||||||
|
|
@ -224,7 +224,7 @@ bool test_one_file (std::ifstream& in_file,
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// test aggregated construction
|
// test aggregated construction
|
||||||
|
|
||||||
CGAL::insert_curves(arr, curves.begin(), curves.end());
|
CGAL::insert(arr, curves.begin(), curves.end());
|
||||||
// when creating insert_points, this call should be fixed to insert_points.
|
// when creating insert_points, this call should be fixed to insert_points.
|
||||||
for (poit = iso_verts.begin();
|
for (poit = iso_verts.begin();
|
||||||
poit != iso_verts.end(); ++poit)
|
poit != iso_verts.end(); ++poit)
|
||||||
|
|
@ -249,8 +249,8 @@ bool test_one_file (std::ifstream& in_file,
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
// insert half of the curves aggregatley and than insert the rest
|
// insert half of the curves aggregatley and than insert the rest
|
||||||
// aggregatley (test the addition visitor)
|
// aggregatley (test the addition visitor)
|
||||||
CGAL::insert_curves(arr, curves.begin(), curves.begin() + (num_of_curves/2));
|
CGAL::insert(arr, curves.begin(), curves.begin() + (num_of_curves/2));
|
||||||
CGAL::insert_curves(arr, curves.begin() + (num_of_curves/2), curves.end());
|
CGAL::insert(arr, curves.begin() + (num_of_curves/2), curves.end());
|
||||||
// when creating insert_points, this call should be fixed to insert_points.
|
// when creating insert_points, this call should be fixed to insert_points.
|
||||||
for (poit = iso_verts.begin();
|
for (poit = iso_verts.begin();
|
||||||
poit != iso_verts.end(); ++poit)
|
poit != iso_verts.end(); ++poit)
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ int main ()
|
||||||
expected_intersect[1] = true;
|
expected_intersect[1] = true;
|
||||||
expected_intersect[2] = true;
|
expected_intersect[2] = true;
|
||||||
|
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 0), Point_2(2, 0)));
|
insert(arr, Segment_2(Point_2(0, 0), Point_2(2, 0)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 0), Point_2(2, 2)));
|
insert(arr, Segment_2(Point_2(2, 0), Point_2(2, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 2), Point_2(0, 2)));
|
insert(arr, Segment_2(Point_2(2, 2), Point_2(0, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 2), Point_2(0, 0)));
|
insert(arr, Segment_2(Point_2(0, 2), Point_2(0, 0)));
|
||||||
|
|
||||||
for (k = 0; k < N_SEGMENTS; k++)
|
for (k = 0; k < N_SEGMENTS; k++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ int main()
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
||||||
// Construct an arrangement of seven intersecting line segments.
|
// Construct an arrangement of seven intersecting line segments.
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 0), Point_2(0, 6)));
|
insert(arr, Segment_2(Point_2(0, 0), Point_2(0, 6)));
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 6), Point_2(6, 6)));
|
insert(arr, Segment_2(Point_2(0, 6), Point_2(6, 6)));
|
||||||
insert_curve(arr, Segment_2(Point_2(6, 6), Point_2(6, 0)));
|
insert(arr, Segment_2(Point_2(6, 6), Point_2(6, 0)));
|
||||||
insert_curve(arr, Segment_2(Point_2(6, 0), Point_2(0, 0)));
|
insert(arr, Segment_2(Point_2(6, 0), Point_2(0, 0)));
|
||||||
|
|
||||||
Arrangement_2::Face_iterator fit;
|
Arrangement_2::Face_iterator fit;
|
||||||
Arrangement_2::Face_handle f;
|
Arrangement_2::Face_handle f;
|
||||||
|
|
@ -52,12 +52,12 @@ int main()
|
||||||
f = fit;
|
f = fit;
|
||||||
}
|
}
|
||||||
|
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 2), Point_2(2, 4)));
|
insert(arr, Segment_2(Point_2(2, 2), Point_2(2, 4)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 4), Point_2(4, 4)));
|
insert(arr, Segment_2(Point_2(2, 4), Point_2(4, 4)));
|
||||||
insert_curve(arr, Segment_2(Point_2(4, 4), Point_2(4, 2)));
|
insert(arr, Segment_2(Point_2(4, 4), Point_2(4, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(4, 2), Point_2(2, 2)));
|
insert(arr, Segment_2(Point_2(4, 2), Point_2(2, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 2), Point_2(4, 4)));
|
insert(arr, Segment_2(Point_2(2, 2), Point_2(4, 4)));
|
||||||
insert_curve(arr, Segment_2(Point_2(4, 2), Point_2(2, 4)));
|
insert(arr, Segment_2(Point_2(4, 2), Point_2(2, 4)));
|
||||||
|
|
||||||
Dual_arrangement_2 darr (arr);
|
Dual_arrangement_2 darr (arr);
|
||||||
Dual_arrangement_2::Incident_edge_iterator fnit = darr.out_edges_begin (f);
|
Dual_arrangement_2::Incident_edge_iterator fnit = darr.out_edges_begin (f);
|
||||||
|
|
|
||||||
|
|
@ -70,10 +70,10 @@ int main ()
|
||||||
Simple_pl simple_pl (arr);
|
Simple_pl simple_pl (arr);
|
||||||
Walk_pl walk_pl (arr);
|
Walk_pl walk_pl (arr);
|
||||||
|
|
||||||
insert_curve (arr, Segment_2 (Point_2 (0, 0), Point_2 (0, 1)));
|
insert (arr, Segment_2 (Point_2 (0, 0), Point_2 (0, 1)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (0, 3), Point_2 (0, 4)));
|
insert (arr, Segment_2 (Point_2 (0, 3), Point_2 (0, 4)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (-1, -1), Point_2 (1, -1)));
|
insert (arr, Segment_2 (Point_2 (-1, -1), Point_2 (1, -1)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (-1, 5), Point_2 (1, 5)));
|
insert (arr, Segment_2 (Point_2 (-1, 5), Point_2 (1, 5)));
|
||||||
|
|
||||||
// Perform the vertical ray-shooting queries.
|
// Perform the vertical ray-shooting queries.
|
||||||
std::cout << "First round of queries: " << std::endl;
|
std::cout << "First round of queries: " << std::endl;
|
||||||
|
|
@ -103,8 +103,8 @@ int main ()
|
||||||
vertical_ray_shooting_query (walk_pl, false, q3);
|
vertical_ray_shooting_query (walk_pl, false, q3);
|
||||||
|
|
||||||
// Insert additional curves and perform the ray-shooting queries again.
|
// Insert additional curves and perform the ray-shooting queries again.
|
||||||
insert_curve (arr, Segment_2 (Point_2 (-1, 0), Point_2 (1, 0)));
|
insert (arr, Segment_2 (Point_2 (-1, 0), Point_2 (1, 0)));
|
||||||
insert_curve (arr, Segment_2 (Point_2 (-1, 4), Point_2 (1, 4)));
|
insert (arr, Segment_2 (Point_2 (-1, 4), Point_2 (1, 4)));
|
||||||
|
|
||||||
std::cout << "Second round of queries: " << std::endl;
|
std::cout << "Second round of queries: " << std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ int main ()
|
||||||
zone_expected_comp[1] = 3;
|
zone_expected_comp[1] = 3;
|
||||||
zone_expected_comp[2] = 4;
|
zone_expected_comp[2] = 4;
|
||||||
|
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 0), Point_2(2, 0)));
|
insert(arr, Segment_2(Point_2(0, 0), Point_2(2, 0)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 0), Point_2(2, 2)));
|
insert(arr, Segment_2(Point_2(2, 0), Point_2(2, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(2, 2), Point_2(0, 2)));
|
insert(arr, Segment_2(Point_2(2, 2), Point_2(0, 2)));
|
||||||
insert_curve(arr, Segment_2(Point_2(0, 2), Point_2(0, 0)));
|
insert(arr, Segment_2(Point_2(0, 2), Point_2(0, 0)));
|
||||||
|
|
||||||
for (k = 0; k < N_SEGMENTS; k++)
|
for (k = 0; k < N_SEGMENTS; k++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue