From 7f8be3da333aee3f043e65fa76077d3db97306eb Mon Sep 17 00:00:00 2001 From: Shai Hirsch Date: Tue, 22 May 2001 12:13:15 +0000 Subject: [PATCH] *** empty log message *** --- .../Pm_with_intersections_2_ref/Pmwx.tex | 138 ++++++++++++++++++ .../Pmwx_change_notification.tex | 93 ++++++++++++ .../Pmwx_traits.tex | 104 +++++++++++++ .../Pm_with_intersections_2_ref/intro.tex | 107 ++++++++++++++ .../Pm_with_intersections_2_ref/pmwx_ref.tex | 12 ++ .../doc_tex/Pm_with_intersections_2/main.tex | 4 + .../doc_tex/Pm_with_intersections_2/pmwx.tex | 128 ++++++++++++++++ .../Pm_with_intersections_2_ref/Pmwx.tex | 138 ++++++++++++++++++ .../Pmwx_change_notification.tex | 93 ++++++++++++ .../Pmwx_traits.tex | 104 +++++++++++++ .../Pm_with_intersections_2_ref/intro.tex | 107 ++++++++++++++ .../Pm_with_intersections_2_ref/pmwx_ref.tex | 12 ++ .../basic/Pm_with_intersections_2/main.tex | 4 + .../basic/Pm_with_intersections_2/pmwx.tex | 128 ++++++++++++++++ 14 files changed, 1172 insertions(+) create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/main.tex create mode 100644 Packages/Arrangement/doc_tex/Pm_with_intersections_2/pmwx.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/main.tex create mode 100644 Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/pmwx.tex diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex new file mode 100644 index 00000000000..892295e288d --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex @@ -0,0 +1,138 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx.tex (Planar map with intersections) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Planar_map_with_intersections_2 +% +========================================================================+ +\begin{ccRefClass}{Planar_map_with_intersections_2} + +\ccDefinition An object \ccStyle{pmwx} of the class + \ccClassTemplateName\ represents the planar + subdivision induced by a set of curves that are possibly intersecting. + This class extends the class \ccStyle{Planar_map_2} + which handles $x$-monotone pairwise interior disjoint + curves. %The class have the following internal typedefs: + An object of the class \ccClassTemplateName\ is also a planar map and + therefore the types, constants, and traversal iterators and operations remain + the same. + + \ccInclude{CGAL/Pm_with_intersections.h} + +\ccInheritsFrom + \ccStyle{Planar_map_2} + + The modifying functions \ccStyle{insert} + override the inherited functions +%\comment{iddo: need to be virtual in planar map}. + +\ccTypes + + \ccNestedType{Pmwx_change_notification}{} + +\ccCreation + \ccCreationVariable{pmwx} + + \ccConstructor{Planar_map_with_intersections_2();} + {creates an empty planar map with the default point location strategy.} + + \ccConstructor{Planar_map_with_intersections_2(Pm_point_location_base *pl);} + {creates an empty planar map with \ccc{*pl} as the point location strategy.} + + \ccConstructor{Planar_map_with_intersections_2(const Traits& tr, Pm_point_location_base *pl);} + {creates an empty planar map with \ccc{tr} as the traits class and \ccc{*pl} as the point location strategy.} + +\ccOperations + + + \ccMethod{Halfedge_handle insert(const X_curve& cv, Pmwx_change_notification *en = NULL);} + {inserts the $x$-monotone curve \ccStyle{cv} into the planar map. + Returns the last inserted halfedge whose target points to the + target point of \ccStyle{cv}. + \ccPrecond{\ccc{cv} is not equivalent to a point. } + } + + + \ccMethod{Halfedge_handle insert_from_vertex(const X_curve& cv, Vertex_handle src, + Pmwx_change_notification *en = NULL);} + {inserts the $x$-monotone curve \ccStyle{cv}, for + which the source vertex, \ccStyle{src}, is already in the + arrangement. + Returns the last inserted halfedge whose target points to the + target point of \ccStyle{cv}. + This function is more efficient than the \ccc{insert} function, + since it does not invoke a point location query for the + endpoint \ccc{src}. Therefore, + whenever possible, it is recommended to use this one rather + than \ccc{insert}. + \ccPrecond{\ccc{src} holds a point which is the same as \ccc{cv's} + source.} + \ccPrecond{\ccc{cv} is not equivalent to a point. } + } + +\begin{ccAdvanced} + + \ccMethod{Halfedge_handle non_intersecting_insert_from_vertex(const X_curve& cv, Vertex_handle src, bool + source);} + {invokes the planar map implementation of + \ccc{insert_from_vertex} function. Since this function does not + check for intersections it is more efficient than \ccc{insert_from_vertex} but + it should not be called when \ccc{cv} could have intersections with other + curves of the planar map. + \ccPrecond{\ccc{cv} has no intersection in the interior with any curve of the map. } + \ccPrecond{\ccc{src} holds a point which is the same as \ccc{cv}'s source.} + } + + \ccMethod{Halfedge_handle non_intersecting_insert(const X_curve& + cv);} + {invokes the planar map implementation of + \ccc{insert} function. Since this function does not + check for intersections it is more efficient than \ccc{insert} but + it should not be called when \ccc{cv} could have intersections with other + curves of the planar map. + \ccPrecond{\ccc{cv} has no intersection in the interior with any curve of the map. } + } + + +\end{ccAdvanced} + + +% The following operations have the same functionality as their +% counterparts in the planar map. +% +% \ccMethod{Vertex_iterator vertices_begin();}{} +% \ccMethod{Vertex_iterator vertices_end();}{} +% \ccMethod{Size number_of_vertices();}{} +% \ccMethod{Halfedge_iterator halfedges_begin();}{} +% \ccMethod{Halfedge_iterator halfedges_end();}{} +% \ccMethod{Size number_of_halfedges();}{} +% \ccMethod{Face_iterator faces_begin();}{} +% \ccMethod{Face_iterator faces_end();}{} +% \ccMethod{Size number_of_faces();}{} +% +% \ccMethod{Halfedge_handle split_edge(Halfedge_handle e, const X_curve& c1, +% const X_curve& c2);}{} +% \ccMethod{Halfedge_handle locate(const Point& p, Locate_type& lt);}{} +% \ccMethod{Halfedge_handle vertical_ray_shoot(const Point& p, Locate_type& lt, bool up);}{} +% +% \ccMethod{Face_handle unbounded_face();}{} +% +% \ccMethod{bool is_valid(bool verbose=false);}{} + + +\end{ccRefClass} + + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex new file mode 100644 index 00000000000..6e43a736bbb --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex @@ -0,0 +1,93 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx_change_notification.tex +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Pmwx_change_notification +% +========================================================================+ +\begin{ccRefConcept}{Planar_Map_with_Intersections_Change_Notification} + +\ccDefinition + An instance of \ccRefName\ can be passed to the modification + methods of a planar map with intersections object. An insertion + of an intersecting curve to a planar map may add several + halfedges and modify several features of the map. The relevant + function of the change notification instance is called after + each such modification. + +\ccTypes +\ccNestedType{Planar_map}{the planar map in which the object is being used.} +\ccNestedType{Traits}{the traits class of \ccc{Planar_map}.} + +\ccCreationVariable{pmwx_cn} + +\ccMethod{virtual void add_edge( + const typename Traits::X_curve& cv, + typename Planar_map::Halfedge_handle e, + bool original_direction, bool overlap);} + {called each time a pair of twin halfedges is added to the planar map. + \ccc{cv} is the curve of the added halfedges. + \ccc{e} is on of the new halfedges. + \ccc{original_direction} is true iff \ccc{cv} is directed the same as the curve that we insert to the map. + \ccc{overlap} is true iff the added halfedges overlap previously inserted halfedges in the map.} + +\ccMethod{virtual void split_edge( + typename Planar_map::Halfedge_handle orig_edge, + typename Planar_map::Halfedge_handle new_edge, + const typename Traits::X_curve& c1, + const typename Traits::X_curve& c2);} + {called each time a pair of twin halfedges is split into two + pairs. The split operation creates a new pair of twin halfedges + (\ccc{new_edge} and its twin) and modifies the original + pair (\ccc{orig_edge} an its twin). + \ccc{c1} and \ccc{c2} are the curves after the split. + } + +\ccMethod{virtual void split_face( + typename Planar_map::Face_handle orig_face, + typename Planar_map::Face_handle new_face);} + {called each time a face of the planar map is being split by + the inserted curve into two faces: \ccc{orig_face} is the + original face and \ccc{new_face} is the new face. + } + +\ccMethod{virtual void add_hole( + typename Planar_map::Face_handle in_face, + typename Planar_map::Halfedge_handle new_hole);} + {called each time a hole is added to a face \ccc{in_face}. + \ccc{new_hole} is a halfedge on the new hole. + } + +\ccMethod{virtual bool have_support_curve();} + {returns true if \ccc{edge_support_curve} function can return the + supporting curve (used by the arrangement class). + } + +\ccMethod{virtual const typename Traits::X_curve& + edge_support_curve(typename Planar_map::Halfedge_handle edge);} + {returns the supporting curve of a \ccc{edge}, if it exists + (used by the arrangement class). + } + + +\ccHasModels + The package does not supply specific implementations of + \ccc{Planar Map with Intersections Change Notification}. The arrangement class has an + internal implementation that is used for the updating of its + hierarchy structure. + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex new file mode 100644 index 00000000000..e72d1c525d0 --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex @@ -0,0 +1,104 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx_2_traits.tex (Arrangement) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Arrangement_2_traits +% +========================================================================+ +\begin{ccRefConcept}{Planar_Map_with_Intersections_Traits} + +\ccDefinition + The \ccRefName\ concept is a refinement of the \ccc{Planar Map Traits} + concept \lcTex{(\ccRefPage{Planar_map_traits})}. + The requirements of the latter + are requirements for the former. + The additional requirements are the following types and methods. + %The \ccStyle{Point} can be implemented for non-linear curves as the + %intersection of 2 curves. + +\ccTypes +\ccNestedType{Point}{same as the planar map traits' \ccc{Point}.} +\ccNestedType{X_curve}{same as the planar map traits' \ccc{X_curve}.} + +\ccCreationVariable{pmwx_traits} + +\ccMethod{Point point_reflect_in_x_and_y(const Point& pt);}{returns the +\ccc{Point} +that is the the reflection of \ccc{pt} in the $x$ and $y$ axes. E.g., +the point $(2,2)$ will be reflected as $(-2,-2)$. } + +\ccMethod{X_curve curve_reflect_in_x_and_y(const X_curve& cv);}{returns the \ccc{X_curve} +that is the the reflection of \ccc{cv} in the $x$ and $y$ axes. E.g., the line segment $((2,2),(3,3))$ will be reflected +as $((-2,-2),(-3,-3))$. } + +\ccMethod{void curve_split(const X_curve& cv, X_curve& c1, X_curve& c2, + const Point& split_pt);}{splits $cv$ at \ccc{split_pt} +and assigns the resulting two curves to \ccc{c1} and \ccc{c2}. +\ccPrecond{\ccc{split_pt} is on \ccc{cv}.} +\ccPrecond{\ccc{split_pt} is not an endpoint of \ccc{cv}.} +} + +\ccMethod{bool do_intersect_to_right(const X_curve& c1, const X_curve& c2, + const Point& pt);}{returns $true$ if \ccc{c1} +and \ccc{c2} intersect to the right of the point \ccc{pt}. +Intersection to the right of \ccc{pt} is defined as +an intersection which is lexicographically strictly to the right of \ccc{pt} +(i.e., an intersection above or to the right of +\ccc{pt} but {\em not} on \ccc{pt}).} + +\ccMethod{bool nearest_intersection_to_right(const X_curve& c1, + const X_curve& c2, + const Point& pt, + Point& p1, Point& p2);} +{finds the +nearest intersection point to the right of \ccc{pt}. Nearest is defined as the +one lexicographically closest to \ccc{pt} not including \ccc{pt} itself. +If the intersection of \ccc{c1} and \ccc{c2} to the +right of \ccc{pt} is an \ccc{X_curve} (i.e., there is an overlapping subcurve +to the right of \ccc{pt}), +then \ccc{p1} will hold the source point of the intersection and +\ccc{p2} will hold its target point. Otherwise \ccc{p1} and \ccc{p2} are +identical. In the case of an overlap we regard the intersection +to the right as the open curve between \ccc{p1} and \ccc{p2}. This means that +if the overlapping subcurve contains \ccc{pt} either \ccc{p1} or \ccc{p2} will +be equal to \ccc{pt}, this is the only case in which this can happen. +If \ccc{c1} and \ccc{c2} do not intersect to the right of \ccc{pt} +the function returns \ccc{false}. +%\ccPrecond{\ccc{do_intersect_to_right(c1,c2,pt) == true}} +} + +%The intersection function is defined in such a way to enable dealing with +%degenerate cases when two curves inserted into the arrangement overlap. + +\ccMethod{bool curves_overlap(const X_curve& cv1, const X_curve& cv2);} +{returns \ccc{true} if \ccc{cv1} and \ccc{cv2} overlap +in a one-dimensional subcurve (i.e., not in a finite number +of points), otherwise returns +\ccc{false}.} + +\ccHasModels + The package does not supply specific implementations of the planar + map with intersections traits concept. However, since the + \ccc{Arrangement Traits} concept is a refinment of the \ccRefName\ + concept, all of the models of the former are models of the latter. + + \ccc{Arr_segment_exact_traits}\\ + \ccc{Arr_leda_segment_exact_traits}\\ + \ccc{Arr_circles_real_traits}\\ + \ccc{Arr_polyline_traits} + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex new file mode 100644 index 00000000000..fc2727ca001 --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex @@ -0,0 +1,107 @@ +% +------------------------------------------------------------------------+ +% | Reference manual chapter: intro.tex (Pmwx) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Arrangement_2) +% | +% +------------------------------------------------------------------------+ + +%+---------------------------------------------------------------------------80 +%| update log +%| +%| 04 May 2001 - Eyal Flato +%| Created from arr documentation +%| +%+---------------------------------------------------------------------------80 + + +% +========================================================================+ +% Introduction +% +========================================================================+ +\clearpage +\section{Planar Map with Intersections Reference Pages} + +\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. + +\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}). + + +\begin{ccAdvanced} +\subsection*{Change Notification} +%----------------------------------------------- +An insertion of an intersecting curve to a planar map may add +several halfedges and modify several features of the map (i.e., +split halfedges, split faces). The relevant function of the change +notification instance, that is passed to the modification methods +of a planar map with intersections, is called after each such +modification. The change notification class is useful in many +cases. For example, one may add a color (or other extra data) to +any halfedge of a planar map. An insertion of a new curve can +split halfedges that were previously in the map. After such split +the color of the newly created halfedges should be updated +according to the original color of the split halfedge. One can do +this by implementing the \ccc{split_edge} function of the change +notification class. This function will be called after each split +of an halfedge in the map. + + +\subsubsection{Example of Change Notification} +\label{ssec:example2} +The following example demonstrates the usage of the change +notification concept during the construction of a +planar map out of three segments --- $(0,1)-(1,0)$, $(0,0)-(1,1)$ +and $(0,1)-(1,1)$. +During the insertion we use \ccc{My_notification} instance to +output the internal process of the construction of the planar map. +We also count how many edges are in the map by incrementing a +counter each time an edge is added (\ccc{add_edge})or +split (\ccc{split_edge}). + +\ccIncludeExampleCode{Pm_with_intersections/example2.C} + +The output of the program looks like this: +\begin{verbatim} +inserting 0 1 1 0 +add_edge +add_hole +inserting 0 0 1 1 +split_edge +add_edge +add_edge +inserting 0 1 1 1 +add_edge +split_face +Total number of edges 5 +\end{verbatim} + +\end{ccAdvanced} + + + +\begin{ccTexOnly} + +\subsection*{Concepts} +\ccRefConceptPage{Planar_Map_with_Intersections_Traits}\\ +\ccRefConceptPage{Planar_Map_with_Intersections_Change_Notification}\\ + +\subsection*{Classes} +\ccRefIdfierPage{CGAL::Planar_map_with_intersections_2}%\\ + + +\end{ccTexOnly} diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex new file mode 100644 index 00000000000..47060389699 --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex @@ -0,0 +1,12 @@ +% +------------------------------------------------------------------------+ +% | Reference manual chapter: pmwx_ref.tex (Planar_map_with_intersections_2) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\input{Pm_with_intersections_2_ref/intro.tex} +\input{Pm_with_intersections_2_ref/Pmwx.tex} +\input{Pm_with_intersections_2_ref/Pmwx_traits.tex} +\input{Pm_with_intersections_2_ref/Pmwx_change_notification.tex} diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/main.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/main.tex new file mode 100644 index 00000000000..ec0aee8af49 --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/main.tex @@ -0,0 +1,4 @@ +\input{pmwx} +% we temporarily include the reference pages in the regular manual +% later this input will be in the reference wrapper +\input{Pm_with_intersections_2_ref/pmwx_ref} diff --git a/Packages/Arrangement/doc_tex/Pm_with_intersections_2/pmwx.tex b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/pmwx.tex new file mode 100644 index 00000000000..9e1055bc83b --- /dev/null +++ b/Packages/Arrangement/doc_tex/Pm_with_intersections_2/pmwx.tex @@ -0,0 +1,128 @@ +%+------------------------------------------------------- +%| CGAL Manual : pmwx.tex +%| +%| Soon to be split into User and Reference Manuals +%+-------------------------------------------------------- +%| update log +%| +%| 04 May 2001 - Eyal Flato +%| Created from arr documentation +%| +%-------------------------------------------------------- + +%\documentclass[12pt]{book} +%\usepackage{graphics, amssymb,epsfig} +%\usepackage{cprog,cc_manual} +% +%\def\Ipe#1{\def\IPEfile{#1}\input{#1}} +% +%\setlength{\evensidemargin}{.0in} +%\setlength{\oddsidemargin}{-0.3in} +%\setlength{\textwidth}{6.8in} +%\setlength{\textheight}{8in} +% +%\renewcommand{\Re}{{\rm I\!\hspace{-0.025em} R}} +%\newcommand{\normal}[1]{\eta_{#1}} +%\newtheorem{theorem}{Theorem}[section] % section +%\newtheorem{remark}[theorem]{Remark} +%\newtheorem{lemma}[theorem]{Lemma} +%\newenvironment{dfn}{{\vspace*{1ex} \noindent \bf Definition }}{\vspace*{1ex}} +%\newcommand{\bigdef}[2]{\index{#1}\begin{dfn} {\rm #2} \end{dfn}} +%\newenvironment{proof}{{\em Proof:}}{\hfill{\hfill\rule{2mm}{2mm}}} +% +%\newcommand{\comment}[1]{{\sf * #1 *}} +%\newcommand{\ncomment}[1]{\noindent {\sf * #1 * }} +% +%\newtheorem{defn}[theorem]{Definition} +%\newcommand{\intsupplanes}{P} +%\def\C{{\cal C}} +%\def\G{{\cal G}} +%\def\F{{\cal F}} +%\def\I{{\cal I}} +%\def\U{{\cal U}} +%\def\M{{\cal M}} +%\def\eps{{\varepsilon}} +%\def\bd{{\partial}} +%\def\dm{{\cal D}} +% +% Title +%\title{CGAL Arrangement Specifications} +% +%\date{ \today } +% +%\begin{document} +% +%\tableofcontents +% +%\maketitle +\chapter{2D Planar Maps with Intersections} \label{I1_ChapterPmwx} + +\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'$. + +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. + + +\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. + + + +%****************************************************************************** + + + +\section{Example Programs} +%--------------------------------------------------- +\subsection{Simple Example of a Segment Planar Map with Intersections} +\label{ssec:example1} +The following example demonstrates the construction of an +$X$-shaped planar subdivision out of two intersecting segments. +We output the coordinates of the halfedges of the constructed +subdivision. + +\ccIncludeExampleCode{Pm_with_intersections/example1.C} + +The output of the program looks like this: +\begin{verbatim} +Inserting the segments: +0 0 1 1 +0 1 1 0 + +Edges of the planar map: +0 0 --- 0.5 0.5 +0.5 0.5 --- 1 1 +0 1 --- 0.5 0.5 +1 0 --- 0.5 0.5 +\end{verbatim} + + + + +% EOF ------------------------------------------------------------------------80 diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex new file mode 100644 index 00000000000..892295e288d --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx.tex @@ -0,0 +1,138 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx.tex (Planar map with intersections) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Planar_map_with_intersections_2 +% +========================================================================+ +\begin{ccRefClass}{Planar_map_with_intersections_2} + +\ccDefinition An object \ccStyle{pmwx} of the class + \ccClassTemplateName\ represents the planar + subdivision induced by a set of curves that are possibly intersecting. + This class extends the class \ccStyle{Planar_map_2} + which handles $x$-monotone pairwise interior disjoint + curves. %The class have the following internal typedefs: + An object of the class \ccClassTemplateName\ is also a planar map and + therefore the types, constants, and traversal iterators and operations remain + the same. + + \ccInclude{CGAL/Pm_with_intersections.h} + +\ccInheritsFrom + \ccStyle{Planar_map_2} + + The modifying functions \ccStyle{insert} + override the inherited functions +%\comment{iddo: need to be virtual in planar map}. + +\ccTypes + + \ccNestedType{Pmwx_change_notification}{} + +\ccCreation + \ccCreationVariable{pmwx} + + \ccConstructor{Planar_map_with_intersections_2();} + {creates an empty planar map with the default point location strategy.} + + \ccConstructor{Planar_map_with_intersections_2(Pm_point_location_base *pl);} + {creates an empty planar map with \ccc{*pl} as the point location strategy.} + + \ccConstructor{Planar_map_with_intersections_2(const Traits& tr, Pm_point_location_base *pl);} + {creates an empty planar map with \ccc{tr} as the traits class and \ccc{*pl} as the point location strategy.} + +\ccOperations + + + \ccMethod{Halfedge_handle insert(const X_curve& cv, Pmwx_change_notification *en = NULL);} + {inserts the $x$-monotone curve \ccStyle{cv} into the planar map. + Returns the last inserted halfedge whose target points to the + target point of \ccStyle{cv}. + \ccPrecond{\ccc{cv} is not equivalent to a point. } + } + + + \ccMethod{Halfedge_handle insert_from_vertex(const X_curve& cv, Vertex_handle src, + Pmwx_change_notification *en = NULL);} + {inserts the $x$-monotone curve \ccStyle{cv}, for + which the source vertex, \ccStyle{src}, is already in the + arrangement. + Returns the last inserted halfedge whose target points to the + target point of \ccStyle{cv}. + This function is more efficient than the \ccc{insert} function, + since it does not invoke a point location query for the + endpoint \ccc{src}. Therefore, + whenever possible, it is recommended to use this one rather + than \ccc{insert}. + \ccPrecond{\ccc{src} holds a point which is the same as \ccc{cv's} + source.} + \ccPrecond{\ccc{cv} is not equivalent to a point. } + } + +\begin{ccAdvanced} + + \ccMethod{Halfedge_handle non_intersecting_insert_from_vertex(const X_curve& cv, Vertex_handle src, bool + source);} + {invokes the planar map implementation of + \ccc{insert_from_vertex} function. Since this function does not + check for intersections it is more efficient than \ccc{insert_from_vertex} but + it should not be called when \ccc{cv} could have intersections with other + curves of the planar map. + \ccPrecond{\ccc{cv} has no intersection in the interior with any curve of the map. } + \ccPrecond{\ccc{src} holds a point which is the same as \ccc{cv}'s source.} + } + + \ccMethod{Halfedge_handle non_intersecting_insert(const X_curve& + cv);} + {invokes the planar map implementation of + \ccc{insert} function. Since this function does not + check for intersections it is more efficient than \ccc{insert} but + it should not be called when \ccc{cv} could have intersections with other + curves of the planar map. + \ccPrecond{\ccc{cv} has no intersection in the interior with any curve of the map. } + } + + +\end{ccAdvanced} + + +% The following operations have the same functionality as their +% counterparts in the planar map. +% +% \ccMethod{Vertex_iterator vertices_begin();}{} +% \ccMethod{Vertex_iterator vertices_end();}{} +% \ccMethod{Size number_of_vertices();}{} +% \ccMethod{Halfedge_iterator halfedges_begin();}{} +% \ccMethod{Halfedge_iterator halfedges_end();}{} +% \ccMethod{Size number_of_halfedges();}{} +% \ccMethod{Face_iterator faces_begin();}{} +% \ccMethod{Face_iterator faces_end();}{} +% \ccMethod{Size number_of_faces();}{} +% +% \ccMethod{Halfedge_handle split_edge(Halfedge_handle e, const X_curve& c1, +% const X_curve& c2);}{} +% \ccMethod{Halfedge_handle locate(const Point& p, Locate_type& lt);}{} +% \ccMethod{Halfedge_handle vertical_ray_shoot(const Point& p, Locate_type& lt, bool up);}{} +% +% \ccMethod{Face_handle unbounded_face();}{} +% +% \ccMethod{bool is_valid(bool verbose=false);}{} + + +\end{ccRefClass} + + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex new file mode 100644 index 00000000000..6e43a736bbb --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_change_notification.tex @@ -0,0 +1,93 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx_change_notification.tex +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Pmwx_change_notification +% +========================================================================+ +\begin{ccRefConcept}{Planar_Map_with_Intersections_Change_Notification} + +\ccDefinition + An instance of \ccRefName\ can be passed to the modification + methods of a planar map with intersections object. An insertion + of an intersecting curve to a planar map may add several + halfedges and modify several features of the map. The relevant + function of the change notification instance is called after + each such modification. + +\ccTypes +\ccNestedType{Planar_map}{the planar map in which the object is being used.} +\ccNestedType{Traits}{the traits class of \ccc{Planar_map}.} + +\ccCreationVariable{pmwx_cn} + +\ccMethod{virtual void add_edge( + const typename Traits::X_curve& cv, + typename Planar_map::Halfedge_handle e, + bool original_direction, bool overlap);} + {called each time a pair of twin halfedges is added to the planar map. + \ccc{cv} is the curve of the added halfedges. + \ccc{e} is on of the new halfedges. + \ccc{original_direction} is true iff \ccc{cv} is directed the same as the curve that we insert to the map. + \ccc{overlap} is true iff the added halfedges overlap previously inserted halfedges in the map.} + +\ccMethod{virtual void split_edge( + typename Planar_map::Halfedge_handle orig_edge, + typename Planar_map::Halfedge_handle new_edge, + const typename Traits::X_curve& c1, + const typename Traits::X_curve& c2);} + {called each time a pair of twin halfedges is split into two + pairs. The split operation creates a new pair of twin halfedges + (\ccc{new_edge} and its twin) and modifies the original + pair (\ccc{orig_edge} an its twin). + \ccc{c1} and \ccc{c2} are the curves after the split. + } + +\ccMethod{virtual void split_face( + typename Planar_map::Face_handle orig_face, + typename Planar_map::Face_handle new_face);} + {called each time a face of the planar map is being split by + the inserted curve into two faces: \ccc{orig_face} is the + original face and \ccc{new_face} is the new face. + } + +\ccMethod{virtual void add_hole( + typename Planar_map::Face_handle in_face, + typename Planar_map::Halfedge_handle new_hole);} + {called each time a hole is added to a face \ccc{in_face}. + \ccc{new_hole} is a halfedge on the new hole. + } + +\ccMethod{virtual bool have_support_curve();} + {returns true if \ccc{edge_support_curve} function can return the + supporting curve (used by the arrangement class). + } + +\ccMethod{virtual const typename Traits::X_curve& + edge_support_curve(typename Planar_map::Halfedge_handle edge);} + {returns the supporting curve of a \ccc{edge}, if it exists + (used by the arrangement class). + } + + +\ccHasModels + The package does not supply specific implementations of + \ccc{Planar Map with Intersections Change Notification}. The arrangement class has an + internal implementation that is used for the updating of its + hierarchy structure. + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex new file mode 100644 index 00000000000..e72d1c525d0 --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/Pmwx_traits.tex @@ -0,0 +1,104 @@ +% +------------------------------------------------------------------------+ +% | Reference manual page: Pmwx_2_traits.tex (Arrangement) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\ccRefPageBegin + +%%RefPage: end of header, begin of main body +% +------------------------------------------------------------------------+ +% +========================================================================+ +% Arrangement_2_traits +% +========================================================================+ +\begin{ccRefConcept}{Planar_Map_with_Intersections_Traits} + +\ccDefinition + The \ccRefName\ concept is a refinement of the \ccc{Planar Map Traits} + concept \lcTex{(\ccRefPage{Planar_map_traits})}. + The requirements of the latter + are requirements for the former. + The additional requirements are the following types and methods. + %The \ccStyle{Point} can be implemented for non-linear curves as the + %intersection of 2 curves. + +\ccTypes +\ccNestedType{Point}{same as the planar map traits' \ccc{Point}.} +\ccNestedType{X_curve}{same as the planar map traits' \ccc{X_curve}.} + +\ccCreationVariable{pmwx_traits} + +\ccMethod{Point point_reflect_in_x_and_y(const Point& pt);}{returns the +\ccc{Point} +that is the the reflection of \ccc{pt} in the $x$ and $y$ axes. E.g., +the point $(2,2)$ will be reflected as $(-2,-2)$. } + +\ccMethod{X_curve curve_reflect_in_x_and_y(const X_curve& cv);}{returns the \ccc{X_curve} +that is the the reflection of \ccc{cv} in the $x$ and $y$ axes. E.g., the line segment $((2,2),(3,3))$ will be reflected +as $((-2,-2),(-3,-3))$. } + +\ccMethod{void curve_split(const X_curve& cv, X_curve& c1, X_curve& c2, + const Point& split_pt);}{splits $cv$ at \ccc{split_pt} +and assigns the resulting two curves to \ccc{c1} and \ccc{c2}. +\ccPrecond{\ccc{split_pt} is on \ccc{cv}.} +\ccPrecond{\ccc{split_pt} is not an endpoint of \ccc{cv}.} +} + +\ccMethod{bool do_intersect_to_right(const X_curve& c1, const X_curve& c2, + const Point& pt);}{returns $true$ if \ccc{c1} +and \ccc{c2} intersect to the right of the point \ccc{pt}. +Intersection to the right of \ccc{pt} is defined as +an intersection which is lexicographically strictly to the right of \ccc{pt} +(i.e., an intersection above or to the right of +\ccc{pt} but {\em not} on \ccc{pt}).} + +\ccMethod{bool nearest_intersection_to_right(const X_curve& c1, + const X_curve& c2, + const Point& pt, + Point& p1, Point& p2);} +{finds the +nearest intersection point to the right of \ccc{pt}. Nearest is defined as the +one lexicographically closest to \ccc{pt} not including \ccc{pt} itself. +If the intersection of \ccc{c1} and \ccc{c2} to the +right of \ccc{pt} is an \ccc{X_curve} (i.e., there is an overlapping subcurve +to the right of \ccc{pt}), +then \ccc{p1} will hold the source point of the intersection and +\ccc{p2} will hold its target point. Otherwise \ccc{p1} and \ccc{p2} are +identical. In the case of an overlap we regard the intersection +to the right as the open curve between \ccc{p1} and \ccc{p2}. This means that +if the overlapping subcurve contains \ccc{pt} either \ccc{p1} or \ccc{p2} will +be equal to \ccc{pt}, this is the only case in which this can happen. +If \ccc{c1} and \ccc{c2} do not intersect to the right of \ccc{pt} +the function returns \ccc{false}. +%\ccPrecond{\ccc{do_intersect_to_right(c1,c2,pt) == true}} +} + +%The intersection function is defined in such a way to enable dealing with +%degenerate cases when two curves inserted into the arrangement overlap. + +\ccMethod{bool curves_overlap(const X_curve& cv1, const X_curve& cv2);} +{returns \ccc{true} if \ccc{cv1} and \ccc{cv2} overlap +in a one-dimensional subcurve (i.e., not in a finite number +of points), otherwise returns +\ccc{false}.} + +\ccHasModels + The package does not supply specific implementations of the planar + map with intersections traits concept. However, since the + \ccc{Arrangement Traits} concept is a refinment of the \ccRefName\ + concept, all of the models of the former are models of the latter. + + \ccc{Arr_segment_exact_traits}\\ + \ccc{Arr_leda_segment_exact_traits}\\ + \ccc{Arr_circles_real_traits}\\ + \ccc{Arr_polyline_traits} + +\end{ccRefConcept} + +% +------------------------------------------------------------------------+ +%%RefPage: end of main body, begin of footer +\ccRefPageEnd +% EOF +% +------------------------------------------------------------------------+ diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex new file mode 100644 index 00000000000..fc2727ca001 --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/intro.tex @@ -0,0 +1,107 @@ +% +------------------------------------------------------------------------+ +% | Reference manual chapter: intro.tex (Pmwx) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Arrangement_2) +% | +% +------------------------------------------------------------------------+ + +%+---------------------------------------------------------------------------80 +%| update log +%| +%| 04 May 2001 - Eyal Flato +%| Created from arr documentation +%| +%+---------------------------------------------------------------------------80 + + +% +========================================================================+ +% Introduction +% +========================================================================+ +\clearpage +\section{Planar Map with Intersections Reference Pages} + +\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. + +\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}). + + +\begin{ccAdvanced} +\subsection*{Change Notification} +%----------------------------------------------- +An insertion of an intersecting curve to a planar map may add +several halfedges and modify several features of the map (i.e., +split halfedges, split faces). The relevant function of the change +notification instance, that is passed to the modification methods +of a planar map with intersections, is called after each such +modification. The change notification class is useful in many +cases. For example, one may add a color (or other extra data) to +any halfedge of a planar map. An insertion of a new curve can +split halfedges that were previously in the map. After such split +the color of the newly created halfedges should be updated +according to the original color of the split halfedge. One can do +this by implementing the \ccc{split_edge} function of the change +notification class. This function will be called after each split +of an halfedge in the map. + + +\subsubsection{Example of Change Notification} +\label{ssec:example2} +The following example demonstrates the usage of the change +notification concept during the construction of a +planar map out of three segments --- $(0,1)-(1,0)$, $(0,0)-(1,1)$ +and $(0,1)-(1,1)$. +During the insertion we use \ccc{My_notification} instance to +output the internal process of the construction of the planar map. +We also count how many edges are in the map by incrementing a +counter each time an edge is added (\ccc{add_edge})or +split (\ccc{split_edge}). + +\ccIncludeExampleCode{Pm_with_intersections/example2.C} + +The output of the program looks like this: +\begin{verbatim} +inserting 0 1 1 0 +add_edge +add_hole +inserting 0 0 1 1 +split_edge +add_edge +add_edge +inserting 0 1 1 1 +add_edge +split_face +Total number of edges 5 +\end{verbatim} + +\end{ccAdvanced} + + + +\begin{ccTexOnly} + +\subsection*{Concepts} +\ccRefConceptPage{Planar_Map_with_Intersections_Traits}\\ +\ccRefConceptPage{Planar_Map_with_Intersections_Change_Notification}\\ + +\subsection*{Classes} +\ccRefIdfierPage{CGAL::Planar_map_with_intersections_2}%\\ + + +\end{ccTexOnly} diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex new file mode 100644 index 00000000000..47060389699 --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/Pm_with_intersections_2_ref/pmwx_ref.tex @@ -0,0 +1,12 @@ +% +------------------------------------------------------------------------+ +% | Reference manual chapter: pmwx_ref.tex (Planar_map_with_intersections_2) +% +------------------------------------------------------------------------+ +% | +% | Package: arr (Planar_map_with_intersections_2) +% | +% +------------------------------------------------------------------------+ + +\input{Pm_with_intersections_2_ref/intro.tex} +\input{Pm_with_intersections_2_ref/Pmwx.tex} +\input{Pm_with_intersections_2_ref/Pmwx_traits.tex} +\input{Pm_with_intersections_2_ref/Pmwx_change_notification.tex} diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/main.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/main.tex new file mode 100644 index 00000000000..ec0aee8af49 --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/main.tex @@ -0,0 +1,4 @@ +\input{pmwx} +% we temporarily include the reference pages in the regular manual +% later this input will be in the reference wrapper +\input{Pm_with_intersections_2_ref/pmwx_ref} diff --git a/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/pmwx.tex b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/pmwx.tex new file mode 100644 index 00000000000..9e1055bc83b --- /dev/null +++ b/Packages/Arrangement/doc_tex/basic/Pm_with_intersections_2/pmwx.tex @@ -0,0 +1,128 @@ +%+------------------------------------------------------- +%| CGAL Manual : pmwx.tex +%| +%| Soon to be split into User and Reference Manuals +%+-------------------------------------------------------- +%| update log +%| +%| 04 May 2001 - Eyal Flato +%| Created from arr documentation +%| +%-------------------------------------------------------- + +%\documentclass[12pt]{book} +%\usepackage{graphics, amssymb,epsfig} +%\usepackage{cprog,cc_manual} +% +%\def\Ipe#1{\def\IPEfile{#1}\input{#1}} +% +%\setlength{\evensidemargin}{.0in} +%\setlength{\oddsidemargin}{-0.3in} +%\setlength{\textwidth}{6.8in} +%\setlength{\textheight}{8in} +% +%\renewcommand{\Re}{{\rm I\!\hspace{-0.025em} R}} +%\newcommand{\normal}[1]{\eta_{#1}} +%\newtheorem{theorem}{Theorem}[section] % section +%\newtheorem{remark}[theorem]{Remark} +%\newtheorem{lemma}[theorem]{Lemma} +%\newenvironment{dfn}{{\vspace*{1ex} \noindent \bf Definition }}{\vspace*{1ex}} +%\newcommand{\bigdef}[2]{\index{#1}\begin{dfn} {\rm #2} \end{dfn}} +%\newenvironment{proof}{{\em Proof:}}{\hfill{\hfill\rule{2mm}{2mm}}} +% +%\newcommand{\comment}[1]{{\sf * #1 *}} +%\newcommand{\ncomment}[1]{\noindent {\sf * #1 * }} +% +%\newtheorem{defn}[theorem]{Definition} +%\newcommand{\intsupplanes}{P} +%\def\C{{\cal C}} +%\def\G{{\cal G}} +%\def\F{{\cal F}} +%\def\I{{\cal I}} +%\def\U{{\cal U}} +%\def\M{{\cal M}} +%\def\eps{{\varepsilon}} +%\def\bd{{\partial}} +%\def\dm{{\cal D}} +% +% Title +%\title{CGAL Arrangement Specifications} +% +%\date{ \today } +% +%\begin{document} +% +%\tableofcontents +% +%\maketitle +\chapter{2D Planar Maps with Intersections} \label{I1_ChapterPmwx} + +\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'$. + +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. + + +\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. + + + +%****************************************************************************** + + + +\section{Example Programs} +%--------------------------------------------------- +\subsection{Simple Example of a Segment Planar Map with Intersections} +\label{ssec:example1} +The following example demonstrates the construction of an +$X$-shaped planar subdivision out of two intersecting segments. +We output the coordinates of the halfedges of the constructed +subdivision. + +\ccIncludeExampleCode{Pm_with_intersections/example1.C} + +The output of the program looks like this: +\begin{verbatim} +Inserting the segments: +0 0 1 1 +0 1 1 0 + +Edges of the planar map: +0 0 --- 0.5 0.5 +0.5 0.5 --- 1 1 +0 1 --- 0.5 0.5 +1 0 --- 0.5 0.5 +\end{verbatim} + + + + +% EOF ------------------------------------------------------------------------80