mirror of https://github.com/CGAL/cgal
Fixed documentation
This commit is contained in:
parent
fb1d6dea5a
commit
391c1a22ff
|
|
@ -109,7 +109,9 @@ general polygons, where the edges of a general polygon may be
|
||||||
general \f$ x\f$-monotone curves, rather than being simple line segments.
|
general \f$ x\f$-monotone curves, rather than being simple line segments.
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecpolygon_validation Conditions for Valid Polygons
|
\subsection bso_ssecpolygon_validation Conditions for Valid Polygons
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
In our context, a polygon must uphold the following conditions:
|
In our context, a polygon must uphold the following conditions:
|
||||||
|
|
||||||
|
|
@ -119,7 +121,10 @@ In our context, a polygon must uphold the following conditions:
|
||||||
<LI><I>Orientation</I> - the polygon's outer boundary must be <I>counter-clockwise oriented</I>.
|
<LI><I>Orientation</I> - the polygon's outer boundary must be <I>counter-clockwise oriented</I>.
|
||||||
</OL>
|
</OL>
|
||||||
|
|
||||||
\subsection bso_ssecpolygon_with_holes_validation Conditions for Valid Polygons with Holes
|
<!----------------------------------------------------------------------------->
|
||||||
|
\subsection bso_ssecpolygon_with_holes_validation Conditions for Valid
|
||||||
|
Polygons with Holes
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
In our context, a polygon with holes must uphold the following conditions:
|
In our context, a polygon with holes must uphold the following conditions:
|
||||||
|
|
||||||
|
|
@ -174,7 +179,9 @@ that accept two `Polygon_2` objects as their input. We explain how
|
||||||
these functions should be used through several examples in the
|
these functions should be used through several examples in the
|
||||||
following sections.
|
following sections.
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection Boolean_set_operations_2ASimpleExample A Simple Example
|
\subsection Boolean_set_operations_2ASimpleExample A Simple Example
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
\image html triangles.png
|
\image html triangles.png
|
||||||
\image latex triangles.png
|
\image latex triangles.png
|
||||||
|
|
@ -193,7 +200,9 @@ which is located in the header file `print_utils.h`.
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/do_intersect.cpp}
|
\cgalExample{Boolean_set_operations_2/do_intersect.cpp}
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecpolygons_with_holes Polygons with Holes
|
\subsection bso_ssecpolygons_with_holes Polygons with Holes
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
\cgalFigureBegin{figsimple,simple.png}
|
\cgalFigureBegin{figsimple,simple.png}
|
||||||
Operations on simple polygons. (a) The union of two polygons, resulting in a point set whose outer boundary is defined by a simple polygon and contains a polygonal hole in its interior. (b) The intersection (darkly shaded) of two polygons (lightly shaded), resulting in two disjoint polygons. (c) The complement (darkly shaded) of a simple polygon (lightly shaded).
|
Operations on simple polygons. (a) The union of two polygons, resulting in a point set whose outer boundary is defined by a simple polygon and contains a polygonal hole in its interior. (b) The intersection (darkly shaded) of two polygons (lightly shaded), resulting in two disjoint polygons. (c) The complement (darkly shaded) of a simple polygon (lightly shaded).
|
||||||
|
|
@ -309,7 +318,9 @@ of several disconnected components, they all accept an output iterator
|
||||||
output polygons to its associated container.
|
output polygons to its associated container.
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
\subsection bso_sssecex_simple_bops Example - Joining and Intersecting Simple Polygons
|
<!----------------------------------------------------------------------------->
|
||||||
|
\subsection bso_sssecex_simple_bops Joining and Intersecting Simple Polygons
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
The following example demonstrates the usage of the free functions
|
The following example demonstrates the usage of the free functions
|
||||||
`join()` and `intersection()` for computing the union and the
|
`join()` and `intersection()` for computing the union and the
|
||||||
|
|
@ -320,16 +331,21 @@ the header file `print_utils.h` under the examples folder.
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/simple_join_intersect.cpp}
|
\cgalExample{Boolean_set_operations_2/simple_join_intersect.cpp}
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_sssecpwh_bops Operations on Polygons with Holes
|
\subsection bso_sssecpwh_bops Operations on Polygons with Holes
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
We have demonstrated that free functions that perform boolean set operations on simple polygons may output polygons with holes. In addition to these functions, the Boolean set-operations package provides the following overridden free functions that accept
|
We have demonstrated that free functions that perform Boolean set
|
||||||
`General_polygon_with_holes_2` objects as their input -
|
operations on simple polygons may output polygons with holes. In
|
||||||
`complement()`, `intersection()`, `join()`, `difference()`,
|
addition to these functions, the Boolean set-operations package
|
||||||
`symmetric_difference()` and `do_intersect()` The prototypes of
|
provides the following overridden free functions that accept
|
||||||
most functions is the same as of their simpler counterparts that operate
|
`General_polygon_with_holes_2` objects as their input: `complement()`,
|
||||||
on simple polygons. The only exception is `complement(P, oi)`, which
|
`intersection()`, `join()`, `difference()`, `symmetric_difference()`,
|
||||||
outputs a range of polygons with holes that represents the complement
|
and `do_intersect()` The prototypes of most functions are the same as
|
||||||
of the polygon with holes \f$ P\f$.
|
of their simpler counterparts that operate on simple polygons. The
|
||||||
|
only exception is `complement(P, oi)`, which outputs a range of
|
||||||
|
polygons with holes that represents the complement of the polygon with
|
||||||
|
holes \f$ P\f$.
|
||||||
|
|
||||||
\image html symm_diff.png
|
\image html symm_diff.png
|
||||||
\image latex symm_diff.png
|
\image latex symm_diff.png
|
||||||
|
|
@ -354,61 +370,71 @@ vertical walls).
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/connect_polygon.cpp}
|
\cgalExample{Boolean_set_operations_2/connect_polygon.cpp}
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecmain_component Operating on Polygon Sets
|
\subsection bso_ssecmain_component Operating on Polygon Sets
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
We argue that the result of a regularized operations on two polygons
|
The result of a regularized operation on two polygons (or polygons
|
||||||
(or polygons with holes) \f$ P\f$ and \f$ Q\f$ is typically a collection of
|
with holes) \f$ P\f$ and \f$ Q\f$ is typically a collection of several
|
||||||
several disconnected polygons with holes. It is only natural to
|
disconnected polygons with holes. It is only natural to represent such
|
||||||
represent such a collection in terms of a class, making it possible to
|
a collection in terms of a class, making it possible to operate on the
|
||||||
operate on the set resulting from computing, for example, \f$ P \setminus
|
set resulting from computing, for example, \f$ P \setminus Q\f$.
|
||||||
Q\f$.
|
|
||||||
|
|
||||||
A central component in the Boolean set-operations package is the
|
A central component in the Boolean set-operations package is the
|
||||||
`Polygon_set_2<Kernel, Container, Dcel>` class-template. An instance of
|
`Polygon_set_2<Kernel, Container, Dcel>` class-template. An instance
|
||||||
this class represents a point set formed by the collection of several
|
of this class represents a point set formed by the collection of
|
||||||
disconnected polygons with holes. It employs the `Arrangement_2` class
|
several disconnected polygons with holes. It employs the
|
||||||
to represent this point set in the plane as a planar arrangement; see
|
`Arrangement_2` class to represent this point set in the plane as a
|
||||||
Chapter \ref chapterArrangement_on_surface_2 "2D Arrangements". The instantiated `Dcel`
|
planar arrangement; see Chapter \ref chapterArrangement_on_surface_2
|
||||||
type is used to represent the underlying internal arrangement. It must model
|
"2D Arrangements". The instantiated `Dcel` type is used to represent
|
||||||
the concept `GeneralPolygonSetDcel`, and defaults to `Gps_default_dcel`.
|
the underlying internal arrangement. It must model the concept
|
||||||
You can override this default, with a different <span class="textsc">Dcel</span> class, typically
|
`GeneralPolygonSetDcel`, and defaults to `Gps_default_dcel`. You can
|
||||||
an extension of the default. Overriding the default is necessary only if
|
override this default, with a different <span
|
||||||
you intend to obtain the underlying internal arrangement and process it further.
|
class="textsc">Dcel</span> class, typically an extension of the
|
||||||
|
default. Overriding the default is necessary only if you intend to
|
||||||
|
obtain the underlying internal arrangement and process it further.
|
||||||
|
|
||||||
An instance \f$ S\f$ of a `Polygon_set_2` class usually represents
|
An instance \f$ S\f$ of a `Polygon_set_2` class usually represents the
|
||||||
the result of a sequence of operations that were applied on some input
|
result of a sequence of operations that were applied on some input
|
||||||
polygons. The representation of \f$ S\f$ is unique, regardless of the particular
|
polygons. The representation of \f$ S\f$ is unique, regardless of the
|
||||||
sequence of operations that were applied in order to arrive at it.
|
particular sequence of operations that were applied in order to arrive
|
||||||
|
at it.
|
||||||
|
|
||||||
In addition, a polygon-set object can be constructed from a single
|
In addition, a polygon-set object can be constructed from a single
|
||||||
polygon object or from a polygon-with-holes object. Once constructed,
|
polygon object or from a polygon-with-holes object. Once constructed,
|
||||||
it is possible to insert new polygons (or polygons with holes)
|
it is possible to insert new polygons (or polygons with holes) into
|
||||||
into the set using the `insert()` method, as long as the inserted
|
the set using the `insert()` method, as long as the inserted polygons
|
||||||
polygons and the existing polygons in the set are disjoint.
|
and the existing polygons in the set are disjoint. The
|
||||||
The `Polygon_set_2` class also provides access functions for
|
`Polygon_set_2` class also provides access functions for obtaining the
|
||||||
accessing the polygons with holes it contains, and a few queries. The
|
polygons with holes it contains, and a few queries. An important query
|
||||||
most important query is `S.oriented_side(q)`, which determined
|
is `S.oriented_side(q)`, which determined whether the query point \f$
|
||||||
whether the query point \f$ q\f$ is contained in the interior of the set
|
q\f$ is contained in the interior of the set \f$ S\f$, lies on the
|
||||||
\f$ S\f$, lies on the boundary of the set, or neither.
|
boundary of the set, or neither.
|
||||||
|
|
||||||
The `General_polygon_set_2` class defines the predicate
|
Similar to the `Polygon_set_2` class template, which applies to linear
|
||||||
`do_intersect()` and the methods `complement()`, `intersection()`,
|
polygons (or polygons with holes), the `General_polygon_set_2` class
|
||||||
`join()`, `difference()` and `symmetric_difference()` as member
|
applies to general polygons (or general polygons with holes). Each of
|
||||||
functions. The operands to these functions may be simple polygons
|
these class templates defines the predicate `do_intersect()` and the
|
||||||
(`Polygon_2` object), polygons with holes
|
methods `complement()`, `intersection()`, `join()`, `difference()` and
|
||||||
(`General_polygon_with_holes_2` objects), or polygon sets
|
`symmetric_difference()` as member functions. The operands to these
|
||||||
(`General_polygon_set_2` objects). Thus, each of the function
|
functions may be simple polygons (`Polygon_2` or `General_polygon_2`
|
||||||
mentioned above is actually realized by a set overriding member
|
objects), polygons with holes (`Polygon_with_holes_2` or
|
||||||
functions.
|
`General_polygon_with_holes_2` objects), or polygon sets
|
||||||
|
(`cpolygon_set_2` or `General_polygon_set_2` objects). Each of the
|
||||||
|
aforementioned free functions is actually realized by a set overriding
|
||||||
|
member function.
|
||||||
|
|
||||||
Member functions of the `General_polygon_set_2` that perform
|
member functions of the `Polygon_set_2`
|
||||||
Boolean set-operations come in two flavors: for example, `S.join(P, Q)`
|
(resp. `General_polygon_set_2`) that perform Boolean set-operations
|
||||||
computes the union of \f$ P\f$ and \f$ Q\f$ and assigned the result to \f$ S\f$, while
|
come in two flavors: for example, `S.join(P, Q)` computes the union of
|
||||||
|
\f$ P\f$ and \f$ Q\f$ and assigned the result to \f$ S\f$, while
|
||||||
`S.join(P)` performs the operation \f$ S \longleftarrow S \cup P\f$.
|
`S.join(P)` performs the operation \f$ S \longleftarrow S \cup P\f$.
|
||||||
Similarly, `S.complement(P)` sets \f$ S\f$ to be the complement of \f$ P\f$,
|
Similarly, `S.complement(P)` sets \f$ S\f$ to be the complement of \f$
|
||||||
while `S.complement()` simply negates the set \f$ S\f$.
|
P\f$, while `S.complement()` assigns \f$ S\f$ with its complement.
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_sssecsequence A Sequence of Set Operations
|
\subsection bso_sssecsequence A Sequence of Set Operations
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
The free functions reviewed in Section \ref bso_ssecpolygons_with_holes
|
The free functions reviewed in Section \ref bso_ssecpolygons_with_holes
|
||||||
serve as a wrapper for the polygon-set class, and are only provided for
|
serve as a wrapper for the polygon-set class, and are only provided for
|
||||||
|
|
@ -437,7 +463,9 @@ interior of this hole.
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/sequence.cpp}
|
\cgalExample{Boolean_set_operations_2/sequence.cpp}
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecinsert_ni Inserting Non Intersecting Polygons
|
\subsection bso_ssecinsert_ni Inserting Non Intersecting Polygons
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
If you want to compute the union of a polygon \f$ P\f$ (\f$ P\f$ may be a simple
|
If you want to compute the union of a polygon \f$ P\f$ (\f$ P\f$ may be a simple
|
||||||
polygon or a polygon-with-holes object) with a general-polygon set
|
polygon or a polygon-with-holes object) with a general-polygon set
|
||||||
|
|
@ -470,7 +498,9 @@ range of polygons. When a range of polygons are inserted into a
|
||||||
polygon set \f$ S\f$, all the polygons in the range and the polygons represented
|
polygon set \f$ S\f$, all the polygons in the range and the polygons represented
|
||||||
by \f$ S\f$ must be pairwise disjoint in their interiors.
|
by \f$ S\f$ must be pairwise disjoint in their interiors.
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecagg_ops Performing Aggregated Operations
|
\subsection bso_ssecagg_ops Performing Aggregated Operations
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
There are a few options to compute the union of a set of polygons
|
There are a few options to compute the union of a set of polygons
|
||||||
\f$ P_1, \ldots P_m\f$. You can do it incrementally as follows. At each step
|
\f$ P_1, \ldots P_m\f$. You can do it incrementally as follows. At each step
|
||||||
|
|
@ -500,11 +530,11 @@ arrangement. Similarly, it is also possible to aggregately compute the
|
||||||
intersection \f$ \bigcap_{i=1}^{m}{P_i}\f$ of a set of input polygons.
|
intersection \f$ \bigcap_{i=1}^{m}{P_i}\f$ of a set of input polygons.
|
||||||
|
|
||||||
Our package provides the free overloaded functions `join()` and
|
Our package provides the free overloaded functions `join()` and
|
||||||
`intersection()` that aggregately compute the union and the intersection
|
`intersection()` that aggregately compute the union and the
|
||||||
of a range of input polygons. There is no restriction on the polygons in the
|
intersection of a range of input polygons. There is no restriction on
|
||||||
range - naturally, they may intersect each other.
|
the polygons in the range; naturally, they may intersect each other.
|
||||||
The package provides the overloaded free function
|
The package provides the overloaded free function \ref do_intersect
|
||||||
\ref do_intersect "do_intersect(begin, end)" that determines whether the polygons in the
|
"do_intersect(begin, end)" that determines whether the polygons in the
|
||||||
range defined by the two input iterators `[begin, end)` intersect.
|
range defined by the two input iterators `[begin, end)` intersect.
|
||||||
|
|
||||||
The class `General_polygon_set_2` also provides equivalent member
|
The class `General_polygon_set_2` also provides equivalent member
|
||||||
|
|
@ -518,49 +548,90 @@ Polygon_set_2 S;
|
||||||
S.join (begin, end);
|
S.join (begin, end);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssectraits_sel Traits Selection
|
\subsection bso_ssectraits_sel Traits Selection
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
When calling boolean set operations on `Polygon_2` or
|
All the free function-templates that apply Boolean set operations
|
||||||
`Polygon_with_holes_2` objects, a `General_polygon_set_2` is
|
accept an optional traits argument; see next Section for more
|
||||||
instantiated internally. This polygon set is templated by a traits
|
information. If a traits class is not provided, a default one that can
|
||||||
class that is automatically deduced from the polygon type and that can
|
handle the type of the curves that comprise the boundaries of the
|
||||||
either be based on:
|
input polygons is selected. You somwhow can influence this selection
|
||||||
|
using a template parameter as described below.
|
||||||
|
|
||||||
- `Arr_polyline_traits_2`: in that case, the polygon is first
|
The set of free function-templates that handle (linear) polygons
|
||||||
decomposed into a set of \f$ x\f$-monotone polylines. This is the
|
include overloaded versions that are parameterized by the template
|
||||||
default behavior.
|
parameter `UsePolylines`. For each such function template the
|
||||||
|
`UsePolylines` template parameter determmines whether to treat the
|
||||||
|
boundary of each input (linear) polygon as a cyclic sequence of single
|
||||||
|
(\f$x\f$-monotone) segments or as a cyclic sequence of
|
||||||
|
(\f$x\f$-monotone) polylines. By default, `UsePolylines` is set to
|
||||||
|
`CGAL::Tag_true`, which implies that the boundary of the each input
|
||||||
|
(linear) polygon is treated as a cyclic sequence of (\f$x\f$-monotone)
|
||||||
|
polylines. In most cases this behaviour is superior (that is, less
|
||||||
|
time-consuming) because the number of events handled as part of the
|
||||||
|
execution of the plane-sweep algorithm is reduced. In cases where the
|
||||||
|
boundaries of the input polygons frequently intersect, treating them
|
||||||
|
as polylines may become less efficient. In these cases substitute the
|
||||||
|
`UsePolylines` template parameter with `CGAL::Tag_false` to restore
|
||||||
|
the original behaviour (where the boundary of each input linear
|
||||||
|
polygon is treated as a cyclic sequence of single \f$x\f$-monotone
|
||||||
|
segments).
|
||||||
|
|
||||||
- `Arr_segment_traits_2`: in that case, every edge of the polygon is
|
\cgalAdvancedBegin
|
||||||
considered as a single \f$ x\f$-monotone curve.
|
|
||||||
|
|
||||||
The traits are selected via a template parameter `UsePolylineTraits`
|
A Boolean set operation can be apppplied on general polygons (or
|
||||||
which is `CGAL::Tag_true` by default: the polyline version is
|
general polygons with holes) directly using an instance of the class
|
||||||
generally significantly faster than the segment version as considering
|
template `General_polygon_set_2` or by using a free function, which
|
||||||
\f$ x\f$-monotone polylines reduces the number of events of the
|
internally uses an instance of the class template
|
||||||
sweep-line algorithm.
|
`General_polygon_set_2`. Similarly, a Boolean set operation can be
|
||||||
|
apppplied on linear polygons (or linear polygons with holes) directly
|
||||||
|
using an instance of the class template `Polygon_set_2` or by using a
|
||||||
|
free function, which internally uses an instance of the class template
|
||||||
|
`Polygon_set_2` by default. An instance of the `Polygon_set_2` class
|
||||||
|
template treats every edge of the polygon as a single
|
||||||
|
(\f$x\f$-monotone) segment, as it utilizes, in turn, the
|
||||||
|
`Arr_segment_traits_2` class template; see Section \ref
|
||||||
|
arr_ssectr_segs in the 2D Arrangements package.
|
||||||
|
|
||||||
Nevertheless, in some specific cases, users can find the segment
|
If the `UsePolylines` template parameter is substitited with
|
||||||
version to be faster: if a \f$ x\f$-monotone polyline from an input
|
`CGAL::Tag_true` the following occurs:
|
||||||
polygon intersects many times another \f$ x\f$-monotone polyline from
|
|
||||||
another input polygon, then it becomes counter-productive to consider
|
|
||||||
polylines instead of segments. In that case, users can fallback to the
|
|
||||||
segment variant by using `CGAL::Tag_false` for the `UsePolylineTraits`
|
|
||||||
template parameter.
|
|
||||||
|
|
||||||
|
<ol>
|
||||||
|
|
||||||
|
<li>Instead of using an instance of the `Polygon_set_2` class
|
||||||
|
template, as described above, an instance of the
|
||||||
|
`General_polygon_set_2` class template is used, which utilzes the
|
||||||
|
`Arr_polyline_traits_2` class template; see Section \ref
|
||||||
|
arr_ssectr_polylines in the 2D Arrangements package.
|
||||||
|
|
||||||
|
<li>Each input linear polygon (resp. linear polygon with holes) is
|
||||||
|
converted into a general polygon (resp. general polygon with holes)
|
||||||
|
bounded by \f$x\f$-monotone polylines. Then, the resulting generl
|
||||||
|
polygons, which are also bounded by \f$x\f$-monotone polylines, are
|
||||||
|
converted back to standard polygons.
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
\cgalAdvancedEnd
|
||||||
|
|
||||||
|
<!--=========================================================================-->
|
||||||
\section bso_secbso_gen Boolean Set-Operations on General Polygons
|
\section bso_secbso_gen Boolean Set-Operations on General Polygons
|
||||||
|
<!--=========================================================================-->
|
||||||
|
|
||||||
\image html general_polygon.png
|
\image html general_polygon.png
|
||||||
\image latex general_polygon.png
|
\image latex general_polygon.png
|
||||||
|
|
||||||
In previous sections only ordinary (linear) polygons were dealt with. Namely, closed
|
In previous sections only ordinary (linear) polygons were dealt
|
||||||
point sets bounded by piecewise linear curves. The Boolean
|
with. Namely, closed point sets bounded by piecewise linear
|
||||||
set-operations package allows a more general geometric mapping of the
|
curves. The Boolean set-operations package allows a more general
|
||||||
polygon edges. The operations provided by the package operate on point
|
geometric mapping of the polygon edges. The operations provided by the
|
||||||
sets bounded by \f$ x\f$-monotone segments of general curves (e.g., conic
|
package operate on point sets bounded by \f$ x\f$-monotone segments of
|
||||||
arcs and segments of polynomial functions). For example, the point set
|
general curves (e.g., conic arcs and segments of polynomial
|
||||||
depicted on the right is a general polygon bounded by two \f$ x\f$-monotone
|
functions). For example, the point set depicted on the right is a
|
||||||
circular arcs that correspond to the lower half and the upper half of
|
general polygon bounded by two \f$ x\f$-monotone circular arcs that
|
||||||
a circle, respectively.
|
correspond to the lower half and the upper half of a circle,
|
||||||
|
respectively.
|
||||||
|
|
||||||
Using the topological terminology, a general polygon can represent any
|
Using the topological terminology, a general polygon can represent any
|
||||||
simply-connected point set whose boundary is a strictly simple curve.
|
simply-connected point set whose boundary is a strictly simple curve.
|
||||||
|
|
@ -600,18 +671,20 @@ concepts.
|
||||||
The central class-template `General_polygon_set_2<Traits,Dcel>` is
|
The central class-template `General_polygon_set_2<Traits,Dcel>` is
|
||||||
used to represent point sets that are comprised of a finite number of
|
used to represent point sets that are comprised of a finite number of
|
||||||
pairwise disjoint general polygons with holes, and provides various
|
pairwise disjoint general polygons with holes, and provides various
|
||||||
Boolean set-operations on such sets. It is parameterized by a <I>traits</I>
|
Boolean set-operations on such sets. It is parameterized by a
|
||||||
class and a <span class="textsc">Dcel</span> class. The former defines the type of points used
|
<I>traits</I> class and a <span class="textsc">Dcel</span> class. The
|
||||||
to represent polygon vertices and the type of \f$ x\f$-monotone curves that
|
former defines the type of points used to represent polygon vertices
|
||||||
represent the polygon edges. The traits class also provides primitive
|
and the type of \f$ x\f$-monotone curves that represent the polygon
|
||||||
geometric operations that operate on objects of these types.
|
edges. The traits class also provides primitive geometric operations
|
||||||
The <span class="textsc">Dcel</span> class is used to represent the underlying internal
|
that operate on objects of these types. The <span
|
||||||
`Arrangement_2` data structure. The instantiated `Dcel` type is
|
class="textsc">Dcel</span> class is used to represent the underlying
|
||||||
used to represent the underlying internal arrangement. It must model the
|
internal `Arrangement_2` data structure. The instantiated `Dcel` type
|
||||||
concept `GeneralPolygonSetDcel`, and defaults to `Gps_default_dcel`.
|
is used to represent the underlying internal arrangement. It must
|
||||||
You can override this default, with a different <span class="textsc">Dcel</span> class, typically
|
model the concept `GeneralPolygonSetDcel`, and defaults to
|
||||||
an extension of the default. Overriding the default is necessary only if
|
`Gps_default_dcel`. You can override this default, with a different
|
||||||
you intend to obtain the underlying internal arrangement and process it further.
|
<span class="textsc">Dcel</span> class, typically an extension of the
|
||||||
|
default. Overriding the default is necessary only if you intend to
|
||||||
|
obtain the underlying internal arrangement and process it further.
|
||||||
|
|
||||||
An instantiated
|
An instantiated
|
||||||
`General_polygon_set_2` class defines the nested types
|
`General_polygon_set_2` class defines the nested types
|
||||||
|
|
@ -620,7 +693,9 @@ An instantiated
|
||||||
the concepts `GeneralPolygon_2` and
|
the concepts `GeneralPolygon_2` and
|
||||||
`GeneralPolygonWithHoles_2` respectively.
|
`GeneralPolygonWithHoles_2` respectively.
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssectraits_concepts The Traits-Class Concepts
|
\subsection bso_ssectraits_concepts The Traits-Class Concepts
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
The traits class used to instantiate the `General_polygon_set_2`
|
The traits class used to instantiate the `General_polygon_set_2`
|
||||||
class template must model the concept `GeneralPolygonSetTraits_2`,
|
class template must model the concept `GeneralPolygonSetTraits_2`,
|
||||||
|
|
@ -630,7 +705,7 @@ and is tailored to handle a specific family of curves. The concept
|
||||||
|
|
||||||
The concept `ArrangementDirectionalXMonotoneTraits_2` refines the
|
The concept `ArrangementDirectionalXMonotoneTraits_2` refines the
|
||||||
concept `ArrangementXMonotoneTraits_2` (see
|
concept `ArrangementXMonotoneTraits_2` (see
|
||||||
Section \ref arr_sssecinsert_x_mon in the 2D Arrangements chapter).
|
Section \ref arr_sssecinsert_x_mon in the 2D Arrangements package).
|
||||||
Thus, a model of this concept must define the type `X_monotone_curve_2`,
|
Thus, a model of this concept must define the type `X_monotone_curve_2`,
|
||||||
which represents an \f$ x\f$-monotone curve, and the type `Point_2`,
|
which represents an \f$ x\f$-monotone curve, and the type `Point_2`,
|
||||||
with represents a planar point. Such a point may be an endpoint of an
|
with represents a planar point. Such a point may be an endpoint of an
|
||||||
|
|
@ -667,7 +742,9 @@ when exact arithmetic is used. When inexact arithmetic is used,
|
||||||
(nearly) degenerate configurations may result in abnormal termination
|
(nearly) degenerate configurations may result in abnormal termination
|
||||||
of the program or even incorrect results.
|
of the program or even incorrect results.
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_sseccirc_seg Operating on Polygons with Circular Arcs
|
\subsection bso_sseccirc_seg Operating on Polygons with Circular Arcs
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
Two traits classes are distributed with \cgal. The first one is named
|
Two traits classes are distributed with \cgal. The first one is named
|
||||||
`Gps_segment_traits_2`, and it is used to perform Boolean
|
`Gps_segment_traits_2`, and it is used to perform Boolean
|
||||||
|
|
@ -701,7 +778,9 @@ operator.
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/circle_segment.cpp}
|
\cgalExample{Boolean_set_operations_2/circle_segment.cpp}
|
||||||
|
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
\subsection bso_ssecgeneral_polygon_concept General Polygon Set Traits Adapter
|
\subsection bso_ssecgeneral_polygon_concept General Polygon Set Traits Adapter
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
The concept `GeneralPolygon_2` and its generic model
|
The concept `GeneralPolygon_2` and its generic model
|
||||||
`General_polygon_2<ArrDirectionalXMonotoneTraits>` facilitate the
|
`General_polygon_2<ArrDirectionalXMonotoneTraits>` facilitate the
|
||||||
|
|
@ -786,7 +865,9 @@ the `Gps_traits_2` adapter.
|
||||||
|
|
||||||
\cgalExample{Boolean_set_operations_2/bezier_traits_adapter.cpp}
|
\cgalExample{Boolean_set_operations_2/bezier_traits_adapter.cpp}
|
||||||
|
|
||||||
\subsection bso_ssecaggregated_gen_ops Example - Aggregated Operations
|
<!----------------------------------------------------------------------------->
|
||||||
|
\subsection bso_ssecaggregated_gen_ops Aggregated Operations
|
||||||
|
<!----------------------------------------------------------------------------->
|
||||||
|
|
||||||
In Section \ref bso_ssecagg_ops we describe how aggregated union
|
In Section \ref bso_ssecagg_ops we describe how aggregated union
|
||||||
and intersection operations can be applied to a collection of ordinary
|
and intersection operations can be applied to a collection of ordinary
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue