Editing of text, especially adding the fact that pmwx handles non x-monotone curves and about the sweep line.

This commit is contained in:
Shai Hirsch 2001-06-13 16:17:54 +00:00
parent 300ed9df0a
commit 3cfa35b6af
4 changed files with 236 additions and 162 deletions

View File

@ -24,44 +24,61 @@
\subsection*{Introduction}
\ccRefLabel{pmwx_ref_intro}
The planar map with intersections class extends the planar map
class. The planar map with intersections adds insertion functions
that handle intersections and overlapping among the curves of the
planar map. The basic types of the planar map (vertex, halfedge,
face, Dcel, etc.) are kept. \ccc{Planar_map_with_intersections_2}
is templated with the planar map class it derives from.
The \ccc{Planar Map with Intersections} package extends the
functionality of the \ccc{Planar Map} package. Morover, the class
\ccc{Planar_map_with_intersections_2} extends the class
\ccc{Planar_map_2}. The \ccc{Planar Map with Intersections} package
supports insertion functions that handle non $x$-monotone curves and
intersections and overlappings among the curves of the planar
map. The basic types of the \ccc{Planar Map} package (vertex,
halfedge, face, Dcel, etc.) are
kept. \ccc{Planar_map_with_intersections_2} is templated with the
planar map class it derives from.
\subsection*{Planar Map with Intersections Traits Class}
%-----------------------------------------------
Since the planar map with intersections has an additional
functionality of intersecting curves it needs additional
functionality of the traits class. We describe the planar map with
intersections traits concept following in this chapter.
Nevertheless, we do not have specific implementation of this
concept, and we use the arrangement traits instead (see
Chapter~\ref{I1_ChapterArrangement}).
Since the planar map with intersections has an additional
functionality of handling non $x$-monotone and intersecting curves
it needs additional functionality of the traits class. We describe
the \ccc{Planar_map_with_intersections_traits} concept following in
this chapter. Nevertheless, we do not have specific implementation
of this concept, and we use models of the \ccc{Arrangement_traits}
concept, which is a refinement thereof instead (see
Chapter~\ref{I1_ChapterArrangement}).
\subsection*{Sweep line}
\subsection*{Sweep Line}
%-------------------------------------------------
The \ccc{Planar Map With Intersections} contains a sweep lines algorithm.
Given a collection of intersecting (possibly overlapping or non $x$-monotone)
curves the algorithm calculates the intersection points. As a result, the
collection of pairwise interior disjoint subcurves can be produced, or,
alternatively, a subdivion is being built.
This subdivion can be either of the type \ccc{Planar Map With Intersections} or of the
type \ccc{Planar map}.However, the \ccStyle{Sweep line} is a part of
\ccStyle {Planar Map With Intersections} package since
the traits used here are those defined in that package, due to calcluations as finding
intersections, overlapping and $x$-monotony.
Using sweep line technique, and building a \ccc{Planar Map With Intersections} is most
usefull when users have a primar list of curves,
but inserting intersecting curves each at a time will be needed afterward.
See the sweep line functions reference pages for implementation details.
\ccc{sweep_to_construct_planar_map}\lcTex{
(\ccRefPage{CGAL::sweep_to_construct_planar_map})},
\ccc{sweep_to_produce_planar_map_subcurves}\lcTex{
(\ccRefPage{CGAL::sweep_to_produce_planar_map_subcurves})},
The \ccc{Planar Map with Intersections} packge contains a sweep line
utility. The sweep line algorithm can be used to build a planar map
much quicker than in an incremental way, where each curve is
inserted after the other. Two global functions are provided.
The function \ccc{sweep_to_construct_planar_map} builds a planar map
as a result of the call. Mind that it is possible to call this
function also with an instance the \ccc{Planar_map_2} class rather
than an instance of \ccc{Planar_map_with_intersections_2}. If no
additional insertion of intersecting or non $x$-monotone curves are
planned follwing the building of the map, then it would be more
efficient (in running time) and less demanding (in traits class
functionality) to use an instance of the former.
The function \ccc{sweep_to_produce_planar_map_subcurves} does not
build a planar map but rather collects the $x$-monotone pairwise
disjoint subcurves in a container. It is possible to tune the
function so that it will avoid to produce repetitions of overlapping
subcurves in the container or not.
The sweep line utility calculates intersections of curves. The
\ccc{Planar_map_with_intersection_traits} concepts requires this
very functionality. Thus, the sweep line functions have to use
traits classes that model the above concept. This is true even for
the case where an instance of \ccc{Planar_map_2} is built.
See the sweep line functions reference pages for implementation
details (\ccc{sweep_to_construct_planar_map}\lcTex{
\ccRefPage{CGAL::sweep_to_construct_planar_map}} and
\ccc{sweep_to_produce_planar_map_subcurves}\lcTex{
\ccRefPage{CGAL::sweep_to_produce_planar_map_subcurves}}).
\begin{ccAdvanced}
@ -127,8 +144,9 @@ Total number of edges 5
\subsection*{Functions}
\ccRefIdfierPage{CGAL::sweep_to_construct_planar_map<Curve_iterator,Planar_map>(Curve_iterator curves_begin, Curve_iterator curves_end, Planar_map &result);}\\
\ccRefIdfierPage{CGAL::sweep_to_produce_planar_map_subcurves<Curve_iterator,Traits,Containe>(Curve_iterator curves_begin, Curve_iterator curves_end, Container &subcurves, bool overlapping = false);}
\ccRefIdfierPage{CGAL::sweep_to_construct_planar_map}\\
\ccRefIdfierPage{CGAL::sweep_to_produce_planar_map_subcurves}\\
\end{ccTexOnly}

View File

@ -59,51 +59,67 @@
\section{Introduction}
\paragraph{2D Planar Map with Intersections:} Given a collection $C$ of (possibly
intersecting) $x$-monotone curves in the plane, we construct a
collection $C'$ as follows: We decompose each curve in $C$ into
maximal connected pieces not intersecting any other curve in $C$.
This way we obtain the collection $C'$ of $x$-monotone, pairwise
interior disjoint curves.
Constructing the {\it planar map with intersection} of the curves
in $C$ gives the {\it planar map}(see
Chapter~\ref{I1_ChapterPlanarMap}) induced by the curves in $C'$.
\paragraph{2D Planar Map with Intersections:}
Given a collection $C$ of (possibly intersecting and not necessarily
$x$-monotone curves in the plane, we construct a collection $C''$ in
two steps, as follows: First, we decompose each curve in C intor
maximal x-monotone curves, thus obtaining the collection
$C'$. Second, We decompose each curve in $C'$ into maximal connected
pieces not intersecting any other curve in $C'$. This way we obtain
the collection $C''$ of $x$-monotone, pairwise interior disjoint
curves. Constructing the {\it planar map with intersection} of the
curves in $C$ gives the {\it planar map}(see
Chapter~\ref{I1_ChapterPlanarMap}) induced by the curves in $C''$.
Planar map with intersections extends the functionality of planar
map by enabling simple insertion of intersecting $x$-monotone
curves. The planar map with intersections class has different
insertion functions but it uses the same data structures of the
planar map. Therefore, any functionality of the planar map is also
supported here (e.g., traversal of planar map features, point
location queries). However, The planar map with intersections
needs additional intersection functions in the geometric traits
class. Note that if one needs to build a planar map of
$x$-monotone, pairwise interior disjoint curves, then it would be
more efficient (in running time) and less demanding (in traits
class functionality) to use the planar map class.
The \ccc{Planar Map with Intersections} package extends the
functionality of the \ccc{Planar Map} package by enabling simple
insertion of intersecting not necessarily $x$-monotone curves. The
\ccc{Planar_map_with_intersections_2} class has different insertion
functions but it uses the same data structures of the planar
map. Therefore, almost any functionality of the planar map is also
supported here (e.g., traversal of planar map features, point
location queries and I/O operations are suppoerted but infinite
objects are not supported). However, the planar map with
intersections needs additional intersection functions in the
geometric traits class. Note that if one needs to build a planar map
of $x$-monotone, pairwise interior disjoint curves, then it would be
more efficient (in running time) and less demanding (in traits class
functionality) to use the planar map class.
\paragraph{Degeneracies}
Like the \ccc{Planar Map} package (see
Chapter~\ref{I1_ChapterPlanarMap}), the \ccc{Planar Map with
Intersections} package can deal with $x$-degenerate input (including
vertical segments). However, while in the planar map the input
curves were assumed to be non intersecting in their interiors, there
is no such assumption when using planar map with
intersections. Furthermore, overlapping curves are supported. If two
curves overlap the traits intersection function returns the two
endpoints of the common part.
\paragraph{Degeneracies} Like the planar map class (see
Chapter~\ref{I1_ChapterPlanarMap}), the planar map with intersections class can deal with
$x$-degenerate input (including vertical segments). However, while in the
planar map the input curves were assumed to be non
intersecting in their interiors, there is no such assumption when using
planar map with intersections. Furthermore, overlapping curves are
supported. If two curves overlap the traits intersection function returns
the two endpoints of the common part.
\paragraph{Sweep line}
A \ccc{Planar Map with Intersections} can be built incrementally by
inserting one curve after the other into the map. For a big number
of curves it is much faster to perfrom the sweep line algorithm on
the collection of input curves. A sweep line utility is supported as
part of the package. The utility can either build the induced planar
map or rather collect the pairwise interior disjoint subcurves
computed in a container.
\paragraph{Sweep line:}
As mentioned in Chapter ~\ref{I1_ChapterPlanarMap}),
inserting interior intersecting curves, overlap or non $x$-monotone to \ccc{Planar map}
is available due to the sweep line algorithm.
When using the sweep line technique it is also possible to report only
the resulting subcurves induced by the input curves.
The sweep line algorithm will use the traits classes defined for \ccc{Planar Maps with Intersections}.
If no additional insertions of intersecting curves are planned
following the building of the map it is possible to perform a sweep
line operation that will build the simpler class \ccc{Planar_map_2}.
This is possible since the output of the sweep line operation is a
collection of $x$-monotone pairwise interior disjoint, which are
supported by the \ccc{Planar Map} package. The result of applying
the sweep line algorithm to a collection of curves and a non-empty
map is equal to that of applying the algorithm to the union of the
planar map curves and the collection of input curves. Simply put,
the intersections of input curves and planar map curves are also
calculated.
%******************************************************************************
\section{Example Programs}
%---------------------------------------------------
\subsection{Simple Example of a Segment Planar Map with Intersections}
@ -129,14 +145,17 @@ Edges of the planar map:
\end{verbatim}
\subsubsection{Example of Sweep line}
\label{ssec:example1}
The following example demonstrates the usage of the \ccc {Sweep line} algorithm.
It constructs a planar map out of four segments --- $(0,0)-(1,1)$ , $(0,1)-(1,0)$ ,
$(0,0)-(1,0)$ and $(0,1)-(1,1)$ , two of them are intersecting in their interior.
The resulting planar map will contain all the disjoint interior sub segments obtained
by the calculation of the \ccc {Sweep line} algorithm. For clearness, we printed all the
halfedges of the resulting planar map to the standard output using the I/O functions for \ccc{Planar map}.
\subsection{Example of Sweep Line}
\label{ssec:example1_sweep}
The following example demonstrates the usage of the \ccc {Sweep
line} algorithm. It constructs a planar map out of four segments
--- $(0,0)-(1,1)$ , $(0,1)-(1,0)$ , $(0,0)-(1,0)$ and $(0,1)-(1,1)$
(an hourglass shape), two of them are intersecting in their
interior. The resulting planar map will contain all the disjoint
interior sub segments obtained by the calculation of the sweep
line algorithm. For clarity, we printed all the halfedges of the
resulting planar map to the standard output using the I/O functions
for the \ccc{Planar map} package.
\ccIncludeExampleCode{Sweep_line/example1.C}

View File

@ -24,44 +24,61 @@
\subsection*{Introduction}
\ccRefLabel{pmwx_ref_intro}
The planar map with intersections class extends the planar map
class. The planar map with intersections adds insertion functions
that handle intersections and overlapping among the curves of the
planar map. The basic types of the planar map (vertex, halfedge,
face, Dcel, etc.) are kept. \ccc{Planar_map_with_intersections_2}
is templated with the planar map class it derives from.
The \ccc{Planar Map with Intersections} package extends the
functionality of the \ccc{Planar Map} package. Morover, the class
\ccc{Planar_map_with_intersections_2} extends the class
\ccc{Planar_map_2}. The \ccc{Planar Map with Intersections} package
supports insertion functions that handle non $x$-monotone curves and
intersections and overlappings among the curves of the planar
map. The basic types of the \ccc{Planar Map} package (vertex,
halfedge, face, Dcel, etc.) are
kept. \ccc{Planar_map_with_intersections_2} is templated with the
planar map class it derives from.
\subsection*{Planar Map with Intersections Traits Class}
%-----------------------------------------------
Since the planar map with intersections has an additional
functionality of intersecting curves it needs additional
functionality of the traits class. We describe the planar map with
intersections traits concept following in this chapter.
Nevertheless, we do not have specific implementation of this
concept, and we use the arrangement traits instead (see
Chapter~\ref{I1_ChapterArrangement}).
Since the planar map with intersections has an additional
functionality of handling non $x$-monotone and intersecting curves
it needs additional functionality of the traits class. We describe
the \ccc{Planar_map_with_intersections_traits} concept following in
this chapter. Nevertheless, we do not have specific implementation
of this concept, and we use models of the \ccc{Arrangement_traits}
concept, which is a refinement thereof instead (see
Chapter~\ref{I1_ChapterArrangement}).
\subsection*{Sweep line}
\subsection*{Sweep Line}
%-------------------------------------------------
The \ccc{Planar Map With Intersections} contains a sweep lines algorithm.
Given a collection of intersecting (possibly overlapping or non $x$-monotone)
curves the algorithm calculates the intersection points. As a result, the
collection of pairwise interior disjoint subcurves can be produced, or,
alternatively, a subdivion is being built.
This subdivion can be either of the type \ccc{Planar Map With Intersections} or of the
type \ccc{Planar map}.However, the \ccStyle{Sweep line} is a part of
\ccStyle {Planar Map With Intersections} package since
the traits used here are those defined in that package, due to calcluations as finding
intersections, overlapping and $x$-monotony.
Using sweep line technique, and building a \ccc{Planar Map With Intersections} is most
usefull when users have a primar list of curves,
but inserting intersecting curves each at a time will be needed afterward.
See the sweep line functions reference pages for implementation details.
\ccc{sweep_to_construct_planar_map}\lcTex{
(\ccRefPage{CGAL::sweep_to_construct_planar_map})},
\ccc{sweep_to_produce_planar_map_subcurves}\lcTex{
(\ccRefPage{CGAL::sweep_to_produce_planar_map_subcurves})},
The \ccc{Planar Map with Intersections} packge contains a sweep line
utility. The sweep line algorithm can be used to build a planar map
much quicker than in an incremental way, where each curve is
inserted after the other. Two global functions are provided.
The function \ccc{sweep_to_construct_planar_map} builds a planar map
as a result of the call. Mind that it is possible to call this
function also with an instance the \ccc{Planar_map_2} class rather
than an instance of \ccc{Planar_map_with_intersections_2}. If no
additional insertion of intersecting or non $x$-monotone curves are
planned follwing the building of the map, then it would be more
efficient (in running time) and less demanding (in traits class
functionality) to use an instance of the former.
The function \ccc{sweep_to_produce_planar_map_subcurves} does not
build a planar map but rather collects the $x$-monotone pairwise
disjoint subcurves in a container. It is possible to tune the
function so that it will avoid to produce repetitions of overlapping
subcurves in the container or not.
The sweep line utility calculates intersections of curves. The
\ccc{Planar_map_with_intersection_traits} concepts requires this
very functionality. Thus, the sweep line functions have to use
traits classes that model the above concept. This is true even for
the case where an instance of \ccc{Planar_map_2} is built.
See the sweep line functions reference pages for implementation
details (\ccc{sweep_to_construct_planar_map}\lcTex{
\ccRefPage{CGAL::sweep_to_construct_planar_map}} and
\ccc{sweep_to_produce_planar_map_subcurves}\lcTex{
\ccRefPage{CGAL::sweep_to_produce_planar_map_subcurves}}).
\begin{ccAdvanced}
@ -127,8 +144,9 @@ Total number of edges 5
\subsection*{Functions}
\ccRefIdfierPage{CGAL::sweep_to_construct_planar_map<Curve_iterator,Planar_map>(Curve_iterator curves_begin, Curve_iterator curves_end, Planar_map &result);}\\
\ccRefIdfierPage{CGAL::sweep_to_produce_planar_map_subcurves<Curve_iterator,Traits,Containe>(Curve_iterator curves_begin, Curve_iterator curves_end, Container &subcurves, bool overlapping = false);}
\ccRefIdfierPage{CGAL::sweep_to_construct_planar_map}\\
\ccRefIdfierPage{CGAL::sweep_to_produce_planar_map_subcurves}\\
\end{ccTexOnly}

View File

@ -59,51 +59,67 @@
\section{Introduction}
\paragraph{2D Planar Map with Intersections:} Given a collection $C$ of (possibly
intersecting) $x$-monotone curves in the plane, we construct a
collection $C'$ as follows: We decompose each curve in $C$ into
maximal connected pieces not intersecting any other curve in $C$.
This way we obtain the collection $C'$ of $x$-monotone, pairwise
interior disjoint curves.
Constructing the {\it planar map with intersection} of the curves
in $C$ gives the {\it planar map}(see
Chapter~\ref{I1_ChapterPlanarMap}) induced by the curves in $C'$.
\paragraph{2D Planar Map with Intersections:}
Given a collection $C$ of (possibly intersecting and not necessarily
$x$-monotone curves in the plane, we construct a collection $C''$ in
two steps, as follows: First, we decompose each curve in C intor
maximal x-monotone curves, thus obtaining the collection
$C'$. Second, We decompose each curve in $C'$ into maximal connected
pieces not intersecting any other curve in $C'$. This way we obtain
the collection $C''$ of $x$-monotone, pairwise interior disjoint
curves. Constructing the {\it planar map with intersection} of the
curves in $C$ gives the {\it planar map}(see
Chapter~\ref{I1_ChapterPlanarMap}) induced by the curves in $C''$.
Planar map with intersections extends the functionality of planar
map by enabling simple insertion of intersecting $x$-monotone
curves. The planar map with intersections class has different
insertion functions but it uses the same data structures of the
planar map. Therefore, any functionality of the planar map is also
supported here (e.g., traversal of planar map features, point
location queries). However, The planar map with intersections
needs additional intersection functions in the geometric traits
class. Note that if one needs to build a planar map of
$x$-monotone, pairwise interior disjoint curves, then it would be
more efficient (in running time) and less demanding (in traits
class functionality) to use the planar map class.
The \ccc{Planar Map with Intersections} package extends the
functionality of the \ccc{Planar Map} package by enabling simple
insertion of intersecting not necessarily $x$-monotone curves. The
\ccc{Planar_map_with_intersections_2} class has different insertion
functions but it uses the same data structures of the planar
map. Therefore, almost any functionality of the planar map is also
supported here (e.g., traversal of planar map features, point
location queries and I/O operations are suppoerted but infinite
objects are not supported). However, the planar map with
intersections needs additional intersection functions in the
geometric traits class. Note that if one needs to build a planar map
of $x$-monotone, pairwise interior disjoint curves, then it would be
more efficient (in running time) and less demanding (in traits class
functionality) to use the planar map class.
\paragraph{Degeneracies}
Like the \ccc{Planar Map} package (see
Chapter~\ref{I1_ChapterPlanarMap}), the \ccc{Planar Map with
Intersections} package can deal with $x$-degenerate input (including
vertical segments). However, while in the planar map the input
curves were assumed to be non intersecting in their interiors, there
is no such assumption when using planar map with
intersections. Furthermore, overlapping curves are supported. If two
curves overlap the traits intersection function returns the two
endpoints of the common part.
\paragraph{Degeneracies} Like the planar map class (see
Chapter~\ref{I1_ChapterPlanarMap}), the planar map with intersections class can deal with
$x$-degenerate input (including vertical segments). However, while in the
planar map the input curves were assumed to be non
intersecting in their interiors, there is no such assumption when using
planar map with intersections. Furthermore, overlapping curves are
supported. If two curves overlap the traits intersection function returns
the two endpoints of the common part.
\paragraph{Sweep line}
A \ccc{Planar Map with Intersections} can be built incrementally by
inserting one curve after the other into the map. For a big number
of curves it is much faster to perfrom the sweep line algorithm on
the collection of input curves. A sweep line utility is supported as
part of the package. The utility can either build the induced planar
map or rather collect the pairwise interior disjoint subcurves
computed in a container.
\paragraph{Sweep line:}
As mentioned in Chapter ~\ref{I1_ChapterPlanarMap}),
inserting interior intersecting curves, overlap or non $x$-monotone to \ccc{Planar map}
is available due to the sweep line algorithm.
When using the sweep line technique it is also possible to report only
the resulting subcurves induced by the input curves.
The sweep line algorithm will use the traits classes defined for \ccc{Planar Maps with Intersections}.
If no additional insertions of intersecting curves are planned
following the building of the map it is possible to perform a sweep
line operation that will build the simpler class \ccc{Planar_map_2}.
This is possible since the output of the sweep line operation is a
collection of $x$-monotone pairwise interior disjoint, which are
supported by the \ccc{Planar Map} package. The result of applying
the sweep line algorithm to a collection of curves and a non-empty
map is equal to that of applying the algorithm to the union of the
planar map curves and the collection of input curves. Simply put,
the intersections of input curves and planar map curves are also
calculated.
%******************************************************************************
\section{Example Programs}
%---------------------------------------------------
\subsection{Simple Example of a Segment Planar Map with Intersections}
@ -129,14 +145,17 @@ Edges of the planar map:
\end{verbatim}
\subsubsection{Example of Sweep line}
\label{ssec:example1}
The following example demonstrates the usage of the \ccc {Sweep line} algorithm.
It constructs a planar map out of four segments --- $(0,0)-(1,1)$ , $(0,1)-(1,0)$ ,
$(0,0)-(1,0)$ and $(0,1)-(1,1)$ , two of them are intersecting in their interior.
The resulting planar map will contain all the disjoint interior sub segments obtained
by the calculation of the \ccc {Sweep line} algorithm. For clearness, we printed all the
halfedges of the resulting planar map to the standard output using the I/O functions for \ccc{Planar map}.
\subsection{Example of Sweep Line}
\label{ssec:example1_sweep}
The following example demonstrates the usage of the \ccc {Sweep
line} algorithm. It constructs a planar map out of four segments
--- $(0,0)-(1,1)$ , $(0,1)-(1,0)$ , $(0,0)-(1,0)$ and $(0,1)-(1,1)$
(an hourglass shape), two of them are intersecting in their
interior. The resulting planar map will contain all the disjoint
interior sub segments obtained by the calculation of the sweep
line algorithm. For clarity, we printed all the halfedges of the
resulting planar map to the standard output using the I/O functions
for the \ccc{Planar map} package.
\ccIncludeExampleCode{Sweep_line/example1.C}