changes according to Sebastien

This commit is contained in:
Michael Hemmer 2013-11-07 18:26:03 +01:00
parent 83deb3ae8c
commit bb7ff87c8d
6 changed files with 41 additions and 39 deletions

View File

@ -6,7 +6,7 @@ namespace CGAL {
a polygon that may have holes.
\details The class template comprises the implementation of the algorithm of Takao Asano and Tetsuo Asano \cite aaghi-vpsesp-85. The algorithm, as the name of the class template suggests, requires preprocessing.
The preprocessing takes \f$ O(n^2)\f$ time and \f$ O(n^2)\f$ space. With the help of preprocessing, the query time is reduced to \f$O(n)\f$.
The preprocessing takes \f$ O(n^2)\f$ time and \f$ O(n^2)\f$ space, which reduces the query time to \f$O(n)\f$.
\tparam Arrangement_2 is the type of input polygonal environment and output visibility polygon.
@ -121,25 +121,25 @@ Access to the attached arrangement
const Input_arrangement_2& arr() const;
/*!
Computes the visibility region for the given query point `q` in the
Computes the visibility region of `q` in the
face `f` of the arrangement that is attached to the visibility object.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param f is the face of the arrangement in which the visibility region is computed
\param out_arr is the output arrangement
\pre `f` is a face of `this->arr()` and represents a valid polygon.
\pre `f` is a face of `arr()` and represents a valid polygon.
\pre `q` is in the interior of the given face `f`
\return a handle to the face in `out_arr` that represents the visibility region
*/
typename Output_arrangement_2::Face_handle compute_visibility(const Point_2& q, const Face_const_handle f, Output_arrangement_2& out_arr) const;
/*!
Computes the visibility region for the given query point `q` that is on `e`.If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
Computes the visibility region of `q` that is on `e`. If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param e the halfedge on which `q` is located
\param out_arr is the output arrangement
\pre `e` is a halfedge of `this->arr()`
\pre `e` is a halfedge of `arr()`
\pre `q` is on `e`
\pre `q` equals to `e->target()->point()` if `q` is an endpoint of `e`
\return a handle to the face in `out_arr` that represents the visibility region

View File

@ -115,25 +115,25 @@ Access to the attached arrangement
const Input_arrangement_2& arr() const;
/*!
Computes the visibility region for the given query point `q` in the
Computes the visibility region of `q` in the
face `f` of the arrangement that is attached to the visibility object.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param f is the face of the arrangement in which the visibility region is computed
\param out_arr is the output arrangement
\pre `f` is a face of `this->arr()` and represents a valid polygon.
\pre `f` is a face of `arr()` and represents a valid polygon.
\pre `q` is in the interior of the given face `f`
\return a handle to the face in `out_arr` that represents the visibility region
*/
typename Output_arrangement_2::Face_handle compute_visibility(const Point_2& q, const Face_const_handle f, Output_arrangement_2& out_arr) const;
/*!
Computes the visibility region for the given query point `q` that is on `e`.If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
Computes the visibility region of `q` that is on `e`. If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param e the halfedge on which `q` is located
\param out_arr is the output arrangement
\pre `e` is a halfedge of `this->arr()`
\pre `e` is a halfedge of `arr()`
\pre `q` is on `e`
\pre `q` equals to `e->target()->point()` if `q` is an endpoint of `e`
\return a handle to the face in `out_arr` that represents the visibility region

View File

@ -5,17 +5,15 @@ namespace CGAL {
\brief This class is a model of the concept `Visibility_2` can answer visibility queries within
a simple polygon with no holes.
\details This class implements the algorithm of B.Joe and R.B.Simpson \cite bjrb-clvpa-87 to
obtain the visibility region, based on a scan of the boundary of the polygon and the notion
of angular displacement as a control variable. The algorithm is a modification and extension
of the linear time algorithm of Lee \cite dtl-voasp-83. It computes the visibility region from a
viewpoint that is in the interior or on the boundary of the polygon.
\details This class implements the algorithm of B.Joe and R.B.Simpson \cite bjrb-clvpa-87.
The algorithm is a modification and extension of the linear time algorithm of Lee \cite dtl-voasp-83.
It computes the visibility region from a viewpoint that is in the interior or on the boundary of the polygon.
The algorithm uses a stack to manipulate the vertices, and ultimately yields the visibility
region. For each scanned edge, at most 2 points are pushed onto the stack. Overall, it
will have at most 2\f$ n \f$ points pushed and popped, thus the time and space complexities of the
algorithm are \f$ O(n) \f$ even in case of degeneracies such as needles, where n is the number of
the vertices of the polygon.
While scanning the boundary the algorithm uses a stack to manipulate the vertices, and ultimately
yields the visibility region. For each scanned edge, at most 2 points are pushed onto the stack.
Overall, at most 2\f$ n \f$ points are pushed or popped. Thus, the time and space complexities of the
algorithm are \f$ O(n) \f$ even in case of degeneracies such as needles, where \f$ n \f$
is the number of the vertices of the polygon.
\tparam Arrangement_2 is the type of input polygonal environment and output visibility region.
@ -128,13 +126,13 @@ Access to the attached arrangement
const Input_arrangement_2& arr() const;
/*!
Computes the visibility region for the given query point `q` in the
Computes the visibility region of `q` in the
face `f` of the arrangement that is attached to the visibility object.
The visibility region of `q` will be stored in `out_arr`.
\param out_arr is the output arrangement
\param q is the query point
\param f is the face of the arrangement in which the visibility region is computed
\pre `f` is a face of `this->arr()` and represents a valid polygon.
\pre `f` is a face of `arr()` and represents a valid polygon.
\pre `q` is in the interior of the given face `f`
\return a handle to the face in `out_arr` that represents the visibility region
*/
@ -142,12 +140,12 @@ The visibility region of `q` will be stored in `out_arr`.
/*!
Computes the visibility region for the given query point `q` that is on `e`.If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
Computes the visibility region of `q` that is on `e`. If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param e the halfedge on which `q` is located
\param out_arr is the output arrangement
\pre `e` is a halfedge of `this->arr()`
\pre `e` is a halfedge of `arr()`
\pre `q` is on `e`
\pre `q` equals to `e->target()->point()` if `q` is an endpoint of `e`
\return a handle to the face in `out_arr` that represents the visibility region

View File

@ -125,13 +125,13 @@ Access to the attached arrangement
const Input_arrangement_2& arr() const;
/*!
Computes the visibility region for the given query point `q` in the
Computes the visibility region of `q` in the
face `f` of the arrangement that is attached to the visibility object.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param f is the face of the arrangement in which the visibility region is computed
\param out_arr is the output arrangement
\pre `f` is a face of `this->arr()` and represents a valid polygon.
\pre `f` is a face of `arr()` and represents a valid polygon.
\pre `q` is in the interior of the given face `f`
\return a handle to the face in `out_arr` that represents the visibility region
*/
@ -139,12 +139,12 @@ The visibility region of `q` will be stored in `out_arr`.
/*!
Computes the visibility region for the given query point `q` that is on `e`.If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
Computes the visibility region of `q` that is on `e`. If `q` is an interior point of `e`, the computed visibility region is restricted to the halfplane indicated by `e`. If `q` is an endpoint of `e`, the visibility region is restricted by `e` and its next.
The visibility region of `q` will be stored in `out_arr`.
\param q is the query point
\param e the halfedge on which `q` is located
\param out_arr is the output arrangement
\pre `e` is a halfedge of `this->arr()`
\pre `e` is a halfedge of `arr()`
\pre `q` is on `e`
\pre `q` equals to `e->target()->point()` if `q` is an endpoint of `e`
\return a handle to the face in `out_arr` that represents the visibility region

View File

@ -9,9 +9,8 @@
\cgalPkgPicture{visibility-teaser-thumbnail.png}
\cgalPkgSummaryBegin
\cgalPkgAuthors{Michael Hemmer, Kan Huang, Francisc Bungiu}
\cgalPkgDesc{This package provides functionality to compute the visibility area
of a point within polygonal regions in two dimensions. The 2D Visibility component offers
several variants for visibility computation amidst linear geometry in the plane.}
\cgalPkgDesc{This package provides several variants to compute
the visibility area of a point within polygonal regions in two dimensions.}
\cgalPkgManuals{Chapter_2D_Visibility_Computation,PkgVisibility_2}
\cgalPkgSummaryEnd
\cgalPkgShortInfoBegin

View File

@ -14,14 +14,19 @@ namespace CGAL {
This package provides functionality to compute the visibility region within polygonal regions in two dimensions.
Using the terminology of the package \ref PkgBooleanSetOperations2Summary, we expect the input polygon
\f$ P \f$ to be a valid polygon or a valid polygon with holes,
that is, we expect \f$ P \f$ to be closed (\f$\partial P \subset P\f$) and each boundary loop
(only one outer boundary loop in case of no holes) to be relatively simple.
\f$ P \f$ to be a valid polygon or a valid polygon with holes (definition see below).
Given two points \f$ p \f$ and \f$ q \f$ in \f$ P \f$, they are said to be
visible to each other iff the segment \f$ pq \subset P \f$, note that \f$\partial P \subset P\f$.
For a query point \f$ q \in P \f$, the set of points that are visible from \f$ q \f$ is defined as the visibility
region of \f$ q \f$, denoted by \f$ V_q \f$
Definition [Valid Polygon]:
A polygon \f$ P \f$ is valid if \f$ P \f$ is closed (\f$\partial P \subset P\f$)
and each boundary loop (only one outer boundary loop in case of no holes) is simple.
See also \ref PkgBooleanSetOperations2Summary.
\subsection visibility_2_degeneracies Degeneracies and Regularization
\cgalFigureBegin{definition-fig, example1.png}
@ -60,8 +65,8 @@ the means to define a family of algorithms, each implemented by a separate class
algorithms are made interchangeable, letting the algorithm in use vary according to the user choice.} for answering queries.
Similar to the point-location case, some of the strategies require preprocessing. Thus, before a visibility object is used
to answer visibility queries, it must be attached to an arrangement object (subsequently also referred to as the environment).
Since a viability object observers changes to the attached arrangement it is possible to
also modify the arrangement after attaching the visibility object.
Afterwards the visibility object observers changes to the attached arrangement.
Thus, it is possible to modify the arrangement after attaching the visibility object.
However, this should be avoided as this also requires an update of the auxiliary
data structures in the attached object.
@ -77,10 +82,10 @@ The package provides the following models of the `Visibility_2` concept:
Class | Function | Preprocessing | Query |Algorithm
-------------------------------|-----------------------------------------------------|-------------------------------|-----------------------------------|-------------------------------
`Simple_polygon_visibility_2` | simple valid polygons | No |\f$ O(n) \f$ time and \f$ O(n) \f$ space | paper of B.Joe and R.B.Simpson \cite bjrb-clvpa-87
`Rotational_sweep_visibility_2` | valid polygons with holes | No | \f$ O(n\log n) \f$ time and \f$ O(n) \f$ space | paper of T.Asano \cite ta-aeafvpprh-85
`Triangular_expansion_visibility_2` | valid polygons with holes | \f$ O(n) \f$ time and \f$ O(n) \f$ space | \f$ O(nh) \f$ time and \f$ O(n) \f$ space. | reference is unknown.
`Preprocessed_rotational_sweep_visibility_2` | valid polygons with holes | \f$ O(n^2) \f$ time and \f$ O(n^2) \f$ space | \f$ O(n) \f$ time and \f$ O(n) \f$ space | paper of Takao Asano, Tetsuo Asano etc \cite aaghi-vpsesp-85
`Simple_polygon_visibility_2` | simple valid polygons | No |\f$ O(n) \f$ time and \f$ O(n) \f$ space | B.Joe and R.B.Simpson \cite bjrb-clvpa-87
`Rotational_sweep_visibility_2` | valid polygons with holes | No | \f$ O(n\log n) \f$ time and \f$ O(n) \f$ space | T.Asano \cite ta-aeafvpprh-85
`Triangular_expansion_visibility_2` | valid polygons with holes | \f$ O(n) \f$ time and \f$ O(n) \f$ space | \f$ O(nh) \f$ time and \f$ O(n) \f$ space. | new
`Preprocessed_rotational_sweep_visibility_2` | valid polygons with holes | \f$ O(n^2) \f$ time and \f$ O(n^2) \f$ space | \f$ O(n) \f$ time and \f$ O(n) \f$ space | Takao Asano, Tetsuo Asano etc \cite aaghi-vpsesp-85
Where \f$ n \f$ is the number of vertices of \f$ f \f$ and \f$ h \f$ is the number of holes+1.