diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt index 64d3604362f..0287ab3226c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Arrangement_on_surface_2.txt @@ -285,18 +285,18 @@ classes built on top of the halfedge data structure. The \f$x\f$-monotone curves of an arrangement are embedded in a rectangular two-dimensional area called the parameter space. The -parameter space is defined as \f$ X \times Y\f$, where \f$ X\f$ and -\f$ Y\f$ are open, half-open, or closed intervals with endpoints in -the compactified real line \f$ \mathbb{R} \cup -\{-\infty,+\infty\}\f$. Let \f$x_{\rm min}\f$, \f$x_{\rm max}\f$, -\f$y_{\rm min}\f$, and \f$y_{\rm max}\f$ denote the endpoints of \f$ -X\f$ and \f$ Y\f$, respectively. We typically refer to these values as -the left, right, bottom, and top sides of the boundary of the -parameter space. If the parameter space is, for example, the entire -compactified plane, as in the case of arrangements in the plane, -\f$x_{\rm min} = y_{\rm min} = -\infty\f$ and \f$x_{\rm max} = y_{\rm -max} = +\infty\f$; see Section \ref aos_sec-curved_surfaces for more -details. +parameter space is defined as \f$X \times Y\f$, where \f$X\f$ and +\f$Y\f$ are open, half-open, or closed intervals with endpoints in the +compactified real line \f$\mathbb{R} \cup \{-\infty,+\infty\}\f$. Let +\f$x_{\rm min}\f$, \f$x_{\rm max}\f$, \f$y_{\rm min}\f$, and +\f$y_{\rm max}\f$ denote the endpoints of \f$X\f$ and \f$Y\f$, +respectively. We typically refer to these values as the left, right, +bottom, and top sides of the boundary of the parameter space. If the +parameter space is, for example, the entire compactified plane, as in +the case of arrangements in the plane, +\f$x_{\rm min} = y_{\rm min} = -\infty\f$ and +\f$x_{\rm max} = y_{\rm max} = +\infty\f$; see Section \ref +aos_sec-curved_surfaces for more details. \cgalAdvancedEnd @@ -350,20 +350,20 @@ theoretically, the former are degenerate holes. See \cgalFigureBegin{aos_fig-arr_segs,arr_segs.png} An arrangement of interior-disjoint line segments with some of the -\dcel records that represent it. The unbounded face \f$ f_0\f$ has +\dcel records that represent it. The unbounded face \f$f_0\f$ has a single connected component that forms a hole inside it, and this -hole comprises of several faces. The halfedge \f$ e\f$ is directed -from its source vertex \f$ v_1\f$ to its target vertex \f$ -v_2\f$. This edge, together with its twin \f$ e'\f$, correspond to a -line segment that connects the points associated with \f$ v_1\f$ and -\f$ v_2\f$ and separates the face \f$ f_1\f$ from \f$ f_2\f$. The -predecessor \f$ e_{\rm prev}\f$ and successor \f$ e_{\rm next}\f$ of -\f$ e\f$ are part of the chain that form the outer boundary of the -face \f$ f_2\f$. The face \f$ f_1\f$ has a more complicated structure +hole comprises of several faces. The halfedge \f$e\f$ is directed +from its source vertex \f$v_1\f$ to its target vertex \f$v_2\f$. +This edge, together with its twin \f$e'\f$, correspond to a +line segment that connects the points associated with \f$v_1\f$ and +\f$v_2\f$ and separates the face \f$f_1\f$ from \f$f_2\f$. The +predecessor \f$e_{\rm prev}\f$ and successor \f$e_{\rm next}\f$ of +\f$e\f$ are part of the chain that form the outer boundary of the +face \f$f_2\f$. The face \f$f_1\f$ has a more complicated structure as it contains two holes in its interior: One hole consists of two -adjacent faces \f$ f_3\f$ and \f$ f_4\f$, while the other hole -comprises of two edges. \f$ f_1\f$ also contains two isolated vertices -\f$ u_1\f$ and \f$ u_2\f$ in its interior. +adjacent faces \f$f_3\f$ and \f$f_4\f$, while the other hole +comprises of two edges. \f$f_1\f$ also contains two isolated vertices +\f$u_1\f$ and \f$u_2\f$ in its interior. \cgalFigureEnd @@ -392,12 +392,12 @@ the `Arrangement_2` class template; their description follows. */ @@ -1210,12 +1215,12 @@ void insert_non_intersecting_curves * * */ template & arr, * * Invokes the member function `arr.is_valid()` to verify the topological * correctness of the arrangement. Then it performs additional validity - * tests. It checks that all \f$ x\f$-monotone curves associated with + * tests. It checks that all \f$x\f$-monotone curves associated with * arrangement edges are pairwise disjoint in their interior. Then it makes sure * that all holes and all isolated vertices are located within the proper * arrangement faces. Note that the test carried out by this function may take a @@ -1254,8 +1259,8 @@ bool is_valid * its endpoints become isolated, they are removed as well. The call * `remove_edge(arr, e)` is equivalent to the call `arr.remove_edge (e, true, * true)`. However, this free function requires that `Traits` be a model of the - * refined concept `ArrangementXMonotoneTraits_2`, which requires merge - * operations on \f$ x\f$-monotone curves. If one of the end-vertices of the + * refined concept `AosXMonotoneTraits_2`, which requires merge + * operations on \f$x\f$-monotone curves. If one of the end-vertices of the * given edge becomes redundant after the edge is removed (see `remove_vertex()` * for the definition of a redundant vertex), it is removed, and its incident * edges are merged. If the edge-removal operation causes two faces to merge, @@ -1266,10 +1271,10 @@ bool is_valid * * */ -template +template typename Arrangement_on_surface_2::Face_handle remove_edge (Arrangement_on_surface_2& arr, @@ -1288,9 +1293,9 @@ remove_edge * *
    *
  • The instantiated `Traits` class must model the - * `ArrangementXMonotoneTraits_2` concept. Not all expressions listed + * `AosXMonotoneTraits_2` concept. Not all expressions listed * by this concept are required. In fact the traits class must model the - * `ArrangementBasicTraits_2` concept and support the merging + * `AosBasicTraits_2` concept and support the merging * functionality. *
*/ @@ -1324,9 +1329,9 @@ bool remove_vertex * * \pre If provided, `pl` must be attached to the given arrangement `arr`. * \pre The instantiated `GeometryTraits` class must model the - * `ArrangementXMonotoneTraits_2` concept. + * `AosXMonotoneTraits_2` concept. * \pre The point-location object `pl`, must model the - * `ArrangementPointLocation_2` concept. + * `AosPointLocation_2` concept. * \pre Dereferencing `oi` must yield a polymorphic object of type * `std::variant`. * diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h index ac6fac59496..140be3ded46 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_on_surface_with_history_2.h @@ -5,18 +5,18 @@ namespace CGAL { * \anchor arr_refaos_with_hist * * An object `arr` of the class `Arrangement_on_surface_with_history_2` - * represents the planar subdivision induced by a set of input curves \f$ \cal - * C\f$. The arrangement is represented as a doubly-connected edge-list (Dcel). As is the case for the + * represents the planar subdivision induced by a set of input curves + * \f$\cal C\f$. The arrangement is represented as a doubly-connected edge-list + * (Dcel). As is the case for the * `Arrangement_2`, each Dcel vertex is - * associated with a point and each edge is associated with an \f$ x\f$-monotone + * associated with a point and each edge is associated with an \f$x\f$-monotone * curve whose interior is disjoint from all other edges and vertices. Each such - * \f$ x\f$-monotone curve is a subcurve of some \f$ C \in \cal C\f$ - or may - * represent an overlap among several curves in \f$ \cal C\f$. + * \f$x\f$-monotone curve is a subcurve of some \f$C \in \cal C\f$ - or may + * represent an overlap among several curves in \f$\cal C\f$. * * The `Arrangement_on_surface_with_history_2` class-template extends the * `Arrangement_2` class-template by keeping an additional container of input - * curves representing \f$ \cal C\f$, and by maintaining a cross-mapping between + * curves representing \f$\cal C\f$, and by maintaining a cross-mapping between * these curves and the arrangement edges they induce. This way it is possible * to determine the inducing curve(s) of each arrangement edge. This mapping * also allows the traversal of input curves, and the traversal of edges induced @@ -26,33 +26,32 @@ namespace CGAL { * *
    *
  • The `GeometryTraits` template-parameter should be substituted by a - * model of the `ArrangementTraits_2` concept. The traits class defines the + * model of the `AosTraits_2` concept. The traits class defines the * `Curve_2` type, which represents an input curve. It also defines the types - * of \f$ x\f$-monotone curves and two-dimensional points, namely - * `ArrangementTraits_2::X_monotone_curve_2` and - * `ArrangementTraits_2::Point_2`, respectively, and supports basic + * of \f$x\f$-monotone curves and two-dimensional points, namely + * `AosTraits_2::X_monotone_curve_2` and + * `AosTraits_2::Point_2`, respectively, and supports basic * geometric predicates on them. *
  • The `TopologyTraits` template-parameter should be substituted by a - * class that is a model of the `ArrangementTopologyTraits` concept. + * class that is a model of the `AosTopologyTraits` concept. *
* * \sa `Arrangement_with_history_2` * \sa `Arrangement_on_surface_2` - * \sa `ArrangementTraits_2` - * \sa `ArrangementTopologyTraits` + * \sa `AosTraits_2` + * \sa `AosTopologyTraits` */ template class Arrangement_on_surface_with_history_2 : - public Arrangement_on_surface_2 -{ + public Arrangement_on_surface_2 { public: /// \name Types /// @{ - //! the geometry traits class in use. + /// the geometry traits class in use. typedef GeometryTraits Geometry_traits_2; - //! the topology traits class in use. + /// the topology traits class in use. typedef TopologyTraits Topology_traits; /*! a private type used as an abbreviation of the @@ -61,16 +60,16 @@ public: typedef Arrangement_on_surface_with_history_2 Self; - //! the Dcel representation of the arrangement. + /// the Dcel representation of the arrangement. typedef typename Topology_traits::Dcel Dcel; - //! the point type, as defined by the traits class. + /// the point type, as defined by the traits class. typedef typename Geometry_traits_2::Point_2 Point_2; - //! the \f$ x\f$-monotone curve type, as defined by the traits class. + /// the \f$x\f$-monotone curve type, as defined by the traits class. typedef typename Geometry_traits_2::X_monotone_curve_2 X_monotone_curve_2; - //! the curve type, as defined by the traits class. + /// the curve type, as defined by the traits class. typedef typename Geometry_traits_2::Curve_2 Curve_2; /// @} @@ -82,7 +81,7 @@ public: */ /// @{ - //! a handle for an input curve. + /// a handle for an input curve. typedef unspecified_type Curve_handle; /*! a bidirectional iterator over the curves that induce the arrangement. @@ -123,13 +122,13 @@ public: /// \name Assignment Methods /// @{ - //! assignment operator. + /// assignment operator. Self& operator=(other); - //! assigns the contents of another arrangement. + /// assigns the contents of another arrangement. void assign(const Self& other); - //! clears the arrangement. + /// clears the arrangement. void clear (); /// @} @@ -140,31 +139,31 @@ public: /// @{ - //! returns the number of input curves that induce the arrangement. + /// returns the number of input curves that induce the arrangement. Size number_of_curves() const; - //! returns the begin-iterator of the curves inducing the arrangement. + /// returns the begin-iterator of the curves inducing the arrangement. Curve_iterator curves_begin(); //! returns the past-the-end iterator of the curves inducing the arrangement. Curve_iterator curves_end(); - //! returns the number of arrangement edges induced by the curve `ch`. + /// returns the number of arrangement edges induced by the curve `ch`. Size number_of_induced_edges(Curve_handle ch) const; - //! returns the begin-iterator of the edges induced by the curve `ch`. + /// returns the begin-iterator of the edges induced by the curve `ch`. Induced_edge_iterator induced_edges_begin(Curve_handle ch) const; - //! returns the past-the-end iterator of the edges induced by the curve `ch`. + /// returns the past-the-end iterator of the edges induced by the curve `ch`. Induced_edge_iterator induced_edges_end(Curve_handle ch) const; - //! returns the number of input curves that originate the edge `e`. + /// returns the number of input curves that originate the edge `e`. Size number_of_originating_curves(Halfedge_handle e) const; - //! returns the begin-iterator of the curves originating the edge `e`. + /// returns the begin-iterator of the curves originating the edge `e`. Originating_curve_iterator originating_curves_begin(Halfedge_handle e) const; - //! returns the past-the-end iterator of the curves originating the edge `e`. + /// returns the past-the-end iterator of the curves originating the edge `e`. Originating_curve_iterator originating_curves_end(Halfedge_handle e) const; /// @} @@ -192,9 +191,9 @@ public: /*! merges the edges represented by `e1` and `e2` into a single edge. The * function returns a handle for one of the merged halfedges. * - * \pre `e1` and `e2` share a common end-vertex, of degree \f$ 2\f$, and the - * \f$ x\f$-monotone curves associated with `e1` and `e2` are mergeable - * into a single \f$ x\f$-monotone curves. + * \pre `e1` and `e2` share a common end-vertex, of degree \f$2\f$, and the + * \f$x\f$-monotone curves associated with `e1` and `e2` are mergeable + * into a single \f$x\f$-monotone curves. */ Halfedge_handle merge_edge(Halfedge_handle e1, Halfedge_handle e2); @@ -210,7 +209,6 @@ public: bool remove_target = true); /// @} - }; /* end Arrangement_on_surface_with_history_2 */ /*! \ingroup PkgArrangementOnSurface2Insert @@ -222,14 +220,14 @@ public: * computing its zone until reaching the right endpoint. * * The given point-location object `pl` is used to locate the left endpoints of - * the \f$ x\f$-monotone curves. By default, the function uses the "walk along + * the \f$x\f$-monotone curves. By default, the function uses the "walk along * line" point-location strategy - namely an instance of the class * `Arr_walk_along_line_point_location >`. * * \pre If provided, `pl` is attached to the given arrangement `arr`. */ -template +template typename Arrangement_on_surface_with_history_2::Curve_handle insert (Arrangement_on_surface_with_history_2& arr, @@ -261,7 +259,6 @@ Size remove_curve (Arrangement_on_surface_with_history_2& arr, typename Arrangement_on_surface_with_history_2::Curve_handle ch); - /*! \addtogroup PkgArrangementOnSurface2Overlay * * Computes the overlay of two arrangements with history `arr1` and `arr2`, and @@ -281,17 +278,16 @@ void overlay Arrangement_on_surface_with_history_2& res, OverlayTraits& ovl_tr); - /*! \addtogroup PkgArrangementOnSurface2Overlay * * Computes the (simple) overlay of two arrangements with history `arr1` and - *`arr2`, and sets the output arrangement with history `res` to represent the - *overlaid arrangement. The function also constructs a consolidated set of - *curves that induce `res`. It employs the default overlay-traits, which - *practically does nothing. + * `arr2`, and sets the output arrangement with history `res` to represent the + * overlaid arrangement. The function also constructs a consolidated set of + * curves that induce `res`. It employs the default overlay-traits, which + * practically does nothing. * * \pre `res` does not refer to either `arr1` or `arr2` (that is, "self overlay" - *is not supported). + * is not supported). */ template diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h index a4f001847c3..3c81415dc98 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_with_history_2.h @@ -5,17 +5,17 @@ namespace CGAL { * \anchor arr_refarr_with_hist * * An object `arr` of the class `Arrangement_with_history_2` represents the - * planar subdivision induced by a set of input curves \f$ \cal C\f$. The + * planar subdivision induced by a set of input curves \f$\cal C\f$. The * arrangement is represented as a doubly-connected edge-list (\dcel). As is * the case for the `Arrangement_2`, each \dcel vertex is - * associated with a point and each edge is associated with an \f$ x\f$-monotone + * associated with a point and each edge is associated with an \f$x\f$-monotone * curve whose interior is disjoint from all other curves and points. Each such - * \f$ x\f$-monotone curve is a subcurve of some \f$ C \in \cal C\f$, or may - * represent an overlap among several curves in \f$ \cal C\f$. + * \f$x\f$-monotone curve is a subcurve of some \f$C \in \cal C\f$, or may + * represent an overlap among several curves in \f$\cal C\f$. * * The `Arrangement_with_history_2` class-template extends the `Arrangement_2` * class-template by keeping an additional container of input curves - * representing \f$ \cal C\f$, and by maintaining a cross-mapping between these + * representing \f$\cal C\f$, and by maintaining a cross-mapping between these * curves and the arrangement edges they induce. This way it is possible to * determine the inducing curve(s) of each arrangement edge. This mapping also * allows the traversal of input curves, and the traversal of edges induced by @@ -24,39 +24,39 @@ namespace CGAL { * The `Arrangement_with_history_2` template has two parameters: *
    *
  • The `Traits` template-parameter should be substituted by a model of - * the `ArrangementTraits_2` concept. The traits class defines the `Curve_2` + * the `AosTraits_2` concept. The traits class defines the `Curve_2` * type, which represents an input curve. It also defines the types of \f$ * x\f$-monotone curves and two-dimensional points, namely - * `ArrangementTraits_2::X_monotone_curve_2` and `ArrangementTraits_2::Point_2`, + * `AosTraits_2::X_monotone_curve_2` and `AosTraits_2::Point_2`, * respectively, and supports basic geometric predicates on them. *
  • The `Dcel` template-parameter should be substituted by a class that is - * a model of the `ArrangementDcelWithRebind` concept. The value of this + * a model of the `AosDcelWithRebind` concept. The value of this * parameter is by default `Arr_default_dcel`. *
* - * \sa `ArrangementDcel` + * \sa `AosDcel` * \sa `Arr_default_dcel` - * \sa `ArrangementTraits_2` + * \sa `AosTraits_2` * \sa `Arrangement_2` * \sa `insertion functions` * \sa `removal functions` * \sa `overlaying arrangements` */ template -class Arrangement_with_history_2 : public Arrangement_on_surface_with_history_2::Traits> { +class Arrangement_with_history_2 : + public Arrangement_on_surface_with_history_2::Traits> { public: - /// \name Types /// @{ - //! the geometry traits class. + /// the geometry traits class. typedef Traits Geometry_traits; - //! The topology traits. + /// The topology traits. typedef typename Default_planar_topology::Traits Topology_traits; - //! The base arrangement on surface type. + /// The base arrangement on surface type. typedef Arrangement_on_surface_with_history_2 Base; @@ -129,13 +129,13 @@ public: * computing its zone until reaching the right endpoint. * * The given point-location object `pl` is used to locate the left endpoints of - * the \f$ x\f$-monotone curves. By default, the function uses the "walk along + * the \f$x\f$-monotone curves. By default, the function uses the "walk along * line" point-location strategy - namely an instance of the class * `Arr_walk_along_line_point_location >`. * * \pre If provided, `pl` is attached to the given arrangement `arr`. */ -template +template typename Arrangement_with_history_2::Curve_handle insert(Arrangement_with_history_2& arr, const typename Traits::Curve_2& c, @@ -161,7 +161,6 @@ template Size remove_curve(Arrangement_with_history_2& arr, typename Arrangement_with_history_2::Curve_handle ch); - /*! \addtogroup PkgArrangementOnSurface2Overlay * Computes the overlay of two arrangements with history `arr1` and `arr2`, and * sets the output arrangement with history `res` to represent the overlaid @@ -170,14 +169,13 @@ Size remove_curve(Arrangement_with_history_2& arr, * * \pre `res` does not refer to either `arr1` or `arr2`. */ -template +template void overlay(const Arrangement_with_history_2& arr1, const Arrangement_with_history_2& arr2, Arrangement_with_history_2& res, OverlayTraits& ovl_tr); - /*! \addtogroup PkgArrangementOnSurface2Overlay * * Computes the (simple) overlay of two arrangements with history `arr1` and @@ -189,8 +187,7 @@ void overlay(const Arrangement_with_history_2& arr1, * \pre `res` does not refer to either `arr1` or `arr2` (that is, "self overlay" * is not supported). */ -template +template void overlay(const Arrangement_with_history_2& arr1, const Arrangement_with_history_2& arr2, Arrangement_with_history_2& res); diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/CORE_algebraic_number_traits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/CORE_algebraic_number_traits.h index b48ef555575..f3b6cdfb9f0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/CORE_algebraic_number_traits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/CORE_algebraic_number_traits.h @@ -12,16 +12,16 @@ public: /// \name Types /// @{ - //! The integer number type. + /// The integer number type. typedef CORE::BigInt Integer; - //! The rational number type. + /// The rational number type. typedef CORE::BigRat Rational; - //! The polynomial type. + /// The polynomial type. typedef CORE::Polynomial Polynomial; - //! The algebraic number type. + /// The algebraic number type. typedef CORE::Expr Algebraic; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h index 7aa284b171a..824e3f73bd7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h @@ -2,100 +2,89 @@ namespace CGAL { namespace IO { -/*! - \defgroup PkgArrangementOnSurface2Read CGAL::IO::read() - \ingroup PkgArrangementOnSurface2IO +/*! \defgroup PkgArrangementOnSurface2Read CGAL::IO::read() + * \ingroup PkgArrangementOnSurface2IO + * + * Reads a given arrangement from a given input stream + * using a specific input format. + * + * \cgalHeading{Requirements} + * + *
    + *
  • The instantiated `Formatter` class must model the + * `AosInputFormatter` concept. + *
  • The instantiated `WithHistoryFormatter` class must model the + * `AosWithHistoryInputFormatter` concept. + *
+ * + * \sa `PkgArrangementOnSurface2Write` + * \sa `PkgArrangementOnSurface2op_left_shift` + * \sa `PkgArrangementOnSurface2op_right_shift` + */ -Reads a given arrangement from a given input stream -using a specific input format. - -\cgalHeading{Requirements} - -
    -
  • The instantiated `Formatter` class must model the - `ArrangementInputFormatter` concept. -
  • The instantiated `WithHistoryFormatter` class must model the - `ArrangementWithHistoryInputFormatter` concept. -
- - -\sa `PkgArrangementOnSurface2Write` - - -\sa `PkgArrangementOnSurface2op_left_shift` -\sa `PkgArrangementOnSurface2op_right_shift` -*/ /// @{ -/*! -Reads the arrangement object `arr` from the given input stream `is` -using a specific input format defined by \"formatter\". -*/ -template -std::istream& read (Arrangement_2& arr, - std::istream& is, - Formatter& formatter); - +/*! Reads the arrangement object `arr` from the given input stream `is` + * using a specific input format defined by \"formatter\". + */ +template +std::istream& read(Arrangement_2& arr, + std::istream& is, Formatter& formatter); /// @} -/*! - \defgroup PkgArrangementOnSurface2Write CGAL::IO::write() - \ingroup PkgArrangementOnSurface2IO +/*! \defgroup PkgArrangementOnSurface2Write CGAL::IO::write() + * \ingroup PkgArrangementOnSurface2IO + * + * Writes a given arrangement into a given output stream + * using a specific output format. + * + * \cgalHeading{Requirements} + * + *
    + *
  • The instantiated `Formatter` class must model the + * `AosOutputFormatter` concept. + *
  • The instantiated `WithHistoryFormatter` class must model the + * `AosWithHistoryOutputFormatter` concept. + *
+ * + * \sa `PkgArrangementOnSurface2Read` + * \sa `PkgArrangementOnSurface2op_left_shift` + * \sa `PkgArrangementOnSurface2op_right_shift` + */ -Writes a given arrangement into a given output stream -using a specific output format. - -\cgalHeading{Requirements} - -
    -
  • The instantiated `Formatter` class must model the - `ArrangementOutputFormatter` concept. -
  • The instantiated `WithHistoryFormatter` class must model the - `ArrangementWithHistoryOutputFormatter` concept. -
- -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2op_left_shift` -\sa `PkgArrangementOnSurface2op_right_shift` -*/ /// @{ -/*! -Writes the arrangement object `arr` into the given output stream -`os` using a specific output format defined by `formatter`. -*/ -template -std::ostream& write (const Arrangement_2& arr, - std::ostream& os, - Formatter& formatter); +/*! Writes the arrangement object `arr` into the given output stream + * `os` using a specific output format defined by `formatter`. + */ +template +std::ostream& write(const Arrangement_2& arr, + std::ostream& os, Formatter& formatter); /// @} } // namespace IO -/*! -\ingroup PkgArrangementOnSurface2op_left_shift -Inserts the arrangement object `arr` into the output stream -`os` using the output format defined by the -`Arr_text_formatter` class. Only the basic geometric and -topological features of the arrangement are inserted. Auxiliary data -that may be attached to the \dcel features is ignored. -*/ -template -std::ostream& operator<< (std::ostream& os, - const Arrangement_2& arr); +/*! \ingroup PkgArrangementOnSurface2op_left_shift + * Inserts the arrangement object `arr` into the output stream + * `os` using the output format defined by the + * `Arr_text_formatter` class. Only the basic geometric and + * topological features of the arrangement are inserted. Auxiliary data + * that may be attached to the \dcel features is ignored. + */ +template +std::ostream& operator<<(std::ostream& os, + const Arrangement_2& arr); -/*! -\ingroup PkgArrangementOnSurface2op_right_shift -Extracts an arrangement from a given input stream using the input -format defined by the `Arr_text_formatter` class - that is, only the -basic geometric and topological features of the arrangement are read -and no auxiliary data is attached to the Dcel features. -*/ -template -std::istream& operator>>(std::istream& is, Arrangement_2& arr); - +/*! \ingroup PkgArrangementOnSurface2op_right_shift + * Extracts an arrangement from a given input stream using the input + * format defined by the `Arr_text_formatter` class - that is, only the + * basic geometric and topological features of the arrangement are read + * and no auxiliary data is attached to the Dcel features. + */ +template +std::istream& operator>>(std::istream& is, Arrangement_2& arr); } /* end namespace CGAL::IO*/ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h index 4695aa5cfb5..8ec0f2f07ee 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_text_formatter.h @@ -1,93 +1,83 @@ - namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2IO +/*! \ingroup PkgArrangementOnSurface2IO + * + * `Arr_extended_dcel_text_formatter` defines the format of an arrangement in an + * input or output stream (typically a file stream), thus enabling reading and + * writing an `Arrangement` instance using a simple text format. The + * `Arrangement` class should be instantiated with a \dcel class which in turn + * instantiates the `Arr_extended_dcel` template with the `VertexData`, + * `HalfedgeData` and `FaceData` types. The formatter supports reading and + * writing the data objects attached to the arrangement vertices, halfedges and + * faces. + * + * The `Arr_extended_dcel_text_formatter` class assumes that the nested + * `Point_2` and the `Curve_2` types defined by the `Arrangement` + * template-parameter, as well as the `VertexData`, `HalfedgeData` and + * `FaceData` types, can all be written to an input stream using the `<<` + * operator and read from an input stream using the `>>` operator. + * + * \cgalModels{AosInputFormatter,AosOutputFormatter} + * + * \sa `PkgArrangementOnSurface2Read` + * \sa `PkgArrangementOnSurface2Write` + * \sa `Arr_extended_dcel` + */ +template +class Arr_extended_dcel_text_formatter {}; -`Arr_extended_dcel_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The `Arrangement` class should be -instantiated with a \dcel class which in turn instantiates the -`Arr_extended_dcel` template with the `VertexData`, `HalfedgeData` and -`FaceData` types. -The formatter supports reading and writing the data objects attached to the -arrangement vertices, halfedges and faces. - -The `Arr_extended_dcel_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter, as well as the `VertexData`, -`HalfedgeData` and `FaceData` types, can all be written to an input stream using -the `<<` operator and read from an input stream using the `>>` operator. - -\cgalModels{ArrangementInputFormatter,ArrangementOutputFormatter} - -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` -\sa `Arr_extended_dcel` - -*/ -template< typename Arrangement > -class Arr_extended_dcel_text_formatter { -public: - -}; /* end Arr_extended_dcel_text_formatter */ } /* end namespace CGAL */ namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2IO +/*! \ingroup PkgArrangementOnSurface2IO + * + * `Arr_face_extended_text_formatter` defines the format of an arrangement in an + * input or output stream (typically a file stream), thus enabling reading and + * writing an `Arrangement` instance using a simple text format. The + * `Arrangement` class should be instantiated with a \dcel class which in turn + * instantiates the `Arr_face_extended_dcel` template with a `FaceData` type. + * The formatter supports reading and writing the data objects attached to the + * arrangement faces as well. + * + * The `Arr_face_extended_text_formatter` class assumes that the nested + * `Point_2` and the `Curve_2` types defined by the `Arrangement` + * template-parameter and that the `FaceData` type can all be written to an + * input stream using the `<<` operator and read from an input stream using the + * `>>` operator. + * + * \cgalModels{AosInputFormatter,AosOutputFormatter} + * + * \sa `PkgArrangementOnSurface2Read` + * \sa `PkgArrangementOnSurface2Write` + * \sa `Arr_face_extended_dcel` + */ +template +class Arr_face_extended_text_formatter {}; -`Arr_face_extended_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The `Arrangement` class should be -instantiated with a \dcel class which in turn instantiates the -`Arr_face_extended_dcel` template with a `FaceData` type. -The formatter supports reading and writing the data objects attached to the -arrangement faces as well. - -The `Arr_face_extended_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter and that the `FaceData` type -can all be written to an input stream using the `<<` operator and read from an input stream using the `>>` operator. - -\cgalModels{ArrangementInputFormatter,ArrangementOutputFormatter} - -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` -\sa `Arr_face_extended_dcel` - -*/ -template< typename Arrangement > -class Arr_face_extended_text_formatter { -public: - -}; /* end Arr_face_extended_text_formatter */ } /* end namespace CGAL */ namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2IO +/*! \ingroup PkgArrangementOnSurface2IO + * + * `Arr_text_formatter` defines the format of an arrangement in an input or + * output stream (typically a file stream), thus enabling reading and writing an + * `Arrangement` instance using a simple text format. The arrangement is assumed + * to store no auxiliary data with its \dcel records (and if there are such + * records they will not be written or read by the formatter). + * + * The `Arr_text_formatter` class assumes that the nested `Point_2` and the + * `Curve_2` types defined by the `Arrangement` template-parameter can both be + * written to an input stream using the `<<` operator and read from an input + * stream using the `>>` operator. + * + * \cgalModels{AosInputFormatter,AosOutputFormatter} + * + * \sa `PkgArrangementOnSurface2Read` + * \sa `PkgArrangementOnSurface2Write` + */ +template +class Arr_text_formatter {}; -`Arr_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an `Arrangement` -instance using a simple text format. The arrangement is assumed to store no auxiliary -data with its \dcel records (and if there are such records they will not be written -or read by the formatter). - -The `Arr_text_formatter` class assumes that the nested `Point_2` and the `Curve_2` types -defined by the `Arrangement` template-parameter can both be written to an input -stream using the `<<` operator and read from an input stream using the `>>` -operator. - -\cgalModels{ArrangementInputFormatter,ArrangementOutputFormatter} - -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` - -*/ -template< typename Arrangement > -class Arr_text_formatter { -public: - -}; /* end Arr_text_formatter */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h index 968bda50939..c38812953c8 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h @@ -2,51 +2,46 @@ namespace CGAL { namespace IO { -/*! -\ingroup PkgArrangementOnSurface2Read - -Reads the arrangement-with-history object `arr` from the given -input stream `is` using a specific input format defined by -\"formatter\". - -*/ -template -std::istream& read (Arrangement_with_history_2& arr, - std::istream& is, - WithHistoryFormatter& formatter); +std::istream& read(Arrangement_with_history_2& arr, + std::istream& is, WithHistoryFormatter& formatter); -/*! -\ingroup PkgArrangementOnSurface2Write -Writes the arrangement-with-history object `arr` into the given -output stream `os` using a specific output format defined by -`formatter`. -*/ -template -std::ostream& write (const Arrangement_with_history_2& arr, - std::ostream& os, - WithHistoryFormatter& formatter); +std::ostream& write(const Arrangement_with_history_2& arr, + std::ostream& os, WithHistoryFormatter& formatter); } // namespace IO -/*! -\ingroup PkgArrangementOnSurface2op_left_shift -Inserts the arrangement-with-history object `arr` into the output -stream `os` using the output format defined by the -`Arr_with_history_text_formatter` class. Only the basic geometric -and topological features of the arrangement are inserted. Auxiliary -data that may be attached to the \dcel features is ignored. -*/ -template -std::ostream& operator<< (std::ostream& os, - const Arrangement_with_history_2& arr); +/*! \ingroup PkgArrangementOnSurface2op_left_shift + * inserts the arrangement-with-history object `arr` into the output + * stream `os` using the output format defined by the + * `Arr_with_history_text_formatter` class. Only the basic geometric + * and topological features of the arrangement are inserted. Auxiliary + * data that may be attached to the \dcel features is ignored. + */ +template +std::ostream& operator<<(std::ostream& os, + const Arrangement_with_history_2& arr); + +/*! \ingroup PkgArrangementOnSurface2op_right_shift + * extracts an arrangement-with-history from a given input stream using + * the default input format. + */ +template +std::istream& operator>>(std::istream& is, + Arrangement_with_history_2& arr); -/*! -\ingroup PkgArrangementOnSurface2op_right_shift -Extracts an arrangement-with-history from a given input stream using -the default input format. -*/ -template -std::istream& operator>>(std::istream& is, Arrangement_with_history_2& arr); } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h index 564b6534b34..305a5f5a753 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_text_formatter.h @@ -1,29 +1,24 @@ - namespace CGAL { -/*! -\ingroup PkgArrangementOnSurface2IO +/*! \ingroup PkgArrangementOnSurface2IO + * + * `Arr_with_history_text_formatter` defines the format of an arrangement in an + * input or output stream (typically a file stream), thus enabling reading and + * writing an arrangement-with-history instance using a simple text format. + * + * The `ArrFormatter` parameter servers as a base class for + * `Arr_with_history_text_formatter` and must be a model of the + * `AosInputFormatter` and the `AosOutputFormatter` concepts. It is used to read + * or write the base arrangement, while the derived class is responsible for + * reading and writing the set of curves inducing the arrangement and + * maintaining the relations between these curves and the edges they induce. + * + * \cgalModels{AosWithHistoryInputFormatter,AosWithHistoryOutputFormatter} + * + * \sa `PkgArrangementOnSurface2Read` + * \sa `PkgArrangementOnSurface2Write` + */ +template +class Arr_with_history_text_formatter {}; -`Arr_with_history_text_formatter` defines the format of an arrangement in an input or output stream -(typically a file stream), thus enabling reading and writing an -arrangement-with-history instance using a simple text format. - -The `ArrFormatter` parameter servers as a base class for -`Arr_with_history_text_formatter` and must be a model of the `ArrangementInputFormatter` -and the `ArrangementOutputFormatter` concepts. It is used to read or write -the base arrangement, while the derived class is responsible for reading and -writing the set of curves inducing the arrangement and maintaining the -relations between these curves and the edges they induce. - -\cgalModels{ArrangementWithHistoryInputFormatter,ArrangementWithHistoryOutputFormatter} - -\sa `PkgArrangementOnSurface2Read` -\sa `PkgArrangementOnSurface2Write` - -*/ -template< typename ArrFormatter > -class Arr_with_history_text_formatter { -public: - -}; /* end Arr_with_history_text_formatter */ } /* end namespace CGAL */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h index cf7782447aa..39d637cde4a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/draw_arrangement_2.h @@ -25,51 +25,63 @@ namespace CGAL { /*! \ingroup PkgArrangementOnSurface2Draw - opens a new window and draws `arr`, an instance of the `CGAL::Arrangement_2` class template. Parameters of the drawing are taken from the optional graphics scene options parameter. - -A call to this function blocks the execution of the program until the drawing window is closed. This function requires `CGAL_Qt6`, and is only available if the macro `CGAL_USE_BASIC_VIEWER` is defined. -Linking with the cmake target `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition `CGAL_USE_BASIC_VIEWER`. - - -\tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. -\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param arr the 2D arrangement to draw. -\param gso the graphics scene options parameter. - -\sa `ArrangementDcel` -\sa `ArrangementTraits_2` -*/ + * The function opens a new window and draws `arr`, an instance of the + * `CGAL::Arrangement_2` class template. Parameters of the drawing are taken + * from the optional graphics scene options parameter. + * + * A call to this function blocks the execution of the program until the drawing + * window is closed. This function requires `CGAL_Qt6`, and is only available if + * the macro `CGAL_USE_BASIC_VIEWER` is defined. Linking with the cmake target + * `CGAL::CGAL_Basic_viewer` will link with `CGAL_Qt6` and add the definition + * `CGAL_USE_BASIC_VIEWER`. + * + * \tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement + * traits concept. At this point it must be an instance of either + * `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. + * \tparam Dcel the \dcel type, a model of the `AosDcel` concept. + * \tparam GSOptions a model of `GraphicsSceneOptions` concept. + * + * \param arr the 2D arrangement to draw. + * \param gso the graphics scene options parameter. + * + * \sa `AosDcel` + * \sa `AosTraits_2` + */ template -void draw(const Arrangement_2& arr, const GSOptions& gso); +void draw(const Arrangement_2& arr, + const GSOptions& gso); /*! \ingroup PkgArrangementOnSurface2Draw - - A shortcut to `CGAL::draw(arr, Graphics_scene_options{})`. -*/ + * + * A shortcut to `CGAL::draw(arr, Graphics_scene_options{})`. + */ template void draw(const Arrangement_2& arr); /*! \ingroup PkgArrangementOnSurface2Draw - -adds the vertices, edges and faces of `arr` into the given graphic scene `gs`. Parameters of the cells are taken from the optional graphics scene options parameter `gso`. Note that `gs` is not cleared before being filled (to enable to draw several data structures in the same basic viewer). - -\tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement traits concept. At this point it must be an instance of either `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. -\tparam Dcel the \dcel type, a model of the `ArrangementDcel` concept. -\tparam GSOptions a model of `GraphicsSceneOptions` concept. - -\param arr the 2D arrangement to draw. -\param gs the graphic scene to fill. -\param gso the graphics scene options parameter. + * + * adds the vertices, edges and faces of `arr` into the given graphic scene + * `gs`. Parameters of the cells are taken from the optional graphics scene + * options parameter `gso`. Note that `gs` is not cleared before being filled + * (to enable to draw several data structures in the same basic viewer). + * + * \tparam GeometryTraits_2 a geometry traits type, a model of a 2D arrangement + * traits concept. At this point it must be an instance of either + * `CGAL::Arr_segment_traits_2` or `CGAL::Arr_conic_traits_2`. + * \tparam Dcel the \dcel type, a model of the `AosDcel` concept. + * \tparam GSOptions a model of `GraphicsSceneOptions` concept. + * + * \param arr the 2D arrangement to draw. + * \param gs the graphic scene to fill. + * \param gso the graphics scene options parameter. */ template void add_to_graphics_scene(const Arrangement_2& arr, CGAL::Graphics_scene& gs, const GSOptions& gso); /*! \ingroup PkgArrangementOnSurface2Draw - - A shortcut to `CGAL::add_to_graphics_scene(arr, gs, Graphics_scene_options{})`. + * A shortcut to `CGAL::add_to_graphics_scene(arr, gs, + * Graphics_scene_options{})`. */ template void add_to_graphics_scene(const Arrangement_2& arr, diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximatePointTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximatePointTraits_2.h new file mode 100644 index 00000000000..90b53ff56e5 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximatePointTraits_2.h @@ -0,0 +1,50 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * The concept `AosApproximatePointTraits_2` refines the basic traits concept + * `AosBasicTraits_2`. A model of this concept is able to approximate a point. + * + * \cgalRefines{AosBasicTraits_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_circle_segment_traits_2} + * \cgalHasModels{CGAL::Arr_conic_traits_2} + * \cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} + * \cgalHasModels{CGAL::Arr_linear_traits_2} + * \cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} + * \cgalHasModels{CGAL::Arr_segment_traits_2} + * \cgalHasModels{CGAL::Arr_polycurve_traits_2} + * \cgalHasModels{CGAL::Arr_polyline_traits_2} + * \cgalHasModels{CGAL::Arr_rational_function_traits_2} + * \cgalHasModelsEnd + * + * \sa `AosConstructXMonotoneCurveTraits_2` + * \sa `AosXMonotoneTraits_2` + * \sa `AosTraits_2` + */ +class AosApproximatePointTraits_2 { +public: + /// \name Types + /// @{ + + //! the number type used to approximate point coordinates, e.g., double. + typedef unspecified_type Approximate_number_type; + + /// @} + + /// \name Functor Types + /// @{ + + /// models the concept `AosTraits::Approximate_2`. + typedef unspecified_type Approximate_2; + + /// @} + + /// \name Accessing Functor Objects + /// @{ + + /// + Approximate_2 approximate_2_object() const; + + /// @} +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateTraits_2.h new file mode 100644 index 00000000000..2020e723039 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateTraits_2.h @@ -0,0 +1,47 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * The concept `AosApproximateTraits_2` refines the concept + * `AosApproximatePointTraits_2`. A model of this concept is able to + * approximate a point and a curve (in addition to the ability to approximate the + * coordinates of a point). + * + * \cgalRefines{AosApproximatePointTraits_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_circle_segment_traits_2} + * \cgalHasModels{CGAL::Arr_conic_traits_2} + * \cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} + * \cgalHasModels{CGAL::Arr_polyline_traits_2} + * \cgalHasModels{CGAL::Arr_segment_traits_2} + * \cgalHasModelsEnd + * + * \sa `AosApproximatePointTraits_2` + * \sa `draw()` + */ +class AosApproximateTraits_2 { +public: + /// \name Types + /// @{ + + //! the approximate point. + typedef unspecified_type Approximate_point_2; + + /// @} + + /// \name Functor Types + /// @{ + + /// models the concept `AosTraits::Approximate_2`. + typedef unspecified_type Approximate_2; + + /// @} + + /// \name Accessing Functor Objects + /// @{ + + /// + Approximate_2 approximate_2_object() const; + + /// @} +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTopologyTraits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTopologyTraits.h similarity index 75% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTopologyTraits.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTopologyTraits.h index 76c42cc2114..36810c0be8a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTopologyTraits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTopologyTraits.h @@ -1,7 +1,7 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTopologyTraits * \cgalConcept * - * The concept `ArrangementBasicTopologyTraits` defines the minimal + * The concept `AosBasicTopologyTraits` defines the minimal * functionality needed for a model of a topology traits, which can substitutes * the `TopolTraits` template parameters when the class template * `Arrangement_on_surface_2` is instantiated. In @@ -13,19 +13,18 @@ * \cgalHasModels{CGAL::Arr_spherical_topology_traits_2} * \cgalHasModelsEnd */ - -class ArrangementBasicTopologyTraits { +class AosBasicTopologyTraits { public: /// \name Types /// @{ - //! models the concept `ArrTraits::Point_2`. + /// models the concept `AosTraits::Point_2`. typedef unspecified_type Point_2; - //! models the concept `ArrTraits::XMonotoneCurve_2`. + /// models the concept `AosTraits::XMonotoneCurve_2`. typedef unspecified_type X_monotone_curve_2; - //! models the concept `ArrangementDcel`. + /// models the concept `AosDcel`. typedef unspecified_type Dcel; /// @} @@ -38,10 +37,10 @@ public: /// \name Access Functions /// @{ - /*! obtains the DCEL (const version). */ + /*! obtains the \dcel (const version). */ const Dcel& dcel() const; - /*! obtains the DCEL (non-const version). */ + /*! obtains the \dcel (non-const version). */ Dcel& dcel(); /// @} @@ -49,5 +48,4 @@ public: /// \name Modifiers /// @{ /// @} - }; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTraits_2.h similarity index 71% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTraits_2.h index 3771c0af1e0..3a974fc6086 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBasicTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBasicTraits_2.h @@ -1,23 +1,23 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * The concept `ArrangementBasicTraits_2` defines the minimal set of geometric + * The concept `AosBasicTraits_2` defines the minimal set of geometric * predicates needed for the construction and maintenance of objects of the * class `Arrangement_2`, as well as performing simple queries (such as * point-location queries) on such arrangements. * * A model of this concept must define nested `Point_2` and `X_monotone_curve_2` - * types, which represent planar points and continuous \f$ x\f$-monotone curves + * types, which represent planar points and continuous \f$x\f$-monotone curves * (a vertical segment is also considered to be weakly \f$ - * x\f$-monotone), respectively. The \f$ x\f$-monotone curves are assumed to be + * x\f$-monotone), respectively. The \f$x\f$-monotone curves are assumed to be * pairwise disjoint in their interiors, so they do not intersect except at * their endpoints. * * The `X_monotone_curve_2` curves of an arrangement are confined to an * iso-rectangular area called the parameter space. The iso-rectangule can be * unbounded, open, or closed. The set of predicates provided by a model the - * concept `ArrangementBasicTraits_2` is sufficient for constructing - * arrangements of \f$ x\f$-monotone curves that do not reach or approach the + * concept `AosBasicTraits_2` is sufficient for constructing + * arrangements of \f$x\f$-monotone curves that do not reach or approach the * boundary of the parameter space. The nature of the input curves, whether they * are expected to reach or approach the left, right, bottom, or top side of the * boundary of the parameter space, are conveyed through the definition of four @@ -45,19 +45,15 @@ * \cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} * \cgalHasModelsEnd */ - -class ArrangementBasicTraits_2 { +class AosBasicTraits_2 { public: - /// \name Types /// @{ - /*! models the concept `ArrTraits::Point_2`. - */ + /// models the concept `AosTraits::Point_2`. typedef unspecified_type Point_2; - /*! models the concept `ArrTraits::XMonotoneCurve_2`. - */ + /// models the concept `AosTraits::XMonotoneCurve_2`. typedef unspecified_type X_monotone_curve_2; /// @} @@ -65,24 +61,19 @@ public: /// \name Categories /// @{ - /*! indicates whether the nested functor `Compare_at_x_left_2` is provided. - */ + /// indicates whether the nested functor `Compare_at_x_left_2` is provided. typedef unspecified_type Has_left_category; - /*! Must be convertible to `CGAL::Arr_oblivious_side_tag`. - */ + /// Must be convertible to `CGAL::Arr_oblivious_side_tag`. typedef unspecified_type Left_side_category; - /*! Must be convertible to `CGAL::Arr_oblivious_side_tag`. - */ + /// Must be convertible to `CGAL::Arr_oblivious_side_tag`. typedef unspecified_type Bottom_side_category; - /*! Must be convertible to `CGAL::Arr_oblivious_side_tag`. - */ + /// Must be convertible to `CGAL::Arr_oblivious_side_tag`. typedef unspecified_type Top_side_category; - /*!Must be convertible to `CGAL::Arr_oblivious_side_tag`. - */ + /// Must be convertible to `CGAL::Arr_oblivious_side_tag`. typedef unspecified_type Right_side_category; /// @} @@ -90,40 +81,35 @@ public: /// \name Functor Types /// @{ - /*! models the concept `ArrTraits::CompareX_2`. - */ + /// models the concept `AosTraits::CompareX_2`. typedef unspecified_type Compare_x_2; - /*! models the concept `ArrTraits::CompareXy_2`. - */ + /// models the concept `AosTraits::CompareXy_2`. typedef unspecified_type Compare_xy_2; - /*! models the concept `ArrTraits::ConstructMinVertex_2`. - */typedef unspecified_type Construct_min_vertex_2; + /// models the concept `AosTraits::ConstructMinVertex_2`. + typedef unspecified_type Construct_min_vertex_2; - /*! models the concept `ArrTraits::ConstructMaxVertex_2`. - */ + /// models the concept `AosTraits::ConstructMaxVertex_2`. typedef unspecified_type Construct_max_vertex_2; - /*! models the concept `ArrTraits::IsVertical_2`. + /*! models the concept `AosTraits::IsVertical_2`. */ typedef unspecified_type Is_vertical_2; - /*! models the concept `ArrTraits::CompareYAtX_2`. + /*! models the concept `AosTraits::CompareYAtX_2`. */ typedef unspecified_type Compare_y_at_x_2; - /*! models the concept `ArrTraits::CompareYAtXLeft_2`. Required only if the + /*! models the concept `AosTraits::CompareYAtXLeft_2`. Required only if the * `Has_left_category` category is convertible to `Tag_true`. */ typedef unspecified_type Compare_y_at_x_left_2; - /*! models the concept `ArrTraits::CompareYAtXRight_2`. - */ + /// models the concept `AosTraits::CompareYAtXRight_2`. typedef unspecified_type Compare_y_at_x_right_2; - /*! models the concept `ArrTraits::Equal_2`. - */ + /// models the concept `AosTraits::Equal_2`. typedef unspecified_type Equal_2; /// @} @@ -131,33 +117,32 @@ public: /// \name Accessing Functor Objects /// @{ - //! + /// Compare_x_2 compare_x_2_object() const; - //! + /// Compare_xy_2 compare_xy_2_object() const; - //! + /// Construct_min_vertex_2 construct_min_vertex_2_object() const; - //! + /// Construct_max_vertex_2 construct_max_vertex_2_object() const; - //! + /// Is_vertical_2 is_vertical_2_object() const; - //! + /// Compare_y_at_x_2 compare_y_at_x_2_object() const; - //! + /// Compare_y_at_x_left_2 compare_y_at_x_left_2_object() const; - //! + /// Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const; - //! + /// Equal_2 equal_2_object() const; /// @} - -}; /* end ArrangementBasicTraits_2 */ +}; /* end AosBasicTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBottomSideTraits_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBottomSideTraits_2.h index 8d2682583b8..611b72751a6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementBottomSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosBottomSideTraits_2.h @@ -1,8 +1,7 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementBottomSideTraits_2` is an abstract concept. It generalizes all + * `AosBottomSideTraits_2` is an abstract concept. It generalizes all * concepts that handle curves that either reach or approach the bottom boundary * side of the parameter space. (An "abstract" concept is a concept that is * useless on its own.) Only a combination of this concept and additional @@ -10,14 +9,13 @@ * boundary sides (that is, left, right, and top) are purposeful, and can have * models. * - * \cgalRefines{ArrangementHorizontalSideTraits_2} + * \cgalRefines{AosHorizontalSideTraits_2} * - * \sa `ArrangementLeftSideTraits_2`, - * `ArrangementRightSideTraits_2`, and - * `ArrangementTopSideTraits_2` + * \sa `AosLeftSideTraits_2` + * \sa `AosRightSideTraits_2` + * \sa `AosTopSideTraits_2` */ - -class ArrangementBottomSideTraits_2 { +class AosBottomSideTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedBottomTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedBottomTraits_2.h similarity index 57% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedBottomTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedBottomTraits_2.h index 37a519a7eca..2c5ba88de4a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedBottomTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedBottomTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementClosedBottomTraits_2` must be used when + * A model of the concept `AosClosedBottomTraits_2` must be used when * the parameter space of the surface, the arrangement is embedded on, is closed * on the left side and curves inserted into the arrangement are expected to * reach this boundary side. A model of this concept can handle curves that * reach the left boundary side when it is closed. * - * \cgalRefines{ArrangementBottomSideTraits_2} + * \cgalRefines{AosBottomSideTraits_2} * - * \sa `ArrangementClosedLeftTraits_2`, - * `ArrangementClosedRightTraits_2`, - * `ArrangementClosedTopTraits_2`, - * `ArrangementOpenBottomTraits_2`, - * `ArrangementContractedBottomTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosClosedLeftTraits_2` + * \sa `AosClosedRightTraits_2` + * \sa `AosClosedTopTraits_2` + * \sa `AosOpenBottomTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosIdentifiedHorizontalTraits_2` */ - -class ArrangementClosedBottomTraits_2 { +class AosClosedBottomTraits_2 { public: /// \name Categories /// @{ @@ -34,7 +32,7 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareXOnBoundary_2`. + /// models the concept `AosTraits::CompareXOnBoundary_2`. typedef unspecified_type Compare_x_on_boundary_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedLeftTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedLeftTraits_2.h similarity index 57% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedLeftTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedLeftTraits_2.h index ec84ff22035..5cb13cd8ccb 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedLeftTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedLeftTraits_2.h @@ -1,30 +1,28 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementClosedLeftTraits_2` must be used when the + * A model of the concept `AosClosedLeftTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is closed on * the left side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * left boundary side when it is closed. - - * \cgalRefines{ArrangementLeftSideTraits_2} - -\sa `ArrangementClosedRightTraits_2`, - `ArrangementClosedBottomTraits_2`, - `ArrangementClosedTopTraits_2`, - `ArrangementOpenLeftTraits_2`, - `ArrangementContractedLeftTraits_2`, and - `ArrangementIdentifiedVerticalTraits_2`, -*/ - -class ArrangementClosedLeftTraits_2 { + * + * \cgalRefines{AosLeftSideTraits_2} + * + * \sa `AosClosedRightTraits_2` + * \sa `AosClosedBottomTraits_2` + * \sa `AosClosedTopTraits_2` + * \sa `AosOpenLeftTraits_2` + * \sa `AosContractedLeftTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` + */ +class AosClosedLeftTraits_2 { public: /// \name Categories /// @{ /*! Must be convertible to `CGAL::Arr_closed_side_tag`. - */ + */ typedef unspecified_type Left_side_category; /// @} @@ -35,7 +33,7 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareYOnBoundary_2`. + /// models the concept `AosTraits::CompareYOnBoundary_2`. typedef unspecified_type Compare_y_on_boundary_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedRightTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedRightTraits_2.h similarity index 57% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedRightTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedRightTraits_2.h index 4b4dc18d53d..b5f22fda9d3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedRightTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedRightTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementClosedRightTraits_2` must be used when the + * A model of the concept `AosClosedRightTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is closed on * the right side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * right boundary side when it is closed. * - * \cgalRefines{ArrangementRightSideTraits_2} + * \cgalRefines{AosRightSideTraits_2} * - * \sa `ArrangementClosedLeftTraits_2`, - * `ArrangementClosedBottomTraits_2`, - * `ArrangementClosedTopTraits_2`, - * `ArrangementOpenRightTraits_2`, - * `ArrangementContractedRightTraits_2`, and - * `ArrangementIdentifiedVerticalTraits_2`, + * \sa `AosClosedLeftTraits_2` + * \sa `AosClosedBottomTraits_2` + * \sa `AosClosedTopTraits_2` + * \sa `AosOpenRightTraits_2` + * \sa `AosContractedRightTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` */ - -class ArrangementClosedRightTraits_2 { +class AosClosedRightTraits_2 { public: /// \name Categories /// @{ @@ -34,7 +32,7 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareYOnBoundary_2`. + /// models the concept `AosTraits::CompareYOnBoundary_2`. typedef unspecified_type Compare_y_on_boundary_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedTopTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedTopTraits_2.h similarity index 57% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedTopTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedTopTraits_2.h index e03e3bfa938..7d8867770bf 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementClosedTopTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosClosedTopTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementClosedTopTraits_2` must be used when the + * A model of the concept `AosClosedTopTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is closed on * the top side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * top boundary side when it is closed. * - * \cgalRefines{ArrangementTopSideTraits_2} + * \cgalRefines{AosTopSideTraits_2} * - * \sa `ArrangementClosedLeftTraits_2`, - * `ArrangementClosedRightTraits_2`, - * `ArrangementClosedBottomTraits_2`, - * `ArrangementOpenTopTraits_2`, - * `ArrangementContractedTopTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosClosedLeftTraits_2` + * \sa `AosClosedRightTraits_2` + * \sa `AosClosedBottomTraits_2` + * \sa `AosOpenTopTraits_2` + * \sa `AosContractedTopTraits_2` + * \sa `AosIdentifiedHorizontalTraits_2` */ - -class ArrangementClosedTopTraits_2 { +class AosClosedTopTraits_2 { public: /// \name Categories /// @{ @@ -34,7 +32,7 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareXOnBoundary_2`. + /// models the concept `AosTraits::CompareXOnBoundary_2`. typedef unspecified_type Compare_x_on_boundary_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructCurveTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructCurveTraits_2.h similarity index 69% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructCurveTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructCurveTraits_2.h index 570967c2932..cab23b645c3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructCurveTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructCurveTraits_2.h @@ -1,11 +1,11 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * The concept `ArrangementConstructCurveTraits_2` refines the basic - * traits concept `ArrangementBasicTraits_2`. A model of this concept is able + * The concept `AosConstructCurveTraits_2` refines the basic + * traits concept `AosBasicTraits_2`. A model of this concept is able * to construct a curve from two points. * - * \cgalRefines{ArrangementTraits_2} + * \cgalRefines{AosTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_conic_traits_2} @@ -17,15 +17,15 @@ * \cgalHasModels{CGAL::Arr_rational_function_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementConstructXMonotoneCurveTraits_2`, and - * `ArrangementTraits_2` + * \sa `AosConstructXMonotoneCurveTraits_2` + * \sa `AosTraits_2` */ -class ArrangementConstructCurveTraits_2 { +class AosConstructCurveTraits_2 { public: /// \name Functor Types /// @{ - /*! models the concept `ArrTraits::ConstructCurve_2`. + /*! models the concept `AosTraits::ConstructCurve_2`. */ typedef unspecified_type Construct_curve_2; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructXMonotoneCurveTraits_2.h similarity index 60% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructXMonotoneCurveTraits_2.h index 6d0a822280e..66261e41f76 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementConstructXMonotoneCurveTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosConstructXMonotoneCurveTraits_2.h @@ -1,11 +1,11 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * The concept `ArrangementConstructXMonotoneCurveTraits_2` refines the basic - * traits concept `ArrangementBasicTraits_2`. A model of this concept is able to - * construct an \f$ x\f$-monotone curve from two points. + * The concept `AosConstructXMonotoneCurveTraits_2` refines the basic + * traits concept `AosBasicTraits_2`. A model of this concept is able to + * construct an \f$x\f$-monotone curve from two points. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_conic_traits_2} @@ -17,17 +17,17 @@ * \cgalHasModels{CGAL::Arr_rational_function_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementApproximateTraits_2`, - * `ArrangementXMonotoneTraits_2` - * `ArrangementTraits_2`, and - * `ArrangementConstructCurveTraits_2`. + * \sa `AosApproximatePointTraits_2` + * \sa `AosXMonotoneTraits_2` + * \sa `AosTraits_2` + * \sa `AosConstructCurveTraits_2` */ -class ArrangementConstructXMonotoneCurveTraits_2 { +class AosConstructXMonotoneCurveTraits_2 { public: /// \name Functor Types /// @{ - /*! models the concept `ArrTraits::ConstructXMonotoneCurve_2`. + /*! models the concept `AosTraits::ConstructXMonotoneCurve_2`. */ typedef unspecified_type Construct_x_monotone_curve_2; @@ -36,8 +36,7 @@ public: /// \name Accessing Functor Objects /// @{ - /*! - */ + /// Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedBottomTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedBottomTraits_2.h index 48563de6d81..858ff1b2173 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedBottomTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedBottomTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementContractedBottomTraits_2` must be used + * A model of the concept `AosContractedBottomTraits_2` must be used * when the parameter space of the surface, the arrangement is embedded on, is * contracted on the bottom side and curves inserted into the arrangement are * expected to reach this boundary side. A model of this concept can handle * curves that reach the bottom boundary side when it is contracted. * - * \cgalRefines{ArrangementBottomSideTraits_2} + * \cgalRefines{AosBottomSideTraits_2} * - * \sa `ArrangementContractedLeftTraits_2`, - * `ArrangementContractedRightTraits_2`, - * `ArrangementContractedTopTraits_2`, - * `ArrangementClosedBottomTraits_2`, - * `ArrangementContractedBottomTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosContractedLeftTraits_2` + * \sa `AosContractedRightTraits_2` + * \sa `AosContractedTopTraits_2` + * \sa `AosClosedBottomTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosIdentifiedHorizontalTraits_2` */ - -class ArrangementContractedBottomTraits_2 { +class AosContractedBottomTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedLeftTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedLeftTraits_2.h index de1940c372b..d4bb30cf67b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedLeftTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedLeftTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementContractedLeftTraits_2` must be used when + * A model of the concept `AosContractedLeftTraits_2` must be used when * the parameter space of the surface, the arrangement is embedded on, is * contracted on the left side and curves inserted into the arrangement are * expected to reach this boundary side. A model of this concept can handle * curves that reach the left boundary side when it is contracted. * - * \cgalRefines{ArrangementLeftSideTraits_2} + * \cgalRefines{AosLeftSideTraits_2} * - * \sa `ArrangementContractedRightTraits_2`, - * `ArrangementContractedBottomTraits_2`, - * `ArrangementContractedTopTraits_2`, - * `ArrangementOpenLeftTraits_2`, - * `ArrangementClosedLeftTraits_2`, and - * `ArrangementIdentifiedVerticalTraits_2` + * \sa `AosContractedRightTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosContractedTopTraits_2` + * \sa `AosOpenLeftTraits_2` + * \sa `AosClosedLeftTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` */ - -class ArrangementContractedLeftTraits_2 { +class AosContractedLeftTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedRightTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedRightTraits_2.h index a36bca2691e..6b6bfc1c141 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedRightTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedRightTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementContractedRightTraits_2` must be used when + * A model of the concept `AosContractedRightTraits_2` must be used when * the parameter space of the surface, the arrangement is embedded on, is * contracted on the right side and curves inserted into the arrangement are * expected to reach this boundary side. A model of this concept can handle * curves that reach the right boundary side when it is contracted. * - * \cgalRefines{ArrangementRightSideTraits_2} + * \cgalRefines{AosRightSideTraits_2} * - * \sa `ArrangementContractedLeftTraits_2`, - * `ArrangementContractedBottomTraits_2`, - * `ArrangementContractedTopTraits_2`, - * `ArrangementOpenRightTraits_2`, - * `ArrangementClosedRightTraits_2`, and - * `ArrangementIdentifiedVerticalTraits_2` + * \sa `AosContractedLeftTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosContractedTopTraits_2` + * \sa `AosOpenRightTraits_2` + * \sa `AosClosedRightTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` */ - -class ArrangementContractedRightTraits_2 { +class AosContractedRightTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedTopTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedTopTraits_2.h index d4a2d352af4..8ee739fc15c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementContractedTopTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosContractedTopTraits_2.h @@ -1,24 +1,22 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementContractedTopTraits_2` must be used when + * A model of the concept `AosContractedTopTraits_2` must be used when * the parameter space of the surface, the arrangement is embedded on, is * contracted on the top side and curves inserted into the arrangement are * expected to reach this boundary side. A model of this concept can handle * curves that reach the top boundary side when it is contracted. * - * \cgalRefines{ArrangementTopSideTraits_2} + * \cgalRefines{AosTopSideTraits_2} * - * \sa `ArrangementContractedLeftTraits_2`, - * `ArrangementContractedRightTraits_2`, - * `ArrangementContractedBottomTraits_2`, - * `ArrangementOpenTopTraits_2`, - * `ArrangementSlosedTopTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosContractedLeftTraits_2` + * \sa `AosContractedRightTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosOpenTopTraits_2` + * \sa `AosSlosedTopTraits_2` + * \sa `AosIdentifiedHorizontalTraits_2` */ - -class ArrangementContractedTopTraits_2 { +class AosContractedTopTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcel.h new file mode 100644 index 00000000000..ccbca2074c2 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcel.h @@ -0,0 +1,232 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A doubly-connected edge-list (\dcel for short) data-structure. It consists of + * three containers of records: vertices \f$V\f$, halfedges \f$E\f$, and faces + * \f$F\f$. It maintains the incidence relation among them. The halfedges are + * ordered in pairs sometimes referred to as twins, such that each halfedge pair + * represent an edge. + * + * A model of the `AosDcel` concept must provide the following types and + * operations. (In addition to the requirements here, the local types + * `Vertex`,`Halfedge`, `Face`, `Outer_ccb`, `Inner_ccb`, and `Isolated_vertex` + * must be models of the concepts `AosDcelVertex`, + * `AosDcelHalfedge`, `AosDcelFace`, `AosDcelOuterCcb`, + * `AosDcelInnerCcb`, and `AosDcelIsolatedVertex` respectively.) + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_dcel_base} + * \cgalHasModels{CGAL::Arr_default_dcel} + * \cgalHasModels{CGAL::Arr_face_extended_dcel} + * \cgalHasModels{CGAL::Arr_extended_dcel} + * \cgalHasModelsEnd + * + * \sa `AosDcelVertex` + * \sa `AosDcelHalfedge` + * \sa `AosDcelFace` + * \sa `AosDcelOuterCcb` + * \sa `AosDcelInnerCcb` + * \sa `AosDcelIsolatedVertex` + */ + +class AosDcel { +public: + /// \name Types + /// @{ + + /// the vertex type. + typedef unspecified_type Vertex; + + /// the halfedge type. + typedef unspecified_type Halfedge; + + /// the face type. + typedef unspecified_type Face; + + /// the Outer CCB type. + typedef unspecified_type Outer_ccb; + + /// the Inner CCB type. + typedef unspecified_type Inner_ccb; + + /// the hole (i.e., Inner_ccb) type. + typedef unspecified_type Hole; + + /// the isolated vertex type. + typedef unspecified_type Isolated_vertex; + + /// used to represent size values (e.g., `std::size_t`). + typedef unspecified_type Size; + + /// a bidirectional iterator over the vertices. Its value-type is `Vertex`. + typedef unspecified_type Vertex_iterator; + + /// a bidirectional iterator over the vertices. Its value-type is `Vertex`. + typedef unspecified_type Vertex_const_iterator; + + /// a bidirectional iterator over the halfedges. Its value-type is `Halfedge`. + typedef unspecified_type Halfedge_iterator; + + /// a bidirectional iterator over the halfedges. Its value-type is `Halfedge`. + typedef unspecified_type Halfedge_const_iterator; + + /// a bidirectional iterator over the faces. Its value-type is `Face`. + typedef unspecified_type Face_iterator; + + /// a bidirectional iterator over the faces. Its value-type is `Face`. + typedef unspecified_type Face_const_iterator; + + /// @} + + /// \name Creation + /// @{ + + /*! constructs an empty \dcel with one unbounded face. + */ + Arr_dcel(); + + /*! assigns the contents of the `other` \dcel whose unbounded face is given by + * `uf`, to `dcel`. The function returns a pointer to the unbounded face of + * `dcel` after the assignment. + */ + Face* assign(const Self& other, const Face *uf); + + /// @} + + /// \name Access Functions + /// @{ + + /*! obtains the number of vertices. */ + Size size_of_vertices() const; + + /*! obtains the number of halfedges (always even). */ + Size size_of_halfedges() const; + + /*! obtains the number of faces. */ + Size size_of_faces() const; + + /*! obtains the number of outer CCBs. */ + Size size_of_outer_ccbs() const; + + /*! obtains the number of inner CCBs. */ + Size size_of_inner_ccbs() const; + + /*! obtains the number of holes (i.e., inner CCBs). */ + Size size_of_holes() const; + + /*! obtains the number of isolated vertices. */ + Size size_of_isolated_vertices() const; + + /*! obtains a begin-iterator of the vertices in `dcel`. */ + Vertex_iterator vertices_begin(); + + /*! obtains a past-the-end iterator of the vertices in `dcel`. */ + Vertex_iterator vertices_end(); + + /*! obtains a range over handles of the vertices in `dcel`. */ + unspecified_type vertex_handles(); + + /*! obtains a begin-iterator of the vertices in `dcel`. */ + Vertex_const_iterator vertices_begin() const; + + /*! obtains a past-the-end iterator of the vertices in `dcel`. */ + Vertex_const_iterator vertices_end() const; + + /*! obtains a const range (model of `ConstRange`) over handles of the vertices + * in `dcel`. + */ + unspecified_type vertex_handles() const; + + /*! obtains a begin-iterator of the halfedges in `dcel`. */ + Halfedge_iterator halfedges_begin(); + + /*! obtains a past-the-end iterator of the halfedges in `dcel`. */ + Halfedge_iterator halfedges_end(); + + /*! obtains a range over handles of the halfedges in `dcel`. */ + unspecified_type halfedge_handles(); + + /*! obtains a begin-iterator of the halfedges in `dcel`. */ + Halfedge_const_iterator halfedges_begin() const; + + /*! obtains a past-the-end iterator of the halfedges in `dcel`. */ + Halfedge_const_iterator halfedges_end() const; + + /*! obtains a const range (model of `ConstRange`) over handles of the halfedges + * in `dcel`. + */ + unspecified_type halfedge_handles() const; + + /*! obtains a begin-iterator of the faces in `dcel`. */ + Face_iterator faces_begin(); + + /*! obtains a past-the-end iterator of the faces in `dcel`. */ + Face_iterator faces_end(); + + /*! obtains a range over handles of the faces in `dcel`. */ + unspecified_type face_handles(); + + /*! obtains a begin-iterator of the faces in `dcel`. */ + Face_const_iterator faces_begin() const; + + /*! obtains a past-the-end iterator of the faces in `dcel`. */ + Face_const_iterator faces_end() const; + + /*! obtains a const range (model of `ConstRange`) over handles of the faces in + * `dcel`. + */ + unspecified_type face_handles() const; + + /// @} + + /// \name Modifiers + /// The following operations allocate a new element of the respective + /// type. Halfedges are always allocated in pairs of opposite + /// halfedges. The halfedges and their opposite pointers are + /// automatically set. + /// @{ + + /*! creates a new vertex. */ + Vertex* new_vertex(); + + /*! creates a new pair of twin halfedges. */ + Halfedge* new_edge(); + + /*! creates a new face. */ + Face* new_face(); + + /*! creates a new outer CCB record. */ + Hole* new_outer_ccb(); + + /*! creates a new inner CCB record. */ + Hole* new_inner_ccb(); + + /*! creates a new hole (i.e., inner CCB) record. */ + Hole* new_hole(); + + /*! creates a new isolated vertex record. */ + Isolated_vertex* new_isolated_vertex(); + + /*! deletes a given vertex `v`. */ + void delete_vertex(Vertex* v); + + /*! deletes a given halfedge `e` as well as its twin. */ + void delete_edge(Halfedge* e); + + /*! deletes a given face `f`. */ + void delete_face(Face* f); + + /*! deletes a given outer CCB `oc`. */ + void delete_outer_ccb(Outer_ccb* oc); + + /*! deletes a given inner CCB `ic`. */ + void delete_inner_ccb(Inner_ccb* oc); + + /*! deletes a given hole (i.e., inner CCB) `ho`. */ + void delete_hole(Hole* ho); + + /*! deletes a given isolated vertex `iv`. */ + void delete_isolated_vertex(Isolated_vertex* iv); + + /// @} +}; /* end AosDcel */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelFace.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelFace.h new file mode 100644 index 00000000000..595f69cf54d --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelFace.h @@ -0,0 +1,152 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A face record in a \dcel data structure. A face represents a region, which + * may have outer and inner boundaries. A boundary conists of a chain of + * incident halfedges, referred to as a Connected Component of the Boundary + * (CCB). A face may be unbounded. Otherwise, it has one or more outer CCBs. A + * face may also be bounded by inner CCBs, and it may contain isolated vertices + * in its interior. A planar face may have only one outer CCBs and its inner + * CCBs are referred to as holes. + * + * \sa `AosDcel` + * \sa `AosDcelVertex` + * \sa `AosDcelHalfedge` + */ +class AosDcelFace { +public: + /// \name Types + /// The non-mutable iterators `Outer_ccb_const_iterator`, + /// `Inner_ccb_const_iterator`, `Hole_const_iterator`, and + /// `Isolated_vertex_const_iterator` are also defined. + /// @{ + + //! the corresponding \dcel vertex type. + typedef unspecified_type Vertex; + + //! the corresponding \dcel halfedge type. + typedef unspecified_type Halfedge; + + /*! a bidirectional iterator over the outer CCBs of the face. Its value-type + * is `Halfedge*`. + */ + typedef unspecified_type Outer_ccb_iterator; + + /*! a bidirectional iterator over the inner CCBs of the face. Its value-type + * is `Halfedge*`. + */ + typedef unspecified_type Inner_ccb_iterator; + + /*! a bidirectional iterator over the holes (i.e., inner CCBs) of the face. Its + * value-type is `Halfedge*`. + */ + typedef unspecified_type Hole_iterator; + + /*! a bidirectional iterator over the isolated vertices in inside the face. + * Its value-type is `Vertex*`. + */ + typedef unspecified_type Isolated_vertex_iterator; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. */ + Arr_dcel_face(); + + /*! assigns `f` with the contents of the `other` face. */ + void assign(const Self& other); + + /// @} + + /// \name Access Functions + /// All functions below also have `const` counterparts, returning + /// non-mutable pointers or iterators: + /// @{ + + /*! determines whether the face is unbounded. */ + bool is_unbounded() const; + + /*! obtains an incident halfedge along the outer boundaries of the face. If + * `f` has no outer boundary, the function returns `nullptr`. + */ + Halfedge* halfedge(); + + /*! obtains the number of outer CCBs of `f`. In case of planar arrangement + * this is either 0 or 1. + */ + std::size_t number_of_outer_ccbs() const; + + /*! obtains a begin iterator for the outer CCBs of `f`. */ + Outer_ccb_iterator outer_ccbs_begin(); + + /*! obtains a past-the-end iterator for the outer CCBs of `f`. */ + Outer_ccb_iterator outer_ccbs_end(); + + /*! obtains the number of inner CCBs of `f`. */ + std::size_t number_of_inner_ccbs() const; + + /*! obtains a begin iterator for the inner CCBs of `f`. */ + Inner_ccb_iterator inner_ccbs_begin(); + + /*! obtains a past-the-end iterator for the inner CCBs of `f`. */ + Inner_ccb_iterator inner_ccbs_end(); + + /*! obtains the number of holes (i.e., inner CCBs) inside `f`. */ + std::size_t number_of_holes() const; + + /*! obtains a begin-iterator for the holes (i.e., inner CCBs) of `f`. */ + Hole_iterator holes_begin(); + + /*! obtains a past-the-end iterator for the holes (i.e., inner CCBs) of `f`. */ + Hole_iterator holes_end(); + + /*! obtains the number of isolated vertices inside `f`. */ + std::size_t number_of_isolated_vertices() const; + + /*! obtains a begin-iterator for the isolated vertices inside `f`. */ + Isolated_vertex_iterator isolated_vertices_begin(); + + /*! obtains a past-the-end iterator for the isolated vertices inside `f`. */ + Isolated_vertex_iterator isolated_vertices_end(); + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the face as unbounded (if `flag` is `true`), or as a bounded face + * (if it is `false`). + */ + void set_unbounded(bool flag); + + /*! sets the incident halfedge. */ + void set_halfedge(Halfedge* e); + + /*! adds `e` as an outer CCB of `f`. */ + void add_outer_ccb(Halfedge* e); + + /*! removes the outer CCB that `it` points to from `f`. */ + void erase_outer_ccb(Outer_ccb_iterator it); + + /*! adds `e` as an inner CCB of `f`. */ + void add_inner_ccb(Halfedge* e); + + /*! removes the inner CCB that `it` points to from `f`. */ + void erase_inner_ccb(Inner_ccb_iterator it); + + /*! adds `e` as a hole (i.e., inner CCB) of `f`. */ + void add_hole(Halfedge* e); + + /*! removes the hole (i.e., inner CCB) that `it` points to from `f`. */ + void erase_hole(Hole_iterator it); + + /*! adds `v` as an isolated vertex inside `f`. */ + void add_isolated_vertex(Vertex* v); + + /*! removes the isolated vertex that `it` points to from inside `f`. */ + void erase_isolated_vertex(Isolated_vertex_iterator it); + + /// @} +}; /* end AosDcelFace */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelHalfedge.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelHalfedge.h new file mode 100644 index 00000000000..bd1cadb977a --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelHalfedge.h @@ -0,0 +1,157 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A halfedge record in a \dcel data structure. Two halfedges with opposite + * directions always form an edge (a halfedge pair). The halfedges form together + * chains, defining the boundaries of connected components, such that all + * halfedges along a chain have the same incident face. Note that the chain the + * halfedge belongs to may form the outer boundary of a bounded face (an outer + * CCB) or the boundary of a hole inside a face (an inner CCB). + * + * An edge is always associated with a curve, but the halfedge records only + * store a pointer to the associated curve, and the actual curve objects are + * stored elsewhere. Two opposite halfedges are always associated with the same + * curve. + * + * \sa `AosDcel` + * \sa `AosDcelVertex` + * \sa `AosDcelFace` + * \sa `AosDcelOuterCcb` + * \sa `AosDcelInnerCcb` + */ + +class AosDcelHalfedge { +public: + /// \name Types + /// @{ + + //! the corresponding \dcel vertex type. + typedef unspecified_type Vertex; + + //! the corresponding \dcel face type. + typedef unspecified_type Face; + + //! the corresponding \dcel hole type. + typedef unspecified_type Hole; + + //! the curve type associated with the edge. + typedef unspecified_type X_monotone_curve; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + Arr_dcel_halfedge(); + + /*! assigns `e` with the contents of the `other` halfedge. + */ + void assign(const Self& other); + + /// @} + + /// \name Access Functions + /// @{ + + /*! returns `ARR_LEFT_TO_RIGHT` if `e`'s source vertex is + * lexicographically smaller than it target, and + * `ARR_RIGHT_TO_LEFT` if it is lexicographically larger than the target. + */ + Arr_halfedge_direction direction() const; + + /*! determines whether the `e` lies on an outer CCB of a bounded face, + * or on an inner CCB (a hole inside a face). The function returns `true` + * if `e` lies on a hole. + */ + bool is_on_hole() const; + + /// @} + + /// \name + /// All functions below also have `const` counterparts, returning non-mutable + /// pointers or references: + /// @{ + + /*! returns the twin halfedge. + */ + Halfedge* opposite(); + + /*! returns the previous halfedge along the chain. + */ + Halfedge* prev(); + + /*! returns the next halfedge along the chain. + */ + Halfedge* next(); + + /*! returns the target vertex. + */ + Vertex* vertex(); + + /*! returns the incident face. + * + * \pre `e` lies on the outer boundary of this face. + */ + Face* face(); + + /*! returns the hole (inner CCB) `e` belongs to. + * + * \pre `e` lies on a hole inside its incident face. + */ + Hole* hole(); + + /*! returns whether the vertex is not associated with a valid curve. + */ + bool has_null_curve() const; + + /*! returns the associated curve. + * \pre `e` is associated with a valid curve. + */ + X_monotone_curve& curve(); + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the opposite halfedge. + */ + void set_opposite(Halfedge* opp); + + /*! sets the lexicographical order between `e`'s source and target + * vertices to be `dir`. The direction of the opposite halfedge is also set + * to the opposite direction. + */ + void set_direction(Arr_halfedge_direction dir); + + /*! sets the previous halfedge of `e` along the chain, + * and updates the cross-pointer `prev->next()`. + */ + void set_prev(Halfedge* prev); + + /*! sets the next halfedge of `e` along the chain, + * and updates the cross-pointer `next->prev()`. + */ + void set_next(Halfedge* next); + + /*! sets the target vertex. + */ + void set_vertex(Vertex* v); + + /*! sets the incident face, marking that `e` lies on the outer CCB + * of the face `f`. + */ + void set_face(Face* f); + + /*! sets the incident hole, marking that `e` lies on an inner CCB. + */ + void set_hole(Hole* ho); + + /*! sets the associated curve of `e` and its opposite halfedge. + */ + void set_curve(X_monotone_curve* c); + + /// @} +}; /* end AosDcelHalfedge */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelInnerCcb.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelInnerCcb.h new file mode 100644 index 00000000000..3c436b30ac3 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelInnerCcb.h @@ -0,0 +1,56 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A hole record in a Dcel data structure, which + * stores the face that contains the hole in its interior, along with an + * iterator for the hole in the holes' container of this face. + * + * \sa `AosDcel` + * \sa `AosDcelFace` + */ + +class AosDcelInnerCcb { +public: + /// \name Types + /// @{ + + /*! the corresponding Dcel face type. */ + typedef unspecified_type Face; + + /*! + */ + typedef Face::InnerCcb_iterator InnerCcb_iterator; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. */ + Arr_dcel_hole(); + + /// @} + + /// \name Access Functions + /// All functions below also have `const` counterparts, returning non-mutable pointers or iterators: + /// @{ + + /*! returns the incident face, which contains `ho` in its interior. */ + Face* face(); + + /*! returns an iterator for the hole. */ + InnerCcb_iterator iterator(); + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the incident face. */ + void set_face(Face* f); + + /*! sets the hole iterator. */ + void set_iterator(InnerCcb_iterator it); + + /// @} +}; /* end AosDcelInnerCcb */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelIsolatedVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelIsolatedVertex.h new file mode 100644 index 00000000000..495e2e89076 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelIsolatedVertex.h @@ -0,0 +1,62 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * An isolated vertex-information record in a \dcel data structure, which stores + * the face that contains the isolated vertex in its interior, along with an + * iterator for the isolated vertex in the isolated vertices' container of this + * face. + * + * \sa `AosDcel` + * \sa `AosDcelFace` + */ + +class AosDcelIsolatedVertex { +public: + /// \name Types + /// @{ + + /// the corresponding \dcel face type. + typedef unspecified_type Face; + + /// + typedef Face::Isolated_vertex_iterator Isolated_vertex_iterator; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + Arr_dcel_isolated_vertex(); + + /// @} + + /// \name Access Functions + /// All functions below also have `const` counterparts, returning + /// non-mutable pointers or iterators: + /// @{ + + /*! returns the incident face, which contains `iv` in its interior. + */ + Face* face(); + + /*! returns an iterator for the isolated vertex. + */ + Isolated_vertex_iterator iterator(); + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the incident face. + */ + void set_face(Face* f); + + /*! sets the isolated vertex iterator. + */ + void set_iterator(Isolated_vertex_iterator it); + + /// @} +}; /* end AosDcelIsolatedVertex */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelOuterCcb.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelOuterCcb.h new file mode 100644 index 00000000000..7d87b8431ee --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelOuterCcb.h @@ -0,0 +1,59 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A hole record in a \dcel data structure, which stores the face that contains + * the hole in its interior, along with an iterator for the hole in the holes' + * container of this face. + * + * \sa `AosDcel` + * \sa `AosDcelFace` + */ +class AosDcelOuterCcb { +public: + /// \name Types + /// @{ + + /// the corresponding \dcel face type. + typedef unspecified_type Face; + + /// + typedef Face::OuterCcb_iterator OuterCcb_iterator; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + Arr_dcel_hole(); + + /// @} + + /// \name Access Functions + /// All functions below also have `const` counterparts, returning non-mutable pointers or iterators: + /// @{ + + /*! returns the incident face, which contains `ho` in its interior. + */ + Face* face(); + + /*! returns an iterator for the hole. + */ + OuterCcb_iterator iterator(); + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the incident face. + */ + void set_face(Face* f); + + /*! sets the hole iterator. + */ + void set_iterator(OuterCcb_iterator it); + + /// @} +}; /* end AosDcelOuterCcb */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelVertex.h new file mode 100644 index 00000000000..be6f92b4b70 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelVertex.h @@ -0,0 +1,117 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * A vertex record in a \dcel data structure. A vertex is always associated + * with a point. However, the vertex record only stores a pointer to the + * associated point, and the actual `Point` object is stored elsewhere. + * + * A vertex usually has several halfedges incident to it, such that it is + * possible to access one of these halfedges directly and to traverse all + * incident halfedges around the vertex. However, the \dcel may also contain + * isolated vertices that have no incident halfedges. In this case, the vertex + * stores an isolated vertex-information record, indicating the face that + * contains this vertex in its interior. + * + * \sa `AosDcel` + * \sa `AosDcelHalfedge` + * \sa `AosDcelIsolatedVertex` + */ +class AosDcelVertex { +public: + /// \name Types + /// @{ + + /// the corresponding \dcel halfedge type. + typedef unspecified_type Halfedge; + + /// the corresponding \dcel isolated vertex-information type. + typedef unspecified_type Isolated_vertex; + + /// the point type associated with the vertex. + typedef unspecified_type Point; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + Arr_dcel_vertex(); + + /*! assigns `v` with the contents of the `other` vertex. + */ + void assign(const Self& other); + + /// @} + + /// \name Access Functions + /// All functions below also have `const` counterparts, returning + /// non-mutable pointers or references: + /// @{ + + /*! returns whether the vertex is isolated (has no incident halfedges). + */ + bool is_isolated() const; + + /*! returns an incident halfedge that has `v` as its target. + * + * \pre `v` is not an isolated vertex. + */ + Halfedge* halfedge(); + + /*! returns the isolated vertex-information record. + * + * \pre `v` is an isolated vertex. + */ + Isolated_vertex* isolated_vertex(); + + /*! returns whether the vertex is not associated with a valid point + * (i.e.\ it lies at infinity). + */ + bool has_null_point() const; + + /*! returns the associated point. + * + * \pre `v`() is associated with a valid point. + */ + Point& point(); + + /*! returns the placement of the \f$x\f$-coordinate in the parameter space, + * that is, either the left boundary-side, the interior, or the right + * boundary-side. + */ + Arr_parameter_space parameter_space_in_x() const; + + /*! returns the placement of the \f$y\f$-coordinate in the parameter space, + * that is, either the bottom boundary-side, the interior, or the top + * boundary-side. + */ + Arr_parameter_space parameter_space_in_y() const; + + /// @} + + /// \name Modifiers + /// @{ + + /*! sets the incident halfedge, marking `v` as a regular vertex. + */ + void set_halfedge(Halfedge* e); + + /*! sets the isolated vertex-information record, marking `v` + * as an isolated vertex. + */ + void set_isolated_vertex(Isolated_vertex* iv); + + /*! sets the associated point. + */ + void set_point(Point* p); + + /*! sets `v` as a vertex on a boundary side. + * + * \pre Either `inf_x` or `inf_y` is not `ARR_INTERIOR`. + */ + void set_boundary(Arr_parameter_space inf_x, Arr_parameter_space inf_y); + + /// @} +}; /* end AosDcelVertex */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelWithRebind.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelWithRebind.h new file mode 100644 index 00000000000..4aa18530dee --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosDcelWithRebind.h @@ -0,0 +1,44 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL + * \cgalConcept + * + * The concept `AosDcelWithRebind` refines the `AosDcel` concept by adding + * a policy clone idiom in form of a rebind struct-template. + * + * Instantiate a \dcel class with many different possible types without ad-hoc + * limitations on type of the \dcel classes. + * + * \cgalRefines{AosDcel} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_default_dcel} + * \cgalHasModels{CGAL::Arr_dcel} + * \cgalHasModels{CGAL::Arr_face_extended_dcel} + * \cgalHasModels{CGAL::Arr_extended_dcel} + * \cgalHasModelsEnd + */ +class AosDcelWithRebind { +public: + /// \name Types + /// @{ + + /*! allows the instantiation of a model of the base concept + * `AosDcel` with a different possible geometry-traits + class without ad-hoc limitations on it. + * + * Following the standard clone policy, the rebind struct-template must + * have a nested type named `other` that defines the type of the + * model replica. + */ + typedef unspecified_type template rebind; + + /// @} + + /// \name Creation + /// @{ + + /*! constructs an empty \dcel with one unbounded face. + */ + Arr_dcel(); + + /// @} +}; /* end AosDcelWithRebind */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementHorizontalSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosHorizontalSideTraits_2.h similarity index 75% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementHorizontalSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosHorizontalSideTraits_2.h index e28c300acea..baa038464c5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementHorizontalSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosHorizontalSideTraits_2.h @@ -1,7 +1,7 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementHorizontalSideTraits_2` is an abstract concept. It generalizes + * `AosHorizontalSideTraits_2` is an abstract concept. It generalizes * all concepts that handle curves that either reach or approach either the * bottom or top sizeds of the boundary of the parameter space. (An "abstract" * concept is a concept that is useless on its own.) Only a combination of this @@ -9,7 +9,7 @@ * approach the remaining boundary sides (that is, left and right) are * purposeful, and can have models. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_linear_traits_2} @@ -18,12 +18,10 @@ * \cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementVerticalSideTraits_2` + * \sa `AosVerticalSideTraits_2` */ - -class ArrangementHorizontalSideTraits_2 { +class AosHorizontalSideTraits_2 { public: - /// \name Categories /// @{ /// @} @@ -35,13 +33,13 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::ParameterSpaceInY_2`. + /// models the concept `AosTraits::ParameterSpaceInY_2`. typedef unspecified_type Parameter_space_in_y_2; - /// models the concept `ArrTraits::CompareXOnBoundaryOfCurveEnd_2`. + /// models the concept `AosTraits::CompareXOnBoundaryOfCurveEnd_2`. typedef unspecified_type Compare_x_on_boundary_2; - /// models the concept `ArrTraits::CompareXNearBoundary_2`. + /// models the concept `AosTraits::CompareXNearBoundary_2`. typedef unspecified_type Compare_x_near_boundary_2; /// @} @@ -53,4 +51,4 @@ public: Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const; /// @} -}; /* end ArrangementHorizontalSideTraits_2 */ +}; /* end AosHorizontalSideTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedHorizontalTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedHorizontalTraits_2.h similarity index 59% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedHorizontalTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedHorizontalTraits_2.h index 1e8603639d0..c95b6ee47d9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedHorizontalTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedHorizontalTraits_2.h @@ -1,23 +1,22 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementIdentifiedHorizontalTraits_2` must be used + * A model of the concept `AosIdentifiedHorizontalTraits_2` must be used * when the parameter space of the surface, the arrangement is embedded on, is * identified on the bottom and top sides and curves inserted into the * arrangement are expected to reach these boundary sides. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * - * \sa `ArrangementIdentifiedVerticalTraits_2`, - * `ArrangementOpenBottomTraits_2`, - * `ArrangementClosedBottomTraits_2`, and - * `ArrangementContractedBottomTraits_2` - * `ArrangementOpenTopTraits_2`, - * `ArrangementClosedTopTraits_2`, and - * `ArrangementContractedTopTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` + * \sa `AosOpenBottomTraits_2` + * \sa `AosClosedBottomTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosOpenTopTraits_2` + * \sa `AosClosedTopTraits_2` + * \sa `AosContractedTopTraits_2` */ - -class ArrangementIdentifiedHorizontalTraits_2 { +class AosIdentifiedHorizontalTraits_2 { public: /// \name Categories /// @{ @@ -34,10 +33,10 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareXOnBoundary_2`. + /// models the concept `AosTraits::CompareXOnBoundary_2`. typedef unspecified_type Compare_x_on_boundary_2; - /// models the concept `ArrTraits::IsOnXIdentification_2`. + /// models the concept `AosTraits::IsOnXIdentification_2`. typedef unspecified_type Is_on_x_identification_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedVerticalTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedVerticalTraits_2.h similarity index 53% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedVerticalTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedVerticalTraits_2.h index f42663dd8da..493596fbf18 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementIdentifiedVerticalTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosIdentifiedVerticalTraits_2.h @@ -1,23 +1,22 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementIdentifiedVerticalTraits_2` must be used - * when the parameter space of the surface, the arrangement is embedded on, is - * identified on the left and right sides and curves inserted into the + * A model of the concept `AosIdentifiedVerticalTraits_2` must be used + * when the parameter space of the surface, the arrangement is embedded on, + * is identified on the left and right sides and curves inserted into the * arrangement are expected to reach these boundary sides. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * - * \sa `ArrangementIdentifiedHorizontalTraits_2`, - * `ArrangementOpenLeftTraits_2`, - * `ArrangementClosedLeftTraits_2`, and - * `ArrangementContractedLeftTraits_2` - * `ArrangementOpenRightTraits_2`, - * `ArrangementClosedRightTraits_2`, and - * `ArrangementContractedRightTraits_2` + * \sa `AosIdentifiedHorizontalTraits_2` + * \sa `AosOpenLeftTraits_2` + * \sa `AosClosedLeftTraits_2` + * \sa `AosContractedLeftTraits_2` + * \sa `AosOpenRightTraits_2` + * \sa `AosClosedRightTraits_2` + * \sa `AosContractedRightTraits_2` */ - -class ArrangementIdentifiedVerticalTraits_2 { +class AosIdentifiedVerticalTraits_2 { public: /// \name Categories /// @{ @@ -34,10 +33,10 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::CompareYOnBoundary_2`. + /// models the concept `AosTraits::CompareYOnBoundary_2`. typedef unspecified_type Compare_y_on_boundary_2; - /// models the concept `ArrTraits::IsOnYIdentification_2`. + /// models the concept `AosTraits::IsOnYIdentification_2`. typedef unspecified_type Is_on_y_identification_2; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosInputFormatter.h new file mode 100644 index 00000000000..daf23668c41 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosInputFormatter.h @@ -0,0 +1,202 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept + * + * A model for the `AosInputFormatter` concept supports a set of + * functions that enable reading an arrangement from an input stream using a + * specific format. + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_text_formatter} + * \cgalHasModels{CGAL::Arr_face_extended_text_formatter} + * \cgalHasModels{CGAL::Arr_extended_dcel_text_formatter} + * \cgalHasModelsEnd + */ +class AosInputFormatter { +public: + /// \name Types + /// @{ + + /// the type of arrangement to input. + typedef unspecified_type Arrangement_2; + + /// the point type. + typedef typename Arrangement_2::Point_2 Point_2; + + /// the \f$x\f$-monotone curve type. + typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + + /// + typedef typename Arrangement_2::Size Size; + + /// + typedef typename Arrangement_2::Vertex_handle Vertex_handle; + + /// + typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + + /// + typedef typename Arrangement_2::Face_handle Face_handle; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + Arr_in_formatter(); + + /*! constructs a formatter that reads from `is`. + */ + Arr_in_formatter(std::istream& is); + + /*! directs `inf` to read from `is`. + */ + void set_in(std::istream& is); + + /// @} + + /// \name Access Functions + /// @{ + + /*! returns the stream that `inf` reads from. + * \pre `inf` is directed to a valid output stream. + */ + std::istream& in(); + + /// @} + + /// \name Formatted Input Functions + /// @{ + + /*! reads a message indicating the beginning of the arrangement. */ + void read_arrangement_begin(); + + /*! reads a message indicating the end of the arrangement. */ + void read_arrangement_end(); + + /*! reads a size value, which is supposed to be preceded by the given label. + */ + Size read_size(const char *label = nullptr); + + /*! reads a message indicating the beginning of the vertex records. */ + void read_vertices_begin(); + + /*! reads a message indicating the end of the vertex records. */ + void read_vertices_end(); + + /*! reads a message indicating the beginning of the edge records. */ + void read_edges_begin(); + + /*! reads a message indicating the end of the edge records. */ + void read_edges_end(); + + /*! reads a message indicating the beginning of the face records. */ + void read_faces_begin(); + + /*! reads a message indicating the end of the face records. */ + void read_faces_end(); + + /*! reads a message indicating the beginning of a single vertex record. */ + void read_vertex_begin(); + + /*! reads a message indicating the end of a single vertex record. */ + void read_vertex_end(); + + /*! reads and returns a vertex index. */ + std::size_t read_vertex_index(); + + /*! reads a point. */ + void read_point(Point_2& p); + + /*! reads an auxiliary vertex-data object and associates it with the vertex + * `v`. + */ + void read_vertex_data(Vertex_handle v); + + /*! reads a message indicating the beginning of a single edge record. */ + void read_edge_begin(); + + /*! reads a message indicating the end of a single edge record. */ + void read_edge_end(); + + /*! reads and returns halfedge index. */ + std::size_t read_halfedge_index(); + + /*! reads an \f$x\f$-monotone curve. */ + void read_x_monotone_curve(X_monotone_curve_2& c); + + /*! reads an auxiliary halfedge-data object and associates it with the + * halfedge `he`. + */ + void read_halfedge_data(Halfedge_handle he); + + /*! reads a message indicating the beginning of a single face record. */ + void read_face_begin(); + + /*! reads a message indicating the end of a single face record. */ + void read_face_end(); + + /*! reads a message indicating the beginning of the container of outer CCBs of + * the current face. + */ + void read_outer_ccbs_begin(); + + /*! reads a message indicating the end of of the container of outer CCBs of + * the current face. + */ + void read_outer_ccbs_end(); + + /*! reads a message indicating the beginning of the container of inner CCBs of + * the current face. + */ + void read_inner_ccbs_begin(); + + /*! reads a message indicating the end of of the container of inner CCBs of the + * current face. + */ + void read_inner_ccbs_end(); + + /*! reads a message indicating the beginning of the container of outer CCBs of + * the current face. + */ + void read_outer_ccb_begin(); + + /*! reads a message indicating the end of the outer CCB of the current face. + */ + void read_outer_ccb_end(); + + /*! reads a message indicating the beginning of the container of holes inside + * the current face. + */ + void read_holes_begin(); + + /*! reads a message indicating the end of the container of holes inside the + * current face. + */ + void read_holes_end(); + + /*! reads a message indicating the beginning a connected component boundary. + */ + void read_ccb_halfedges_begin(); + + /*! reads a message indicating the end of a connected component boundary. + */ + void read_ccb_halfedges_end(); + + /*! reads a message indicating the beginning of the container of isolated + * vertices inside the current face. + */ + void read_isolated_vertices_begin(); + + /*! reads a message indicating the end of the container of isolated vertices + * inside the current face. + */ + void read_isolated_vertices_end(); + + /*! reads an auxiliary face-data object and associates it with the face `f`. + */ + void read_face_data(Face_handle f); + + /// @} +}; /* end AosInputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLandmarkTraits_2.h similarity index 71% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLandmarkTraits_2.h index 673d553e69d..a397e520631 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLandmarkTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLandmarkTraits_2.h @@ -1,15 +1,15 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * The concept `ArrangementLandmarkTraits_2` refines the traits concepts - * `ArrangementApproximateTraits_2` and - * `ArrangementConstructXMonotoneCurveTraits_2`. The type of an arrangement + * The concept `AosLandmarkTraits_2` refines the traits concepts + * `AosApproximatePointTraits_2` and + * `AosConstructXMonotoneCurveTraits_2`. The type of an arrangement * associated with the landmark point-location strategy (see * `CGAL::Arr_landmarks_point_location`) must be an instance of the * `CGAL::Arrangement_2` class template, where the Traits parameter * is substituted by a model of this concept. * - * \cgalRefines{ArrangementApproximateTraits_2,ArrangementConstructXMonotoneCurveTraits_2} + * \cgalRefines{AosApproximatePointTraits_2,AosConstructXMonotoneCurveTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_conic_traits_2} @@ -22,12 +22,11 @@ * \cgalHasModels{CGAL::Arr_rational_function_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementXMonotoneTraits_2` and - * `ArrangementTraits_2` + * \sa `AosXMonotoneTraits_2` + * \sa `AosTraits_2` */ -class ArrangementLandmarkTraits_2 { +class AosLandmarkTraits_2 { public: - /// \name Types /// @{ /// @} @@ -39,5 +38,4 @@ public: /// \name Accessing Functor Objects /// @{ /// @} - }; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLeftSideTraits_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLeftSideTraits_2.h index 6f2d1343a85..3e51ae5a480 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementLeftSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosLeftSideTraits_2.h @@ -1,8 +1,7 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementLeftSideTraits_2` is an abstract concept. It generalizes all + * `AosLeftSideTraits_2` is an abstract concept. It generalizes all * concepts that handle curves that either reach or approach the left boundary * side of the parameter space. (An "abstract" concept is a concept that is * useless on its own.) Only a combination of this concept and additional @@ -10,14 +9,14 @@ * boundary sides (that is, right, bottom, and top) are purposeful, and can have * models. * - * \cgalRefines{ArrangementVerticalSideTraits_2} + * \cgalRefines{AosVerticalSideTraits_2} * - * \sa `ArrangementRightSideTraits_2`, - * `ArrangementBottomSideTraits_2`, and - * `ArrangementTopSideTraits_2` + * \sa `AosRightSideTraits_2`, + * `AosBottomSideTraits_2`, and + * `AosTopSideTraits_2` */ -class ArrangementLeftSideTraits_2 { +class AosLeftSideTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBottomTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBottomTraits_2.h index 2298e679738..7ff47562d16 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBottomTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBottomTraits_2.h @@ -1,24 +1,23 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementOpenBottomTraits_2` must be used when the + * A model of the concept `AosOpenBottomTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is open on * the bottom side and curves inserted into the arrangement are expected to * reach this boundary side. A model of this concept can handle curves that * reach the bottom boundary side when it is open. * - * \cgalRefines{ArrangementBottomSideTraits_2} + * \cgalRefines{AosBottomSideTraits_2} * - * \sa `ArrangementOpenLeftTraits_2`, - * `ArrangementOpenRightTraits_2`, - * `ArrangementOpenTopTraits_2`, - * `ArrangementClosedBottomTraits_2`, - * `ArrangementContractedBottomTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosOpenLeftTraits_2`, + * `AosOpenRightTraits_2`, + * `AosOpenTopTraits_2`, + * `AosClosedBottomTraits_2`, + * `AosContractedBottomTraits_2`, and + * `AosIdentifiedHorizontalTraits_2` */ -class ArrangementOpenBottomTraits_2 { +class AosOpenBottomTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBoundaryTraits_2.h similarity index 65% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBoundaryTraits_2.h index 7cce69c075d..246df377069 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenBoundaryTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenBoundaryTraits_2.h @@ -1,43 +1,41 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * Several predicates are required to handle \f$ x\f$-monotone curves that + * Several predicates are required to handle \f$x\f$-monotone curves that * approach infinity and thus approach the boundary of the parameter * space. These predicates are sufficient to handle not only curves embedded in * an unbounded parameter space, but also curves embedded in a bounded parameter - * space with open boundaries. Models of the concept - * `ArrangementOpenBoundaryTraits_2` handle curves that approach the boundary of - * a parameter space. This concept refines the concept - * `ArrangementBasicTraits_2`. The arrangement template instantiated with a - * traits class that models this concept can handle \f$ x\f$-monotone curves - * that are unbounded in any direction. The concept - * `ArrangementOpenBoundaryTraits_2`, nonetheless, also supports planar \f$ - * x\f$-monotone curves that reach the boundary of an open yet bounded parameter - * space. + * space with open boundaries. Models of the concept `AosOpenBoundaryTraits_2` + * handle curves that approach the boundary of a parameter space. This concept + * refines the concept `AosBasicTraits_2`. The arrangement template instantiated + * with a traits class that models this concept can handle \f$x\f$-monotone + * curves that are unbounded in any direction. The concept + * `AosOpenBoundaryTraits_2`, nonetheless, also supports planar \f$x\f$-monotone + * curves that reach the boundary of an open yet bounded parameter space. * - * An \f$ x\f$-monotone curve may be closed, in which case its endpoints + * An \f$x\f$-monotone curve may be closed, in which case its endpoints * are representable as `Point_2` objects, or open at the boundary of the * parameter space. It can have one open end and one closed end (e.g., a - * ray). The nature of the \f$ x\f$-monotone curves, whether they are expected + * ray). The nature of the \f$x\f$-monotone curves, whether they are expected * to be closed or not at any one of the four boundary-sides, is conveyed * through the definition of the four nested types `Left_side_category`, * `Right_side_category`, `Bottom_side_category`, and `Top_side_category`. If * some curves handled by a model of the concept - * `ArrangementOpenBoundaryTraits_2` are expected to be open on the left, the + * `AosOpenBoundaryTraits_2` are expected to be open on the left, the * nested type `Left_side_category` must be convertible to * `CGAL::Arr_open_side_tag`. Similarly, if some curves handled by the concept * are expected to be open on the right, open at the bottom, or open at the top, * the corresponding nested type must be convertible to * `CGAL::Arr_open_side_tag`. A model of the concept - * `ArrangementOpenBoundaryTraits_2` must have all the four categories + * `AosOpenBoundaryTraits_2` must have all the four categories * convertible to `CGAL::Arr_open_side_tag`.\cgalFootnote{We intend to introduce * more concepts that require only a subset of the categories to be convertible - * to \cgalFootnoteCode{CGAL::Arr_open_side_tag}.} In this case the \dcel of the arrangement - * instantiated with the model is initialized with an implicit bounding - * rectangle. When the parameter space is bounded, it is the exact geometric - * embedding of the implicit bounding rectangle. + * to \cgalFootnoteCode{CGAL::Arr_open_side_tag}.} In this case the \dcel of the + * arrangement instantiated with the model is initialized with an implicit + * bounding rectangle. When the parameter space is bounded, it is the exact + * geometric embedding of the implicit bounding rectangle. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_linear_traits_2} @@ -47,27 +45,26 @@ * \cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementBasicTraits_2` - * \sa `ArrangementXMonotoneTraits_2` - * \sa `ArrangementLandmarkTraits_2` - * \sa `ArrangementTraits_2` + * \sa `AosBasicTraits_2` + * \sa `AosXMonotoneTraits_2` + * \sa `AosLandmarkTraits_2` + * \sa `AosTraits_2` */ -class ArrangementOpenBoundaryTraits_2 { +class AosOpenBoundaryTraits_2 { public: - /// \name Categories /// @{ - //! Must be convertible to `CGAL::Arr_open_side_tag`. + /// Must be convertible to `CGAL::Arr_open_side_tag`. typedef unspecified_type Left_side_category; - //! Must be convertible to `CGAL::Arr_open_side_tag`. + /// Must be convertible to `CGAL::Arr_open_side_tag`. typedef unspecified_type Bottom_side_category; - //! Must be convertible to `CGAL::Arr_open_side_tag`. + /// Must be convertible to `CGAL::Arr_open_side_tag`. typedef unspecified_type Top_side_category; - //! Must be convertible to `CGAL::Arr_open_side_tag`. + /// Must be convertible to `CGAL::Arr_open_side_tag`. typedef unspecified_type Right_side_category; /// @} @@ -75,14 +72,14 @@ public: /// \name Functor Types /// @{ - /*! models the concept `ArrTraits::ParameterSpaceInX_2`. Required only if the + /*! models the concept `AosTraits::ParameterSpaceInX_2`. Required only if the * traits class supports unbounded curves that approach the left or the right * sides (the `Left_side_category` or the `Right_side_category` categories are * convertible to `CGAL::Arr_open_side_tag`). */ typedef unspecified_type Parameter_space_in_x_2; - /*! models the concept `ArrTraits::CompareYNearBoundary_2`. + /*! models the concept `AosTraits::CompareYNearBoundary_2`. * Required only if the traits class supports unbounded curves that approach * the left or the right sides (the `Left_side_category` or the * `Right_side_category` categories are convertible to @@ -90,7 +87,7 @@ public: */ typedef unspecified_type Compare_y_near_boundary_2; - /*! models the concept `ArrTraits::ParameterSpaceInY_2`. + /*! models the concept `AosTraits::ParameterSpaceInY_2`. * Required only if the traits class supports unbounded curves that approach * the bottom or the top sides (the `Bottom_side_category` or the * `Top_side_category` categories are convertible to @@ -98,14 +95,14 @@ public: */ typedef unspecified_type Parameter_space_in_y_2; - /*! models the concept `ArrTraits::CompareXOnBoundaryOfCurveEnd_2`. Required + /*! models the concept `AosTraits::CompareXOnBoundaryOfCurveEnd_2`. Required * only if the traits class supports unbounded curves that approach the bottom * or the top sides (the `Bottom_side_category` or the `Top_side_category` * categories are convertible to `CGAL::Arr_open_side_tag`). */ typedef unspecified_type Compare_x_on_boundary_2; - /*! models the concept `ArrTraits::CompareXNearBoundary_2`. Required only if + /*! models the concept `AosTraits::CompareXNearBoundary_2`. Required only if * the traits class supports unbounded curves that approach the bottom or the * top sides (the `Bottom_side_category` or the `Top_side_category` categories * are convertible to `CGAL::Arr_open_side_tag`). @@ -117,21 +114,20 @@ public: /// \name Accessing Functor Objects /// @{ - /*! */ + /// Parameter_space_in_x_2 parameter_space_in_x_2_object() const; - /*! */ + /// Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const; - /*! */ + /// Parameter_space_in_y_2 parameter_space_in_y_2_object() const; - /*! */ + /// Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const; - /*! */ + /// Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const; /// @} - -}; /* end ArrangementOpenBoundaryTraits_2 */ +}; /* end AosOpenBoundaryTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenLeftTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenLeftTraits_2.h index b4f1b8d2ee3..0bac1f858ab 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenLeftTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenLeftTraits_2.h @@ -1,24 +1,23 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementOpenLeftTraits_2` must be used when the + * A model of the concept `AosOpenLeftTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is open on * the left side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * left boundary side when it is open. * - * \cgalRefines{ArrangementLeftSideTraits_2} + * \cgalRefines{AosLeftSideTraits_2} * - * \sa `ArrangementOpenRightTraits_2`, - * `ArrangementOpenBottomTraits_2`, - * `ArrangementOpenTopTraits_2`, - * `ArrangementClosedLeftTraits_2`, - * `ArrangementContractedLeftTraits_2`, and - * `ArrangementIdentifiedVerticalTraits_2` + * \sa `AosOpenRightTraits_2`, + * `AosOpenBottomTraits_2`, + * `AosOpenTopTraits_2`, + * `AosClosedLeftTraits_2`, + * `AosContractedLeftTraits_2`, and + * `AosIdentifiedVerticalTraits_2` */ -class ArrangementOpenLeftTraits_2 { +class AosOpenLeftTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenRightTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenRightTraits_2.h index a5683bc1aff..f74aaa81f76 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenRightTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenRightTraits_2.h @@ -1,24 +1,23 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementOpenRightTraits_2` must be used when the + * A model of the concept `AosOpenRightTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is open on * the right side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * right boundary side when it is open. * - * \cgalRefines{ArrangementRightSideTraits_2} + * \cgalRefines{AosRightSideTraits_2} * - * \sa `ArrangementOpenLeftTraits_2`, - * `ArrangementOpenBottomTraits_2`, - * `ArrangementOpenTopTraits_2`, - * `ArrangementClosedRightTraits_2`, - * `ArrangementContractedRightTraits_2`, and - * `ArrangementIdentifiedVerticalTraits_2` + * \sa `AosOpenLeftTraits_2`, + * `AosOpenBottomTraits_2`, + * `AosOpenTopTraits_2`, + * `AosClosedRightTraits_2`, + * `AosContractedRightTraits_2`, and + * `AosIdentifiedVerticalTraits_2` */ -class ArrangementOpenRightTraits_2 { +class AosOpenRightTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenTopTraits_2.h similarity index 56% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenTopTraits_2.h index ad852c41ed3..0628e0894f9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOpenTopTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOpenTopTraits_2.h @@ -1,24 +1,23 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * A model of the concept `ArrangementOpenTopTraits_2` must be used when the + * A model of the concept `AosOpenTopTraits_2` must be used when the * parameter space of the surface, the arrangement is embedded on, is open on * the top side and curves inserted into the arrangement are expected to reach * this boundary side. A model of this concept can handle curves that reach the * top boundary side when it is open. * - * \cgalRefines{ArrangementTopSideTraits_2} + * \cgalRefines{AosTopSideTraits_2} * - * \sa `ArrangementOpenLeftTraits_2`, - * `ArrangementOpenRightTraits_2`, - * `ArrangementOpenBottomTraits_2`, - * `ArrangementClosedTopTraits_2`, - * `ArrangementContractedTopTraits_2`, and - * `ArrangementIdentifiedHorizontalTraits_2` + * \sa `AosOpenLeftTraits_2`, + * `AosOpenRightTraits_2`, + * `AosOpenBottomTraits_2`, + * `AosClosedTopTraits_2`, + * `AosContractedTopTraits_2`, and + * `AosIdentifiedHorizontalTraits_2` */ -class ArrangementOpenTopTraits_2 { +class AosOpenTopTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOutputFormatter.h new file mode 100644 index 00000000000..ea79ba8eea2 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosOutputFormatter.h @@ -0,0 +1,193 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept + * + * A model for the `AosOutputFormatter` concept supports a set of functions that + * enable writing an arrangement to an output stream using a specific format. + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_text_formatter} + * \cgalHasModels{CGAL::Arr_face_extended_text_formatter} + * \cgalHasModels{CGAL::Arr_extended_dcel_text_formatter} + * \cgalHasModelsEnd + */ +class AosOutputFormatter { +public: + /// \name Types + /// @{ + + /// the type of arrangement to output. + typedef unspecified_type Arrangement_2; + + /// the point type. + typedef typename Arrangement_2::Point_2 Point_2; + + /// the \f$x\f$-monotone curve type. + typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; + + /// + typedef typename Arrangement_2::Size Size; + + /// + typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; + + /// + typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; + + /// + typedef typename Arrangement_2::Face_const_handle Face_const_handle; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. */ + Arr_out_formatter(); + + /*! constructs a formatter that writes to `os`. */ + Arr_out_formatter(std::ostream& os); + + /*! directs `outf` to write to `os`. */ + void set_out(std::ostream& os); + + /// @} + + /// \name Access Functions + /// @{ + + /*! + returns the stream that `outf` writes to. + \pre `outf` is directed to a valid output stream. + */ + std::ostream& out(); + + /// @} + + /// \name Formatted Output Functions + /// @{ + + /*! writes a message indicating the beginning of the arrangement. */ + void write_arrangement_begin(); + + /*! writes a message indicating the end of the arrangement. */ + void write_arrangement_end(); + + /*! writes a size value, preceded by a given label. */ + void write_size(const char *label, Size size); + + /*! writes a message indicating the beginning of the vertex records. */ + void write_vertices_begin(); + + /*! writes a message indicating the end of the vertex records. */ + void write_vertices_end(); + + /*! writes a message indicating the beginning of the edge records. */ + void write_edges_begin(); + + /*! writes a message indicating the end of the edge records. */ + void write_edges_end(); + + /*! writes a message indicating the beginning of the face records. */ + void write_faces_begin(); + + /*! writes a message indicating the end of the face records. */ + void write_faces_end(); + + /*! writes a message indicating the beginning of a single vertex record. */ + void write_vertex_begin(); + + /*! writes a message indicating the end of a single vertex record. */ + void write_vertex_end(); + + /*! writes a vertex index. */ + void write_vertex_index(std::size_t idx); + + /*! writes a point. */ + void write_point(const Point_2& p); + + /*! writes the auxiliary data associated with the vertex. */ + void write_vertex_data(Vertex_const_handle v); + + /*! writes a message indicating the beginning of a single edge record. */ + void write_edge_begin(); + + /*! writes a message indicating the end of a single edge record. */ + void write_edge_end(); + + /*! writes a halfedge index. */ + void write_halfedge_index(std::size_t idx); + + /*! writes an \f$x\f$-monotone curve. */ + void write_x_monotone_curve(const X_monotone_curve_2& c); + + /*! writes the auxiliary data associated with the halfedge. */ + void write_halfedge_data(Halfedge_const_handle he); + + /*! writes a message indicating the beginning of a single face record. */ + void write_face_begin(); + + /*! writes a message indicating the end of a single face record. */ + void write_face_end(); + + /*! writes a message indicating the beginning of the container of outer CCBs + * of the current face. + */ + void write_outer_ccbs_begin(); + + /*! writes a message indicating the end of the container of outer ccbs of the + * current face. + */ + void write_outer_ccbs_end(); + + /*! writes a message indicating the beginning of the container of inner CCBs + * of the current face. + */ + void write_inner_ccbs_begin(); + + /*! writes a message indicating the end of the container of inner ccbs of the + * current face. + */ + void write_inner_ccbs_end(); + + /*! writes a message indicating the beginning of the outer CCB of the current + * face. + */ + void write_outer_ccb_begin(); + + /*! writes a message indicating the end of the outer CCB of the current face. + */ + void write_outer_ccb_end(); + + /*! writes a message indicating the beginning of the container of holes inside + * the current face. + */ + void write_holes_begin(); + + /*! writes a message indicating the end of the container of holes inside the + * current face. + */ + void write_holes_end(); + + /*! writes a message indicating the beginning a connected component's boundary. + */ + void write_ccb_halfedges_begin(); + + /*! writes a message indicating the end of a connected component's boundary. + */ + void write_ccb_halfedges_end(); + + /*! writes a message indicating the beginning of the container of isolated + * vertices inside the current face. + */ + void write_isolated_vertices_begin(); + + /*! writes a message indicating the end of the container of isolated vertices + * inside the current face. + */ + void write_isolated_vertices_end(); + + /*! writes the auxiliary data associated with the face. */ + void write_face_data(Face_const_handle f); + + /// @} +}; /* end AosOutputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosPointLocation_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosPointLocation_2.h new file mode 100644 index 00000000000..fe02f149abb --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosPointLocation_2.h @@ -0,0 +1,84 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept + * + * A model of the `AosPointLocation_2` concept can answer point-location queries + * on an arrangement attached to it. Namely, given a `Arrangement_2::Point_2` + * object, representing a point in the plane, it returns the arrangement cell + * containing it. In the general case, the query point is contained inside an + * arrangement face, but in degenerate situations it may lie on an edge or + * coincide with an arrangement vertex. + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_naive_point_location} + * \cgalHasModels{CGAL::Arr_walk_along_line_point_location} + * \cgalHasModels{CGAL::Arr_trapezoid_ric_point_location} + * \cgalHasModels{CGAL::Arr_landmarks_point_location} + * \cgalHasModelsEnd + * + * \sa `CGAL::Arr_naive_point_location` + * \sa `CGAL::Arr_walk_along_line_point_location` + * \sa `CGAL::Arr_trapezoid_ric_point_location` + * \sa `CGAL::Arr_landmarks_point_location` + * \sa `CGAL::Arr_point_location_result` + */ +class AosPointLocation_2 { +public: + /// \name Types + /// @{ + + //! the associated arrangement type. + typedef unspecified_type Arrangement_2; + + //! equivalent to `Arrangement_2::Point_2`. + typedef unspecified_type Point_2; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + AosPointLocation_2(); + + /*! constructs a point-location object `pl` attached to the given + * arrangement `arr`. + */ + AosPointLocation_2 (const Arrangement_2& arr); + + /// @} + + /// \name Query Functions + /// @{ + + /*! locates the arrangement cell that contains the query point `q` + * and returns a discriminated union container of the following bounded + * types: + * + *
    + *
  • `Arrangement_2::Face_const_handle`, in case `q` is + * contained inside an arrangement face; + *
  • `Arrangement_2::Halfedge_const_handle`, in case `q` lies + * on an arrangement edge; + *
  • `Arrangement_2::Vertex_const_handle`, in case `q` coincides + * with an arrangement vertex. + *
+ * \pre `pl` is attached to a valid arrangement object. + */ + Arr_point_location_result::Type locate(const Point_2& q) const; + + /// @} + + /// \name Operations + /// @{ + + /*! attaches `pl` to the given arrangement `arr`. + */ + void attach (const Arrangement_2& arr); + + /*! detaches `pl` from the arrangement it is currently attached to. + */ + void detach (); + + /// @} +}; /* end AosPointLocation_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosRightSideTraits_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosRightSideTraits_2.h index ed6d2be0c4d..b71b594dcf1 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementRightSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosRightSideTraits_2.h @@ -1,8 +1,7 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementRightSideTraits_2` is an abstract concept. It generalizes all + * `AosRightSideTraits_2` is an abstract concept. It generalizes all * concepts that handle curves that either reach or approach the right boundary * side of the parameter space. (An "abstract" concept is a concept that is * useless on its own.) Only a combination of this concept and additional @@ -10,14 +9,13 @@ * boundary sides (that is, left, bottom, and top) are purposeful, and can have * models. * - * \cgalRefines{ArrangementVerticalSideTraits_2} + * \cgalRefines{AosVerticalSideTraits_2} * - * \sa `ArrangementLeftSideTraits_2`, - * `ArrangementBottomSideTraits_2`, and - * `ArrangementTopSideTraits_2` + * \sa `AosLeftSideTraits_2` + * \sa `AosBottomSideTraits_2` + * \sa `AosTopSideTraits_2` */ - -class ArrangementRightSideTraits_2 { +class AosRightSideTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementSphericalBoundaryTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosSphericalBoundaryTraits_2.h similarity index 53% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementSphericalBoundaryTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosSphericalBoundaryTraits_2.h index 25fde7ef42d..e5ed46d6f4d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementSphericalBoundaryTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosSphericalBoundaryTraits_2.h @@ -1,45 +1,42 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * Models of the concept `ArrangementSphericalBoundaryTraits_2` handle curves on + * Models of the concept `AosSphericalBoundaryTraits_2` handle curves on * a sphere or a surface that is topological equivalent to a sphere. The sphere * is oriented in such a way that the boundary of the rectangular parameter * space, the sphere is the mapping of which, is identified on the left and * right sides and contracted at the top and bottom sides. * - * \cgalRefines{ArrangementBasicTraits_2,ArrangementIdentifiedVerticalTraits_2, - * ArrangementContractedBottomTraits_2,ArrangementContractedTopTraits_2} + * \cgalRefines{AosBasicTraits_2,AosIdentifiedVerticalTraits_2, + * AosContractedBottomTraits_2,AosContractedTopTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementOpenBoundaryTraits_2` - * \sa `ArrangementBasicTraits_2` - * \sa `ArrangementIdentifiedVerticalTraits_2` - * \sa `ArrangementContractedBottomTraits_2` - * \sa `ArrangementContractedTopTraits_2` - * \sa `ArrangementHorizontalSideTraits_2` - * \sa `ArrangementVerticalSideTraits_2` + * \sa `AosOpenBoundaryTraits_2` + * \sa `AosBasicTraits_2` + * \sa `AosIdentifiedVerticalTraits_2` + * \sa `AosContractedBottomTraits_2` + * \sa `AosContractedTopTraits_2` + * \sa `AosHorizontalSideTraits_2` + * \sa `AosVerticalSideTraits_2` */ - -class ArrangementSphericalBoundaryTraits_2 { +class AosSphericalBoundaryTraits_2 { public: - /// \name Categories /// @{ - //! Must be convertible to `CGAL::Arr_identified_side_tag`. + /// Must be convertible to `CGAL::Arr_identified_side_tag`. typedef unspecified_type Left_side_category; - //! Must be convertible to `CGAL::Arr_identified_side_tag`. + /// Must be convertible to `CGAL::Arr_identified_side_tag`. typedef unspecified_type Bottom_side_category; - //! Must be convertible to `CGAL::Arr_contracted_side_tag`. + /// Must be convertible to `CGAL::Arr_contracted_side_tag`. typedef unspecified_type Top_side_category; - //! Must be convertible to `CGAL::Arr_contracted_side_tag`. + /// Must be convertible to `CGAL::Arr_contracted_side_tag`. typedef unspecified_type Right_side_category; /// @} @@ -47,25 +44,25 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::ParameterSpaceInX_2`. + /// models the concept `AosTraits::ParameterSpaceInX_2`. typedef unspecified_type Parameter_space_in_x_2; - /// models the concept `ArrTraits::CompareXOnBoundaryOfCurveEnd_2`. + /// models the concept `AosTraits::CompareXOnBoundaryOfCurveEnd_2`. typedef unspecified_type Compare_x_on_boundary_2; - /// models the concept `ArrTraits::CompareXNearBoundary_2`. + /// models the concept `AosTraits::CompareXNearBoundary_2`. typedef unspecified_type Compare_x_near_boundary_2; - /// models the concept `ArrTraits::ParameterSpaceInY_2`. + /// models the concept `AosTraits::ParameterSpaceInY_2`. typedef unspecified_type Parameter_space_in_y_2; - /// models the concept `ArrTraits::CompareYOnBoundary_2`. + /// models the concept `AosTraits::CompareYOnBoundary_2`. typedef unspecified_type Compare_y_on_boundary_2; - /// models the concept `ArrTraits::CompareYNearBoundary_2`. + /// models the concept `AosTraits::CompareYNearBoundary_2`. typedef unspecified_type Compare_y_near_boundary_2; - /// models the concept `ArrTraits::IsOnYIdentification_2`. + /// models the concept `AosTraits::IsOnYIdentification_2`. typedef unspecified_type Is_on_y_identification_2; /// @} @@ -73,26 +70,26 @@ public: /// \name Accessing Functor Objects /// @{ - /*! */ + /// Parameter_space_in_x_2 parameter_space_in_x_2_object() const; - /*! */ + /// Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const; - /*! */ + /// Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const; - /*! */ + /// Parameter_space_in_y_2 parameter_space_in_y_2_object() const; - /*! */ + /// Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const; - /*! */ + /// Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const; - /*! */ + /// Is_on_y_identification_2 is_on_y_identification_2_object() const; - /// @} -}; /* end ArrangementSphericalBoundaryTraits_2 */ + /// @} +}; /* end AosSphericalBoundaryTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopSideTraits_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopSideTraits_2.h index e579a7df9ef..f3cc3e3b806 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopSideTraits_2.h @@ -1,8 +1,7 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsTraits +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementTopSideTraits_2` is an abstract concept. It generalizes all + * `AosTopSideTraits_2` is an abstract concept. It generalizes all * concepts that handle curves that either reach or approach the top boundary * side of the parameter space. (An "abstract" concept is a concept that is * useless on its own.) Only a combination of this concept and additional @@ -10,14 +9,13 @@ * boundary sides (that is, left, right, and bottom) are purposeful, and can * have models. * - * \cgalRefines{ArrangementHorizontalSideTraits_2} + * \cgalRefines{AosHorizontalSideTraits_2} * - * \sa `ArrangementLeftSideTraits_2`, - * `ArrangementRightSideTraits_2`, and - * `ArrangementBottomSideTraits_2` + * \sa `AosLeftSideTraits_2` + * \sa `AosRightSideTraits_2` + * \sa `AosBottomSideTraits_2` */ - -class ArrangementTopSideTraits_2 { +class AosTopSideTraits_2 { public: /// \name Categories /// @{ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopologyTraits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopologyTraits.h similarity index 97% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopologyTraits.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopologyTraits.h index bf0c5121709..1dd1caf27b3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTopologyTraits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTopologyTraits.h @@ -29,16 +29,15 @@ * \sa `Arrangement_on_surface_2` */ -class ArrangementTopologyTraits { +class AosTopologyTraits { public: - /// \name Types /// @{ - /*! */ + /// typedef unspecified_type Geometry_traits_2; - /*! */ + /// typedef unspecified_type Dcel; /// @} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Approximate_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Approximate_2.h new file mode 100644 index 00000000000..a9712000aa9 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Approximate_2.h @@ -0,0 +1,54 @@ +namespace AosTraits { + +/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects + * \cgalConcept + * + * \cgalRefines{Functor} + * + * \cgalHasModelsBegin + * \cgalHasModels{AosApproximatePointTraits_2::Approximate_2} + * \cgalHasModels{AosApproximateTraits_2::Approximate_2} + * \cgalHasModelsEnd + */ +class Approximate_2 { +public: + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! obtains an approximation of `p`'s \f$x\f$-coordinate (if `i == 0`), or of + * `p`'s \f$y\f$-coordinate (if `i == 1`). + * \pre `i` is either 0 or 1. + */ + CGAL::Approximate_number_type operator()(AosTraits::Point_2 p, int i); + + /*! obtains an approximation of `p`. + */ + CGAL::Approximate_point_2 operator()(AosTraits::Point_2 p); + + /*! approximates a given \f$x\f$-monotone curve. It computes a sequence of + * approximate points that represent an approximate polyline, and inserts + * them into an output container given through an output iterator. The + * first and last points in the sequence are always approximations of the + * endpoints of the given curve. + * + * \param xcv The exact \f$x\f$-monotone curve. + * \param error The error bound of the polyline approximation. This is the + * Hausdorff distance between the curve and the polyline that + * approximates the curve. + * \param oi An output iterator for the output container. + * \param l2r A Boolean flag that indicates whether the curve direction is + * left to right. + * \return The past-the-end iterator of the output container. + * + * \pre Dereferencing `oi` must yield an object of type + * `Arr_conic_traits_2::Approximate_point_2`. + */ + template + OutputIterator operator()(const X_monotone_curve_2& xcv, double error, + OutputIterator oi, bool l2r = true) const; + + /// @} +}; /* end AosTraits::Approximate_2 */ + +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--AreMergeable_2.h similarity index 72% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--AreMergeable_2.h index 8c9f51309ab..5969ea3ccee 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--AreMergeable_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--AreMergeable_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementXMonotoneTraits_2::Are_mergeable_2} + * \cgalHasModels{AosXMonotoneTraits_2::Are_mergeable_2} * \cgalHasModelsEnd */ class AreMergeable_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -22,11 +21,10 @@ public: * share a common endpoint, and they do not bend to form a * non-\f$x\f$-monotone curve. */ - bool operator()(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2); + bool operator()(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2); /// @} - -}; /* end ArrTraits::AreMergeable_2 */ +}; /* end AosTraits::AreMergeable_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXNearBoundary_2.h similarity index 54% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearBoundary_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXNearBoundary_2.h index ad6f44f179a..c24b8d93242 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXNearBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXNearBoundary_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableTernaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementOpenBoundaryTraits_2::Compare_x_near_boundary_} + * \cgalHasModels{AosOpenBoundaryTraits_2::Compare_x_near_boundary_} * \cgalHasModelsEnd */ class CompareXNearBoundary_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -24,26 +23,29 @@ public: * precisely, compares the \f$x\f$-coordinates of the horizontal projection * of a point \f$p\f$ onto `xcv1` and `xcv2`. If `xcv1` and `xcv2` approach * the bottom boundary-side, \f$p\f$ is located far to the bottom, such that - * the result is invariant under a translation of \f$ p\f$ farther to the + * the result is invariant under a translation of \f$p\f$ farther to the * bottom. If `xcv1` and `xcv2` approach the top boundary-side, \f$p\f$ is * located far to the top in a similar manner. * - * \pre The \f$x\f$-coordinates of the limits of the curves at their - * respective ends are equal. That is, `compare_x_on_boundary_2`(`xcv1`, - * `xcv2`, `ce`) = `CGAL::EQUAL`. + * \pre The \f$x\f$-coordinates of the boundary of the curves at their + * respective ends are equal. That is, + * \link AosHorizontalSideTraits_2::Compare_x_on_boundary_2 + * `compare_x_on_boundary_2`\endlink(`xcv1`, `xcv2`, `ce`) = `CGAL::EQUAL`. * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `parameter_space_in_y_2`\endlink(`xcv1`, `ce`) = - * \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `parameter_space_in_y_2`\endlink(`xcv2`, `ce`). + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 + * `parameter_space_in_y_2`\endlink(`xcv1`, `ce`) = + * \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 + * `parameter_space_in_y_2`\endlink(`xcv2`, `ce`). * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `parameter_space_in_y_2`\endlink(`xcv1`, `ce`) \f$ \neq\f$ + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 + * `parameter_space_in_y_2`\endlink(`xcv1`, `ce`) \f$\neq\f$ * `CGAL::ARR_INTERIOR`. */ - Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, - const ArrTraits::X_monotone_curve_2& xcv2, + Comparison_result operator()(const AosTraits::X_monotone_curve_2& xcv1, + const AosTraits::X_monotone_curve_2& xcv2, CGAL::Arr_curve_end ce); /// @} - -}; /* end ArrTraits::CompareXNearBoundary_2 */ +}; /* end AosTraits::CompareXNearBoundary_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundaryOfCurveEnd_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundaryOfCurveEnd_2.h new file mode 100644 index 00000000000..e24c6e03622 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundaryOfCurveEnd_2.h @@ -0,0 +1,74 @@ +namespace AosTraits { + +/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects + * \cgalConcept + * + * \cgalRefines{AdaptableFunctor} + * + * \cgalHasModelsBegin + * \cgalHasModels{AosHorizontalSideTraits_2::Compare_x_on_boundary_2} + * \cgalHasModels{AosOpenBoundaryTraits_2::Compare_x_on_boundary_2} + * \cgalHasModels{AosSphericalBoundaryTraits_2::Compare_x_on_boundary_2} + * \cgalHasModelsEnd + */ +class CompareXOnBoundaryOfCurveEnd_2 { +public: + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! Given a point `p`, an \f$x\f$-monotone curve `xcv`, and an + * enumeration `ce` that specifies either the minimum or the maximum end of + * the curve where the curve has a vertical asymptote, compares the + * \f$x\f$-coordinate of `p` and the \f$x\f$-coordinate of the limit of the + * curve at its specified end. The variable `xcv` identifies the parametric + * curve \f$c(t) = (x(t), y(t))\f$ defined over an open or half-open interval + * with endpoints \f$0\f$ and \f$1\f$. The enumeration `ce` identifies an + * open end \f$d \in\{0,1\}\f$ of \f$c\f$. Formally, compares the + * \f$x\f$-coordinate of `p` and \f$\lim_{t \rightarrow d} x(t)\f$. Returns + * `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. + * + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink(`xcv`, `ce`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. + * + * \pre If the parameter space is unbounded, \f$c\f$ has a vertical asymptote + * at its \f$d\f$-end; that is, + * \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv`, `ce`) = `CGAL::ARR_INTERIOR`. + */ + Comparison_result operator()(const AosTraits::Point_2& p, + const AosTraits::X_monotone_curve_2& xcv, + CGAL::Arr_curve_end ce); + + /*! Given two \f$x\f$-monotone curves `xcv1` and `xcv2` and two indices `ce1` + * and `ce2` that specify either the minimum or the maximum ends of `xcv1` and + * `xcv2`, respectively, where the curves have vertical asymptotes, compares + * the \f$x\f$-coordinates of the limits of the curves at their specified + * ends. The variables `xcv1` and `xcv2` identify the parametric curves + * \f$c_1(t) = (x_1(t),y_1(t))\f$ and \f$c_2(t) = (x_2(t),y_2(t))\f$, + * respectively, defined over open or half-open intervals with endpoints + * \f$0\f$ and \f$1\f$. The indices `ce1` and `ce2` identify open ends + * \f$d_1\in\{0,1\}\f$ and \f$d_2 \in\{0,1\}\f$ of \f$c_1\f$ and \f$c_2\f$, + * respectively. Formally, compares \f$\lim_{t \rightarrow d_1} x_1(t)\f$ and + * \f$\lim_{t \rightarrow d_2} x_2(t)\f$. Returns `CGAL::SMALLER`, + * `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. + * + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink(`xcv1`, `ce1`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. + * + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink(`xcv2`, `ce2`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. + * + * \pre If the parameter space is unbounded, \f$c_1\f$ has a vertical + * asymptote at its respective end; that is, + * \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv1`, `ce1`) = `CGAL::ARR_INTERIOR`. + * + * \pre If the parameter space is unbounded, \f$c_2\f$ has a vertical asymptote + * at its respective end; that is, + * \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv2`, `ce2`) = `CGAL::ARR_INTERIOR`. + */ + Comparison_result operator()(const AosTraits::X_monotone_curve_2& xcv1, + CGAL::Arr_curve_end ce1, + const AosTraits::X_monotone_curve_2& xcv2, + CGAL::Arr_curve_end ce2); + + /// @} +}; /* end AosTraits::CompareXOnBoundaryOfCurveEnd_2 */ + +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundary_2.h similarity index 57% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundary_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundary_2.h index af30ebbfb93..4fbaa082f64 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXOnBoundary_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,9 +6,9 @@ namespace ArrTraits { * \cgalRefines{AdaptableFunctor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementClosedBottomTraits_2::Compare_x_on_boundary_2} - * \cgalHasModels{ArrangementClosedTopTraits_2::Compare_x_on_boundary_2} - * \cgalHasModels{ArrangementIdentifiedHorizontalTraits_2::Compare_x_on_boundary_2} + * \cgalHasModels{AosClosedBottomTraits_2::Compare_x_on_boundary_2} + * \cgalHasModels{AosClosedTopTraits_2::Compare_x_on_boundary_2} + * \cgalHasModels{AosIdentifiedHorizontalTraits_2::Compare_x_on_boundary_2} * \cgalHasModelsEnd */ class CompareXOnBoundary_2 { @@ -23,16 +23,16 @@ public: * x\f$-coordinate of `p1` and the \f$x\f$-coordinate of `p2`. Returns * `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 + * \pre \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 * `Parameter_space_in_y_2`\endlink (`p1`) \f$\neq\f$ `CGAL::ARR_INTERIOR` or - * \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 + * \link AosHorizontalSideTraits_2::Parameter_space_in_y_2 * `Parameter_space_in_y_2`\endlink (`p2`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. */ - Comparison_result operator()(const ArrTraits::Point_2& p1, - const ArrTraits::Point_2& p2); + Comparison_result operator()(const AosTraits::Point_2& p1, + const AosTraits::Point_2& p2); /// @} -}; /* end ArrTraits::CompareXOnBoundaryOfCurveEnd_2 */ +}; /* end AosTraits::CompareXOnBoundaryOfCurveEnd_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareX_2.h similarity index 70% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareX_2.h index 466869d5a01..117a467f0c9 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareX_2.h @@ -1,16 +1,16 @@ -namespace ArrTraits { +namespace AosTraits { + /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept * * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Compare_x_2} + * \cgalHasModels{AosBasicTraits_2::Compare_x_2} * \cgalHasModelsEnd */ class CompareX_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -18,10 +18,9 @@ public: /*! returns `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` according to the * \f$x\f$-ordering of points `p1` and `p2`. */ - Comparison_result operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); + Comparison_result operator()(AosTraits::Point_2 p1, AosTraits::Point_2 p2); /// @} - -}; /* end ArrTraits::CompareX_2 */ +}; /* end AosTraits::CompareX_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXy_2.h similarity index 71% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXy_2.h index db282c6d238..10f3ce75cda 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXy_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareXy_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Compare_xy_2} + * \cgalHasModels{AosBasicTraits_2::Compare_xy_2} * \cgalHasModelsEnd */ class CompareXy_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -19,10 +18,9 @@ public: /*! returns `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` according * to the lexicographic \f$xy\f$-order of the points `p1` and `p2`. */ - Comparison_result operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); + Comparison_result operator()(AosTraits::Point_2 p1, AosTraits::Point_2 p2); /// @} - -}; /* end ArrTraits::CompareXy_2 */ +}; /* end AosTraits::CompareXy_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXLeft_2.h similarity index 63% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXLeft_2.h index f49c04d0ec1..428de11c5cc 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXLeft_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXLeft_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,29 +6,27 @@ namespace ArrTraits { * \cgalRefines{AdaptableTernaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Compare_y_at_x_left_2} + * \cgalHasModels{AosBasicTraits_2::Compare_y_at_x_left_2} * \cgalHasModelsEnd */ class CompareYAtXLeft_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! accepts two \f$x\f$-monotone curves `xc1` and `xc2` that have a common - * right endpoint `p`, and returns `CGAL::SMALLER, CGAL::EQUAL` or + * right endpoint `p`, and returns `CGAL::SMALLER`, `CGAL::EQUAL` or * `CGAL::LARGER` according to the relative position of the two curves * immediately to the left of \f$p\f$. Note that in case one of the * \f$x\f$-monotone curves is a vertical segment (emanating downward from * `p`), it is always considered to be below the other curve. */ - Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2, - ArrTraits::Point_2 p); + Comparison_result operator()(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2, + AosTraits::Point_2 p); /// @} - -}; /* end ArrTraits::CompareYAtXLeft_2 */ +}; /* end AosTraits::CompareYAtXLeft_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXRight_2.h similarity index 62% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXRight_2.h index 62fe93cdc3a..5f95bd0c84a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtXRight_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtXRight_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,29 +6,27 @@ namespace ArrTraits { * \cgalRefines{AdaptableTernaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Compare_y_at_x_right_2} + * \cgalHasModels{AosBasicTraits_2::Compare_y_at_x_right_2} * \cgalHasModelsEnd */ class CompareYAtXRight_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! accepts two \f$x\f$-monotone curves `xc1` and `xc2` - * that have a common left endpoint `p`, and returns `CGAL::SMALLER, - * CGAL::EQUAL` or `CGAL::LARGER` according to the relative position of the + * that have a common left endpoint `p`, and returns `CGAL::SMALLER`, + * `CGAL::EQUAL` or `CGAL::LARGER` according to the relative position of the * two curves immediately to the right of \f$p\f$. Note that in case one of * the \f$x\f$-monotone curves is a vertical segment emanating upward from * `p`, it is always considered to be above the other curve. */ - Comparison_result operator()(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2, - ArrTraits::Point_2 p); + Comparison_result operator()(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2, + AosTraits::Point_2 p); /// @} - -}; /* end ArrTraits::CompareYAtXRight_2 */ +}; /* end AosTraits::CompareYAtXRight_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtX_2.h similarity index 66% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtX_2.h index bc8d1d81573..e884e8e2cca 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYAtX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYAtX_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Compare_y_at_x_2} + * \cgalHasModels{AosBasicTraits_2::Compare_y_at_x_2} * \cgalHasModelsEnd */ class CompareYAtX_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -20,11 +19,10 @@ public: * of `p` on `xc`, and returns `CGAL::SMALLER`, `CGAL::EQUAL`, or * `CGAL::LARGER` according to the result. */ - Comparison_result operator()(ArrTraits::Point_2 p, - ArrTraits::X_monotone_curve_2 xc); + Comparison_result operator()(AosTraits::Point_2 p, + AosTraits::X_monotone_curve_2 xc); /// @} - -}; /* end ArrTraits::CompareYAtX_2 */ +}; /* end AosTraits::CompareYAtX_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYNearBoundary_2.h similarity index 67% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYNearBoundary_2.h index cb11491e316..06b77ba1568 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYNearBoundary_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYNearBoundary_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableTernaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementOpenBoundaryTraits_2::Compare_y_near_boundary_2} + * \cgalHasModels{AosOpenBoundaryTraits_2::Compare_y_near_boundary_2} * \cgalHasModelsEnd */ class CompareYNearBoundary_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -30,18 +29,17 @@ public: * to `xcv2` and `ce`. In that case \f$p\f$ is located far to the right in a * similar manner. * - * \pre \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv2`, `ce`) = - * \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv1`, `ce`). + * \pre \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv2`, `ce`) = + * \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv1`, `ce`). * - * \pre \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv1`, `ce`) \f$\neq\f$ + * \pre \link AosVerticalSideTraits_2::Parameter_space_in_x_2 `parameter_space_in_x_2`\endlink(`xcv1`, `ce`) \f$\neq\f$ * `CGAL::ARR_INTERIOR`. */ - Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, - const ArrTraits::X_monotone_curve_2& xcv2, + Comparison_result operator()(const AosTraits::X_monotone_curve_2& xcv1, + const AosTraits::X_monotone_curve_2& xcv2, CGAL::Arr_curve_end ce); /// @} - -}; /* end ArrTraits::CompareYNearBoundary_2 */ +}; /* end AosTraits::CompareYNearBoundary_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYOnBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYOnBoundary_2.h new file mode 100644 index 00000000000..8ad41f9bf32 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--CompareYOnBoundary_2.h @@ -0,0 +1,39 @@ +namespace AosTraits { + +/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects + * \cgalConcept + * + * \cgalRefines{AdaptableBinaryFunction} + * + * \cgalHasModelsBegin + * \cgalHasModels{AosClosedLeftTraits_2::Compare_y_on_boundary_2} + * \cgalHasModels{AosClosedRightTraits_2::Compare_y_on_boundary_2} + * \cgalHasModels{AosIdentifiedVerticalTraits_2::Compare_y_on_boundary_2} + * \cgalHasModels{AosSphericalBoundaryTraits_2::Compare_y_on_boundary_2} + * \cgalHasModelsEnd + */ +class CompareYOnBoundary_2 { +public: + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! Given two points `p1` and `p2`, such that either `p1` or `p2` (or both) + * lie on the bottom or top boundary of the parameter space, compares the + * \f$y\f$-coordinate of `p1` and the \f$y\f$-coordinate of `p2`. Returns + * `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. + * + * \pre \link AosVerticalSideTraits_2::Parameter_space_in_x_2 + * `Parameter_space_in_x_2`\endlink(`p1`) \f$\neq\f$ + * `CGAL::ARR_INTERIOR` or + * \link AosVerticalSideTraits_2::Parameter_space_in_x_2 + * `Parameter_space_in_x_2`\endlink(`p2`) \f$\neq\f$ + * `CGAL::ARR_INTERIOR`. + */ + Comparison_result operator()(const AosTraits::Point_2& p1, + const AosTraits::Point_2& p2); + + /// @} +}; /* end AosTraits::CompareYOnBoundary_2 */ + +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructCurve_2.h new file mode 100644 index 00000000000..771afd0ed93 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructCurve_2.h @@ -0,0 +1,25 @@ +namespace AosTraits { + +/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects + * \cgalConcept + * + * \cgalRefines{Functor} + * + * \cgalHasModelsBegin + * \cgalHasModels{AosConstructCurveTraits_2::Construct_curve_2} + * \cgalHasModelsEnd + */ +class ConstructCurve_2 { +public: + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! returns a curve connecting `p1` and `p2` (i.e., the two input points + * are its endpoints). + */ + AosTraits::Curve_2 operator()(AosTraits::Point_2 p1, AosTraits::Point_2 p2); + /// @} +}; /* end AosTraits::ConstructCurve_2 */ + +} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMaxVertex_2.h similarity index 65% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMaxVertex_2.h index 85d379693bf..970e0e15151 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMaxVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMaxVertex_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,22 +6,20 @@ namespace ArrTraits { * \cgalRefines{AdaptableUnaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Construct_max_vertex_2} + * \cgalHasModels{AosBasicTraits_2::Construct_max_vertex_2} * \cgalHasModelsEnd */ class ConstructMaxVertex_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! returns the lexicographically larger (right) endpoint of `xc`. */ - ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); + AosTraits::Point_2 operator()(AosTraits::X_monotone_curve_2 xc); /// @} - -}; /* end ArrTraits::ConstructMaxVertex_2 */ +}; /* end AosTraits::ConstructMaxVertex_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMinVertex_2.h similarity index 65% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMinVertex_2.h index f9f8f3b99ac..c78fdaa3cf3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructMinVertex_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructMinVertex_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,7 +6,7 @@ namespace ArrTraits { * \cgalRefines{AdaptableUnaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Construct_min_vertex_2} + * \cgalHasModels{AosBasicTraits_2::Construct_min_vertex_2} * \cgalHasModelsEnd */ class ConstructMinVertex_2 { @@ -18,10 +18,10 @@ public: /*! returns the lexicographically smaller (left) endpoint of `xc`. */ - ArrTraits::Point_2 operator()(ArrTraits::X_monotone_curve_2 xc); + AosTraits::Point_2 operator()(AosTraits::X_monotone_curve_2 xc); /// @} -}; /* end ArrTraits::ConstructMinVertex_2 */ +}; /* end AosTraits::ConstructMinVertex_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructXMonotoneCurve_2.h similarity index 58% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructXMonotoneCurve_2.h index 39c1e7b42e5..31e4428183f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructXMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ConstructXMonotoneCurve_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementConstructXMonotoneCurveTraits_2::Construct_x_monotone_curve_2} + * \cgalHasModels{AosConstructXMonotoneCurveTraits_2::Construct_x_monotone_curve_2} * \cgalHasModelsEnd */ class ConstructXMonotoneCurve_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -19,11 +18,10 @@ public: /*! returns an \f$x\f$-monotone curve connecting `p1` and `p2` (i.e., the * two input points are its endpoints). */ - ArrTraits::X_monotone_curve_2 operator()(ArrTraits::Point_2 p1, - ArrTraits::Point_2 p2); + AosTraits::X_monotone_curve_2 operator()(AosTraits::Point_2 p1, + AosTraits::Point_2 p2); /// @} - -}; /* end ArrTraits::ConstructXMonotoneCurve_2 */ +}; /* end AosTraits::ConstructXMonotoneCurve_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Curve_2.h similarity index 65% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Curve_2.h index 5268f489519..c09afb827a4 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Curve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Curve_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects * \cgalConcept @@ -7,12 +7,9 @@ namespace ArrTraits { * * \cgalRefines{CopyConstructible,Assignable,DefaultConstructible} * \cgalHasModelsBegin - * \cgalHasModels{ArrangementTraits_2::Curve_2} + * \cgalHasModels{AosTraits_2::Curve_2} * \cgalHasModelsEnd */ -class Curve_2 { -public: - -}; /* end ArrTraits::Curve_2 */ +class Curve_2 {}; } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Equal_2.h similarity index 58% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Equal_2.h index ed6d47ed592..027e53a786a 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Equal_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Equal_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,28 +6,26 @@ namespace ArrTraits { * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Equal_2} + * \cgalHasModels{AosBasicTraits_2::Equal_2} * \cgalHasModelsEnd */ class Equal_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! determines whether `p1` and `p2` are geometrically equivalent. */ - bool operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); + bool operator()(AosTraits::Point_2 p1, AosTraits::Point_2 p2); - /*! determines whether `xc1` and `xc2` are geometrically equivalent (have the - * same graph). + /*! determines whether `xc1` and `xc2` are geometrically equivalent + * (have the same graph). */ - bool operator()(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2); + bool operator()(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2); /// @} - -}; /* end ArrTraits::Equal_2 */ +}; /* end AosTraits::Equal_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Intersect_2.h similarity index 78% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Intersect_2.h index f13a26422e9..4fa6e0bbb25 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Intersect_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Intersect_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,7 +6,7 @@ namespace ArrTraits { * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementXMonotoneTraits_2::Intersect_2} + * \cgalHasModels{AosXMonotoneTraits_2::Intersect_2} * \cgalHasModelsEnd */ class Intersect_2 { @@ -40,17 +40,17 @@ public: * nondeterministic. * * \pre Dereferencing `oi` must yield an object of type - * `std::optional>`, - * where `%Point_2` is a model of `ArrTraits::Point_2` and - * `X_monotone_curve_2` is a model of `ArrTraits::XMonotoneCurve_2`. + * `std::optional>`, + * where `%Point_2` is a model of `AosTraits::Point_2` and + * `X_monotone_curve_2` is a model of `AosTraits::XMonotoneCurve_2`. */ template - OutputIterator operator()(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2, + OutputIterator operator()(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2, OutputIterator& oi); -/// @} + /// @} -}; /* end ArrTraits::Intersect_2 */ +}; /* end AosTraits::Intersect_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnXIdentification_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnXIdentification_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnXIdentification_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnXIdentification_2.h index 351ae415352..026bd99d0da 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnXIdentification_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnXIdentification_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableUnaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementIdentifiedHorizontalTraits_2::Is_on_x_identification_2} + * \cgalHasModels{AosIdentifiedHorizontalTraits_2::Is_on_x_identification_2} * \cgalHasModelsEnd */ class IsOnXIdentification_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -19,15 +18,14 @@ public: /*! determines whether the point `p` lies on the vertical identification * curve. */ - bool operator()(ArrTraits::Point& point) const; + bool operator()(AosTraits::Point& point) const; /*! determines whether the curve `cv` lies on the vertical identification * curve. */ - bool operator()(ArrTraits::const X_monotone_curve_2& cv) const; + bool operator()(AosTraits::const X_monotone_curve_2& cv) const; /// @} - -}; /* end ArrTraits::IsOnXIdentification_2 */ +}; /* end AosTraits::IsOnXIdentification_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnYIdentification_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnYIdentification_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnYIdentification_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnYIdentification_2.h index 5ca8c772233..b2360e98ab0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsOnYIdentification_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsOnYIdentification_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,12 +6,11 @@ namespace ArrTraits { * \cgalRefines{AdaptableUnaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementIdentifiedVerticalTraits_2::Is_on_y_identification_2} + * \cgalHasModels{AosIdentifiedVerticalTraits_2::Is_on_y_identification_2} * \cgalHasModelsEnd */ class IsOnYIdentification_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -19,15 +18,14 @@ public: /*! determines whether the point `p` lies on the horizontal identification * curve. */ - bool operator()(ArrTraits::Point& point) const; + bool operator()(AosTraits::Point& point) const; /*! determines whether the curve `cv` lies on the horizontal identification * curve. */ - bool operator()(ArrTraits::const X_monotone_curve_2& cv) const; + bool operator()(AosTraits::const X_monotone_curve_2& cv) const; /// @} - -}; /* end ArrTraits::IsOnYIdentification_2 */ +}; /* end AosTraits::IsOnYIdentification_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsVertical_2.h similarity index 66% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsVertical_2.h index e6894c911cf..811f4ca5efa 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--IsVertical_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--IsVertical_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,22 +6,20 @@ namespace ArrTraits { * \cgalRefines{AdaptableUnaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Is_vertical_2} + * \cgalHasModels{AosBasicTraits_2::Is_vertical_2} * \cgalHasModelsEnd */ class IsVertical_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! determines whether `xc` is a vertical segment. */ - bool operator()(ArrTraits::X_monotone_curve_2 xc); + bool operator()(AosTraits::X_monotone_curve_2 xc); /// @} - -}; /* end ArrTraits::IsVertical_2 */ +}; /* end AosTraits::IsVertical_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--MakeXMonotone_2.h similarity index 77% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--MakeXMonotone_2.h index a86290bd333..da38e1f9f84 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--MakeXMonotone_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--MakeXMonotone_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,7 +6,7 @@ namespace ArrTraits { * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementTraits_2::Make_x_monotone_2} + * \cgalHasModels{AosTraits_2::Make_x_monotone_2} * \cgalHasModelsEnd */ class MakeXMonotone_2 { @@ -27,13 +27,13 @@ public: * * \pre Dereferencing `oi` must yield a polymorphic object of type * `std::variant<%Point_2, X_monotone_curve_2>`, where `%Point_2` is a model - * of `ArrTraits::Point_2` and `X_monotone_curve_2` is a model of - * `ArrTraits::XMonotoneCurve_2`. + * of `AosTraits::Point_2` and `X_monotone_curve_2` is a model of + * `AosTraits::XMonotoneCurve_2`. */ template - OutputIterator operator()(ArrTraits::Curve_2 c, OutputIterator oi); + OutputIterator operator()(AosTraits::Curve_2 c, OutputIterator oi); /// @} -}; /* end ArrTraits::MakeXMonotone_2 */ +}; /* end AosTraits::MakeXMonotone_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Merge_2.h similarity index 53% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Merge_2.h index 0ff9c3ff392..6c8bbdf153f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Merge_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Merge_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,27 +6,25 @@ namespace ArrTraits { * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementXMonotoneTraits_2::Merge_2} + * \cgalHasModels{AosXMonotoneTraits_2::Merge_2} * \cgalHasModelsEnd */ class Merge_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ - /*! accepts two mergeable \f$ x\f$-monotone curves `xc1` and `xc2` + /*! accepts two mergeable \f$x\f$-monotone curves `xc1` and `xc2` * and assigns `xc` with the merged curve. * * \pre `are_mergeable_2`(`xc1`, `xc2`) is true. */ - void merge(ArrTraits::X_monotone_curve_2 xc1, - ArrTraits::X_monotone_curve_2 xc2, - ArrTraits::X_monotone_curve_2& xc); + void merge(AosTraits::X_monotone_curve_2 xc1, + AosTraits::X_monotone_curve_2 xc2, + AosTraits::X_monotone_curve_2& xc); /// @} - -}; /* end ArrTraits::Merge_2 */ +}; /* end AosTraits::Merge_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInX_2.h similarity index 70% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInX_2.h index 3f0c55da195..af9e3380718 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInX_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInX_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,21 +6,20 @@ namespace ArrTraits { * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementVerticalSideTraits_2::Parameter_space_in_x_2} - * \cgalHasModels{ArrangementOpenBoundaryTraits_2::Parameter_space_in_x_2} - * \cgalHasModels{ArrangementSphericalBoundaryTraits_2::Parameter_space_in_x_2} + * \cgalHasModels{AosVerticalSideTraits_2::Parameter_space_in_x_2} + * \cgalHasModels{AosOpenBoundaryTraits_2::Parameter_space_in_x_2} + * \cgalHasModels{AosSphericalBoundaryTraits_2::Parameter_space_in_x_2} * \cgalHasModelsEnd */ class ParameterSpaceInX_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ /*! Given an \f$x\f$-monotone curve `xcv` and an enumeration `ce` * that specifies either the minimum or the maximum end of the curve, - * determines the location of the curve end along the \f$ x\f$-dimension. The + * determines the location of the curve end along the \f$x\f$-dimension. The * variable `xcv` identifies the parametric curve \f$c(t) = (x(t), y(t))\f$ * defined over an open or half-open interval with endpoints \f$0\f$ and * \f$1\f$. The enumeration `ce` identifies an open end \f$d \in\{0,1\}\f$ of @@ -31,19 +30,18 @@ public: * `CGAL::ARR_LEFT_BOUNDARY`, `CGAL::ARR_RIGHT_BOUNDARY`, or * `CGAL::ARR_INTERIOR`, accordingly. * - * \post If `ArrTraits::Left_side_category` is convertible to + * \post If `AosTraits::Left_side_category` is convertible to * `CGAL::Arr_oblivious_side_tag` then the result is not * `CGAL::ARR_LEFT_BOUNDARY`. * - * \post If `ArrTraits::Right_side_category` is convertible to + * \post If `AosTraits::Right_side_category` is convertible to * `CGAL::Arr_oblivious_side_tag` then the result is not * `CGAL::ARR_RIGHT_BOUNDARY`. */ - CGAL::Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, + CGAL::Arr_parameter_space operator()(const AosTraits::X_monotone_curve_2& xcv, CGAL::Arr_curve_end ce); /// @} - -}; /* end ArrTraits::ParameterSpaceInX_2 */ +}; /* end AosTraits::ParameterSpaceInX_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInY_2.h similarity index 73% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInY_2.h index c598003b214..a8354c2dd98 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ParameterSpaceInY_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ParameterSpaceInY_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept @@ -6,14 +6,13 @@ namespace ArrTraits { * \cgalRefines{AdaptableBinaryFunction} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2} - * \cgalHasModels{ArrangementOpenBoundaryTraits_2::Parameter_space_in_y_2} - * \cgalHasModels{ArrangementSphericalBoundaryTraits_2::Parameter_space_in_y_2} + * \cgalHasModels{AosHorizontalSideTraits_2::Parameter_space_in_y_2} + * \cgalHasModels{AosOpenBoundaryTraits_2::Parameter_space_in_y_2} + * \cgalHasModels{AosSphericalBoundaryTraits_2::Parameter_space_in_y_2} * \cgalHasModelsEnd */ class ParameterSpaceInY_2 { public: - /// \name Operations /// A model of this concept must provide: /// @{ @@ -22,7 +21,7 @@ public: * that specifies either the minimum or the maximum end of the curve, * determines the location of the curve end along the \f$y\f$-dimension. The * variable `xcv` identifies the parametric curve \f$c(t) = (x(t),y(t))\f$ - * defined over an open or half-open interval with endpoints \f$ 0\f$ and + * defined over an open or half-open interval with endpoints \f$0\f$ and * \f$1\f$. The enumeration `ce` identifies an open end \f$d \in\{0,1\}\f$ of * \f$c\f$. Formally, determines whether \f$\lim_{t \rightarrow d} y(t)\f$ * evaluates to \f$b_b\f$, \f$b_t\f$, or a value in between, where \f$b_b\f$ @@ -30,19 +29,18 @@ public: * of the parameter space, respectively. Returns `CGAL::ARR_BOTTOM_BOUNDARY`, * `CGAL::ARR_TOP_BOUNDARY`, or `CGAL::ARR_INTERIOR`, accordingly. * - * \post If `ArrTraits::Bottom_side_category` is convertible to + * \post If `AosTraits::Bottom_side_category` is convertible to * `CGAL::Arr_oblivious_side_tag` then the result is not * `CGAL::ARR_BOTTOM_BOUNDARY` . * - * \post If `ArrTraits::Top_side_category` is convertible to + * \post If `AosTraits::Top_side_category` is convertible to * `CGAL::Arr_oblivious_side_tag` then the result is not * `CGAL::ARR_TOP_BOUNDARY`. */ - CGAL::Arr_parameter_space operator()(const ArrTraits::X_monotone_curve_2& xcv, + CGAL::Arr_parameter_space operator()(const AosTraits::X_monotone_curve_2& xcv, CGAL::Arr_curve_end ce); -/// @} - -}; /* end ArrTraits::ParameterSpaceInY_2 */ + /// @} +}; /* end AosTraits::ParameterSpaceInY_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Point_2.h similarity index 64% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Point_2.h index 337ccf35ae5..8854a4a2ffa 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Point_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Point_2.h @@ -1,4 +1,4 @@ -namespace ArrTraits { +namespace AosTraits { /*! \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects * \cgalConcept @@ -8,12 +8,9 @@ namespace ArrTraits { * \cgalRefines{CopyConstructible,Assignable,DefaultConstructible} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::Point_2} + * \cgalHasModels{AosBasicTraits_2::Point_2} * \cgalHasModelsEnd */ -class Point_2 { -public: - -}; /* end ArrTraits::Point_2 */ +class Point_2 {}; } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Split_2.h similarity index 62% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Split_2.h index 68a833aa549..b789dcb991c 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Split_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--Split_2.h @@ -1,11 +1,12 @@ -namespace ArrTraits { +namespace AosTraits { + /*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects * \cgalConcept * * \cgalRefines{Functor} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementXMonotoneTraits_2::Split_2} + * \cgalHasModels{AosXMonotoneTraits_2::Split_2} * \cgalHasModelsEnd */ class Split_2 { @@ -18,13 +19,12 @@ public: * splits `xc` at the split point into two subcurves `xc1` and `xc2`, such * that `p` is `xc1`'s right endpoint and `xc2`'s left endpoint. */ - void operator()(ArrTraits::X_monotone_curve_2 xc, - ArrTraits::Point_2 p, - ArrTraits::X_monotone_curve_2& xc1, - ArrTraits::X_monotone_curve_2& xc2); + void operator()(AosTraits::X_monotone_curve_2 xc, + AosTraits::Point_2 p, + AosTraits::X_monotone_curve_2& xc1, + AosTraits::X_monotone_curve_2& xc2); /// @} - -}; /* end ArrTraits::Split_2 */ +}; /* end AosTraits::Split_2 */ } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--XMonotoneCurve_2.h similarity index 62% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--XMonotoneCurve_2.h index 3b61bb2dca4..dc21fbee02d 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--XMonotoneCurve_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--XMonotoneCurve_2.h @@ -1,4 +1,5 @@ -namespace ArrTraits { +namespace AosTraits { + /*! \ingroup PkgArrangementOnSurface2ConceptsGeometricObjects * \cgalConcept * @@ -7,12 +8,9 @@ namespace ArrTraits { * \cgalRefines{CopyConstructible,Assignable,DefaultConstructible} * * \cgalHasModelsBegin - * \cgalHasModels{ArrangementBasicTraits_2::X_monotone_curve_2} + * \cgalHasModels{AosBasicTraits_2::X_monotone_curve_2} * \cgalHasModelsEnd */ -class XMonotoneCurve_2 { -public: - -}; /* end ArrTraits::XMonotoneCurve_2 */ +class XMonotoneCurve_2 {}; } diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits_2.h new file mode 100644 index 00000000000..c65fd9ee100 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits_2.h @@ -0,0 +1,78 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * The concept `AosTraits_2` allows the construction of arrangement of + * general planar curves. Models of this concept are used by the free + * \link PkgArrangementOnSurface2Insert `CGAL::insert()` \endlink functions of + * the arrangement package and by the `CGAL::Arrangement_with_history_2` class. + * + * A model of this concept must define the nested `Curve_2` type, which + * represents a general planar curve that is not necessarily \f$x\f$-monotone + * and is not necessarily connected. Such curves are eventually subdivided into + * \f$x\f$-monotone subcurves and isolated points (represented by the `Point_2` + * and `X_monotone_curve_2` types, defined in the basic traits concept). + * + * A model of the concept `AosTraits_2` that handles arbitrary curves, + * which are always \f$x\f$-monotone, such as a traits class that handles + * linear curves may define the nested types `Curve_2` and + * `X_monotone_curve_2` to be of equivalent types. Moreover, defining + * them as of equivalent types is advantageous, as it enables a generic + * simple implementation of the nested Functor + * `Make_x_monotone_2`. + * + * On the other hand, a model of the `AosTraits_2` concept that handles + * arbitrary curves, which may be not \f$x\f$-monotone must define the + * `Curve_2` and `X_monotone_curve_2` nested types to be of + * different types to allow proper dispatching of the free functions + * that accept such curves, such as `intsert()`. + * + * \cgalRefines{AosXMonotoneTraits_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_segment_traits_2} + * \cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} + * \cgalHasModels{CGAL::Arr_linear_traits_2} + * \cgalHasModels{CGAL::Arr_polyline_traits_2} + * \cgalHasModels{CGAL::Arr_circle_segment_traits_2} + * \cgalHasModels{CGAL::Arr_line_arc_traits_2} + * \cgalHasModels{CGAL::Arr_circular_arc_traits_2} + * \cgalHasModels{CGAL::Arr_circular_line_arc_traits_2} + * \cgalHasModels{CGAL::Arr_conic_traits_2} + * \cgalHasModels{CGAL::Arr_rational_function_traits_2} + * \cgalHasModels{CGAL::Arr_Bezier_curve_traits_2} + * \cgalHasModels{CGAL::Arr_algebraic_segment_traits_2} + * \cgalHasModels{CGAL::Arr_curve_data_traits_2} + * \cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} + * \cgalHasModelsEnd + * + * \sa `AosBasicTraits_2` + * \sa `AosXMonotoneTraits_2` + * \sa `AosLandmarkTraits_2` + */ +class AosTraits_2 { +public: + /// \name Types + /// @{ + + ///! models the concept `AosTraits::Curve_2`. + typedef unspecified_type Curve_2; + + /// @} + + /// \name Functor Types + /// @{ + + /// models the concept `AosTraits::MakeXMonotone_2`. + typedef unspecified_type Make_x_monotone_2; + + /// @} + + /// \name Accessing Functor Objects + /// @{ + + /*! + */ + Make_x_monotone_2 make_x_monotone_2_object() const; + + /// @} +}; /* end AosTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalRayShoot_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalRayShoot_2.h new file mode 100644 index 00000000000..bd488ffe20a --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalRayShoot_2.h @@ -0,0 +1,111 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept + * + * A model of the `AosVerticalRayShoot_2` concept can answer vertical + * ray-shooting queries on an arrangement attached to it. Namely, given a + * `Arrangement_2::Point_2` object, representing a point in the plane, it + * returns the arrangement feature (edge or vertex) that lies strictly above it + * (or below it). By "strictly" we mean that if the query point lies on an + * arrangement edge (or on an arrangement vertex) this edge will not be + * the query result, but the feature lying above or below it. (An exception to + * this rule is the degenerate case where the query point lies in the interior + * of a vertical edge.) Note that it may happen that the query point lies above + * the upper envelope (or below the lower envelope) of the arrangement, and the + * vertical ray emanating from the query point goes to infinity without hitting + * any arrangement feature on its way. In this case the unbounded face is + * returned. + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_naive_point_location} + * \cgalHasModels{CGAL::Arr_walk_along_line_point_location} + * \cgalHasModels{CGAL::Arr_trapezoid_ric_point_location} + * \cgalHasModels{CGAL::Arr_landmarks_point_location} + * \cgalHasModelsEnd + * + * \sa `CGAL::Arr_naive_point_location` + * \sa `CGAL::Arr_walk_along_line_point_location` + * \sa `CGAL::Arr_trapezoid_ric_point_location` + * \sa `CGAL::Arr_landmarks_point_location` + * \sa `CGAL::Arr_point_location_result` + */ +class AosVerticalRayShoot_2 { +public: + /// \name Types + /// @{ + + //! the associated arrangement type. + typedef unspecified_type Arrangement_2; + + //! equivalent to `Arrangement_2::Point_2`. + typedef unspecified_type Point_2; + + /// @} + + /// \name Creation + /// @{ + + /*! default constructor. + */ + AosVerticalRayShoot_2(); + + /*! constructs a ray-shooting object `rs` attached to the given arrangement + * `arr`. + */ + AosVerticalRayShoot_2 (const Arrangement_2& arr); + + /// @} + + /// \name Query Functions + /// @{ + + /*! locates the arrangement feature that is first hit by an upward-directed + * vertical ray emanating from the query point `q`, and returns a handle for + * this feature. The function returns a + * discriminated union container of the following bounded types: + * + *
    + *
  • `Arrangement_2::Halfedge_const_handle`, in case the vertical + * ray hits an arrangement edge; + *
  • `Arrangement_2::Vertex_const_handle`, in case the vertical + * ray hits an arrangement vertex. + *
  • `Arrangement_2::Face_const_handle` for the unbounded arrangement + * face, in case `q` lies above the upper envelope of the arrangement. + *
+ * + * \pre `rs` is attached to a valid arrangement instance. + */ + Arr_point_location_result::Type ray_shoot_up(const Point_2& q) const; + + /*! locates the arrangement feature that is first hit by a downward-directed + * vertical ray emanating from the query point `q`, and returns a handle for + * this feature. The function returns a discriminated union container of the + * following bounded types: + * + *
    + *
  • `Arrangement_2::Halfedge_const_handle`, in case the vertical + * ray hits an arrangement edge; + *
  • `Arrangement_2::Vertex_const_handle`, in case the vertical + * ray hits an arrangement vertex. + *
  • `Arrangement_2::Face_const_handle` for the unbounded arrangement + * face, in case `q` lies below the lower envelope of the arrangement. + *
+ * + * \pre `rs` is attached to a valid arrangement instance. + */ + Arr_point_location_result::Type ray_shoot_down(const Point_2& q) const; + + /// @} + + /// \name Operations + /// @{ + + /*! attaches `rs` to the given arrangement `arr`. + */ + void attach (const Arrangement_2& arr); + + /*! detaches `rs` from the arrangement it is currently attached to. + */ + void detach (); + + /// @} +}; /* end AosVerticalRayShoot_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalSideTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalSideTraits_2.h similarity index 76% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalSideTraits_2.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalSideTraits_2.h index 88802d7ad61..0f474e380b6 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalSideTraits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosVerticalSideTraits_2.h @@ -1,7 +1,7 @@ /*! \ingroup PkgArrangementOnSurface2ConceptsTraits * \cgalConcept * - * `ArrangementVerticalSideTraits_2` is an abstract concept. It generalizes all + * `AosVerticalSideTraits_2` is an abstract concept. It generalizes all * concepts that handle curves that either reach or approach either the left or * right sizeds of the boundary of the parameter space. (An "abstract" concept * is a concept that is useless on its own.) Only a combination of this concept @@ -9,7 +9,7 @@ * remaining boundary sides (that is, bottom and top) are purposeful, and can * have models. * - * \cgalRefines{ArrangementBasicTraits_2} + * \cgalRefines{AosBasicTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Arr_linear_traits_2} @@ -18,11 +18,10 @@ * \cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} * \cgalHasModelsEnd * - * \sa `ArrangementVerticalSideTraits_2` + * \sa `AosVerticalSideTraits_2` */ -class ArrangementVerticalSideTraits_2 { +class AosVerticalSideTraits_2 { public: - /// \name Categories /// @{ /// @} @@ -34,10 +33,10 @@ public: /// \name Functor Types /// @{ - /// models the concept `ArrTraits::ParameterSpaceInX_2`. + /// models the concept `AosTraits::ParameterSpaceInX_2`. typedef unspecified_type Parameter_space_in_x_2; - /// models the concept `ArrTraits::CompareYNearBoundary_2`. + /// models the concept `AosTraits::CompareYNearBoundary_2`. typedef unspecified_type Compare_y_near_boundary_2; /// @} @@ -47,5 +46,4 @@ public: Parameter_space_in_x_2 parameter_space_in_x_2_object() const; Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const; /// @} - -}; /* end ArrangementHorizontalSideTraits_2 */ +}; /* end AosHorizontalSideTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryInputFormatter.h new file mode 100644 index 00000000000..31336368078 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryInputFormatter.h @@ -0,0 +1,62 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept + * + * A model for the `AosWithHistoryInputFormatter` concept supports a set of + * functions that enable reading an arrangement-with-history instance from an + * input stream using a specific format. + * + * \cgalRefines{AosInputFormatter} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_with_history_text_formatter} + * \cgalHasModelsEnd + */ +class AosWithHistoryInputFormatter { +public: + /// \name Types + /// @{ + + /*! the type of arrangement to input. + */ + typedef unspecified_type Arr_with_history_2; + + /*! the inducing curve type. + */ + typedef typename Arrangement_2::Curve_2 Curve_2; + + /// @} + + /// \name Formatted Input Functions + /// @{ + + /*! reads a message indicating the beginning of the inducing curves. + */ + void read_curves_begin(); + + /*! reads a message indicating the end of the inducing curves. + */ + void read_curves_end(); + + /*! reads a message indicating the beginning of a single curve record. + */ + void read_curve_begin(); + + /*! reads a message indicating the end of a single curve record. + */ + void read_curve_end(); + + /*! reads a curve. + */ + void read_curve(Curve_2& c); + + /*! reads a message indicating the beginning of the set of edges + * induced by the current curve. + */ + void read_induced_edges_begin(); + + /*! reads a message indicating the end of the induced edges set. + */ + void read_induced_edges_end(); + + /// @} +}; /* end AosWithHistoryInputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryOutputFormatter.h similarity index 74% rename from Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h rename to Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryOutputFormatter.h index 2aa87cc1d95..b72d935a8a2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryOutputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosWithHistoryOutputFormatter.h @@ -1,21 +1,19 @@ +/*! \ingroup PkgArrangementOnSurface2Concepts + * \cgalConcept -/*! -\ingroup PkgArrangementOnSurface2Concepts -\cgalConcept - -A model for the `ArrangementWithHistoryOutputFormatter` concept supports a set of functions that enable +A model for the `AosWithHistoryOutputFormatter` concept supports a set of functions that enable writing an arrangement-with-history instance to an output stream using a specific format. -\cgalRefines{ArrangementOutputFormatter} +\cgalRefines{AosOutputFormatter} \cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_with_history_text_formatter} +\cgalHasModels{CGAL::Arr_with_history_text_formatter} \cgalHasModelsEnd */ -class ArrangementWithHistoryOutputFormatter { +class AosWithHistoryOutputFormatter { public: /// \name Types @@ -74,5 +72,4 @@ void write_induced_edges_end(); /// @} -}; /* end ArrangementWithHistoryOutputFormatter */ - +}; /* end AosWithHistoryOutputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosXMonotoneTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosXMonotoneTraits_2.h new file mode 100644 index 00000000000..c03fad48b2a --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosXMonotoneTraits_2.h @@ -0,0 +1,113 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * The concept `AosXMonotoneTraits_2` refines the basic arrangement-traits + * concept. A model of this concept is able to handle \f$x\f$-monotone curves + * that intersect in their interior (and points that coincide with curve + * interiors). This is necessary for constructing arrangements of sets of + * intersecting \f$x\f$-monotone curves. + * + * As the resulting structure, represented by the `Arrangement_2` class, stores + * pairwise interior-disjoint curves, the input curves are split at the + * intersection points before being inserted into the arrangement. A model of + * this refined concept therefore needs to compute the intersections (and + * possibly overlaps) between two \f$x\f$-monotone curves and to support curve + * splitting. + * + * \cgalRefines{AosBasicTraits_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_segment_traits_2} + * \cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} + * \cgalHasModels{CGAL::Arr_linear_traits_2} + * \cgalHasModels{CGAL::Arr_polyline_traits_2} + * \cgalHasModels{CGAL::Arr_circle_segment_traits_2} + * \cgalHasModels{CGAL::Arr_line_arc_traits_2} + * \cgalHasModels{CGAL::Arr_circular_arc_traits_2} + * \cgalHasModels{CGAL::Arr_circular_line_arc_traits_2} + * \cgalHasModels{CGAL::Arr_conic_traits_2} + * \cgalHasModels{CGAL::Arr_rational_function_traits_2} + * \cgalHasModels{CGAL::Arr_Bezier_curve_traits_2} + * \cgalHasModels{CGAL::Arr_algebraic_segment_traits_2} + * \cgalHasModels{CGAL::Arr_curve_data_traits_2} + * \cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} + * \cgalHasModelsEnd + * + * \sa `AosBasicTraits_2` + */ +class AosXMonotoneTraits_2 { +public: + /// \name Types + /// @{ + + /// the multiplicity type. + typedef unspecified_type Multiplicity; + + /// @} + + /// \name Tags + /// @{ + + /*! indicates whether the nested functors `Are_mergeable_2` and `Merge_2` + * are provided. + */ + typedef unspecified_type Has_merge_category; + + /// @} + + /// \name Functor Types + /// @{ + + /// models the concept `AosTraits::Intersect_2`. + typedef unspecified_type Intersect_2; + + /// models the concept `AosTraits::Split_2`. + typedef unspecified_type Split_2; + + /// @} + + /// \name + /// \attention The two following function-object types are + /// optional. If they are supported, the `Has_merge_category` tag + /// should be defined as `Tag_true` and otherwise as `Tag_false`. + /// @{ + + /*! models the concept `AosTraits::AreMergeable_2`. + */ + typedef unspecified_type Are_mergeable_2; + + /*! models the concept `AosTraits::Merge_2`. + */ + typedef unspecified_type Merge_2; + + /// @} + + /// \name Accessing Functor Objects + /// @{ + + /*! + */ + Intersect_2 intersect_2_object() const; + + /*! + */ + Split_2 split_2_object() const; + + /// @} + + /// \name + /// The two following methods are optional. If they are supported, the + /// `Has_merge_category` tag should be defined as `Tag_true` and otherwise + /// as `Tag_false`. + /// @{ + + /*! + */ + Are_mergeable_2 are_mergeable_2_object() const; + + /*! + */ + Merge_2 merge_2_object() const; + + /// @} +}; /* end AosXMonotoneTraits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h deleted file mode 100644 index fc450689a0d..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--Approximate_2.h +++ /dev/null @@ -1,28 +0,0 @@ -namespace ArrTraits { - -/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects - * \cgalConcept - * - * \cgalRefines{Functor} - * - * \cgalHasModelsBegin - * \cgalHasModels{ArrangementApproximateTraits_2::Approximate_2} - * \cgalHasModelsEnd - */ -class Approximate_2 { -public: - - /// \name Operations - /// A model of this concept must provide: - /// @{ - - /*! obtains an approximation of `p`'s \f$x\f$-coordinate (if `i` == 0), or of - * `p`'s \f$y\f$-coordinate (if `i` == 1). - */ - CGAL::Approximate_number_type operator()(ArrTraits::Point_2 p, int i); - - /// @} - -}; /* end ArrTraits::Approximate_2 */ - -} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundaryOfCurveEnd_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundaryOfCurveEnd_2.h deleted file mode 100644 index 28208660fec..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareXOnBoundaryOfCurveEnd_2.h +++ /dev/null @@ -1,76 +0,0 @@ -namespace ArrTraits { - -/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects - * \cgalConcept - * - * \cgalRefines{AdaptableFunctor} - * - * \cgalHasModelsBegin - * \cgalHasModels{ArrangementHorizontalSideTraits_2::Compare_x_on_boundary_2} - * \cgalHasModels{ArrangementOpenBoundaryTraits_2::Compare_x_on_boundary_2} - * \cgalHasModels{ArrangementSphericalBoundaryTraits_2::Compare_x_on_boundary_2} - * \cgalHasModelsEnd - */ -class CompareXOnBoundaryOfCurveEnd_2 { -public: - - /// \name Operations - /// A model of this concept must provide: - /// @{ - - /*! Given a point `p`, an \f$x\f$-monotone curve `xcv`, and an - * enumeration `ce` that specifies either the minimum or the maximum end of - * the curve where the curve has a vertical asymptote, compares the \f$ - * x\f$-coordinate of `p` and the \f$x\f$-coordinate of the limit of the - * curve at its specified end. The variable `xcv` identifies the parametric - * curve \f$c(t) = (x(t), y(t))\f$ defined over an open or half-open interval - * with endpoints \f$ 0\f$ and \f$ 1\f$. The enumeration `ce` identifies an - * open end \f$d \in\{0,1\}\f$ of \f$c\f$. Formally, compares the \f$ - * x\f$-coordinate of `p` and \f$ \lim_{t \rightarrow d} x(t)\f$. Returns - * `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. - * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink (`xcv`, `ce`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. - * - * \pre If the parameter space is unbounded, \f$c\f$ has a vertical asymptote - * at its \f$ d\f$-end; that is, - * \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv`, `ce`) = `CGAL::ARR_INTERIOR`. - */ - Comparison_result operator()(const ArrTraits::Point_2& p, - const ArrTraits::X_monotone_curve_2& xcv, - CGAL::Arr_curve_end ce); - -/*! Given two \f$ x\f$-monotone curves `xcv1` and `xcv2` and two indices `ce1` - * and `ce2` that specify either the minimum or the maximum ends of `xcv1` and - * `xcv2`, respectively, where the curves have vertical asymptotes, compares the - * \f$ x\f$-coordinates of the limits of the curves at their specified - * ends. The variables `xcv1` and `xcv2` identify the parametric curves \f$ - * c_1(t) = (x_1(t),y_1(t))\f$ and \f$ c_2(t) = (x_2(t),y_2(t))\f$, - * respectively, defined over open or half-open intervals with endpoints \f$ - * 0\f$ and \f$ 1\f$. The indices `ce1` and `ce2` identify open ends \f$ d_1 - * \in\{0,1\}\f$ and \f$ d_2 \in\{0,1\}\f$ of \f$ c_1\f$ and \f$ c_2\f$, - * respectively. Formally, compares \f$ \lim_{t \rightarrow d_1} x_1(t)\f$ and - * \f$\lim_{t \rightarrow d_2} x_2(t)\f$. Returns `CGAL::SMALLER`, - * `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. - * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink(`xcv1`, `ce1`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. - * - * \pre \link ArrangementHorizontalSideTraits_2::Parameter_space_in_y_2 `Parameter_space_in_y_2`\endlink(`xcv2`, `ce2`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. - * - * \pre If the parameter space is unbounded, \f$c_1\f$ has a vertical - * asymptote at its respective end; that is, - * \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv1`, `ce1`) = `CGAL::ARR_INTERIOR`. - * - * \pre If the parameter space is unbounded, \f$c_2\f$ has a vertical asymptote - * at its respective end; that is, - * \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 `Parameter_space_in_x_2`\endlink(`xcv2`, `ce2`) = `CGAL::ARR_INTERIOR`. - */ -Comparison_result operator()(const ArrTraits::X_monotone_curve_2& xcv1, - CGAL::Arr_curve_end ce1, - const ArrTraits::X_monotone_curve_2& xcv2, - CGAL::Arr_curve_end ce2); - -/// @} - -}; /* end ArrTraits::CompareXOnBoundaryOfCurveEnd_2 */ - -} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h deleted file mode 100644 index 206458c178b..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--CompareYOnBoundary_2.h +++ /dev/null @@ -1,39 +0,0 @@ -namespace ArrTraits { - -/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects - * \cgalConcept - * - * \cgalRefines{AdaptableBinaryFunction} - * - * \cgalHasModelsBegin - * \cgalHasModels{ArrangementClosedLeftTraits_2::Compare_y_on_boundary_2} - * \cgalHasModels{ArrangementClosedRightTraits_2::Compare_y_on_boundary_2} - * \cgalHasModels{ArrangementIdentifiedVerticalTraits_2::Compare_y_on_boundary_2} - * \cgalHasModels{ArrangementSphericalBoundaryTraits_2::Compare_y_on_boundary_2} - * \cgalHasModelsEnd - */ -class CompareYOnBoundary_2 { -public: - - /// \name Operations - /// A model of this concept must provide: - /// @{ - - /*! Given two points `p1` and `p2`, such that either `p1` or `p2` (or both) - * lie on the bottom or top boundary of the parameter space, compares the \f$ - * y\f$-coordinate of `p1` and the \f$y\f$-coordinate of `p2`. Returns - * `CGAL::SMALLER`, `CGAL::EQUAL`, or `CGAL::LARGER` accordingly. - * - * \pre \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 - * `Parameter_space_in_x_2`\endlink (`p1`) \f$\neq\f$ `CGAL::ARR_INTERIOR` or - * \link ArrangementVerticalSideTraits_2::Parameter_space_in_x_2 - * `Parameter_space_in_x_2`\endlink (`p2`) \f$\neq\f$ `CGAL::ARR_INTERIOR`. - */ - Comparison_result operator()(const ArrTraits::Point_2& p1, - const ArrTraits::Point_2& p2); - -/// @} - -}; /* end ArrTraits::CompareYOnBoundary_2 */ - -} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructCurve_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructCurve_2.h deleted file mode 100644 index 12a1109a33b..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrTraits--ConstructCurve_2.h +++ /dev/null @@ -1,28 +0,0 @@ -namespace ArrTraits { - -/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects - * \cgalConcept - * - * \cgalRefines{Functor} - * - * \cgalHasModelsBegin - * \cgalHasModels{ArrangementConstructCurveTraits_2::Construct_curve_2} - * \cgalHasModelsEnd - */ -class ConstructCurve_2 { -public: - - /// \name Operations - /// A model of this concept must provide: - /// @{ - - /*! returns a curve connecting `p1` and `p2` (i.e., the - * two input points are its endpoints). - */ - ArrTraits::Curve_2 operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2); - - /// @} - -}; /* end ArrTraits::ConstructCurve_2 */ - -} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h deleted file mode 100644 index 7dfd9a01f6b..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementApproximateTraits_2.h +++ /dev/null @@ -1,55 +0,0 @@ -/*! -\ingroup PkgArrangementOnSurface2ConceptsTraits -\cgalConcept - -The concept `ArrangementApproximateTraits_2` refines the basic traits concept -`ArrangementBasicTraits_2`. A model of this concept is able to approximate a -point. - -\cgalRefines{ArrangementBasicTraits_2} - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_conic_traits_2} -\cgalHasModels{CGAL::Arr_geodesic_arc_on_sphere_traits_2} -\cgalHasModels{CGAL::Arr_linear_traits_2} -\cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} -\cgalHasModels{CGAL::Arr_segment_traits_2} -\cgalHasModels{CGAL::Arr_polycurve_traits_2} -\cgalHasModels{CGAL::Arr_polyline_traits_2} -\cgalHasModels{CGAL::Arr_rational_function_traits_2} -\cgalHasModelsEnd - -\sa `ArrangementConstructXMonotoneCurveTraits_2`, - `ArrangementXMonotoneTraits_2`, and - `ArrangementTraits_2` -*/ -class ArrangementApproximateTraits_2 { -public: - /// \name Types - /// @{ - - /*! - * the number type used to approximate point coordinates, e.g., double. - */ - typedef unspecified_type Approximate_number_type; - - /// @} - - /// \name Functor Types - /// @{ - - /*! - * models the concept `ArrTraits::Approximate_2`. - */ - typedef unspecified_type Approximate_2; - /// @} - /// \name Accessing Functor Objects - /// @{ - - /*! - * - */ - Approximate_2 approximate_2_object() const; - - /// @} -} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h deleted file mode 100644 index b0cb67e12e9..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h +++ /dev/null @@ -1,234 +0,0 @@ -/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL - * \cgalConcept - * - * A doubly-connected edge-list (\dcel for short) data-structure. It consists of - * three containers of records: vertices \f$ V\f$, halfedges \f$ E\f$, and faces - * \f$ F\f$. It maintains the incidence relation among them. The halfedges are - * ordered in pairs sometimes referred to as twins, such that each halfedge pair - * represent an edge. - * - * A model of the `ArrangementDcel` concept must provide the following types and - * operations. (In addition to the requirements here, the local types - * `Vertex`,`Halfedge`, `Face`, `Outer_ccb`, `Inner_ccb`, and `Isolated_vertex` - * must be models of the concepts `ArrangementDcelVertex`, - * `ArrangementDcelHalfedge`, `ArrangementDcelFace`, `ArrangementDcelOuterCcb`, - * `ArrangementDcelInnerCcb`, and `ArrangementDcelIsolatedVertex` respectively.) - * - * \cgalHasModelsBegin - * \cgalHasModels{CGAL::Arr_dcel_base} - * \cgalHasModels{CGAL::Arr_default_dcel} - * \cgalHasModels{CGAL::Arr_face_extended_dcel} - * \cgalHasModels{CGAL::Arr_extended_dcel} - * \cgalHasModelsEnd - * - * \sa `ArrangementDcelVertex` - * \sa `ArrangementDcelHalfedge` - * \sa `ArrangementDcelFace` - * \sa `ArrangementDcelOuterCcb` - * \sa `ArrangementDcelInnerCcb` - * \sa `ArrangementDcelIsolatedVertex` - */ - -class ArrangementDcel { -public: - -/// \name Types -/// @{ - -/*! the vertex type. */ -typedef unspecified_type Vertex; - -/*! the halfedge type. */ -typedef unspecified_type Halfedge; - -/*! the face type. */ -typedef unspecified_type Face; - -/*! the Outer CCB type. */ -typedef unspecified_type Outer_ccb; - -/*! the Inner CCB type. */ -typedef unspecified_type Inner_ccb; - -/*! the hole (i.e., Inner_ccb) type. */ -typedef unspecified_type Hole; - -/*! the isolated vertex type. */ -typedef unspecified_type Isolated_vertex; - -/*! used to represent size values (e.g., `size_t`). */ -typedef unspecified_type Size; - -/*! a bidirectional iterator over the vertices. Its value-type is `Vertex`. */ -typedef unspecified_type Vertex_iterator; - -/*! a bidirectional iterator over the vertices. Its value-type is `Vertex`. */ -typedef unspecified_type Vertex_const_iterator; - -/*! a bidirectional iterator over the halfedges. Its value-type is `Halfedge`. */ -typedef unspecified_type Halfedge_iterator; - -/*! a bidirectional iterator over the halfedges. Its value-type is `Halfedge`. */ -typedef unspecified_type Halfedge_const_iterator; - -/*! a bidirectional iterator over the faces. Its value-type is `Face`. */ -typedef unspecified_type Face_iterator; - -/*! a bidirectional iterator over the faces. Its value-type is `Face`. */ -typedef unspecified_type Face_const_iterator; - -/// @} - -/// \name Creation -/// @{ - -/*! constructs an empty \dcel with one unbounded face. - */ -Arr_dcel(); - -/*! assigns the contents of the `other` \dcel whose unbounded face is given by - * `uf`, to `dcel`. The function returns a pointer to the unbounded face of - * `dcel` after the assignment. - */ -Face* assign(const Self& other, const Face *uf); - -/// @} - -/// \name Access Functions -/// @{ - -/*! obtains the number of vertices. */ -Size size_of_vertices() const; - -/*! obtains the number of halfedges (always even). */ -Size size_of_halfedges() const; - -/*! obtains the number of faces. */ -Size size_of_faces() const; - -/*! obtains the number of outer CCBs. */ -Size size_of_outer_ccbs() const; - -/*! obtains the number of inner CCBs. */ -Size size_of_inner_ccbs() const; - -/*! obtains the number of holes (i.e., inner CCBs). */ -Size size_of_holes() const; - -/*! obtains the number of isolated vertices. */ -Size size_of_isolated_vertices() const; - -/*! obtains a begin-iterator of the vertices in `dcel`. */ -Vertex_iterator vertices_begin(); - -/*! obtains a past-the-end iterator of the vertices in `dcel`. */ -Vertex_iterator vertices_end(); - -/*! obtains a range over handles of the vertices in `dcel`. */ -unspecified_type vertex_handles(); - -/*! obtains a begin-iterator of the vertices in `dcel`. */ -Vertex_const_iterator vertices_begin() const; - -/*! obtains a past-the-end iterator of the vertices in `dcel`. */ -Vertex_const_iterator vertices_end() const; - -/*! obtains a const range (model of `ConstRange`) over handles of the vertices - * in `dcel`. - */ -unspecified_type vertex_handles() const; - -/*! obtains a begin-iterator of the halfedges in `dcel`. */ -Halfedge_iterator halfedges_begin(); - -/*! obtains a past-the-end iterator of the halfedges in `dcel`. */ -Halfedge_iterator halfedges_end(); - -/*! obtains a range over handles of the halfedges in `dcel`. */ -unspecified_type halfedge_handles(); - -/*! obtains a begin-iterator of the halfedges in `dcel`. */ -Halfedge_const_iterator halfedges_begin() const; - -/*! obtains a past-the-end iterator of the halfedges in `dcel`. */ -Halfedge_const_iterator halfedges_end() const; - -/*! obtains a const range (model of `ConstRange`) over handles of the halfedges - * in `dcel`. - */ -unspecified_type halfedge_handles() const; - -/*! obtains a begin-iterator of the faces in `dcel`. */ -Face_iterator faces_begin(); - -/*! obtains a past-the-end iterator of the faces in `dcel`. */ -Face_iterator faces_end(); - -/*! obtains a range over handles of the faces in `dcel`. */ -unspecified_type face_handles(); - -/*! obtains a begin-iterator of the faces in `dcel`. */ -Face_const_iterator faces_begin() const; - -/*! obtains a past-the-end iterator of the faces in `dcel`. */ -Face_const_iterator faces_end() const; - -/*! obtains a const range (model of `ConstRange`) over handles of the faces in - * `dcel`. - */ -unspecified_type face_handles() const; - -/// @} - -/// \name Modifiers -/// The following operations allocate a new element of the respective -/// type. Halfedges are always allocated in pairs of opposite -/// halfedges. The halfedges and their opposite pointers are -/// automatically set. -/// @{ - -/*! creates a new vertex. */ -Vertex* new_vertex(); - -/*! creates a new pair of twin halfedges. */ -Halfedge* new_edge(); - -/*! creates a new face. */ -Face* new_face(); - -/*! creates a new outer CCB record. */ -Hole* new_outer_ccb(); - -/*! creates a new inner CCB record. */ -Hole* new_inner_ccb(); - -/*! creates a new hole (i.e., inner CCB) record. */ -Hole* new_hole(); - -/*! creates a new isolated vertex record. */ -Isolated_vertex* new_isolated_vertex(); - -/*! deletes a given vertex `v`. */ -void delete_vertex(Vertex* v); - -/*! deletes a given halfedge `e` as well as its twin. */ -void delete_edge(Halfedge* e); - -/*! deletes a given face `f`. */ -void delete_face(Face* f); - -/*! deletes a given outer CCB `oc`. */ -void delete_outer_ccb(Outer_ccb* oc); - -/*! deletes a given inner CCB `ic`. */ -void delete_inner_ccb(Inner_ccb* oc); - -/*! deletes a given hole (i.e., inner CCB) `ho`. */ -void delete_hole(Hole* ho); - -/*! deletes a given isolated vertex `iv`. */ -void delete_isolated_vertex(Isolated_vertex* iv); - -/// @} - -}; /* end ArrangementDcel */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h deleted file mode 100644 index dc3fa8f8674..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * \ingroup PkgArrangementOnSurface2ConceptsDCEL - * \cgalConcept - * - * A face record in a \dcel data structure. A face represents a region, which - * may have outer and inner boundaries. A boundary conists of a chain of - * incident halfedges, referred to as a Connected Component of the Boundary - * (CCB). A face may be unbounded. Otherwise, it has one or more outer CCBs. A - * face may also be bounded by inner CCBs, and it may contain isolated vertices - * in its interior. A planar face may have only one outer CCBs and its inner - * CCBs are referred to as holes. - * - * \sa `ArrangementDcel` - * \sa `ArrangementDcelVertex` - * \sa `ArrangementDcelHalfedge` - */ - -class ArrangementDcelFace { -public: - -/// \name Types -/// The non-mutable iterators `Outer_ccb_const_iterator`, -/// `Inner_ccb_const_iterator`, `Hole_const_iterator`, and -/// `Isolated_vertex_const_iterator` are also defined. -/// @{ - -/*! the corresponding \dcel vertex type. */ -typedef unspecified_type Vertex; - -/*! the corresponding \dcel halfedge type. */ -typedef unspecified_type Halfedge; - -/*! a bidirectional iterator over the outer CCBs of the face. Its value-type - * is `Halfedge*`. - */ -typedef unspecified_type Outer_ccb_iterator; - -/*! a bidirectional iterator over the inner CCBs of the face. Its value-type - * is `Halfedge*`. - */ -typedef unspecified_type Inner_ccb_iterator; - -/*! a bidirectional iterator over the holes (i.e., inner CCBs) of the face. Its - * value-type is `Halfedge*`. - */ -typedef unspecified_type Hole_iterator; - -/*! a bidirectional iterator over the isolated vertices in inside the face. - * Its value-type is `Vertex*`. - */ -typedef unspecified_type Isolated_vertex_iterator; - -/// @} - -/// \name Creation -/// @{ - -/*! default constructor. */ -Arr_dcel_face(); - -/*! assigns `f` with the contents of the `other` face. */ -void assign(const Self& other); - -/// @} - -/// \name Access Functions -/// All functions below also have `const` counterparts, returning -/// non-mutable pointers or iterators: -/// @{ - -/*! determines whether the face is unbounded. */ -bool is_unbounded() const; - -/*! obtains an incident halfedge along the outer boundaries of the face. If `f` - * has no outer boundary, the function returns `nullptr`. - */ -Halfedge* halfedge(); - -/*! obtains the number of outer CCBs of `f`. In case of planar arrangement - * this is either 0 or 1. - */ -size_t number_of_outer_ccbs() const; - -/*! obtains a begin iterator for the outer CCBs of `f`. */ -Outer_ccb_iterator outer_ccbs_begin(); - -/*! obtains a past-the-end iterator for the outer CCBs of `f`. */ -Outer_ccb_iterator outer_ccbs_end(); - -/*! obtains the number of inner CCBs of `f`. */ -size_t number_of_inner_ccbs() const; - -/*! obtains a begin iterator for the inner CCBs of `f`. */ -Inner_ccb_iterator inner_ccbs_begin(); - -/*! obtains a past-the-end iterator for the inner CCBs of `f`. */ -Inner_ccb_iterator inner_ccbs_end(); - -/*! obtains the number of holes (i.e., inner CCBs) inside `f`. */ -size_t number_of_holes() const; - -/*! obtains a begin-iterator for the holes (i.e., inner CCBs) of `f`. */ -Hole_iterator holes_begin(); - -/*! obtains a past-the-end iterator for the holes (i.e., inner CCBs) of `f`. */ -Hole_iterator holes_end(); - -/*! obtains the number of isolated vertices inside `f`. */ -size_t number_of_isolated_vertices() const; - -/*! obtains a begin-iterator for the isolated vertices inside `f`. */ -Isolated_vertex_iterator isolated_vertices_begin(); - -/*! obtains a past-the-end iterator for the isolated vertices inside `f`. */ -Isolated_vertex_iterator isolated_vertices_end(); - -/// @} - -/// \name Modifiers -/// @{ - -/*! sets the face as unbounded (if `flag` is `true`), or as a bounded face - * (if it is `false`). - */ -void set_unbounded(bool flag); - -/*! sets the incident halfedge. */ -void set_halfedge(Halfedge* e); - -/*! adds `e` as an outer CCB of `f`. */ -void add_outer_ccb(Halfedge* e); - -/*! removes the outer CCB that `it` points to from `f`. */ -void erase_outer_ccb(Outer_ccb_iterator it); - -/*! adds `e` as an inner CCB of `f`. */ -void add_inner_ccb(Halfedge* e); - -/*! removes the inner CCB that `it` points to from `f`. */ -void erase_inner_ccb(Inner_ccb_iterator it); - -/*! adds `e` as a hole (i.e., inner CCB) of `f`. */ -void add_hole(Halfedge* e); - -/*! removes the hole (i.e., inner CCB) that `it` points to from `f`. */ -void erase_hole(Hole_iterator it); - -/*! adds `v` as an isolated vertex inside `f`. */ -void add_isolated_vertex(Vertex* v); - -/*! removes the isolated vertex that `it` points to from inside `f`. */ -void erase_isolated_vertex(Isolated_vertex_iterator it); - -/// @} - -}; /* end ArrangementDcelFace */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h deleted file mode 100644 index 3444ed51779..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelHalfedge.h +++ /dev/null @@ -1,186 +0,0 @@ -/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL - * \cgalConcept - * - * A halfedge record in a \dcel data structure. Two halfedges with opposite - * directions always form an edge (a halfedge pair). The halfedges form together - * chains, defining the boundaries of connected components, such that all - * halfedges along a chain have the same incident face. Note that the chain the - * halfedge belongs to may form the outer boundary of a bounded face (an outer - * CCB) or the boundary of a hole inside a face (an inner CCB). - * - * An edge is always associated with a curve, but the halfedge records only - * store a pointer to the associated curve, and the actual curve objects are - * stored elsewhere. Two opposite halfedges are always associated with the same - * curve. - * - * \sa `ArrangementDcel` - * \sa `ArrangementDcelVertex` - * \sa `ArrangementDcelFace` - * \sa `ArrangementDcelOuterCcb` - * \sa `ArrangementDcelInnerCcb` - */ - -class ArrangementDcelHalfedge { -public: - -/// \name Types -/// @{ - -/*! -the corresponding \dcel vertex type. -*/ -typedef unspecified_type Vertex; - -/*! -the corresponding \dcel face type. -*/ -typedef unspecified_type Face; - -/*! -the corresponding \dcel hole type. -*/ -typedef unspecified_type Hole; - -/*! -the curve type associated with the edge. -*/ -typedef unspecified_type X_monotone_curve; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -Arr_dcel_halfedge(); - -/*! -assigns `e` with the contents of the `other` halfedge. -*/ -void assign (const Self& other); - -/// @} - -/// \name Access Functions -/// @{ - -/*! -returns `ARR_LEFT_TO_RIGHT` if `e`'s source vertex is -lexicographically smaller than it target, and -`ARR_RIGHT_TO_LEFT` if it is lexicographically larger than -the target. -*/ -Arr_halfedge_direction direction() const; - -/*! -determines whether the `e` lies on an outer CCB of a bounded face, -or on an inner CCB (a hole inside a face). The function returns `true` -if `e` lies on a hole. -*/ -bool is_on_hole() const; - -/// @} - -/// \name -/// All functions below also have `const` counterparts, returning non-mutable pointers or references: -/// @{ - -/*! -returns the twin halfedge. -*/ -Halfedge* opposite(); - -/*! -returns the previous halfedge along the chain. -*/ -Halfedge* prev(); - -/*! -returns the next halfedge along the chain. -*/ -Halfedge* next(); - -/*! -returns the target vertex. -*/ -Vertex* vertex(); - -/*! -returns the incident face. -\pre `e` lies on the outer boundary of this face. -*/ -Face* face(); - -/*! -returns the hole (inner CCB) `e` belongs to. -\pre `e` lies on a hole inside its incident face. -*/ -Hole* hole(); - -/*! -returns whether the vertex is not associated with a valid curve. -*/ -bool has_null_curve() const; - -/*! -returns the associated curve. -\pre `e` is associated with a valid curve. -*/ -X_monotone_curve& curve(); - -/// @} - -/// \name Modifiers -/// @{ - -/*! -sets the opposite halfedge. -*/ -void set_opposite (Halfedge* opp); - -/*! -sets the lexicographical order between `e`'s source and target -vertices to be `dir`. -The direction of the opposite halfedge is also set to the -opposite direction. -*/ -void set_direction (Arr_halfedge_direction dir); - -/*! -sets the previous halfedge of `e` along the chain, -and updates the cross-pointer `prev->next()`. -*/ -void set_prev (Halfedge* prev); - -/*! -sets the next halfedge of `e` along the chain, -and updates the cross-pointer `next->prev()`. -*/ -void set_next (Halfedge* next); - -/*! -sets the target vertex. -*/ -void set_vertex (Vertex* v); - -/*! -sets the incident face, marking that `e` lies on the outer CCB -of the face `f`. -*/ -void set_face (Face* f); - -/*! -sets the incident hole, marking that `e` lies on an inner CCB. -*/ -void set_hole (Hole* ho); - -/*! -sets the associated curve of `e` and its opposite halfedge. -*/ -void set_curve (X_monotone_curve* c); - -/// @} - -}; /* end ArrangementDcelHalfedge */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelInnerCcb.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelInnerCcb.h deleted file mode 100644 index ae984d9f836..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelInnerCcb.h +++ /dev/null @@ -1,60 +0,0 @@ -/*! \ingroup PkgArrangementOnSurface2ConceptsDCEL - * \cgalConcept - * - * A hole record in a Dcel data structure, which - * stores the face that contains the hole in its interior, along with an - * iterator for the hole in the holes' container of this face. - * - * \sa `ArrangementDcel` - * \sa `ArrangementDcelFace` - * - */ - -class ArrangementDcelInnerCcb { -public: - -/// \name Types -/// @{ - -/*! the corresponding Dcel face type. */ -typedef unspecified_type Face; - -/*! - -*/ -typedef Face::InnerCcb_iterator InnerCcb_iterator; - -/// @} - -/// \name Creation -/// @{ - -/*! default constructor. */ -Arr_dcel_hole(); - -/// @} - -/// \name Access Functions -/// All functions below also have `const` counterparts, returning non-mutable pointers or iterators: -/// @{ - -/*! returns the incident face, which contains `ho` in its interior. */ -Face* face(); - -/*! returns an iterator for the hole. */ -InnerCcb_iterator iterator(); - -/// @} - -/// \name Modifiers -/// @{ - -/*! sets the incident face. */ -void set_face(Face* f); - -/*! sets the hole iterator. */ -void set_iterator(InnerCcb_iterator it); - -/// @} - -}; /* end ArrangementDcelInnerCcb */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h deleted file mode 100644 index 633747e65fd..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelIsolatedVertex.h +++ /dev/null @@ -1,77 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsDCEL -\cgalConcept - -An isolated vertex-information record in a \dcel data structure, which stores -the face that contains the isolated vertex in its interior, along with an -iterator for the isolated vertex in the isolated vertices' container of this -face. - -\sa `ArrangementDcel` -\sa `ArrangementDcelFace` - -*/ - -class ArrangementDcelIsolatedVertex { -public: - -/// \name Types -/// @{ - -/*! -the corresponding \dcel face type. -*/ -typedef unspecified_type Face; - -/*! - -*/ -typedef Face::Isolated_vertex_iterator Isolated_vertex_iterator; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -Arr_dcel_isolated_vertex(); - -/// @} - -/// \name Access Functions -/// All functions below also have `const` counterparts, returning -/// non-mutable pointers or iterators: -/// @{ - -/*! -returns the incident face, which contains `iv` in its interior. -*/ -Face* face (); - -/*! -returns an iterator for the isolated vertex. -*/ -Isolated_vertex_iterator iterator(); - -/// @} - -/// \name Modifiers -/// @{ - -/*! -sets the incident face. -*/ -void set_face (Face* f); - -/*! -sets the isolated vertex iterator. -*/ -void set_iterator (Isolated_vertex_iterator it); - -/// @} - -}; /* end ArrangementDcelIsolatedVertex */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelOuterCcb.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelOuterCcb.h deleted file mode 100644 index 8ad9cfa530a..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelOuterCcb.h +++ /dev/null @@ -1,74 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsDCEL -\cgalConcept - -A hole record in a \dcel data structure, which stores the face that contains -the hole in its interior, along with an iterator for the hole in the holes' -container of this face. - -\sa `ArrangementDcel` -\sa `ArrangementDcelFace` - -*/ - -class ArrangementDcelOuterCcb { -public: - -/// \name Types -/// @{ - -/*! -the corresponding \dcel face type. -*/ -typedef unspecified_type Face; - -/*! - -*/ -typedef Face::OuterCcb_iterator OuterCcb_iterator; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -Arr_dcel_hole(); - -/// @} - -/// \name Access Functions -/// All functions below also have `const` counterparts, returning non-mutable pointers or iterators: -/// @{ - -/*! -returns the incident face, which contains `ho` in its interior. -*/ -Face* face (); - -/*! -returns an iterator for the hole. -*/ -OuterCcb_iterator iterator(); - -/// @} - -/// \name Modifiers -/// @{ - -/*! -sets the incident face. -*/ -void set_face (Face* f); - -/*! -sets the hole iterator. -*/ -void set_iterator (OuterCcb_iterator it); - -/// @} - -}; /* end ArrangementDcelOuterCcb */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h deleted file mode 100644 index d4eb01ee7c3..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelVertex.h +++ /dev/null @@ -1,140 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsDCEL -\cgalConcept - -A vertex record in a \dcel data structure. A vertex is always associated -with a point. However, the vertex record only stores a pointer to the -associated point, and the actual `Point` object is stored elsewhere. - -A vertex usually has several halfedges incident to it, such that it is -possible to access one of these halfedges directly and to traverse all -incident halfedges around the vertex. However, the \dcel may also contain -isolated vertices that have no incident halfedges. In this case, the vertex -stores an isolated vertex-information record, indicating the face that -contains this vertex in its interior. - -\sa `ArrangementDcel` -\sa `ArrangementDcelHalfedge` -\sa `ArrangementDcelIsolatedVertex` - -*/ - -class ArrangementDcelVertex { -public: - -/// \name Types -/// @{ - -/*! -the corresponding \dcel halfedge type. -*/ -typedef unspecified_type Halfedge; - -/*! -the corresponding \dcel isolated -vertex-information type. -*/ -typedef unspecified_type Isolated_vertex; - -/*! -the point type associated with the vertex. -*/ -typedef unspecified_type Point; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -Arr_dcel_vertex(); - -/*! -assigns `v` with the contents of the `other` vertex. -*/ -void assign (const Self& other); - -/// @} - -/// \name Access Functions -/// All functions below also have `const` counterparts, returning -/// non-mutable pointers or references: -/// @{ - -/*! -returns whether the vertex is isolated (has no incident halfedges). -*/ -bool is_isolated() const; - -/*! -returns an incident halfedge that has `v` as its target. -\pre `v` is not an isolated vertex. -*/ -Halfedge* halfedge(); - -/*! -returns the isolated vertex-information record. -\pre `v` is an isolated vertex. -*/ -Isolated_vertex* isolated_vertex(); - -/*! -returns whether the vertex is not associated with a valid point (i.e.\ it -lies at infinity). -*/ -bool has_null_point () const; - -/*! -returns the associated point. -\pre `v`() is associated with a valid point. -*/ -Point& point(); - -/*! -returns the placement of the \f$ x\f$-coordinate in the parameter space, -that is, either the left boundary-side, the interior, or the right -boundary-side. -*/ -Arr_parameter_space parameter_space_in_x () const; - -/*! -returns the placement of the \f$ y\f$-coordinate in the parameter space, -that is, either the bottom boundary-side, the interior, or the top -boundary-side. -*/ -Arr_parameter_space parameter_space_in_y () const; - -/// @} - -/// \name Modifiers -/// @{ - -/*! -sets the incident halfedge, marking `v` as a regular vertex. -*/ -void set_halfedge (Halfedge* e); - -/*! -sets the isolated vertex-information record, marking `v` -as an isolated vertex. -*/ -void set_isolated_vertex (Isolated_vertex* iv); - -/*! -sets the associated point. -*/ -void set_point (Point* p); - -/*! -sets `v` as a vertex on a boundary side. -\pre Either `inf_x` or `inf_y` is not `ARR_INTERIOR`. -*/ -void set_boundary (Arr_parameter_space inf_x, Arr_parameter_space inf_y); - -/// @} - -}; /* end ArrangementDcelVertex */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h deleted file mode 100644 index 5d1c38474a6..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelWithRebind.h +++ /dev/null @@ -1,51 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsDCEL -\cgalConcept - -The concept `ArrangementDcelWithRebind` refines the `ArrangementDcel` concept by adding -a policy clone idiom in form of a rebind struct-template. - -Instantiate a dcel class with many different possible types without ad-hoc limitations on type of the dcel classes. - -\cgalRefines{ArrangementDcel} - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_default_dcel} -\cgalHasModels{CGAL::Arr_dcel} -\cgalHasModels{CGAL::Arr_face_extended_dcel} -\cgalHasModels{CGAL::Arr_extended_dcel} -\cgalHasModelsEnd - -*/ - -class ArrangementDcelWithRebind { -public: - -/// \name Types -/// @{ - -/*! -allows the instantiation of a model of the base concept -`ArrangementDcel` with a different possible geometry-traits -class without ad-hoc limitations on it. - -Following the standard clone policy, the rebind struct-template must -have a nested type named `other` that defines the type of the -model replica. -*/ -typedef unspecified_type template rebind; - -/// @} - -/// \name Creation -/// @{ - -/*! -constructs an empty \dcel with one unbounded face. -*/ -Arr_dcel(); - -/// @} - -}; /* end ArrangementDcelWithRebind */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h deleted file mode 100644 index 286b02727ad..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h +++ /dev/null @@ -1,204 +0,0 @@ -/*! \ingroup PkgArrangementOnSurface2Concepts - * \cgalConcept - * - * A model for the `ArrangementInputFormatter` concept supports a set of - * functions that enable reading an arrangement from an input stream using a - * specific format. - * - * \cgalHasModelsBegin - * \cgalHasModels{CGAL::Arr_text_formatter} - * \cgalHasModels{CGAL::Arr_face_extended_text_formatter} - * \cgalHasModels{CGAL::Arr_extended_dcel_text_formatter} - * \cgalHasModelsEnd - * - */ - -class ArrangementInputFormatter { -public: - -/// \name Types -/// @{ - -/*! the type of arrangement to input. */ -typedef unspecified_type Arrangement_2; - -/*! the point type. */ -typedef typename Arrangement_2::Point_2 Point_2; - -/*! the \f$ x\f$-monotone curve type. */ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - -/*! */ -typedef typename Arrangement_2::Size Size; - -/*! */ -typedef typename Arrangement_2::Vertex_handle Vertex_handle; - -/*! */ -typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; - -/*! */ -typedef typename Arrangement_2::Face_handle Face_handle; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -Arr_in_formatter(); - -/*! -constructs a formatter that reads from `is`. -*/ -Arr_in_formatter(std::istream& is); - -/*! -directs `inf` to read from `is`. -*/ -void set_in(std::istream& is); - -/// @} - -/// \name Access Functions -/// @{ - -/*! returns the stream that `inf` reads from. - * \pre `inf` is directed to a valid output stream. - */ -std::istream& in(); - -/// @} - -/// \name Formatted Input Functions -/// @{ - -/*! reads a message indicating the beginning of the arrangement. */ -void read_arrangement_begin(); - -/*! reads a message indicating the end of the arrangement. */ -void read_arrangement_end(); - -/*! reads a size value, which is supposed to be preceded by the given label. */ -Size read_size(const char *label = nullptr); - -/*! reads a message indicating the beginning of the vertex records. */ -void read_vertices_begin(); - -/*! reads a message indicating the end of the vertex records. */ -void read_vertices_end(); - -/*! reads a message indicating the beginning of the edge records. */ -void read_edges_begin(); - -/*! reads a message indicating the end of the edge records. */ -void read_edges_end(); - -/*! reads a message indicating the beginning of the face records. */ -void read_faces_begin(); - -/*! reads a message indicating the end of the face records. */ -void read_faces_end(); - -/*! reads a message indicating the beginning of a single vertex record. */ -void read_vertex_begin(); - -/*! reads a message indicating the end of a single vertex record. */ -void read_vertex_end(); - -/*! reads and returns a vertex index. */ -std::size_t read_vertex_index(); - -/*! reads a point. */ -void read_point(Point_2& p); - -/*! reads an auxiliary vertex-data object and associates it with the vertex `v`. - */ -void read_vertex_data(Vertex_handle v); - -/*! reads a message indicating the beginning of a single edge record. */ -void read_edge_begin(); - -/*! reads a message indicating the end of a single edge record. */ -void read_edge_end(); - -/*! reads and returns halfedge index. */ -std::size_t read_halfedge_index(); - -/*! reads an \f$ x\f$-monotone curve. */ -void read_x_monotone_curve(X_monotone_curve_2& c); - -/*! reads an auxiliary halfedge-data object and associates it with the halfedge - * `he`. - */ -void read_halfedge_data(Halfedge_handle he); - -/*! reads a message indicating the beginning of a single face record. */ -void read_face_begin(); - -/*! reads a message indicating the end of a single face record. */ -void read_face_end(); - -/*! reads a message indicating the beginning of the container of outer CCBs of - * the current face. - */ -void read_outer_ccbs_begin(); - -/*! reads a message indicating the end of of the container of outer CCBs of the - * current face. - */ -void read_outer_ccbs_end(); - -/*! reads a message indicating the beginning of the container of inner CCBs of - * the current face. - */ -void read_inner_ccbs_begin(); - -/*! reads a message indicating the end of of the container of inner CCBs of the - * current face. - */ -void read_inner_ccbs_end(); - -/*! reads a message indicating the beginning of the container of outer CCBs of - * the current face. - */ -void read_outer_ccb_begin(); - -/*! reads a message indicating the end of the outer CCB of the current face. */ -void read_outer_ccb_end(); - -/*! reads a message indicating the beginning of the container of holes inside - * the current face. - */ -void read_holes_begin(); - -/*! reads a message indicating the end of the container of holes inside the - * current face. - */ -void read_holes_end(); - -/*! reads a message indicating the beginning a connected component boundary. */ -void read_ccb_halfedges_begin(); - -/*! reads a message indicating the end of a connected component boundary. - */ -void read_ccb_halfedges_end(); - -/*! reads a message indicating the beginning of the container of isolated - * vertices inside the current face. - */ -void read_isolated_vertices_begin(); - -/*! reads a message indicating the end of the container of isolated vertices - * inside the current face. - */ -void read_isolated_vertices_end(); - -/*! reads an auxiliary face-data object and associates it with the face `f`. */ -void read_face_data(Face_handle f); - -/// @} - -}; /* end ArrangementInputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h deleted file mode 100644 index bb1846ad8f5..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementOutputFormatter.h +++ /dev/null @@ -1,197 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2Concepts -\cgalConcept - -A model for the `ArrangementOutputFormatter` concept supports a set of functions that enable -writing an arrangement to an output stream using a specific format. - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_text_formatter} -\cgalHasModels{CGAL::Arr_face_extended_text_formatter} -\cgalHasModels{CGAL::Arr_extended_dcel_text_formatter} -\cgalHasModelsEnd - -*/ - -class ArrangementOutputFormatter { -public: - -/// \name Types -/// @{ - -/*! the type of arrangement to output. */ -typedef unspecified_type Arrangement_2; - -/*! the point type. */ -typedef typename Arrangement_2::Point_2 Point_2; - -/*! the \f$ x\f$-monotone curve type. */ -typedef typename Arrangement_2::X_monotone_curve_2 X_monotone_curve_2; - -/*! */ -typedef typename Arrangement_2::Size Size; - -/*! */ -typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - -/*! */ -typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - -/*! */ -typedef typename Arrangement_2::Face_const_handle Face_const_handle; - -/// @} - -/// \name Creation -/// @{ - -/*! default constructor. */ -Arr_out_formatter(); - -/*! constructs a formatter that writes to `os`. */ -Arr_out_formatter (std::ostream& os); - -/*! directs `outf` to write to `os`. */ -void set_out (std::ostream& os); - -/// @} - -/// \name Access Functions -/// @{ - -/*! -returns the stream that `outf` writes to. -\pre `outf` is directed to a valid output stream. -*/ -std::ostream& out (); - -/// @} - -/// \name Formatted Output Functions -/// @{ - -/*! writes a message indicating the beginning of the arrangement. */ -void write_arrangement_begin (); - -/*! writes a message indicating the end of the arrangement. */ -void write_arrangement_end (); - -/*! writes a size value, preceded by a given label. */ -void write_size (const char *label, Size size); - -/*! writes a message indicating the beginning of the vertex records. */ -void write_vertices_begin(); - -/*! writes a message indicating the end of the vertex records. */ -void write_vertices_end(); - -/*! writes a message indicating the beginning of the edge records. */ -void write_edges_begin(); - -/*! writes a message indicating the end of the edge records. */ -void write_edges_end(); - -/*! writes a message indicating the beginning of the face records. */ -void write_faces_begin(); - -/*! writes a message indicating the end of the face records. */ -void write_faces_end(); - -/*! writes a message indicating the beginning of a single vertex record. */ -void write_vertex_begin(); - -/*! writes a message indicating the end of a single vertex record. */ -void write_vertex_end(); - -/*! writes a vertex index. */ -void write_vertex_index (std::size_t idx); - -/*! writes a point. */ -void write_point (const Point_2& p); - -/*! writes the auxiliary data associated with the vertex. */ -void write_vertex_data (Vertex_const_handle v); - -/*! writes a message indicating the beginning of a single edge record. */ -void write_edge_begin(); - -/*! writes a message indicating the end of a single edge record. */ -void write_edge_end(); - -/*! writes a halfedge index. */ -void write_halfedge_index (std::size_t idx); - -/*! writes an \f$ x\f$-monotone curve. */ -void write_x_monotone_curve (const X_monotone_curve_2& c); - -/*! writes the auxiliary data associated with the halfedge. */ -void write_halfedge_data (Halfedge_const_handle he); - -/*! writes a message indicating the beginning of a single face record. */ -void write_face_begin(); - -/*! writes a message indicating the end of a single face record. */ -void write_face_end(); - -/*! writes a message indicating the beginning of the container of outer CCBs of - * the current face. - */ -void write_outer_ccbs_begin(); - -/*! writes a message indicating the end of the container of outer ccbs of the - * current face. - */ -void write_outer_ccbs_end(); - -/*! writes a message indicating the beginning of the container of inner CCBs of - * the current face. - */ -void write_inner_ccbs_begin(); - -/*! writes a message indicating the end of the container of inner ccbs of the - * current face. - */ -void write_inner_ccbs_end(); - -/*! writes a message indicating the beginning of the outer CCB of the current - * face. - */ -void write_outer_ccb_begin(); - -/*! writes a message indicating the end of the outer CCB of the current face. */ -void write_outer_ccb_end(); - -/*! writes a message indicating the beginning of the container of holes inside - * the current face. - */ -void write_holes_begin(); - -/*! writes a message indicating the end of the container of holes inside the - * current face. - */ -void write_holes_end(); - -/*! writes a message indicating the beginning a connected component's boundary. - */ -void write_ccb_halfedges_begin(); - -/*! writes a message indicating the end of a connected component's boundary. */ -void write_ccb_halfedges_end(); - -/*! writes a message indicating the beginning of the container of isolated - * vertices inside the current face. - */ -void write_isolated_vertices_begin(); - -/*! writes a message indicating the end of the container of isolated vertices - * inside the current face. - */ -void write_isolated_vertices_end(); - -/*! writes the auxiliary data associated with the face. */ -void write_face_data (Face_const_handle f); - -/// @} - -}; /* end ArrangementOutputFormatter */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h deleted file mode 100644 index 5840d853bfe..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementPointLocation_2.h +++ /dev/null @@ -1,100 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2Concepts -\cgalConcept - -A model of the `ArrangementPointLocation_2` concept can answer point-location queries on -an arrangement attached to it. Namely, given a `Arrangement_2::Point_2` -object, representing a point in the plane, it returns the arrangement cell -containing it. In the general case, the query point is contained inside an -arrangement face, but in degenerate situations it may lie on an edge or -coincide with an arrangement vertex. - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_naive_point_location} -\cgalHasModels{CGAL::Arr_walk_along_line_point_location} -\cgalHasModels{CGAL::Arr_trapezoid_ric_point_location} -\cgalHasModels{CGAL::Arr_landmarks_point_location} -\cgalHasModelsEnd - -\sa `CGAL::Arr_naive_point_location` -\sa `CGAL::Arr_walk_along_line_point_location` -\sa `CGAL::Arr_trapezoid_ric_point_location` -\sa `CGAL::Arr_landmarks_point_location` -\sa `CGAL::Arr_point_location_result` - -*/ - -class ArrangementPointLocation_2 { -public: - -/// \name Types -/// @{ - -/*! -the associated arrangement type. -*/ -typedef unspecified_type Arrangement_2; - -/*! -equivalent to `Arrangement_2::Point_2`. -*/ -typedef unspecified_type Point_2; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -ArrangementPointLocation_2(); - -/*! -constructs a point-location object `pl` attached to the given -arrangement `arr`. -*/ -ArrangementPointLocation_2 (const Arrangement_2& arr); - -/// @} - -/// \name Query Functions -/// @{ - -/*! -locates the arrangement cell that contains the query point `q` -and returns a discriminated union container of the following bounded -types: - -
    -
  • `Arrangement_2::Face_const_handle`, in case `q` is -contained inside an arrangement face; -
  • `Arrangement_2::Halfedge_const_handle`, in case `q` lies -on an arrangement edge; -
  • `Arrangement_2::Vertex_const_handle`, in case `q` coincides -with an arrangement vertex. -
-\pre `pl` is attached to a valid arrangement object. -*/ -Arr_point_location_result::Type locate(const Point_2& q) const; - -/// @} - -/// \name Operations -/// @{ - -/*! -attaches `pl` to the given arrangement `arr`. -*/ -void attach (const Arrangement_2& arr); - -/*! -detaches `pl` from the arrangement it is currently attached to. -*/ -void detach (); - -/// @} - -}; /* end ArrangementPointLocation_2 */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h deleted file mode 100644 index e7f2288b560..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementTraits_2.h +++ /dev/null @@ -1,90 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsTraits -\cgalConcept - -The concept `ArrangementTraits_2` allows the construction of arrangement -of general planar curves. Models of this concept are used -by the free \link PkgArrangementOnSurface2Insert `CGAL::insert()` \endlink functions of the arrangement package and -by the `CGAL::Arrangement_with_history_2` class. - -A model of this concept must define the nested `Curve_2` type, which -represents a general planar curve that is not necessarily \f$ x\f$-monotone -and is not necessarily connected. Such curves are eventually subdivided into -\f$ x\f$-monotone subcurves and isolated points (represented by the `Point_2` -and `X_monotone_curve_2` types, defined in the basic traits concept). - -A model of the concept `ArrangementTraits_2` that handles arbitrary curves, -which are always \f$ x\f$-monotone, such as a traits class that handles -linear curves may define the nested types `Curve_2` and -`X_monotone_curve_2` to be of equivalent types. Moreover, defining -them as of equivalent types is advantageous, as it enables a generic -simple implementation of the nested Functor -`Make_x_monotone_2`. - -On the other hand, a model of the `ArrangementTraits_2` concept that handles -arbitrary curves, which may be not \f$ x\f$-monotone must define the -`Curve_2` and `X_monotone_curve_2` nested types to be of -different types to allow proper dispatching of the free functions -that accept such curves, such as `intsert()`. - -\cgalRefines{ArrangementXMonotoneTraits_2} - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_segment_traits_2} -\cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} -\cgalHasModels{CGAL::Arr_linear_traits_2} -\cgalHasModels{CGAL::Arr_polyline_traits_2} -\cgalHasModels{CGAL::Arr_circle_segment_traits_2} -\cgalHasModels{CGAL::Arr_line_arc_traits_2} -\cgalHasModels{CGAL::Arr_circular_arc_traits_2} -\cgalHasModels{CGAL::Arr_circular_line_arc_traits_2} -\cgalHasModels{CGAL::Arr_conic_traits_2} -\cgalHasModels{CGAL::Arr_rational_function_traits_2} -\cgalHasModels{CGAL::Arr_Bezier_curve_traits_2} -\cgalHasModels{CGAL::Arr_algebraic_segment_traits_2} -\cgalHasModels{CGAL::Arr_curve_data_traits_2} -\cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} -\cgalHasModelsEnd - -\sa `ArrangementBasicTraits_2` -\sa `ArrangementXMonotoneTraits_2` -\sa `ArrangementLandmarkTraits_2` - -*/ - -class ArrangementTraits_2 { -public: - -/// \name Types -/// @{ - -/*! -models the concept `ArrTraits::Curve_2`. -*/ -typedef unspecified_type Curve_2; - -/// @} - -/// \name Functor Types -/// @{ - -/*! -models the concept `ArrTraits::MakeXMonotone_2`. -*/ -typedef unspecified_type Make_x_monotone_2; - -/// @} - -/// \name Accessing Functor Objects -/// @{ - -/*! - -*/ -Make_x_monotone_2 make_x_monotone_2_object() const; - -/// @} - -}; /* end ArrangementTraits_2 */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h deleted file mode 100644 index 8ee996a9b0a..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementVerticalRayShoot_2.h +++ /dev/null @@ -1,126 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2Concepts -\cgalConcept - -A model of the `ArrangementVerticalRayShoot_2` concept can answer vertical ray-shooting -queries on an arrangement attached to it. Namely, given a -`Arrangement_2::Point_2` object, representing a point in the plane, -it returns the arrangement feature (edge or vertex) that lies -strictly above it (or below it). By "strictly" we mean that if the -query point lies on an arrangement edge (or on an arrangement vertex) -this edge will not be the query result, but the feature lying -above or below it. (An exception to this rule is the degenerate case -where the query point lies in the interior of a vertical edge.) Note -that it may happen that the query point lies above the upper envelope -(or below the lower envelope) of the arrangement, and the vertical ray -emanating from the query point goes to infinity without hitting any -arrangement feature on its way. In this case the unbounded face is -returned. - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_naive_point_location} -\cgalHasModels{CGAL::Arr_walk_along_line_point_location} -\cgalHasModels{CGAL::Arr_trapezoid_ric_point_location} -\cgalHasModels{CGAL::Arr_landmarks_point_location} -\cgalHasModelsEnd - -\sa `CGAL::Arr_naive_point_location` -\sa `CGAL::Arr_walk_along_line_point_location` -\sa `CGAL::Arr_trapezoid_ric_point_location` -\sa `CGAL::Arr_landmarks_point_location` -\sa `CGAL::Arr_point_location_result` -*/ - -class ArrangementVerticalRayShoot_2 { -public: - -/// \name Types -/// @{ - -/*! -the associated arrangement type. -*/ -typedef unspecified_type Arrangement_2; - -/*! -equivalent to `Arrangement_2::Point_2`. -*/ -typedef unspecified_type Point_2; - -/// @} - -/// \name Creation -/// @{ - -/*! -default constructor. -*/ -ArrangementVerticalRayShoot_2(); - -/*! -constructs a ray-shooting object `rs` attached to the given -arrangement `arr`. -*/ -ArrangementVerticalRayShoot_2 (const Arrangement_2& arr); - -/// @} - -/// \name Query Functions -/// @{ - -/*! -locates the arrangement feature that is first hit by an upward-directed -vertical ray emanating from the query point `q`, -and returns a handle for this feature. The function returns a -discriminated union container of the following bounded types: -
    -
  • `Arrangement_2::Halfedge_const_handle`, in case the vertical -ray hits an arrangement edge; -
  • `Arrangement_2::Vertex_const_handle`, in case the vertical -ray hits an arrangement vertex. -
  • `Arrangement_2::Face_const_handle` for the unbounded arrangement -face, in case `q` lies above the upper envelope of the -arrangement. -
-\pre `rs` is attached to a valid arrangement instance. -*/ -Arr_point_location_result::Type ray_shoot_up(const Point_2& q) const; - -/*! -locates the arrangement feature that is first hit by a downward-directed -vertical ray emanating from the query point `q`, -and returns a handle for this feature. The function returns a -discriminated union container of the following bounded types: -
    -
  • `Arrangement_2::Halfedge_const_handle`, in case the vertical -ray hits an arrangement edge; -
  • `Arrangement_2::Vertex_const_handle`, in case the vertical -ray hits an arrangement vertex. -
  • `Arrangement_2::Face_const_handle` for the unbounded arrangement -face, in case `q` lies below the lower envelope of the -arrangement. -
-\pre `rs` is attached to a valid arrangement instance. -*/ -Arr_point_location_result::Type ray_shoot_down (const Point_2& q) const; - -/// @} - -/// \name Operations -/// @{ - -/*! -attaches `rs` to the given arrangement `arr`. -*/ -void attach (const Arrangement_2& arr); - -/*! -detaches `rs` from the arrangement it is currently attached to. -*/ -void detach (); - -/// @} - -}; /* end ArrangementVerticalRayShoot_2 */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h deleted file mode 100644 index 0e6ec4d3af8..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementWithHistoryInputFormatter.h +++ /dev/null @@ -1,78 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2Concepts -\cgalConcept - -A model for the `ArrangementWithHistoryInputFormatter` concept supports a set of functions that enable -reading an arrangement-with-history instance from an input stream using a -specific format. - -\cgalRefines{ArrangementInputFormatter} - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_with_history_text_formatter} -\cgalHasModelsEnd - -*/ - -class ArrangementWithHistoryInputFormatter { -public: - -/// \name Types -/// @{ - -/*! -the type of arrangement to input. -*/ -typedef unspecified_type Arr_with_history_2; - -/*! -the inducing curve type. -*/ -typedef typename Arrangement_2::Curve_2 Curve_2; - -/// @} - -/// \name Formatted Input Functions -/// @{ - -/*! -reads a message indicating the beginning of the inducing curves. -*/ -void read_curves_begin(); - -/*! -reads a message indicating the end of the inducing curves. -*/ -void read_curves_end(); - -/*! -reads a message indicating the beginning of a single curve record. -*/ -void read_curve_begin(); - -/*! -reads a message indicating the end of a single curve record. -*/ -void read_curve_end(); - -/*! -reads a curve. -*/ -void read_curve (Curve_2& c); - -/*! -reads a message indicating the beginning of the set of edges -induced by the current curve. -*/ -void read_induced_edges_begin(); - -/*! -reads a message indicating the end of the induced edges set. -*/ -void read_induced_edges_end(); - -/// @} - -}; /* end ArrangementWithHistoryInputFormatter */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h deleted file mode 100644 index 88cc075b5b1..00000000000 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementXMonotoneTraits_2.h +++ /dev/null @@ -1,136 +0,0 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsTraits -\cgalConcept - -The concept `ArrangementXMonotoneTraits_2` refines the basic arrangement-traits concept. -A model of this concept is able to handle \f$ x\f$-monotone curves that -intersect in their interior (and points that coincide with curve -interiors). This is necessary for constructing arrangements of sets of -intersecting \f$ x\f$-monotone curves. - -As the resulting structure, represented by the `Arrangement_2` class, -stores pairwise interior-disjoint curves, the input curves are split at -the intersection points before being inserted into the arrangement. -A model of this refined concept therefore needs to compute the intersections -(and possibly overlaps) between two \f$ x\f$-monotone curves and to support -curve splitting. - -\cgalRefines{ArrangementBasicTraits_2} - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_segment_traits_2} -\cgalHasModels{CGAL::Arr_non_caching_segment_traits_2} -\cgalHasModels{CGAL::Arr_linear_traits_2} -\cgalHasModels{CGAL::Arr_polyline_traits_2} -\cgalHasModels{CGAL::Arr_circle_segment_traits_2} -\cgalHasModels{CGAL::Arr_line_arc_traits_2} -\cgalHasModels{CGAL::Arr_circular_arc_traits_2} -\cgalHasModels{CGAL::Arr_circular_line_arc_traits_2} -\cgalHasModels{CGAL::Arr_conic_traits_2} -\cgalHasModels{CGAL::Arr_rational_function_traits_2} -\cgalHasModels{CGAL::Arr_Bezier_curve_traits_2} -\cgalHasModels{CGAL::Arr_algebraic_segment_traits_2} -\cgalHasModels{CGAL::Arr_curve_data_traits_2} -\cgalHasModels{CGAL::Arr_consolidated_curve_data_traits_2} -\cgalHasModelsEnd - -\sa `ArrangementBasicTraits_2` - -*/ - -class ArrangementXMonotoneTraits_2 { -public: - -/// \name Types -/// @{ - -/*! -the multiplicity type. -*/ -typedef unspecified_type Multiplicity; - -/// @} - -/// \name Tags -/// @{ - -/*! -indicates whether the nested functors `Are_mergeable_2` and -`Merge_2` are provided. -*/ -typedef unspecified_type Has_merge_category; - -/// @} - -/// \name Functor Types -/// @{ - -/*! -models the concept `ArrTraits::Intersect_2`. -*/ -typedef unspecified_type Intersect_2; - -/*! -models the concept `ArrTraits::Split_2`. -*/ -typedef unspecified_type Split_2; - -/// @} - -/// \name -/// \attention The two following function-object types are -/// optional. If they are supported, the `Has_merge_category` tag -/// should be defined as `Tag_true` and otherwise as `Tag_false`. -/// @{ - -/*! -models the concept `ArrTraits::AreMergeable_2`. - - - -*/ -typedef unspecified_type Are_mergeable_2; - -/*! -models the concept `ArrTraits::Merge_2`. -*/ -typedef unspecified_type Merge_2; - -/// @} - -/// \name Accessing Functor Objects -/// @{ - -/*! - -*/ -Intersect_2 intersect_2_object() const; - -/*! - -*/ -Split_2 split_2_object() const; - -/// @} - -/// \name -/// The two following methods are optional. If they are supported, the -/// `Has_merge_category` tag should be defined as `Tag_true` and otherwise -/// as `Tag_false`. -/// @{ - -/*! - -*/ -Are_mergeable_2 are_mergeable_2_object() const; - -/*! - -*/ -Merge_2 merge_2_object() const; - -/// @} - -}; /* end ArrangementXMonotoneTraits_2 */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h index 137ccd40de4..ec00686e66b 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/OverlayTraits.h @@ -1,185 +1,151 @@ - -/*! -\ingroup PkgArrangementOnSurface2ConceptsTraits -\cgalConcept - -A model for the `OverlayTraits` should be able to operate on records (namely, -vertices, halfedges and faces) of two input \dcel classes, named -`Dcel_A` and `Dcel_B`, and construct the records of an output \dcel class, referred to as `Dcel_R`. - -Models for the concept are used by the global `overlay()` function to -maintain the auxiliary data stored with the \dcel records of the resulting -overlaid arrangement, based on the contents of the input records. - -\cgalHasModelsBegin -\cgalHasModels{CGAL::Arr_default_overlay_traits} -\cgalHasModels{CGAL::Arr_face_overlay_traits} -\cgalHasModelsEnd - -\sa `overlay` - -*/ - +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * A model for the `OverlayTraits` should be able to operate on records (namely, + * vertices, halfedges and faces) of two input \dcel classes, named `Dcel_A` and + * `Dcel_B`, and construct the records of an output \dcel class, referred to as + * `Dcel_R`. + * + * Models for the concept are used by the global `overlay()` function to + * maintain the auxiliary data stored with the \dcel records of the resulting + * overlaid arrangement, based on the contents of the input records. + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_default_overlay_traits} + * \cgalHasModels{CGAL::Arr_face_overlay_traits} + * \cgalHasModelsEnd + * + * \sa `overlay` + */ class OverlayTraits { public: + /// \name Types + /// @{ -/// \name Types -/// @{ + //! a constant handle a vertex in `Dcel_A`. + typedef unspecified_type Vertex_handle_A; -/*! -a constant handle a vertex in `Dcel_A`. -*/ -typedef unspecified_type Vertex_handle_A; + //! a constant handle to a halfedge in `Dcel_A`. + typedef unspecified_type Halfedge_handle_A; -/*! -a constant handle to a halfedge in `Dcel_A`. -*/ -typedef unspecified_type Halfedge_handle_A; + //! a constant handle to a face `Dcel_A`. + typedef unspecified_type Face_handle_A; -/*! -a constant handle to a face `Dcel_A`. -*/ -typedef unspecified_type Face_handle_A; + //! a constant handle to a vertex in `Dcel_B`. + typedef unspecified_type Vertex_handle_B; -/*! -a constant handle to a vertex in `Dcel_B`. -*/ -typedef unspecified_type Vertex_handle_B; + //! a constant handle to a halfedge in `Dcel_B`. + typedef unspecified_type Halfedge_handle_B; -/*! -a constant handle to a halfedge in `Dcel_B`. -*/ -typedef unspecified_type Halfedge_handle_B; + //! a constant handle to a face in `Dcel_B`. + typedef unspecified_type Face_handle_B; -/*! -a constant handle to a face in `Dcel_B`. -*/ -typedef unspecified_type Face_handle_B; + //! a handle to a vertex in `Dcel_R`. + typedef unspecified_type Vertex_handle_R; -/*! -a handle to a vertex in `Dcel_R`. -*/ -typedef unspecified_type Vertex_handle_R; + //! a handle to a halfedge in `Dcel_R`. + typedef unspecified_type Halfedge_handle_R; -/*! -a handle to a halfedge in `Dcel_R`. -*/ -typedef unspecified_type Halfedge_handle_R; + //! a handle to a faces in `Dcel_R`. + typedef unspecified_type Face_handle_R; -/*! -a handle to a faces in `Dcel_R`. -*/ -typedef unspecified_type Face_handle_R; + /// @} -/// @} + /// \name Vertex Creation + /// Whenever a vertex in the overlaid arrangement is created, one of + /// the following functions is called in order to attach the + /// appropriate auxiliary data to this vertex: + /// @{ -/// \name Vertex Creation -/// Whenever a vertex in the overlaid arrangement is created, one of -/// the following functions is called in order to attach the -/// appropriate auxiliary data to this vertex: -/// @{ + /*! constructs the vertex `v` induced by the coinciding vertices + * `v1` and `v2`. + */ + void create_vertex(Vertex_handle_A v1, + Vertex_handle_B v2, + Vertex_handle_R v) const; -/*! -constructs the vertex `v` induced by the coinciding vertices -`v1` and `v2`. -*/ -void create_vertex (Vertex_handle_A v1, -Vertex_handle_B v2, -Vertex_handle_R v) const; + /*! constructs the vertex `v` induced by the vertex `v1` that lies on + * the halfedge `e2`. + */ + void create_vertex(Vertex_handle_A v1, + Halfedge_handle_B e2, + Vertex_handle_R v) const; -/*! -constructs the vertex `v` induced by the vertex `v1` that lies on -the halfedge `e2`. -*/ -void create_vertex (Vertex_handle_A v1, -Halfedge_handle_B e2, -Vertex_handle_R v) const; + /*! constructs the vertex `v` induced by the vertex `v1` that lies + * inside the face `f2`. + */ + void create_vertex(Vertex_handle_A v1, + Face_handle_B f2, + Vertex_handle_R v) const; -/*! -constructs the vertex `v` induced by the vertex `v1` that lies -inside the face `f2`. -*/ -void create_vertex (Vertex_handle_A v1, -Face_handle_B f2, -Vertex_handle_R v) const; + /*! constructs the vertex `v` induced by the vertex `v2` that lies on + * the halfedge `e1`. + */ + void create_vertex(Halfedge_handle_A e1, + Vertex_handle_B v2, + Vertex_handle_R v) const; -/*! -constructs the vertex `v` induced by the vertex `v2` that lies on -the halfedge `e1`. -*/ -void create_vertex (Halfedge_handle_A e1, -Vertex_handle_B v2, -Vertex_handle_R v) const; + /*! constructs the vertex `v` induced by the vertex `v2` that lies + * inside the face `f1`. + */ + void create_vertex(Face_handle_A f1, + Vertex_handle_B v2, + Vertex_handle_R v) const; -/*! -constructs the vertex `v` induced by the vertex `v2` that lies -inside the face `f1`. -*/ -void create_vertex (Face_handle_A f1, -Vertex_handle_B v2, -Vertex_handle_R v) const; + /*! constructs the vertex `v` induced by the intersection of the + halfedges `e1` and `e2`. + */ + void create_vertex(Halfedge_handle_A e1, + Halfedge_handle_B e2, + Vertex_handle_R v) const; + /// @} -/*! -constructs the vertex `v` induced by the intersection of the -halfedges `e1` and `e2`. -*/ -void create_vertex (Halfedge_handle_A e1, -Halfedge_handle_B e2, -Vertex_handle_R v) const; -/// @} + /// \name Edge Creation + /// Whenever an edge in the overlaid arrangement is created, one of + /// the following functions is called in order to attach the + /// appropriate auxiliary data to this vertex. Note that an edge is + /// created after both its end-vertices are created, (and the + /// corresponding `create_vertex()` methods were invoked). In all + /// cases, the edge is represented by a halfedge `e` directed in + /// lexicographic decreasing order (from right to left). The + /// `create_edge()` method should attach auxiliary data to the twin + /// halfedge (namely to `e->twin()`) as well: + /// @{ -/// \name Edge Creation -/// Whenever an edge in the overlaid arrangement is created, one of -/// the following functions is called in order to attach the -/// appropriate auxiliary data to this vertex. Note that an edge is -/// created after both its end-vertices are created, (and the -/// corresponding `create_vertex()` methods were invoked). In all -/// cases, the edge is represented by a halfedge `e` directed in -/// lexicographic decreasing order (from right to left). The -/// `create_edge()` method should attach auxiliary data to the twin -/// halfedge (namely to `e->twin()`) as well: -/// @{ + /*! constructs the halfedge `e` induced by an overlap between the + * halfedges `e1` and `e2`. + */ + void create_edge(Halfedge_handle_A e1, + Halfedge_handle_B e2, + Halfedge_handle_R e) const; -/*! -constructs the halfedge `e` induced by an overlap between the -halfedges `e1` and `e2`. -*/ -void create_edge (Halfedge_handle_A e1, -Halfedge_handle_B e2, -Halfedge_handle_R e) const; + /*! constructs the halfedge `e` induced by the halfedge `e1` that lies + * inside the face `f2`. + */ + void create_edge(Halfedge_handle_A e1, + Face_handle_B f2, + Halfedge_handle_R e) const; -/*! -constructs the halfedge `e` induced by the halfedge `e1` that lies -inside the face `f2`. -*/ -void create_edge (Halfedge_handle_A e1, -Face_handle_B f2, -Halfedge_handle_R e) const; + /*! constructs the halfedge `e` induced by the halfedge `e2` that lies + * inside the face `f1`. + */ + void create_edge(Face_handle_A f1, + Halfedge_handle_B e2, + Halfedge_handle_R e) const; + /// @} + /// \name Face Creation + /// The following function is invoked whenever a new face is + /// created. It is guaranteed that all halfedges along the face + /// boundary have already been created an have their auxiliary data + /// fields attached to them: + /// @{ -/*! -constructs the halfedge `e` induced by the halfedge `e2` that lies -inside the face `f1`. -*/ -void create_edge (Face_handle_A f1, -Halfedge_handle_B e2, -Halfedge_handle_R e) const; -/// @} -/// \name Face Creation -/// The following function is invoked whenever a new face is -/// created. It is guaranteed that all halfedges along the face -/// boundary have already been created an have their auxiliary data -/// fields attached to them: -/// @{ - -/*! -constructs the face `f` induced by the an overlap between the -faces `f1` and `f2`. -*/ -void create_face (Face_handle_A f1, -Face_handle_B f2, -Face_handle_R f) const; - -/// @} + /*! constructs the face `f` induced by the an overlap between the + * faces `f1` and `f2`. + */ + void create_face(Face_handle_A f1, + Face_handle_B f2, + Face_handle_R f) const; + /// @} }; /* end OverlayTraits */ - diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 62d1384f312..bae19005dc3 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -5,7 +5,7 @@ /// \cgalConceptNamespace /// The namespace containing concepts specific to Arrangements. -namespace ArrTraits {} +namespace AosTraits {} /// \defgroup PkgArrangementOnSurface2ConceptsTopologyTraits Topology Traits Concepts /// \ingroup PkgArrangementOnSurface2Concepts @@ -81,11 +81,11 @@ namespace ArrTraits {} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -Given a set \f$ \mathcal{C}\f$ of planar curves, the arrangement +Given a set \f$\mathcal{C}\f$ of planar curves, the arrangement \f$ {\mathcal A}({\mathcal C})\f$ is the subdivision of the plane induced -by the curves in \f$ \mathcal{C}\f$ into maximally connected cells. The cells -can be \f$ 0\f$-dimensional (vertices), \f$ 1\f$-dimensional (edges) -or \f$ 2\f$-dimensional (faces). +by the curves in \f$\mathcal{C}\f$ into maximally connected cells. The cells +can be \f$0\f$-dimensional (vertices), \f$1\f$-dimensional (edges) +or \f$2\f$-dimensional (faces). The class `Arrangement_2` encapsulates a data structure that maintains arrangements of arbitrary bounded planar curves. It comes @@ -111,85 +111,87 @@ implemented as peripheral classes or as free (global) functions. \cgalCRPSection{Concepts} -- `ArrangementDcel` -- `ArrangementDcelWithRebind` -- `ArrangementDcelVertex` -- `ArrangementDcelHalfedge` -- `ArrangementDcelFace` -- `ArrangementDcelOuterCcb` -- `ArrangementDcelInnerCcb` -- `ArrangementDcelIsolatedVertex` -- `ArrangementBasicTopologyTraits` -- `ArrangementBasicTraits_2` -- `ArrangementConstructXMonotoneCurveTraits_2` -- `ArrangementConstructCurveTraits_2` -- `ArrangementLandmarkTraits_2` -- `ArrangementXMonotoneTraits_2` -- `ArrangementTraits_2` -- `ArrangementHorizontalSideTraits_2` -- `ArrangementVerticalSideTraits_2` -- `ArrangementIdentifiedVerticalTraits_2` -- `ArrangementIdentifiedHorizontalTraits_2` -- `ArrangementOpenBoundaryTraits_2` -- `ArrangementSphericalBoundaryTraits_2` -- `ArrangementInputFormatter` -- `ArrangementOutputFormatter` -- `ArrangementWithHistoryInputFormatter` -- `ArrangementWithHistoryOutputFormatter` -- `ArrangementPointLocation_2` -- `ArrangementVerticalRayShoot_2` -- `ArrangementOpenLeftTraits_2` -- `ArrangementOpenRightTraits_2` -- `ArrangementOpenBottomTraits_2` -- `ArrangementOpenTopTraits_2` -- `ArrangementClosedLeftTraits_2` -- `ArrangementClosedRightTraits_2` -- `ArrangementClosedBottomTraits_2` -- `ArrangementClosedTopTraits_2` -- `ArrangementContractedLeftTraits_2` -- `ArrangementContractedRightTraits_2` -- `ArrangementContractedBottomTraits_2` -- `ArrangementContractedTopTraits_2` -- `ArrangementLeftSideTraits_2` -- `ArrangementRightSideTraits_2` -- `ArrangementBottomSideTraits_2` -- `ArrangementTopSideTraits_2` -- `ArrangementTopologyTraits` +- `AosApproximateTraits_2` +- `AosApproximatePointTraits_2` +- `AosBasicTopologyTraits` +- `AosBasicTraits_2` +- `AosBottomSideTraits_2` +- `AosClosedBottomTraits_2` +- `AosClosedLeftTraits_2` +- `AosClosedRightTraits_2` +- `AosClosedTopTraits_2` +- `AosConstructCurveTraits_2` +- `AosConstructXMonotoneCurveTraits_2` +- `AosContractedBottomTraits_2` +- `AosContractedLeftTraits_2` +- `AosContractedRightTraits_2` +- `AosContractedTopTraits_2` +- `AosDcel` +- `AosDcelFace` +- `AosDcelHalfedge` +- `AosDcelInnerCcb` +- `AosDcelIsolatedVertex` +- `AosDcelOuterCcb` +- `AosDcelVertex` +- `AosDcelWithRebind` +- `AosHorizontalSideTraits_2` +- `AosIdentifiedHorizontalTraits_2` +- `AosIdentifiedVerticalTraits_2` +- `AosInputFormatter` +- `AosLandmarkTraits_2` +- `AosLeftSideTraits_2` +- `AosOpenBottomTraits_2` +- `AosOpenBoundaryTraits_2` +- `AosOpenLeftTraits_2` +- `AosOpenRightTraits_2` +- `AosOpenTopTraits_2` +- `AosOutputFormatter` +- `AosPointLocation_2` +- `AosRightSideTraits_2` +- `AosSphericalBoundaryTraits_2` +- `AosTopologyTraits` +- `AosTopSideTraits_2` +- `AosTraits_2` +- `AosVerticalRayShoot_2` +- `AosVerticalSideTraits_2` +- `AosWithHistoryInputFormatter` +- `AosWithHistoryOutputFormatter` +- `AosXMonotoneTraits_2` \cgalCRPSection{Geometric Object Concepts} -- `ArrTraits::Point_2` -- `ArrTraits::XMonotoneCurve_2` -- `ArrTraits::Curve_2` +- `AosTraits::Point_2` +- `AosTraits::XMonotoneCurve_2` +- `AosTraits::Curve_2` \cgalCRPSection{Function Object Concepts} -- `ArrTraits::CompareX_2` -- `ArrTraits::CompareXy_2` -- `ArrTraits::ConstructMinVertex_2` -- `ArrTraits::ConstructMaxVertex_2` -- `ArrTraits::IsVertical_2` -- `ArrTraits::IsOnXIdentification_2` -- `ArrTraits::IsOnYIdentification_2` -- `ArrTraits::CompareYAtX_2` -- `ArrTraits::CompareYAtXLeft_2` -- `ArrTraits::CompareYAtXRight_2` -- `ArrTraits::Equal_2` -- `ArrTraits::ParameterSpaceInX_2` -- `ArrTraits::ParameterSpaceInY_2` -- `ArrTraits::CompareXOnBoundary_2` -- `ArrTraits::CompareYOnBoundary_2` -- `ArrTraits::CompareXNearBoundary_2` -- `ArrTraits::CompareYNearBoundary_2` -- `ArrTraits::CompareXOnBoundaryOfCurveEnd_2` -- `ArrTraits::Intersect_2` -- `ArrTraits::Split_2` -- `ArrTraits::AreMergeable_2` -- `ArrTraits::Merge_2` -- `ArrTraits::MakeXMonotone_2` -- `ArrTraits::Approximate_2` -- `ArrTraits::ConstructXMonotoneCurve_2` -- `ArrTraits::ConstructCurve_2` +- `AosTraits::Approximate_2` +- `AosTraits::AreMergeable_2` +- `AosTraits::CompareX_2` +- `AosTraits::CompareXy_2` +- `AosTraits::CompareYAtX_2` +- `AosTraits::CompareYAtXLeft_2` +- `AosTraits::CompareYAtXRight_2` +- `AosTraits::ConstructMinVertex_2` +- `AosTraits::ConstructMaxVertex_2` +- `AosTraits::CompareXOnBoundary_2` +- `AosTraits::CompareYOnBoundary_2` +- `AosTraits::CompareXNearBoundary_2` +- `AosTraits::CompareYNearBoundary_2` +- `AosTraits::CompareXOnBoundaryOfCurveEnd_2` +- `AosTraits::ConstructCurve_2` +- `AosTraits::ConstructXMonotoneCurve_2` +- `AosTraits::Equal_2` +- `AosTraits::Intersect_2` +- `AosTraits::IsVertical_2` +- `AosTraits::IsOnXIdentification_2` +- `AosTraits::IsOnYIdentification_2` +- `AosTraits::MakeXMonotone_2` +- `AosTraits::Merge_2` +- `AosTraits::ParameterSpaceInX_2` +- `AosTraits::ParameterSpaceInY_2` +- `AosTraits::Split_2` \cgalCRPSection{Classes} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/central_concept_cluster.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/central_concept_cluster.png index 8f47fe2dde1..5cd2a04bdcf 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/central_concept_cluster.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/central_concept_cluster.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/identified_clusters.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/identified_clusters.png index da89fbebdd5..e109ecba1fb 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/identified_clusters.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/identified_clusters.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/landmark_concept_cluster.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/landmark_concept_cluster.png index 4230f21bd2f..83bfc35d997 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/landmark_concept_cluster.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/landmark_concept_cluster.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/left_side_cluster.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/left_side_cluster.png index aef6892be92..6b61310c825 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/left_side_cluster.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/left_side_cluster.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/open_concept_hierarchy.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/open_concept_hierarchy.png index a3e45b74265..d206fa8ee04 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/open_concept_hierarchy.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/open_concept_hierarchy.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/side_clusters.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/side_clusters.png index d82390981b5..84eeacc4b82 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/side_clusters.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/side_clusters.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/spherical_concept_hierarchy.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/spherical_concept_hierarchy.png index 2f2fa8cfe7a..0bd2d7d089d 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/spherical_concept_hierarchy.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig/spherical_concept_hierarchy.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/central_concept_cluster.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/central_concept_cluster.tex index 17589bef685..7c453859f46 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/central_concept_cluster.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/central_concept_cluster.tex @@ -8,11 +8,11 @@ fill=white,blur shadow,rounded corners,align=center}} \begin{document} \begin{forest} - [\name{ArrangementBasicTraits\_2}, + [\name{AosBasicTraits\_2}, forked edges, for tree={concept,edge={-latex}} - [\name{ArrangementXMonotoneTraits\_2} - [\name{ArrangementTraits\_2}] + [\name{AosXMonotoneTraits\_2} + [\name{AosTraits\_2}] ] ] \end{forest} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/identified_clusters.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/identified_clusters.tex index 8276d12593e..e3ae550fca0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/identified_clusters.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/identified_clusters.tex @@ -1,22 +1,30 @@ \documentclass[12pt]{standalone} \input{header} +\usepackage[edges]{forest} +\usetikzlibrary{shadows.blur,arrows.meta} \pagestyle{empty} +\def\name#1{\textsf{\it #1}} +\tikzset{concept/.style={rectangle split,rectangle split parts=1,draw, + fill=white,blur shadow,rounded corners,align=center}} \begin{document} - \psset{treevshift=0,unit=1em,xunit=2em,yunit=1em,everytree={},etcratio=.75,triratio=.5} - \jtree[everylabel=\sl,xunit=70pt,arrows=->] - \! = {} - <4wideleft>[scaleby=2.24 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementLeftSideTraits\_2}}}@lt !lt - ^[scaleby=1.15 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenRightSideTraits\_2}}}@rt !rt - ^[scaleby=1.15 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenBottomSideTraits\_2}}}@bt !bt - ^<4wideright>[scaleby=2.26 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenTopSideTraits\_2}}}@tt !tt - . - \!lt = [scaleby=1.08 1]{\psframebox{\concept{ArrangementIdentifiedVerticalTraits\_2}}}@ivt !ivt - . - \!bt = [scaleby=1.17 1]{\psframebox{\concept{ArrangementIdentifiedHorizontalTraits\_2}}}@iht !iht - . - \ncline{rt:b}{ivt:t} - \ncline{tt:b}{iht:t} - \endjtree - \psset{treevshift=0,unit=1cm,xunit=1cm,yunit=1cm,everytree={}, - etcratio=.75,triratio=.5} +\begin{forest} + [,phantom,for tree={concept,edge={-Stealth}} + [,phantom + [\name{AosLeftSideTraits\_2} + [,phantom] + [\name{AosIdentifiedVerticalTraits\_2},name=ivt] + ] + [\name{AosRightSideTraits\_2},name=rst] + ] + [,phantom + [\name{AosBottomSideTraits\_2} + [,phantom] + [\name{AosIdentifiedHorizontalTraits\_2},name=iht] + ] + [\name{AosTopSideTraits\_2},name=tst] + ] + ] + \draw[-Stealth] (rst) to (ivt); + \draw[-Stealth] (tst) to (iht); + \end{forest} \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/landmark_concept_cluster.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/landmark_concept_cluster.tex index 60a04859ea5..eeb9e0e589e 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/landmark_concept_cluster.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/landmark_concept_cluster.tex @@ -8,14 +8,14 @@ fill=white,blur shadow,rounded corners,align=center}} \begin{document} \begin{forest} - [\name{ArrangementBasicTraits\_2},name=abt, + [\name{AosBasicTraits\_2},name=abt, % forked edges, for tree={concept,edge={-latex}} - [\name{ArrangementApproximateTraits\_2} + [\name{AosApproximatePointTraits\_2} [,phantom] - [\name{ArrangementLandmarkTraits\_2},name=alt,before drawing tree={x=0}] + [\name{AosLandmarkTraits\_2},name=alt,before drawing tree={x=0}] ] - [\name{ArrangementConstructXMonotoneCurveTraits\_2},name=acxmt] + [\name{AosConstructXMonotoneCurveTraits\_2},name=acxmt] ] \draw[-latex] (acxmt) to (alt); \end{forest} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.png b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.png index 6908e84c4e9..6b61310c825 100644 Binary files a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.png and b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.png differ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.tex index 1cf36b78cec..82b6591f12f 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/left_side_cluster.tex @@ -1,16 +1,19 @@ \documentclass[12pt]{standalone} \input{header} +\usepackage[edges]{forest} +\usetikzlibrary{shadows.blur,arrows.meta} \pagestyle{empty} +\def\name#1{\textsf{\it #1}} +\tikzset{concept/.style={rectangle split,rectangle split parts=1,draw, + fill=white,blur shadow,rounded corners,align=center}} \begin{document} - \psset{treevshift=0,unit=1em,xunit=2em,yunit=1em,everytree={},etcratio=.75,triratio=.5} - \jtree[everylabel=\sl,xunit=70pt,arrows=->] - \! = {\psframebox{\concept{ArrangementLeftSideTraits\_2}}} - <4wideleft>[scaleby=2.44 1]{\psframebox{\concept{ArrangementOpenLeftTraits\_2}}}@ult !ult - ^[scaleby=1.37 1]{\psframebox{\concept{ArrangementClosedLeftTraits\_2}}}@urt !urt - ^[scaleby=1.12 1]{\psframebox{\concept{ArrangementContractedLeftTraits\_2}}}@ubt !ubt - ^<4wideright>[scaleby=2.56 1]{\psframebox{\concept{ArrangementIdentifiedVerticalTraits\_2}}}@utt !utt - . - \endjtree - \psset{treevshift=0,unit=1cm,xunit=1cm,yunit=1cm,everytree={}, - etcratio=.75,triratio=.5} +\begin{forest} + [\name{AosLeftSideTraits\_2},before drawing tree={x=0pt}, + for tree={concept,edge={-Stealth}} + [{\name{AosOpenLeftTraits\_2}}] + [{\name{AosClosedLeftTraits\_2}}] + [{\name{AosContractedLeftTraits\_2}}] + [{\name{AosIdentifiedLeftTraits\_2}}] + ] +\end{forest} \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/open_concept_hierarchy.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/open_concept_hierarchy.tex index c44d6ebe93e..4107460f723 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/open_concept_hierarchy.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/open_concept_hierarchy.tex @@ -1,21 +1,23 @@ \documentclass[12pt]{standalone} \input{header} +\usepackage[edges]{forest} +\usetikzlibrary{shadows.blur,arrows.meta} \pagestyle{empty} +\def\name#1{\textsf{\it #1}} +\tikzset{concept/.style={rectangle split,rectangle split parts=1,draw, + fill=white,blur shadow,rounded corners,align=center}} \begin{document} - \psset{treevshift=0,unit=1em,xunit=2em,yunit=1em,everytree={},etcratio=.75,triratio=.5} - \jtree[everylabel=\sl,xunit=70pt,arrows=->] - \! = {} - <4wideleft>[scaleby=2.35 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementOpenLeftTraits\_2}}}@ult !ult - ^[scaleby=1.21 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenOpenRightTraits\_2}}}@urt !urt - ^[scaleby=1.18 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenOpenBottomTraits\_2}}}@ubt !ubt - ^<4wideright>[scaleby=2.35 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenOpenTopTraits\_2}}}@utt !utt - . - \!ult = <4wideright>[scaleby=2.10 1]{\psframebox{\concept{ArrangementOpenBoundaryTraits\_2}}}@ut !ut - . - \ncline{urt:b}{ut:t} - \ncline{ubt:b}{ut:t} - \ncline{utt:b}{ut:t} - \endjtree - \psset{treevshift=0,unit=1cm,xunit=1cm,yunit=1cm,everytree={}, - etcratio=.75,triratio=.5} +\begin{forest} + [,phantom,before drawing tree={x=0pt},for tree={concept,edge={-Stealth}} + [{\name{AosOpenLeftTraits\_2}},name=olt + [\name{AosOpenBoundaryTraits\_2},name=oyt,before drawing tree={x=0pt}] + ] + [{\name{AosOpenRightTraits\_2}},name=ort] + [{\name{AosOpenBottomTraits\_2}},name=obt] + [{\name{AosOpenTopTraits\_2}},name=ott] + ] + \draw[-Stealth] (ort) to (oyt); + \draw[-Stealth] (obt) to (oyt); + \draw[-Stealth] (ott) to (oyt); +\end{forest} \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/side_clusters.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/side_clusters.tex index 141b2c2ed33..05ee3493476 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/side_clusters.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/side_clusters.tex @@ -1,20 +1,23 @@ \documentclass[12pt]{standalone} \input{header} +\usepackage[edges]{forest} +\usetikzlibrary{shadows.blur,arrows.meta} \pagestyle{empty} +\def\name#1{\textsf{\it #1}} +\tikzset{concept/.style={rectangle split,rectangle split parts=1,draw, + fill=white,blur shadow,rounded corners,align=center}} \begin{document} - \psset{treevshift=0,unit=1em,xunit=2em,yunit=1em,everytree={},etcratio=.75,triratio=.5} - \jtree[everylabel=\sl,xunit=70pt,arrows=->] - \! = {} - [scaleby=2.31 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementVerticalSideTraits\_2}}}@vst !vst - ^[scaleby=2.31 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangemenHorizontalSideTraits\_2}}}@hst !hst - . - \!hst = [scaleby=1.15 1]{\psframebox{\concept{ArrangementBottomSideTraits\_2}}}@bst !bst - ^[scaleby=1.15 1]{\psframebox{\concept{ArrangementTopSideTraits\_2}}}@tst !tst - . - \!vst = [scaleby=1.12 1]{\psframebox{\concept{ArrangementLeftSideTraits\_2}}}@lst !lst - ^[scaleby=1.12 1]{\psframebox{\concept{ArrangementRightSideTraits\_2}}}@rst !rst - . - \endjtree - \psset{treevshift=0,unit=1cm,xunit=1cm,yunit=1cm,everytree={}, - etcratio=.75,triratio=.5} +\begin{forest} + [,phantom,before drawing tree={x=0pt}, + for tree={concept,edge={-Stealth}} + [\name{AosVerticalSideTraits\_2} + [\name{AosLeftSideTraits\_2}] + [\name{AosRightSideTraits\_2}] + ] + [\name{AosHorizontalSideTraits\_2} + [\name{AosBottomSideTraits\_2}] + [\name{AosTopologyTraits\_2}] + ] + ] +\end{forest} \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/spherical_concept_hierarchy.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/spherical_concept_hierarchy.tex index bdb8ce0845a..aeafefc7a52 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/spherical_concept_hierarchy.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/spherical_concept_hierarchy.tex @@ -1,19 +1,35 @@ \documentclass[12pt]{standalone} \input{header} +\usepackage[edges]{forest} +\usetikzlibrary{shadows.blur,arrows.meta} \pagestyle{empty} +\def\name#1{\textsf{\it #1}} +\tikzset{concept/.style={rectangle split,rectangle split parts=1,draw, + fill=white,blur shadow,rounded corners,align=center}} \begin{document} - \psset{treevshift=0,unit=1em,xunit=2em,yunit=1em,everytree={},etcratio=.75,triratio=.5} - \jtree[everylabel=\sl,xunit=70pt,arrows=->] - \! = {} - [scaleby=2.81 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementIdentifiedVerticalTraits\_2}}}@uvt !uvt - ^[scaleby=1 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementContractedBottomTraits\_2}}}@ubt !ubt - ^[scaleby=2.73 0,arrows=-,linestyle=none]{\psframebox{\concept{ArrangementContractedTopTraits\_2}}}@utt !utt - . - \!ubt = [scaleby=1 1]{\psframebox{\concept{ArrangementSphericalBoundaryTraits\_2}}}@ut !ut - . - \ncline{uvt:b}{ut:t} - \ncline{utt:b}{ut:t} - \endjtree - \psset{treevshift=0,unit=1cm,xunit=1cm,yunit=1cm,everytree={}, - etcratio=.75,triratio=.5} + \begin{forest} + [\name{AosBasicTraits\_2},name=abt,before drawing tree={x=0pt},for tree={concept,edge={-Stealth}} + [\name{AosVerticalSideTraits\_2} + [\name{AosLeftSideTraits\_2} + [,phantom] + [\name{AosIdentifiedVerticalTraits\_2},name=ivt + [,phantom] + [\name{AosSphericalBoundaryTraits\_2},name=sbt,before drawing tree={x=0pt}] + ] + ] + [\name{AosRightSideTraits\_2},name=rst] + ] + [\name{AosHorizontalSideTraits\_2},before drawing tree={x-=1.5em} + [\name{AosBottomSideTraits\_2} + [\name{AosContractedBottomTraits\_2},name=cbt,before drawing tree={x-=3em}] + ] + [\name{AosTopSideTraits\_2},before drawing tree={x-=3em} + [\name{AosContractedTopTraits\_2},name=ctt,before drawing tree={x-=3em}] + ] + ] + ] + \draw[-Stealth] (cbt) to (sbt); + \draw[-Stealth] (ctt) to (sbt); + \draw[-Stealth] (rst) to (ivt); + \end{forest} \end{document} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h index 06ec80facc7..dbe7b2b89cb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_algebraic_segment_traits_2.h @@ -73,7 +73,7 @@ public: typedef typename Algebraic_kernel_d_2::Polynomial_2 Polynomial_2; - /// public types for ArrangementTraits_2 + /// public types for AosTraits_2 typedef typename Algebraic_kernel_d_2::Curve_analysis_2 Curve_2; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h index 1e622f83d34..922f6c7ebed 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h @@ -316,7 +316,7 @@ public: Make_x_monotone_2(const Base& base, std::size_t& counter) : m_object(base.make_x_monotone_2_object()), m_counter(counter) {} - /*! Subdivide a given curve into \f$x\f$-monotone subcurves and insert them + /*! subdivides a given curve into \f$x\f$-monotone subcurves and insert them * into a given output iterator. * \param cv the curve. * \param oi the output iterator for the result. Its value type is a variant diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index f38156da2af..0e986fc78bb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -40,24 +40,24 @@ namespace CGAL { inline void* _clean_pointer(const void* p) { - static_assert(sizeof(void*) == sizeof(size_t)); - const size_t mask = ~1; - const size_t val = (reinterpret_cast(p) & mask); + static_assert(sizeof(void*) == sizeof(std::size_t)); + const std::size_t mask = ~1; + const std::size_t val = (reinterpret_cast(p) & mask); return (reinterpret_cast(val)); } inline void* _set_lsb(const void* p) { - const size_t mask = 1; - const size_t val = (reinterpret_cast(p) | mask); + const std::size_t mask = 1; + const std::size_t val = (reinterpret_cast(p) | mask); return (reinterpret_cast( val)); } inline bool _is_lsb_set(const void* p) { - const size_t mask = 1; - const size_t val = reinterpret_cast(p); + const std::size_t mask = 1; + const std::size_t val = reinterpret_cast(p); return ((val & mask) != 0); } @@ -565,7 +565,7 @@ public: Outer_ccb_const_iterator; /*! obtains the number of outer CCBs the face has. */ - size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); } + std::size_t number_of_outer_ccbs() const { return (this->outer_ccbs.size()); } /*! obtains an iterator for the first outer CCB of the face. */ Outer_ccb_iterator outer_ccbs_begin() { return (this->outer_ccbs.begin()); } @@ -601,7 +601,7 @@ public: typedef Inner_ccb_const_iterator Hole_const_iterator; /*! obtains the number of inner CCBs the face has. */ - size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); } + std::size_t number_of_inner_ccbs() const { return (this->inner_ccbs.size()); } /*! obtains an iterator for the first inner CCB of the face. */ Inner_ccb_iterator inner_ccbs_begin() { return (this->inner_ccbs.begin()); } @@ -646,7 +646,7 @@ public: } // Backward compatibility: - size_t number_of_holes() const { return number_of_inner_ccbs(); } + std::size_t number_of_holes() const { return number_of_inner_ccbs(); } Hole_iterator holes_begin() { return inner_ccbs_begin(); } Hole_iterator holes_end() { return inner_ccbs_end(); } Hole_const_iterator holes_begin() const { return inner_ccbs_begin(); } @@ -669,7 +669,7 @@ public: Isolated_vertex_const_iterator; /*! obtains the number of isloated vertices inside the face. */ - size_t number_of_isolated_vertices() const + std::size_t number_of_isolated_vertices() const { return (this->iso_verts.size()); } /*! obtains an iterator for the first isloated vertex inside the face. */ @@ -986,13 +986,13 @@ protected: typedef In_place_list Inner_ccb_list; typedef In_place_list Iso_vert_list; - typedef std::allocator_traits Allocator_traits; - typedef typename Allocator_traits::template rebind_alloc Vertex_allocator; - typedef typename Allocator_traits::template rebind_alloc Halfedge_allocator; - typedef typename Allocator_traits::template rebind_alloc Face_allocator; - typedef typename Allocator_traits::template rebind_alloc Outer_ccb_allocator; - typedef typename Allocator_traits::template rebind_alloc Inner_ccb_allocator; - typedef typename Allocator_traits::template rebind_alloc Iso_vert_allocator; + typedef std::allocator_traits Allocator_traits; + typedef typename Allocator_traits::template rebind_alloc Vertex_allocator; + typedef typename Allocator_traits::template rebind_alloc Halfedge_allocator; + typedef typename Allocator_traits::template rebind_alloc Face_allocator; + typedef typename Allocator_traits::template rebind_alloc Outer_ccb_allocator; + typedef typename Allocator_traits::template rebind_alloc Inner_ccb_allocator; + typedef typename Allocator_traits::template rebind_alloc Iso_vert_allocator; public: typedef typename Halfedge_list::size_type Size; @@ -1002,7 +1002,6 @@ public: typedef std::bidirectional_iterator_tag iterator_category; protected: - Vertex_list vertices; // The vertices container. Halfedge_list halfedges; // The halfedges container. Face_list faces; // The faces container. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_directional_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_directional_non_caching_segment_basic_traits_2.h index 48de8ad5792..825b244e69e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_directional_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_directional_non_caching_segment_basic_traits_2.h @@ -22,10 +22,10 @@ namespace CGAL { /*! \class * A model of the following concepts: - * 1. ArrangementBasicTraits_2, - * 2. ArrangementDirectionalXMonotoneTraits_2, - * 4. ArrangementConstructXMonotoneCurveTraits_2, and - * 3. ArrangementOpenBoundaryTraits_2 + * 1. AosBasicTraits_2, + * 2. AosDirectionalXMonotoneTraits_2, + * 4. AosConstructXMonotoneCurveTraits_2, and + * 3. AosOpenBoundaryTraits_2 * It handles linear curves. */ template @@ -43,7 +43,7 @@ public: Arr_directional_non_caching_segment_basic_traits_2() : Base() {} /// \name Types and functors inherited from the base, required by the - // ArrangementBasicTraits_2 concept. + // AosBasicTraits_2 concept. //@{ // Traits types: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h index da68eb331be..0f9b28f3cdd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_extended_dcel.h @@ -61,8 +61,10 @@ public: template struct rebind { - using Point_2 = Point_; - using other = typename Vertex_base::template rebind; + using Pnt = Point_; + using Rebind_vertex_base = typename Vertex_base::template rebind; + using Other_vertex_base = typename Rebind_vertex_base::other; + using other = Arr_extended_vertex; }; }; @@ -101,8 +103,10 @@ public: template struct rebind { - using X_monotonote_curve_2 = XMonotoneCurve; - using other = typename Halfedge_base::template rebind; + using Xcv = XMonotoneCurve; + using Rebind_halfedge_base = typename Halfedge_base::template rebind; + using Other_halfedge_base = typename Rebind_halfedge_base::other; + using other = Arr_extended_halfedge; }; }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h index b15cf639204..c4a72fced45 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_basic_traits_2.h @@ -25,8 +25,8 @@ /*! \file The basic non-caching segment traits-class for the arrangement * package. This traits class handles \f$x\f$-monotone non-intersecting - * segments. It is a model of the ArrangementBasicTraits_2 concept. The class - * is templated by a kernel and inherits from it all the types and many of the + * segments. It is a model of the AosBasicTraits_2 concept. The class is + * templated by a kernel and inherits from it all the types and many of the * functors required by the concept it models. */ @@ -41,7 +41,7 @@ namespace CGAL { /*! \class - * A model of the ArrangementBasicTraits_2 concept that handles \f$x\f$-monotone + * A model of the AosBasicTraits_2 concept that handles \f$x\f$-monotone * non-intersecting line segments. */ template diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h index 4029a7be681..f65c22ef052 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h @@ -20,10 +20,10 @@ /*! \file The non-caching segment traits-class for the arrangement package. * This traits class handles general segments. It is a model of the - * ArrangementTraits_2 concept, a refinement of the ArrangementBasicTraits_2 + * AosTraits_2 concept, a refinement of the AosBasicTraits_2 * concept. The class is templated by a kernel and inherits from the * Arr_non_caching_segment_basic_traits_2 class instantiated with the kernel - - * a model of the ArrangementBasicTraits_2 concept. It defined a few additional + * a model of the AosBasicTraits_2 concept. It defined a few additional * functors required by the concept it models. */ @@ -38,7 +38,7 @@ namespace CGAL { /*! \class - * A model of the ArrangementTraits_2 concept that handles general + * A model of the AosTraits_2 concept that handles general * line segments. */ template diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h index aef731fa798..7bf3b5da9cc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h @@ -1043,7 +1043,7 @@ public: //@} /// \name Types and functors defined here, required by the - // ArrangementDirectionalXMonotoneTraits_2 concept. + // AosDirectionalXMonotoneTraits_2 concept. //@{ Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h index 5ac5c4d6bd9..deef58f9d78 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h @@ -2165,7 +2165,7 @@ public: CGAL_precondition(is_in_x_range(xcv1, xcv2)); /* The traits class which the basic traits adaptor accepts as a template - * parameter is a model of the ArrangementBasicTraits_2 concept so it + * parameter is a model of the AosBasicTraits_2 concept so it * needs not to support intersections at all, therefore it is complicated * to check if the x-curves are disjoint in their interiors. Moreover, * compare_y_position functor is called only from the arrangement class diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index 5bc8054c525..1436405e4d8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -1568,7 +1568,7 @@ template bool do_intersect(Arrangement_on_surface_2& arr, - const typename GeometryTraits_2::X_monotone_curve_2& c, + const typename GeometryTraits_2::Curve_2& c, const PointLocation& pl, std::is_same::type) { typedef GeometryTraits_2 Gt2; @@ -1607,7 +1607,7 @@ do_intersect(Arrangement_on_surface_2& arr, // Check whether the isolated point lies inside a face (otherwise, // it coincides with a vertex or an edge). auto obj = pl.locate(*iso_p); - if (std::get_if(&x_obj) != nullptr) return true; + if (std::get_if(&obj) != nullptr) return true; } // If we reached here, the curve does not intersect the arrangement. diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h index cbc2a9ad81a..26117033c04 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h @@ -64,7 +64,7 @@ public: BaseCKvA::Curved_kernel_via_analysis_2> Functor_base; }; - //!\name Embedded types to fulfill \c ArrangementTraits_2 concept + //!\name Embedded types to fulfill \c AosTraits_2 concept //! type of curve that can be analyzed typedef typename Curve_kernel_2::Curve_analysis_2 Curve_2; @@ -245,14 +245,14 @@ public: }; public: - //!\name Embedded types to fulfill \c ArrangementTraits_2 concept + //!\name Embedded types to fulfill \c AosTraits_2 concept //!@{ typedef internal::Point_2< Self > Point_2; typedef internal::Arc_2< Self > Arc_2; - //! type of weakly x-monotone arc for \c ArrangementTraits_2 + //! type of weakly x-monotone arc for \c AosTraits_2 typedef Arc_2 X_monotone_curve_2; //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h index 34eb19ae4b2..6353425cd4c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Filtered_curved_kernel_via_analysis_2_impl.h @@ -716,7 +716,7 @@ public: //! type of an arc on generic curve typedef internal::Arc_2< Self > Arc_2; - //! type of weakly x-monotone arc for \c ArrangementTraits_2 + //! type of weakly x-monotone arc for \c AosTraits_2 typedef Arc_2 X_monotone_curve_2; //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h index e1accd10731..b6090350941 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_basic_insertion_traits_2.h @@ -251,7 +251,7 @@ public: // vertex to the extended point. if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point())) return (Point_2(base_p, vh)); - else return (Point_2(base_p)); + return (Point_2(base_p)); } }; @@ -308,7 +308,7 @@ public: // vertex to the extended point. if (! vh->is_at_open_boundary() && m_base_equal(base_p, vh->point())) return (Point_2(base_p, vh)); - else return (Point_2(base_p)); + return (Point_2(base_p)); } }; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp index e1287e2761a..c5436ee7b89 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_do_intersect.cpp @@ -8,47 +8,49 @@ #include #include -typedef CGAL::Quotient Number_type; -typedef CGAL::Simple_cartesian Kernel; -typedef CGAL::Arr_segment_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; -typedef Arrangement_2::Halfedge_handle Halfedge_handle; +using Number_type = CGAL::Quotient; +using Kernel = CGAL::Simple_cartesian; +using Traits_2 = CGAL::Arr_segment_traits_2; +using Point_2 = Traits_2::Point_2; +using Segment_2 = Traits_2::X_monotone_curve_2; +using Arrangement_2 = CGAL::Arrangement_2; +using Halfedge_handle = Arrangement_2::Halfedge_handle; -#define N_SEGMENTS 3 +int main () { + Arrangement_2 arr; + using Tt = Arrangement_2::Topology_traits; + Tt::Default_point_location_strategy def_pl(arr); -int main () -{ - Arrangement_2 arr; - Segment_2 segs[N_SEGMENTS]; - bool expected_intersect[N_SEGMENTS]; - int k; + Segment_2 segs[] = { + Segment_2(Point_2(-2, -2), Point_2(-1, -1)), + Segment_2(Point_2(-1, 1), Point_2(0, 1)), + Segment_2(Point_2(-1, 0), Point_2(0, 0)) + }; - segs[0] = Segment_2 (Point_2 (-2, -2), Point_2 (-1, -1)); - segs[1] = Segment_2 (Point_2 (-1, 1), Point_2 (0, 1)); - segs[2] = Segment_2 (Point_2 (-1, 0), Point_2 (0, 0)); - - expected_intersect[0] = false; - expected_intersect[1] = true; - expected_intersect[2] = true; + bool expected_intersect[] = {false, true, true}; insert(arr, Segment_2(Point_2(0, 0), Point_2(2, 0))); insert(arr, Segment_2(Point_2(2, 0), Point_2(2, 2))); insert(arr, Segment_2(Point_2(2, 2), Point_2(0, 2))); insert(arr, Segment_2(Point_2(0, 2), Point_2(0, 0))); - for (k = 0; k < N_SEGMENTS; k++) - { - bool do_inter = do_intersect(arr, segs[k]); + size_t k = 0; + for (const auto& seg : segs) { + bool do_inter_0 = do_intersect(arr, seg); + bool do_inter_1 = do_intersect(arr, seg, def_pl, std::true_type()); + bool do_inter_2 = do_intersect(arr, seg, def_pl, std::false_type()); - std::cout << "Segment: " << segs[k]; - std::cout << " Expected: " << expected_intersect[k]; - std::cout << " Actual: " << do_inter << std::endl; + std::cout << "Segment: " << segs[k] << std::endl; + std::cout << " Expected: " << expected_intersect[k] << std::endl; + std::cout << " Actual auto: " << do_inter_0 << std::endl; + std::cout << " Actual x-monotone curve: " << do_inter_1 << std::endl; + std::cout << " Actual curve: " << do_inter_2 << std::endl; - if (expected_intersect[k] != do_inter) - return (1); + if (expected_intersect[k] != do_inter_0) return -1; + if (expected_intersect[k] != do_inter_1) return -1; + if (expected_intersect[k] != do_inter_2) return -1; + ++k; } - return (0); + return 0; } diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt index 661e4d89ae5..adfd0e20e78 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt @@ -669,10 +669,10 @@ The traits class used to instantiate the `General_polygon_set_2` class template must model the concept `GeneralPolygonSetTraits_2`, and is tailored to handle a specific family of curves. The concept `GeneralPolygonSetTraits_2` refines the concept -`ArrangementDirectionalXMonotoneTraits_2` specified next. +`AosDirectionalXMonotoneTraits_2` specified next. -The concept `ArrangementDirectionalXMonotoneTraits_2` refines the -concept `ArrangementXMonotoneTraits_2` (see +The concept `AosDirectionalXMonotoneTraits_2` refines the +concept `AosXMonotoneTraits_2` (see 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`, which represents an \f$ x\f$-monotone curve, and the type `Point_2`, @@ -687,7 +687,7 @@ curve is not required to have a designated source and target, it i smaller) and the right (lexicographically larger) endpoints of a given curve. -The `ArrangementDirectionalXMonotoneTraits_2` concept treats its +The `AosDirectionalXMonotoneTraits_2` concept treats its \f$ x\f$-monotone curves as directed objects. It thus requires two additional operations on \f$ x\f$-monotone curves:
    @@ -702,10 +702,10 @@ The traits classes `Arr_segment_traits_2`, `Arr_conic_traits_2` and `Arr_rational_function_traits_2`, which are bundled in the `Arrangement_2` package and distributed with \cgal, are all models of the refined concept -`ArrangementDirectionalXMonotoneTraits_2`.\cgalFootnote{The \cgalFootnoteCode{Arr_polyline_traits_2} class is not a model of the, \cgalFootnoteCode{ArrangementDirectionalXMonotoneTraits_2} concept, as the \f$ x\f$-monotone curve it defines is always directed from left to right. Thus, an opposite curve cannot be constructed. However, it is not very useful to construct a polygon whose edges are polylines, as an ordinary polygon with linear edges can represent the same entity.} +`AosDirectionalXMonotoneTraits_2`.\cgalFootnote{The \cgalFootnoteCode{Arr_polyline_traits_2} class is not a model of the, \cgalFootnoteCode{AosDirectionalXMonotoneTraits_2} concept, as the \f$ x\f$-monotone curve it defines is always directed from left to right. Thus, an opposite curve cannot be constructed. However, it is not very useful to construct a polygon whose edges are polylines, as an ordinary polygon with linear edges can represent the same entity.} Just as with the case of computations using models of the -`ArrangementXMonotoneTraits_2` concept, operations are robust only +`AosXMonotoneTraits_2` concept, operations are robust only when exact arithmetic is used. When inexact arithmetic is used, (nearly) degenerate configurations may result in abnormal termination of the program or even incorrect results. @@ -761,7 +761,7 @@ curves. The class-template `General_polygon_2` models the concept `GeneralPolygon_2`. Its sole template parameter must be instantiated with a model of the concept -`ArrangementDirectionalXMonotoneTraits_2` from which it obtains the +`AosDirectionalXMonotoneTraits_2` from which it obtains the `X_monotone_curve_2` type. It uses the geometric operations on this type provided by such a model to maintain a container of directed curves of type `X_monotone_curve_2`, which represents a @@ -772,7 +772,7 @@ The class-template models the concept `GeneralPolygonSetTraits_2`, and can be used to instantiate the class template `General_polygon_set_2`. It serves as an adapter for a geometric traits class, which models the -concept `ArrangementDirectionalXMonotoneTraits_2`. +concept `AosDirectionalXMonotoneTraits_2`. It can be used for performing set-operations on general polygons. The implementation of the adapter is rather simple, as it is derived from the instantiated template-parameter `ArrXMonotoneTraits_2` @@ -781,13 +781,13 @@ the methods provided by the instantiated parameter `GeneralPolygon`, which is a model of the concept `GeneralPolygon_2`. By default, the `GeneralPolygon` parameter is defined as -`General_polygon_2`. +`General_polygon_2`. The code excerpt listed below defines a general-polygon set type that can be used to perform Boolean set-operations on point sets bounded by the \f$ x\f$-monotone curve type defined by the arrangement-traits class `Arr_traits_2`, which is some representative model of the concept -`ArrangementDirectionalXMonotoneTraits_2`. +`AosDirectionalXMonotoneTraits_2`. \code{.cpp} #include diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h index 39faf23e21a..4fd5c2c9e38 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h @@ -90,7 +90,7 @@ void complement(const Polygon_2& pgn, * \param pgn the input polygon. * \param res the complement of \p pgn. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template void @@ -136,7 +136,7 @@ OutputIterator complement(const Polygon_with_holes_2& pgn, * `General_polygon_with_holes_2<>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -161,7 +161,7 @@ void complement(const Polygon_2& pgn, * \param res the resulting complement of \p pgn * \param traits a traits object. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -193,7 +193,7 @@ OutputIterator complement(const Polygon_with_holes_2& pgn, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -438,7 +438,7 @@ OutputIterator difference(const Polygon_with_holes_2& pgn1, * Its dereference type must be convertibe to * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. - * \pre `%ArrTraits` must be a model of the concept `ArrangementDirectionalXMonotoneTraits_2`. + * \pre `%ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator difference(const General_polygon_2& pgn1, @@ -454,7 +454,7 @@ OutputIterator difference(const General_polygon_2& pgn1, * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -471,7 +471,7 @@ difference(const General_polygon_with_holes_2>& pgn * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -578,7 +578,7 @@ OutputIterator difference(const Polygon_with_holes_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -597,7 +597,7 @@ OutputIterator difference(const General_polygon_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -617,7 +617,7 @@ difference(const General_polygon_with_holes_2>& pgn * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -858,7 +858,7 @@ bool do_intersect(const Polygon_with_holes_2& pgn1, * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` * otherwise. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool do_intersect(const General_polygon_2& pgn1, @@ -870,7 +870,7 @@ bool do_intersect(const General_polygon_2& pgn1, * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` * otherwise. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool @@ -883,7 +883,7 @@ do_intersect(const General_polygon_2& pgn1, * \return `true` if `pgn1` and `pgn2` intersect in their interior and `false` * otherwise. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool do_intersect(const General_polygon_with_holes_2>& pgn1, @@ -1058,7 +1058,7 @@ bool do_intersect(const Polygon_with_holes_2& pgn1, * otherwise. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool do_intersect(const General_polygon_2& pgn1, @@ -1073,7 +1073,7 @@ bool do_intersect(const General_polygon_2& pgn1, * otherwise. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool @@ -1089,7 +1089,7 @@ do_intersect(const General_polygon_2& pgn1, * otherwise. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool @@ -1415,7 +1415,7 @@ OutputIterator intersection(const Polygon_with_holes_2& pgn1, * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator intersection(const General_polygon_2& pgn1, @@ -1431,7 +1431,7 @@ OutputIterator intersection(const General_polygon_2& pgn1, * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -1448,7 +1448,7 @@ intersection(const General_polygon_with_holes_2>& p * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -1672,7 +1672,7 @@ intersection(const Polygon_with_holes_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -1693,7 +1693,7 @@ OutputIterator intersection(const General_polygon_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -1715,7 +1715,7 @@ intersection(const General_polygon_with_holes_2>& p * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -2026,7 +2026,7 @@ bool join(const Polygon_with_holes_2& pgn1, * \param res the resulting union of \p pgn1 and \p pgn2. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool join(const General_polygon_2& pgn1, @@ -2039,7 +2039,7 @@ bool join(const General_polygon_2& pgn1, * \param res the resulting union of \p pgn1 and \p pgn2. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool @@ -2053,7 +2053,7 @@ join(const General_polygon_2& pgn1, * \param res the resulting union of \p pgn1 and \p pgn2. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template bool @@ -2217,7 +2217,7 @@ bool join(const Polygon_with_holes_2& pgn2, * \param traits a traits object. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -2234,7 +2234,7 @@ bool join(const General_polygon_2& pgn1, * \param traits a traits object. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -2252,7 +2252,7 @@ join(const General_polygon_2& pgn1, * \param traits a traits object. * \return `true` if the two input polygons overlap. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -2568,7 +2568,7 @@ oriented_side(const Polygon_with_holes_2& pgn1, * \param pgn1 1st the input polygon. * \param pgn2 the 2nd input polygon. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template Oriented_side oriented_side(const General_polygon_2& pgn1, @@ -2578,7 +2578,7 @@ Oriented_side oriented_side(const General_polygon_2& pgn1, * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template Oriented_side @@ -2589,7 +2589,7 @@ oriented_side(const General_polygon_2& pgn1, * \param pgn1 the 1st input polygon. * \param pgn2 the 2nd input polygon. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template Oriented_side @@ -2655,7 +2655,7 @@ Oriented_side oriented_side(const Polygon_with_holes_2& pgn1, * \param pgn2 the 2nd input polygon. * \param traits a traits object. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * */ @@ -2669,7 +2669,7 @@ Oriented_side oriented_side(const General_polygon_2& pgn1, * \param pgn2 the 2nd input polygon. * \param traits a traits object. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * */ @@ -2684,7 +2684,7 @@ oriented_side(const General_polygon_2& pgn1, * \param pgn2 the 2nd input polygon. * \param traits a traits object. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. * */ @@ -2727,7 +2727,7 @@ Oriented_side oriented_side(const Point_2& p, * \param p the input point. * \param pgn the input polygon. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template Oriented_side oriented_side(const Point_2& p, @@ -2770,7 +2770,7 @@ Oriented_side oriented_side(const Point_2& p, * \param pgn the input polygon. * \param traits a traits object. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`. */ template @@ -3063,7 +3063,7 @@ symmetric_difference(const Polygon_with_holes_2& pgn1, * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator symmetric_difference(const General_polygon_2& pgn1, @@ -3081,7 +3081,7 @@ OutputIterator symmetric_difference(const General_polygon_2& pgn1, * `General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -3100,7 +3100,7 @@ symmetric_difference(const General_polygon_with_holes_2>`. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. */ template OutputIterator @@ -3332,7 +3332,7 @@ symmetric_difference(const Polygon_with_holes_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -3353,7 +3353,7 @@ OutputIterator symmetric_difference(const General_polygon_2& pgn1, * \param traits a traits object. * \return the past-the-end iterator of the output container. * \pre `%ArrTraits` must be a model of the concept - * `ArrangementDirectionalXMonotoneTraits_2`. + * `AosDirectionalXMonotoneTraits_2`. * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`. */ template @@ -3375,7 +3375,7 @@ symmetric_difference(const General_polygon_with_holes_2 diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h index c5c628cc757..ac8899ed76e 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_2.h @@ -7,10 +7,10 @@ namespace CGAL { The class `General_polygon_2` models the concept `GeneralPolygon_2`. It represents a simple general-polygon. It is parameterized with the type `ArrTraits` that models the concept -`ArrangementDirectionalXMonotoneTraits_2`. The latter is a refinement -of the concept `ArrangementXMonotoneTraits_2`. In addition to the -requirements of the concept `ArrangementXMonotoneTraits_2`, a -model of the concept `ArrangementDirectionalXMonotoneTraits_2` must +`AosDirectionalXMonotoneTraits_2`. The latter is a refinement +of the concept `AosXMonotoneTraits_2`. In addition to the +requirements of the concept `AosXMonotoneTraits_2`, a +model of the concept `AosDirectionalXMonotoneTraits_2` must support the following functions:
    • Given an \f$ x\f$-monotone curve, construct its opposite curve. diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h index 7490789ba66..f65b5d11004 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/General_polygon_set_2.h @@ -50,7 +50,7 @@ boundary and the holes are also pairwise disjoint, except perhaps at the vertices. \sa `Arrangement_2` -\sa `ArrangementXMonotoneTraits_2` +\sa `AosXMonotoneTraits_2` \sa `Nef_polyhedron_2` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h index 6d65a9e5e43..ca47397e6a2 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Gps_traits_2.h @@ -7,8 +7,8 @@ namespace CGAL { The traits class `Gps_traits_2` models the concept `GeneralPolygonSetTraits_2`. It inherits from the instantiated type of the template parameter `ArrTraits`, which must model the -concept `ArrangementDirectionalXMonotoneTraits_2`, (which in turn refines -the concept `ArrangementXMonotoneTraits_2`). The template parameter +concept `AosDirectionalXMonotoneTraits_2`, (which in turn refines +the concept `AosXMonotoneTraits_2`). The template parameter `GeneralPolygon_t` must be instantiated with a model of the concept of `GpsTraitsGeneralPolygon_2`. By default, the latter is instantiated by `CGAL::General_polygon_2`. diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/AosDirectionalXMonotoneTraits_2.h similarity index 80% rename from Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h rename to Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/AosDirectionalXMonotoneTraits_2.h index 3278e482000..1f2e9dac658 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrangementDirectionalXMonotoneTraits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/AosDirectionalXMonotoneTraits_2.h @@ -7,14 +7,14 @@ This concept refines the basic arrangement \f$ x\f$-monotone traits concept. A model of this concept is able to handle directed \f$ x\f$-monotone curves that intersect in their interior. Namely, an instance of the `X_monotone_curve_2` type defined by a model of the concept -`ArrangementXMonotoneTraits_2` is only required to have a left +`AosXMonotoneTraits_2` is only required to have a left (lexicographically smaller) endpoint and a right endpoint. If the traits class is also a model of -`ArrangementDirectionalXMonotoneTraits_2`, the \f$ x\f$-monotone curve is +`AosDirectionalXMonotoneTraits_2`, the \f$ x\f$-monotone curve is also required to have a direction, namely one of these two endpoint serves as its source and the other as its target. -\cgalRefines{ArrangementXMonotoneTraits_2} +\cgalRefines{AosXMonotoneTraits_2} \cgalHasModelsBegin \cgalHasModels{CGAL::Arr_segment_traits_2} @@ -26,11 +26,11 @@ as its source and the other as its target. \cgalHasModels{CGAL::Arr_algebraic_segment_traits_2} \cgalHasModelsEnd -\sa `ArrangementXMonotoneTraits_2` +\sa `AosXMonotoneTraits_2` */ -class ArrangementDirectionalXMonotoneTraits_2 { +class AosDirectionalXMonotoneTraits_2 { public: /// \name Functor Types @@ -74,17 +74,17 @@ typedef unspecified_type Merge_2; /*! default constructor. */ -ArrangementDirectionalXMonotoneTraits_2(); +AosDirectionalXMonotoneTraits_2(); /*! copy constructor */ -ArrangementDirectionalXMonotoneTraits_2(ArrangementDirectionalXMonotoneTraits_2 other); +AosDirectionalXMonotoneTraits_2(AosDirectionalXMonotoneTraits_2 other); /*! assignment operator. */ -ArrangementDirectionalXMonotoneTraits_2 operator=(other); +AosDirectionalXMonotoneTraits_2 operator=(other); /// @} @@ -103,5 +103,4 @@ Construct_opposite_2 construct_opposite_2_object(); /// @} -}; /* end ArrangementDirectionalXMonotoneTraits_2 */ - +}; /* end AosDirectionalXMonotoneTraits_2 */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h index 65fd4f347a8..93f15a825bf 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--AreMergeable_2.h @@ -6,7 +6,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableBinaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Are_mergeable_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Are_mergeable_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h index e7714c04561..daf5b7a705c 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--CompareEndpointsXy_2.h @@ -7,7 +7,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableUnaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Compare_endpoints_xy_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Compare_endpoints_xy_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h index 92ee2585b2d..c61205872cb 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--ConstructOpposite_2.h @@ -7,7 +7,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableUnaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Construct_opposite_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Construct_opposite_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h index 35c4fdf3273..4b6fcea1cc0 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Intersect_2.h @@ -6,7 +6,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableBinaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Intersect_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Intersect_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h index 18f8f26e936..fa931a25d70 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Merge_2.h @@ -6,7 +6,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableBinaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Merge_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Merge_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h index 5d6529d4862..8cb1a811b3f 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/ArrDirectionalTraits--Split_2.h @@ -6,7 +6,7 @@ namespace ArrDirectionalTraits { \cgalRefines{AdaptableUnaryFunction} \cgalHasModelsBegin -\cgalHasModels{ArrangementDirectionalXMonotoneTraits_2::Split_2} +\cgalHasModels{AosDirectionalXMonotoneTraits_2::Split_2} \cgalHasModelsEnd */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h index 6d28d6afbf4..2df5a74cbda 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcel.h @@ -9,12 +9,12 @@ It maintains the incidence relation among them. The halfedges are ordered in pairs sometimes referred to as twins, such that each halfedge pair represent an edge. -A model of the `GeneralPolygonSetDcel` simply refines `ArrangementDcel`, +A model of the `GeneralPolygonSetDcel` simply refines `AosDcel`, the `Halfedge` and `Face` types being models of the concepts `GeneralPolygonSetDcelHalfedge` and `GeneralPolygonSetDcelFace` respectively -\cgalRefines{ArrangementDcel} +\cgalRefines{AosDcel} \cgalHasModelsBegin \cgalHasModels{CGAL::Gps_default_dcel} @@ -28,4 +28,3 @@ respectively class GeneralPolygonSetDcel {}; /* end GeneralPolygonSetDcel */ - diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelFace.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelFace.h index 01a99bce20e..5201673abe7 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelFace.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelFace.h @@ -7,14 +7,14 @@ A face record in a \em Dcel data structure used by the `General_polygon_set_2` and `Polygon_set_2` template classes to represent the underlying internal `Arrangement_2` data structure. -\cgalRefines{ArrangementDcelFace} +\cgalRefines{AosDcelFace} \cgalHasModelsBegin \cgalHasModels{CGAL::Gps_face_base} \cgalHasModelsEnd -\sa `ArrangementDcel` -\sa `ArrangementDcelVertex` +\sa `AosDcel` +\sa `AosDcelVertex` \sa `GeneralPolygonSetDcelHalfedge` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelHalfedge.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelHalfedge.h index a21a5fd8b7f..975fc355f4c 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelHalfedge.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetDcelHalfedge.h @@ -6,14 +6,14 @@ A halfedge record in a \em Dcel data structure used by the `General_polygon_set_2` and `Polygon_set_2` template classes to represent the underlying internal `Arrangement_2` data structure. -\cgalRefines{ArrangementDcelHalfedge} +\cgalRefines{AosDcelHalfedge} \cgalHasModelsBegin \cgalHasModels{CGAL::Gps_face_halfedge} \cgalHasModelsEnd -\sa `ArrangementDcel` -\sa `ArrangementDcelVertex` +\sa `AosDcel` +\sa `AosDcelVertex` \sa `GeneralPolygonSetDcelFace` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h index 2c8966d8239..a1c48bf7217 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Concepts/GeneralPolygonSetTraits_2.h @@ -11,7 +11,7 @@ a type that represents a general polygon and another one that represents general polygon with holes. It also requires operations that operate on these types. -\cgalRefines{ArrangementDirectionalXMonotoneTraits_2} +\cgalRefines{AosDirectionalXMonotoneTraits_2} \cgalHasModelsBegin \cgalHasModels{CGAL::Gps_segment_traits_2} @@ -19,7 +19,7 @@ types. \cgalHasModels{CGAL::Gps_traits_2} \cgalHasModelsEnd -\sa `ArrangementDirectionalXMonotoneTraits_2` +\sa `AosDirectionalXMonotoneTraits_2` */ diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt index c36bb0cdd61..d9e29fbf99a 100644 --- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt +++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/PackageDescription.txt @@ -41,7 +41,7 @@ containment predicates. - `GpsTraitsGeneralPolygon_2` - `GpsTraitsGeneralPolygonWithHoles_2` - `GeneralPolygon_2` -- `ArrangementDirectionalXMonotoneTraits_2` +- `AosDirectionalXMonotoneTraits_2` - `GeneralPolygonSetTraits_2` - `GeneralPolygonSetDcel` - `GeneralPolygonSetDcelFace` diff --git a/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXMonotone_2.h b/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXMonotone_2.h index 0767ad52573..d47fd62c986 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXMonotone_2.h +++ b/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXMonotone_2.h @@ -18,7 +18,7 @@ public: Splits the arc `ca` into `x`-monotone arcs that are returned through the output iterator. Note that, to ensure an easy interface with the `Arrangement_2` package, the arcs are returned as `CGAL::Object`'s -(see the `ArrangementTraits_2` concept). +(see the `AosTraits_2` concept). */ template < class OutputIterator > OutputIterator @@ -27,4 +27,3 @@ operator()(const CircularKernel::Circular_arc_2 &ca, OutputIterator oit); /// @} }; /* end CircularKernel::MakeXMonotone_2 */ - diff --git a/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXYMonotone_2.h b/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXYMonotone_2.h index 7e454234f27..5cbed951333 100644 --- a/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXYMonotone_2.h +++ b/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--MakeXYMonotone_2.h @@ -18,7 +18,7 @@ public: Splits the arc `ca` into `y`-monotone arcs that are returned through the output iterator. Note that, to ensure an easy interface with the `Arrangement_2` package, the arcs are returned as `CGAL::Object`'s -(see the `ArrangementTraits_2` concept). +(see the `AosTraits_2` concept). */ template < class OutputIterator > OutputIterator @@ -27,4 +27,3 @@ operator()(const CircularKernel::Circular_arc_2 &ca, OutputIterator oit); /// @} }; /* end CircularKernel::MakeXYMonotone_2 */ - diff --git a/Distance_3/benchmark/Distance_3/CMakeLists.txt b/Distance_3/benchmark/Distance_3/CMakeLists.txt new file mode 100644 index 00000000000..3cc6ca18f7d --- /dev/null +++ b/Distance_3/benchmark/Distance_3/CMakeLists.txt @@ -0,0 +1,23 @@ +# Created by the script cgal_create_cmake_script +# This is the CMake script for compiling a CGAL application. + +cmake_minimum_required(VERSION 3.12...3.31) +project(Distance_3_Benchs) + +find_package(CGAL REQUIRED) + +if(MSVC) + # Turn off a VC++ warning on a potential division by zero + # in Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h + # where CGAL_assume() does not help + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4723") +endif() + +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Distance_3/benchmark/Distance_3/bench_compare_distance_3.cpp b/Distance_3/benchmark/Distance_3/bench_compare_distance_3.cpp new file mode 100644 index 00000000000..d7005a594ab --- /dev/null +++ b/Distance_3/benchmark/Distance_3/bench_compare_distance_3.cpp @@ -0,0 +1,297 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +// #define CGAL_USE_GTE_AS_SANITY_CHECK +#ifdef CGAL_USE_GTE_AS_SANITY_CHECK +#include +#include +#endif + +#include +#include + +struct randomint +{ + randomint() ; + int get() const { return sequence[cur]; } + int next() { + cur = (cur + 1) % 11; + return get(); + } + +private: + int sequence[11]; + int cur; +}; + +inline randomint::randomint() +{ + cur = 0; + sequence[0] = 19; + sequence[1] = 5; + sequence[2] = 17; + sequence[3] = 13; + sequence[4] = 29; + sequence[5] = 2; + sequence[6] = 23; + sequence[7] = 31; + sequence[8] = 3; + sequence[9] = 37; + sequence[10] = 11; +} + +randomint ri; + +template +struct Test +{ + typedef typename K::RT RT; + typedef typename K::FT FT; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_3 P; + typedef typename K::Segment_3 S; + typedef typename K::Vector_3 V; + typedef typename K::Ray_3 R; + typedef typename K::Line_3 L; + typedef typename K::Triangle_3 T; + typedef typename K::Plane_3 Pl; + typedef typename K::Tetrahedron_3 Tet; + typedef typename K::Iso_cuboid_3 Cub; + +private: + CGAL::Random& r; + double m = 0, M = 1; + +public: + Test(CGAL::Random& r) : r(r) { } + +private: + inline RT to_nt(int d) const { return RT(d); } + + P p(int x, int y, int z) + { + int w = ri.next(); + return P(to_nt(x*w), to_nt(y*w), to_nt(z*w), to_nt(w)); + } + + P random_point() const + { + return P(FT(r.get_double(m, M)), FT(r.get_double(m, M)), FT(r.get_double(m, M))); + } + + Pl pl(int a, int b, int c, int d) + { + int w = ri.next(); + return Pl(to_nt(a*w), to_nt(b*w), to_nt(c*w), to_nt(d*w)); + } + + +private: + void P_P(int N, FT d2) + { + std::cout << "Point - Point" << std::endl; + CGAL::Real_timer t; + t.start(); + for(int i=0; i(F& f){ + + }; + P_P(10000000, FT(0.1)); + P_S(1000000, FT(0.1)); + + std::cout << std::endl; + P_T(500000, FT(10)); + P_T(500000, FT(0.1)); + P_T(500000, FT(0.001)); + std::cout << std::endl; + + P_Tet(200000, FT(0.1)); + + std::cout << std::endl; + S_S(500000, FT(10)); + S_S(500000, FT(0.1)); + S_S(500000, FT(0.001)); + std::cout << std::endl; + S_L(500000, FT(0.1)); + + std::cout << std::endl; + T_T(500000, FT(10)); + T_T(500000, FT(0.1)); + T_T(500000, FT(0.001)); + std::cout << std::endl; + std::cout << std::endl; + } +}; + +int main(int argc, char** argv) +{ + std::cout.precision(17); + std::cerr.precision(17); + + std::cout << "3D Distance tests" << std::endl; + + CGAL::Random rp; + CGAL::Random r(argc==1?rp.get_seed():std::stoi(argv[1])); + std::cout << "random seed = " << r.get_seed() << std::endl; + + Test >(r).run(); + Test >(r).run(); +// Test > >(r).run(); + + // Test >(r).run(); + + Test(r).run(); + + Test(r).run(); + + std::cout << "Done!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Distance_3/benchmark/Distance_3/bench_distance_3.cpp b/Distance_3/benchmark/Distance_3/bench_distance_3.cpp new file mode 100644 index 00000000000..641bd01f0ae --- /dev/null +++ b/Distance_3/benchmark/Distance_3/bench_distance_3.cpp @@ -0,0 +1,280 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +// #define CGAL_USE_GTE_AS_SANITY_CHECK +#ifdef CGAL_USE_GTE_AS_SANITY_CHECK +#include +#include +#endif + +#include +#include + +struct randomint +{ + randomint() ; + int get() const { return sequence[cur]; } + int next() { + cur = (cur + 1) % 11; + return get(); + } + +private: + int sequence[11]; + int cur; +}; + +inline randomint::randomint() +{ + cur = 0; + sequence[0] = 19; + sequence[1] = 5; + sequence[2] = 17; + sequence[3] = 13; + sequence[4] = 29; + sequence[5] = 2; + sequence[6] = 23; + sequence[7] = 31; + sequence[8] = 3; + sequence[9] = 37; + sequence[10] = 11; +} + +randomint ri; + +template +struct Test +{ + typedef typename K::RT RT; + typedef typename K::FT FT; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_3 P; + typedef typename K::Segment_3 S; + typedef typename K::Vector_3 V; + typedef typename K::Ray_3 R; + typedef typename K::Line_3 L; + typedef typename K::Triangle_3 T; + typedef typename K::Plane_3 Pl; + typedef typename K::Tetrahedron_3 Tet; + typedef typename K::Iso_cuboid_3 Cub; + +private: + CGAL::Random& r; + double m = 0, M = 1; + +public: + Test(CGAL::Random& r) : r(r) { } + +private: + inline RT to_nt(int d) const { return RT(d); } + + P p(int x, int y, int z) + { + int w = ri.next(); + return P(to_nt(x*w), to_nt(y*w), to_nt(z*w), to_nt(w)); + } + + P random_point() const + { + return P(FT(r.get_double(m, M)), FT(r.get_double(m, M)), FT(r.get_double(m, M))); + } + + Pl pl(int a, int b, int c, int d) + { + int w = ri.next(); + return Pl(to_nt(a*w), to_nt(b*w), to_nt(c*w), to_nt(d*w)); + } + + +private: + void P_P(int N) + { + std::cout << "Point - Point" << std::endl; + CGAL::Real_timer t; + t.start(); + for(int i=0; i +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +template +class Old_compare_squared_distance_3 +{ + typedef typename K::FT FT; +public: + typedef typename K::Comparison_result result_type; + + template + CGAL::Needs_FT + operator()(const T1& p, const T2& q, const FT& d2) const + { + return CGAL::compare(CGAL::internal::squared_distance(p, q, K()), d2); + } +}; + +template +struct Test +{ + typedef typename K::RT RT; + typedef typename K::FT FT; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_3 P; + typedef typename K::Segment_3 S; + typedef typename K::Vector_3 V; + typedef typename K::Ray_3 R; + typedef typename K::Line_3 L; + typedef typename K::Triangle_3 T; + typedef typename K::Plane_3 Pl; + typedef typename K::Tetrahedron_3 Tet; + typedef typename K::Iso_cuboid_3 Cub; + + typedef std::vector >::iterator Iterator; + typedef CGAL::Box_intersection_d::Box_with_handle_d CBox; + + size_t nb_closed_pairs; + size_t nb_tested_pairs; + +public: + Test() : nb_closed_pairs(0), nb_tested_pairs(0){ } + + void close_triangles(std::vector

      &points, std::vector >& triangles, FT d2){ + std::vector< CBox > boxes; + auto extend_bbox3=[&](const Iterator it, FT& d2){ + CGAL::Bbox_3 bb = points[(*it)[0]].bbox()+points[(*it)[1]].bbox()+points[(*it)[2]].bbox(); + return CGAL::Bbox_3(bb.xmin(),bb.ymin(),bb.zmin(),bb.xmax()+CGAL::to_double(d2),bb.ymax()+CGAL::to_double(d2),bb.zmax()+CGAL::to_double(d2)); + }; + + auto callback=[&](const CBox &ba, const CBox &bb){ + boost::container::small_vector &a = *(ba.handle()); + boost::container::small_vector &b = *(bb.handle()); + + std::sort(a.begin(), a.end()); + std::sort(b.begin(), b.end()); + std::vector v; + std::set_intersection(a.begin(), a.end(), b.begin(), b.end(),std::back_inserter(v)); + + if(v.size()!=0) //they have common vertices + return; + + nb_tested_pairs++; + if(nb_tested_pairs>1000000) + return; + + T tr1(points[a[0]], points[a[1]], points[a[2]]); + T tr2(points[b[0]], points[b[1]], points[b[2]]); + bool comp = K().compare_squared_distance_3_object()(tr1, tr2, d2)!=CGAL::LARGER; + if(comp) + { + nb_closed_pairs++; + } + }; + + for(Iterator it=triangles.begin(); it!=triangles.end(); ++it) + boxes.emplace_back(extend_bbox3(it, d2), it); + + CGAL::box_self_intersection_d(boxes.begin(), boxes.end(), callback); + } + + void run(std::string filename, FT d2) + { + nb_closed_pairs=0; + std::vector

      input_points; + std::vector> input_triangles; + + if (!CGAL::IO::read_polygon_soup(filename, input_points, input_triangles)) + { + std::cerr << "Cannot read " << filename << "\n"; + return; + } + CGAL::Real_timer t; + t.start(); + close_triangles(input_points, input_triangles, d2); + t.stop(); + std::cout << "#points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " has " << nb_closed_pairs << " pairs at squared distance " << d2 << " in " << t.time() << " sec." << std::endl; + } +}; + +int main(int argc, char** argv) +{ + const std::string filename = argc == 1 ? CGAL::data_file_path("meshes/elephant.off") + : std::string(argv[1]); + + // const std::string out_file = argc <= 2 ? "rounded_soup.off" + // : std::string(argv[2]); + + std::cout.precision(17); + std::cerr.precision(17); + + std::cout << "3D Distance bench" << std::endl; + + std::vector::Point_3> input_points; + std::vector> input_triangles; + + if (!CGAL::IO::read_polygon_soup(filename, input_points, input_triangles)) + { + std::cerr << "Cannot read " << filename << "\n"; + return 1; + } + CGAL::Bbox_3 bb = CGAL::bbox_3(input_points.begin(), input_points.end()); + double max= (std::max)((std::max)(bb.xmax()-bb.xmin(),bb.ymax()-bb.ymin()),bb.zmax()-bb.zmin()); + +// Test >().run(filename); +// Test >().run(filename); +// Test > >(r).run(); + + // Test >(r).run(); + + // Test().run(filename, max*max); + // Test().run(filename, 10*max*max/input_points.size()); + + double average_length=0; + double min_sq_length=CGAL::squared_distance(input_points[input_triangles[0][0]],input_points[input_triangles[0][1]]); + for(auto &tr: input_triangles){ + for(int i=0; i<3; ++i){ + double l=CGAL::squared_distance(input_points[tr[i]], input_points[tr[(i+1)%3]]); + min_sq_length=(std::min)(min_sq_length, l); + average_length+=std::sqrt(l); + } + } + average_length/=(3*input_triangles.size()); + + std::cout << "Simple_Cartesian" << std::endl; + Test >().run(filename, average_length*average_length/256); + Test >().run(filename, min_sq_length*4); + + // Equivalent to EPECK since there are only predicates + // Test().run(filename, 100*max/input_points.size()); + // std::cout << "EPICK" << std::endl; + // Test().run(filename, average_length*average_length/256); + // Test().run(filename, min_sq_length*4); + + std::cout << "EPECK" << std::endl; + Test().run(filename, average_length*average_length/256); + Test().run(filename, min_sq_length*4); + + std::cout << "Done!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Distance_3/include/CGAL/Distance_3/Line_3_Line_3.h b/Distance_3/include/CGAL/Distance_3/Line_3_Line_3.h index 03495be04fa..a27c6b7aaa6 100644 --- a/Distance_3/include/CGAL/Distance_3/Line_3_Line_3.h +++ b/Distance_3/include/CGAL/Distance_3/Line_3_Line_3.h @@ -45,17 +45,18 @@ squared_distance(const typename K::Line_3& line1, return squared_distance_to_plane(normal, diff, k); } -} // namespace internal - template -inline -typename K::FT -squared_distance(const Line_3& line1, - const Line_3& line2) +typename K::Comparison_result +compare_squared_distance(const typename K::Line_3& line1, + const typename K::Line_3& line2, + const K& k, + const typename K::FT& d2) { - return K().compute_squared_distance_3_object()(line1, line2); + return compare(squared_distance(line1,line2,k),d2); } +} // namespace internal + } // namespace CGAL #endif // CGAL_DISTANCE_3_LINE_3_LINE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Line_3_Plane_3.h b/Distance_3/include/CGAL/Distance_3/Line_3_Plane_3.h index 6bb4d125c59..df4a14ef8ed 100644 --- a/Distance_3/include/CGAL/Distance_3/Line_3_Plane_3.h +++ b/Distance_3/include/CGAL/Distance_3/Line_3_Plane_3.h @@ -61,26 +61,28 @@ squared_distance(const typename K::Plane_3& pl, return squared_distance(l, pl, k); } +template +inline typename K::Comparison_result +compare_squared_distance(const typename K::Line_3& l, + const typename K::Plane_3& pl, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(l, pl, k), d2); +} + +template +inline typename K::Comparison_result +compare_squared_distance(const typename K::Plane_3& pl, + const typename K::Line_3& l, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(l, pl, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Line_3& line, - const Plane_3& plane) -{ - return K().compute_squared_distance_3_object()(line, plane); -} - -template -inline -typename K::FT -squared_distance(const Plane_3& plane, - const Line_3& line) -{ - return K().compute_squared_distance_3_object()(plane, line); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_LINE_3_PLANE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Plane_3_Plane_3.h b/Distance_3/include/CGAL/Distance_3/Plane_3_Plane_3.h index d18fb366b7f..6331d938d82 100644 --- a/Distance_3/include/CGAL/Distance_3/Plane_3_Plane_3.h +++ b/Distance_3/include/CGAL/Distance_3/Plane_3_Plane_3.h @@ -39,17 +39,18 @@ squared_distance(const typename K::Plane_3& plane1, return sq_dist(plane1.point(), plane2); } -} // namespace internal - template -inline -typename K::FT -squared_distance(const Plane_3& plane1, - const Plane_3& plane2) +inline typename K::Comparison_result +compare_squared_distance(const typename K::Plane_3& plane1, + const typename K::Plane_3& plane2, + const K& k, + const typename K::FT& d2) { - return K().compute_squared_distance_3_object()(plane1, plane2); + return compare(squared_distance(plane1,plane2,k), d2); } +} // namespace internal + } // namespace CGAL #endif // CGAL_DISTANCE_3_PLANE_3_PLANE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Line_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Line_3.h index 0d1527c48a7..b265894c910 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Line_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Line_3.h @@ -66,26 +66,30 @@ squared_distance(const typename K::Line_3& line, return squared_distance(pt, line, k); } +template +inline +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Line_3& line, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(pt, line, k), d2); +} + +template +inline +typename K::Comparison_result +compare_squared_distance(const typename K::Line_3& line, + const typename K::Point_3& pt, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(pt, line, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Point_3& pt, - const Line_3& line) -{ - return K().compute_squared_distance_3_object()(pt, line); -} - -template -inline -typename K::FT -squared_distance(const Line_3& line, - const Point_3& pt) -{ - return K().compute_squared_distance_3_object()(line, pt); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_LINE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Plane_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Plane_3.h index 7544a72d963..921b13a446f 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Plane_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Plane_3.h @@ -48,26 +48,26 @@ squared_distance(const typename K::Plane_3& plane, return squared_distance(pt, plane, k); } -} // namespace internal - template -inline -typename K::FT -squared_distance(const Point_3& pt, - const Plane_3& plane) +inline typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Plane_3& plane, + const K& k, + const typename K::FT& d2) { - return K().compute_squared_distance_3_object()(pt, plane); + return compare(squared_distance(pt, plane, k), d2); } template -inline -typename K::FT -squared_distance(const Plane_3& plane, - const Point_3& pt) +inline typename K::Comparison_result +compare_squared_distance(const typename K::Plane_3& plane, + const typename K::Point_3& pt, + const K& k, + const typename K::FT& d2) { - return K().compute_squared_distance_3_object()(plane, pt); + return compare_squared_distance(pt, plane, k, d2); } -} // namespace CGAL +} } // namespace CGAL::internal #endif // CGAL_DISTANCE_3_POINT_3_PLANE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Point_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Point_3.h index 6b307e571c7..4d7de336e31 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Point_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Point_3.h @@ -32,17 +32,19 @@ squared_distance(const typename K::Point_3& pt1, return k.compute_squared_distance_3_object()(pt1, pt2); } -} // namespace internal - template inline -typename K::FT -squared_distance(const Point_3& pt1, - const Point_3& pt2) +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt1, + const typename K::Point_3& pt2, + const K& k, + const typename K::FT& d2) { - return internal::squared_distance(pt1, pt2, K()); + return compare(k.compute_squared_distance_3_object()(pt1, pt2), d2); } +} // namespace internal + } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_POINT_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Ray_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Ray_3.h index 7eff899b0eb..bb4195cbb75 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Ray_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Ray_3.h @@ -87,26 +87,28 @@ squared_distance(const typename K::Ray_3& ray, return squared_distance(pt, ray, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Ray_3& ray, + const K& k, + const typename K::FT &d2) +{ + return compare(squared_distance(pt, ray, k), d2); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Ray_3& ray, + const typename K::Point_3& pt, + const K& k, + const typename K::FT &d2) +{ + return compare_squared_distance(pt, ray, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Point_3& pt, - const Ray_3& ray) -{ - return K().compute_squared_distance_3_object()(pt, ray); -} - -template -inline -typename K::FT -squared_distance(const Ray_3& ray, - const Point_3& pt) -{ - return K().compute_squared_distance_3_object()(ray, pt); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_RAY_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Segment_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Segment_3.h index 554c0a58d2d..07f79bfd912 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Segment_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Segment_3.h @@ -79,6 +79,7 @@ squared_distance(const typename K::Point_3& pt, typedef typename K::Vector_3 Vector_3; typename K::Construct_vector_3 vector = k.construct_vector_3_object(); + typename K::Compute_squared_distance_3 sq_dist = k.compute_squared_distance_3_object(); // assert that the segment is valid (non zero length). const Vector_3 diff = vector(seg.source(), pt); @@ -90,7 +91,7 @@ squared_distance(const typename K::Point_3& pt, const RT e = wdot(segvec, segvec, k); if(wmult((K*)0, d, segvec.hw()) > wmult((K*)0, e, diff.hw())) - return squared_distance(pt, seg.target(), k); + return sq_dist(pt, seg.target()); // This is an expanded call to squared_distance_to_line() to avoid recomputing 'e' const Vector_3 wcr = wcross(segvec, diff, k); @@ -108,26 +109,30 @@ squared_distance(const typename K::Segment_3& seg, return squared_distance(pt, seg, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Segment_3& seg, + const K& k, + const typename K::FT& d2) +{ + //Doing an early exit was slower. + return compare(squared_distance(pt, seg, k), d2); +} + +template +inline +typename K::Comparison_result +compare_squared_distance(const typename K::Segment_3& seg, + const typename K::Point_3& pt, + const K& k, + const typename K::FT &d2) +{ + return compare_squared_distance(pt, seg, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Point_3& pt, - const Segment_3& seg) -{ - return K().compute_squared_distance_3_object()(pt, seg); -} - -template -inline -typename K::FT -squared_distance(const Segment_3& seg, - const Point_3& pt) -{ - return K().compute_squared_distance_3_object()(seg, pt); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_SEGMENT_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Tetrahedron_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Tetrahedron_3.h index 04d148818a3..031a60a6650 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Tetrahedron_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Tetrahedron_3.h @@ -43,10 +43,28 @@ squared_distance(const typename K::Point_3& pt, const Point_3& t2 = vertex(tet, 2); const Point_3& t3 = vertex(tet, 3); - bool dmin_initialized = false; + Orientation ori_tet = orientation(t0,t1,t2,t3); + + if(ori_tet==COPLANAR){ + //Degen Tetrahedron + //Get the minimum of three triangles (no need to test the fourth) + bool inside = false; + typename K::FT dmin = squared_distance_to_triangle(pt, t0, t1, t2, k, inside); + if(inside) + return dmin; + typename K::FT d = squared_distance_to_triangle(pt, t0, t1, t3, k, inside); + if(inside) + return d; + dmin=(std::min)(d,dmin); + d = squared_distance_to_triangle(pt, t0, t2, t3, k, inside); + return (std::min)(d,dmin); + } + + bool dmin_initialized = false; //dmin_initialized and !on_bounded_side have always the samed value typename K::FT dmin; bool inside = false; - if(orientation(t0,t1,t2, pt) == NEGATIVE) + + if(orientation(pt, t0,t1,t2) == ori_tet) { on_bounded_side = false; dmin = squared_distance_to_triangle(pt, t0, t1, t2, k, inside); @@ -55,7 +73,7 @@ squared_distance(const typename K::Point_3& pt, return dmin; } - if(orientation(t0,t3,t1, pt) == NEGATIVE) + if(orientation(pt, t0,t3,t1) == ori_tet) { on_bounded_side = false; const typename K::FT d = squared_distance_to_triangle(pt, t0, t3, t1, k, inside); @@ -73,7 +91,7 @@ squared_distance(const typename K::Point_3& pt, } } - if(orientation(t1,t3,t2, pt) == NEGATIVE) + if(orientation(pt, t1,t3,t2) == ori_tet) { on_bounded_side = false; const typename K::FT d = squared_distance_to_triangle(pt, t1, t3, t2, k, inside); @@ -91,7 +109,7 @@ squared_distance(const typename K::Point_3& pt, } } - if(orientation(t2,t3,t0, pt) == NEGATIVE) + if(orientation(pt, t2,t3,t0) == ori_tet) { on_bounded_side = false; const typename K::FT d = squared_distance_to_triangle(pt, t2, t3, t0, k, inside); @@ -125,24 +143,100 @@ squared_distance(const typename K::Tetrahedron_3& tet, return squared_distance(pt, tet, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Tetrahedron_3& tet, + const K& k, + const typename K::FT& d2) +{ + typedef typename K::Point_3 Point_3; + + typename K::Construct_vertex_3 vertex = k.construct_vertex_3_object(); + typename K::Orientation_3 orientation = k.orientation_3_object(); + + /* The content of this function is very similar with the one above, the difference is we can exit earlier if + we found a triangle closer than d or plane farther than d since we do not need the exact distance. + (there are also early exits in calling functions) */ + + bool on_bounded_side = true; + bool inside_or_far_to_the_plane = false; + const Point_3& t0 = vertex(tet, 0); + const Point_3& t1 = vertex(tet, 1); + const Point_3& t2 = vertex(tet, 2); + const Point_3& t3 = vertex(tet, 3); + + Orientation ori_tet = orientation(t0,t1,t2,t3); + + if(ori_tet==COPLANAR){ + //Degen Tetrahedron + //Get the minimum of three triangles (no need to test the fourth) + typename K::Comparison_result res = compare_squared_distance_to_triangle(pt, t0, t1, t2, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane) + return res; + typename K::Comparison_result temp_res = compare_squared_distance_to_triangle(pt, t0, t1, t3, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane) + return temp_res; + res=smaller_of(res,temp_res); + temp_res = compare_squared_distance_to_triangle(pt, t0, t2, t3, k, d2, inside_or_far_to_the_plane); + return smaller_of(res,temp_res); + } + + typename K::Comparison_result res=LARGER; + if(orientation(pt, t0,t1,t2) == ori_tet) + { + on_bounded_side = false; + res = compare_squared_distance_to_triangle(pt, t0, t1, t2, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane || res==SMALLER) + return res; + } + + if(orientation(pt, t0,t3,t1) == ori_tet) + { + on_bounded_side = false; + const typename K::Comparison_result temp_res = compare_squared_distance_to_triangle(pt, t0, t3, t1, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane || temp_res==SMALLER) + return temp_res; + res = smaller_of(res, temp_res); + } + + if(orientation(pt, t1,t3,t2) == ori_tet) + { + on_bounded_side = false; + const typename K::Comparison_result temp_res = compare_squared_distance_to_triangle(pt, t1, t3, t2, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane || temp_res==SMALLER) + return temp_res; + res = smaller_of(res, temp_res); + } + + if(orientation(pt, t2,t3,t0) == ori_tet) + { + on_bounded_side = false; + const typename K::Comparison_result temp_res = compare_squared_distance_to_triangle(pt, t2, t3, t0, k, d2, inside_or_far_to_the_plane); + if(inside_or_far_to_the_plane || temp_res==SMALLER) + return temp_res; + res = smaller_of(res, temp_res); + } + + if(on_bounded_side) + return compare(typename K::FT(0),d2); + + return res; +} + +template +inline +typename K::Comparison_result +compare_squared_distance(const typename K::Tetrahedron_3& tet, + const typename K::Point_3& pt, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(pt, tet, k, d2); +} + } // namespace internal -template -typename K::FT -squared_distance(const Tetrahedron_3& tet, - const Point_3& pt) -{ - return K().compute_squared_distance_3_object()(tet, pt); -} - -template -typename K::FT -squared_distance(const Point_3& pt, - const Tetrahedron_3& tet) -{ - return K().compute_squared_distance_3_object()(pt, tet); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_TETRAHEDRON_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Point_3_Triangle_3.h b/Distance_3/include/CGAL/Distance_3/Point_3_Triangle_3.h index 8b58e9a81a6..94c2f836990 100644 --- a/Distance_3/include/CGAL/Distance_3/Point_3_Triangle_3.h +++ b/Distance_3/include/CGAL/Distance_3/Point_3_Triangle_3.h @@ -69,7 +69,7 @@ squared_distance_to_triangle_RT(const typename K::Point_3& pt, if(normal == NULL_VECTOR) { // The case normal==NULL_VECTOR covers the case when the triangle - // is colinear, or even more degenerate. In that case, we can + // is collinear, or even more degenerate. In that case, we can // simply take also the distance to the three segments. squared_distance_RT(pt, segment(t2, t0), num, den, k); @@ -206,7 +206,7 @@ squared_distance_to_triangle(const typename K::Point_3& pt, if(normal == NULL_VECTOR) { // The case normal == NULL_VECTOR covers the case when the triangle - // is colinear, or even more degenerate. In that case, we can + // is collinear, or even more degenerate. In that case, we can // simply take also the distance to the three segments. // // Note that in the degenerate case, at most 2 edges cover the full triangle, @@ -292,26 +292,140 @@ squared_distance(const typename K::Triangle_3& t, return squared_distance(pt, t, k); } +template +typename K::Comparison_result +compare_squared_distance_to_triangle(const typename K::Point_3& pt, + const typename K::Point_3& t0, + const typename K::Point_3& t1, + const typename K::Point_3& t2, + const K& k, + const typename K::FT &d2, + bool& inside_or_far_to_the_plane) +{ + typedef typename K::Vector_3 Vector_3; + + typename K::Construct_segment_3 segment = k.construct_segment_3_object(); + typename K::Construct_vector_3 vector = k.construct_vector_3_object(); + typename K::Compare_squared_distance_3 csq_dist = k.compare_squared_distance_3_object(); + + /* The content of this function is very similar with the one above, the difference is we can exit earlier if + we found a segment closer than d or if the point is farther than d to the plane since we do not need the exact distance */ + + const Vector_3 e1 = vector(t0, t1); + const Vector_3 oe3 = vector(t0, t2); + const Vector_3 normal = wcross(e1, oe3, k); + + if(normal == NULL_VECTOR) + { + // The case normal == NULL_VECTOR covers the case when the triangle + // is collinear, or even more degenerate. In that case, we can + // simply take also the distance to the three segments. + // + // Note that in the degenerate case, at most 2 edges cover the full triangle, + // and only two distances could be used + typename K::Comparison_result res1 = csq_dist(pt, segment(t2, t0), d2); + if(certainly(res1 == SMALLER)) + return SMALLER; + typename K::Comparison_result res2 = csq_dist(pt, segment(t1, t2), d2); + return smaller_of(res1,res2); + } + + // Compare first the distance to the plane, if larger we can exit early + typename K::Comparison_result res_p_pl = compare(squared_distance_to_plane(normal, vector(t0, pt), k), d2); + if(certainly(res_p_pl==LARGER)) + { + inside_or_far_to_the_plane=true; + return LARGER; + } + + //If we are smaller when compare to a segment, we can exit early + if(!on_left_of_triangle_edge(pt, normal, t0, t1, k)) + { + typename K::Comparison_result res_p_s1 = csq_dist(pt, segment(t0, t1), d2); + if(certainly(res_p_s1==SMALLER)) + return SMALLER; + if(!on_left_of_triangle_edge(pt, normal, t1, t2, k)) + { + // can't be to the right of all three segments + typename K::Comparison_result res_p_s2 = csq_dist(pt, segment(t1, t2), d2); + return smaller_of(res_p_s1, res_p_s2); + } + else // on_left_of_triangle_edge(pt, normal, t1, t2, k) + { + if(!on_left_of_triangle_edge(pt, normal, t2, t0, k)) + { + typename K::Comparison_result res_p_s3 = csq_dist(pt, segment(t2, t0), d2); + return smaller_of(res_p_s1, res_p_s3); + } + else // on_left_of_triangle_edge(pt, normal, t2, t0, k) + { + return res_p_s1; + } + } + } + else // on_left_of_triangle_edge(pt, normal, t0, t1, k) + { + if(!on_left_of_triangle_edge(pt, normal, t1, t2, k)) + { + typename K::Comparison_result res_p_s2 = csq_dist(pt, segment(t1, t2), d2); + if(certainly(res_p_s2 == SMALLER)) + return SMALLER; + if(!on_left_of_triangle_edge(pt, normal, t2, t0, k)) + { + typename K::Comparison_result res_p_s3 = csq_dist(pt, segment(t2, t0), d2); + return smaller_of(res_p_s2, res_p_s3); + } + else // on_left_of_triangle_edge(pt, normal, t2, t0, k) + { + return res_p_s2; + } + } + else // on_left_of_triangle_edge(pt, normal, t1, t2, k) + { + if(!on_left_of_triangle_edge(pt, normal, t2, t0, k)) + { + return csq_dist(pt, segment(t2, t0), d2); + } + else // on_left_of_triangle_edge(pt, normal, t2, t0, k) + { + inside_or_far_to_the_plane = true; + return res_p_pl; + } + } + } +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Point_3& pt, + const typename K::Triangle_3& t, + const K& k, + const typename K::FT& d2) +{ + typename K::Construct_vertex_3 vertex = k.construct_vertex_3_object(); + + bool unused_inside_or_far_to_the_plane = false; + return compare_squared_distance_to_triangle(pt, + vertex(t, 0), + vertex(t, 1), + vertex(t, 2), + k, + d2, + unused_inside_or_far_to_the_plane); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Triangle_3& t, + const typename K::Point_3& pt, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(pt, t, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Point_3& pt, - const Triangle_3& t) -{ - return K().compute_squared_distance_3_object()(pt, t); -} - -template -inline -typename K::FT -squared_distance(const Triangle_3& t, - const Point_3& pt) -{ - return K().compute_squared_distance_3_object()(t, pt); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_POINT_3_TRIANGLE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Ray_3_Line_3.h b/Distance_3/include/CGAL/Distance_3/Ray_3_Line_3.h index d4b51b59cbe..ed431f63128 100644 --- a/Distance_3/include/CGAL/Distance_3/Ray_3_Line_3.h +++ b/Distance_3/include/CGAL/Distance_3/Ray_3_Line_3.h @@ -77,26 +77,28 @@ squared_distance(const typename K::Line_3& line, return squared_distance(ray, line, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Ray_3& ray, + const typename K::Line_3& line, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(ray, line, k), d2); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Line_3& line, + const typename K::Ray_3& ray, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(ray, line, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Line_3& line, - const Ray_3& ray) -{ - return K().compute_squared_distance_3_object()(line, ray); -} - -template -inline -typename K::FT -squared_distance(const Ray_3& ray, - const Line_3& line) -{ - return K().compute_squared_distance_3_object()(ray, line); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_RAY_3_LINE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Ray_3_Plane_3.h b/Distance_3/include/CGAL/Distance_3/Ray_3_Plane_3.h index bdc9a956146..eb2a4810a32 100644 --- a/Distance_3/include/CGAL/Distance_3/Ray_3_Plane_3.h +++ b/Distance_3/include/CGAL/Distance_3/Ray_3_Plane_3.h @@ -72,26 +72,28 @@ squared_distance(const typename K::Plane_3& plane, return squared_distance(ray, plane, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Ray_3& ray, + const typename K::Plane_3& plane, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(ray, plane, k), d2); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Plane_3& plane, + const typename K::Ray_3& ray, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(ray, plane, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Ray_3& ray, - const Plane_3& plane) -{ - return K().compute_squared_distance_3_object()(ray, plane); -} - -template -inline -typename K::FT -squared_distance(const Plane_3& plane, - const Ray_3& ray) -{ - return K().compute_squared_distance_3_object()(plane, ray); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_RAY_3_PLANE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Ray_3_Ray_3.h b/Distance_3/include/CGAL/Distance_3/Ray_3_Ray_3.h index 8ca1eca308c..9367e095e92 100644 --- a/Distance_3/include/CGAL/Distance_3/Ray_3_Ray_3.h +++ b/Distance_3/include/CGAL/Distance_3/Ray_3_Ray_3.h @@ -117,6 +117,16 @@ squared_distance(const typename K::Ray_3& ray1, } } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Ray_3& ray1, + const typename K::Ray_3& ray2, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(ray1, ray2, k), d2); +} + } // namespace internal template @@ -129,15 +139,6 @@ ray_ray_squared_distance_parallel(const Vector_3& ray1dir, return internal::ray_ray_squared_distance_parallel(ray1dir, ray2dir, s1_min_s2, K()); } -template -inline -typename K::FT -squared_distance(const Ray_3& ray1, - const Ray_3& ray2) -{ - return K().compute_squared_distance_3_object()(ray1, ray2); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_RAY_3_RAY_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Segment_3_Line_3.h b/Distance_3/include/CGAL/Distance_3/Segment_3_Line_3.h index 5781c5ceb74..f5d3336b5d6 100644 --- a/Distance_3/include/CGAL/Distance_3/Segment_3_Line_3.h +++ b/Distance_3/include/CGAL/Distance_3/Segment_3_Line_3.h @@ -38,6 +38,8 @@ squared_distance(const typename K::Segment_3& seg, typename K::Construct_vector_3 vector = k.construct_vector_3_object(); typename K::Compute_squared_distance_3 sq_dist = k.compute_squared_distance_3_object(); + //Probably writable with less if than currently + const Point_3& linepoint = line.point(); const Point_3& start = seg.source(); const Point_3& end = seg.target(); @@ -60,26 +62,12 @@ squared_distance(const typename K::Segment_3& seg, const RT sdm_ss2l = wdot(perpend2line, start_min_lp, k); const RT sdm_se2l = wdot(perpend2line, end_min_lp, k); - if(sdm_ss2l < RT(0)) { - crossing = (sdm_se2l >= RT(0)); - } else { - if(sdm_se2l <= RT(0)) { - crossing = true; - } else { - crossing = (sdm_ss2l == RT(0)); - } - } + crossing = (sdm_ss2l*sdm_se2l) <= RT(0); - if(crossing) { + if(crossing) return squared_distance_to_plane(normal, start_min_lp, k); - } else { - const RT dm = distance_measure_sub(sdm_ss2l, sdm_se2l, start_min_lp, end_min_lp, k); - if(dm <= RT(0)) { - return squared_distance_to_line(linedir, start_min_lp, k); - } else { - return squared_distance_to_line(linedir, end_min_lp, k); - } - } + else + return min(squared_distance_to_line(linedir, start_min_lp, k), squared_distance_to_line(linedir, end_min_lp, k)); } template @@ -91,25 +79,29 @@ squared_distance(const typename K::Line_3& line, return squared_distance(seg, line, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Segment_3& seg, + const typename K::Line_3& line, + const K& k, + const typename K::FT& d2) +{ + // Perform an early exit was slower + return compare(squared_distance(seg, line, k), d2); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Line_3& line, + const typename K::Segment_3& seg, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(seg, line, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Segment_3& seg, - const Line_3& line) -{ - return K().compute_squared_distance_3_object()(seg, line); -} - -template -inline -typename K::FT -squared_distance(const Line_3& line, - const Segment_3& seg) -{ - return K().compute_squared_distance_3_object()(line, seg); -} } // namespace CGAL diff --git a/Distance_3/include/CGAL/Distance_3/Segment_3_Plane_3.h b/Distance_3/include/CGAL/Distance_3/Segment_3_Plane_3.h index 1c8d6799556..4b46049940c 100644 --- a/Distance_3/include/CGAL/Distance_3/Segment_3_Plane_3.h +++ b/Distance_3/include/CGAL/Distance_3/Segment_3_Plane_3.h @@ -37,12 +37,13 @@ squared_distance(const typename K::Segment_3 &seg, typedef typename K::Point_3 Point_3; typename K::Construct_vector_3 vector = k.construct_vector_3_object(); + typename K::Compute_squared_distance_3 sq_dist = k.compute_squared_distance_3_object(); const Point_3& start = seg.start(); const Point_3& end = seg.end(); if (start == end) - return squared_distance(start, plane, k); + return sq_dist(start, plane); const Point_3& planepoint = plane.point(); const Vector_3 start_min_pp = vector(planepoint, start); @@ -83,26 +84,28 @@ squared_distance(const typename K::Plane_3& plane, return squared_distance(seg, plane, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Segment_3 &seg, + const typename K::Plane_3 &plane, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(seg, plane, k), d2); +} + +template +inline typename K::Comparison_result +compare_squared_distance(const typename K::Plane_3& plane, + const typename K::Segment_3& seg, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(seg, plane, k, d2); +} + } // namespace internal -template -inline -typename K::FT -squared_distance(const Segment_3& seg, - const Plane_3& plane) -{ - return K().compute_squared_distance_3_object()(seg, plane); -} - -template -inline -typename K::FT -squared_distance(const Plane_3& plane, - const Segment_3& seg) -{ - return K().compute_squared_distance_3_object()(plane, seg); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_SEGMENT_3_PLANE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Segment_3_Ray_3.h b/Distance_3/include/CGAL/Distance_3/Segment_3_Ray_3.h index 5943630d76f..d35fda6d08b 100644 --- a/Distance_3/include/CGAL/Distance_3/Segment_3_Ray_3.h +++ b/Distance_3/include/CGAL/Distance_3/Segment_3_Ray_3.h @@ -73,6 +73,8 @@ squared_distance(const typename K::Segment_3& seg, const Point_3& ss = seg.source(); const Point_3& se = seg.target(); + //TODO This seems complicated compared to Segment_3_Segment_3.h. Consider improving by adapting Lumelsky's method for segment-segment intersection. + if(ss == se) return sq_dist(ss, ray); @@ -166,6 +168,26 @@ squared_distance(const typename K::Ray_3& ray, return squared_distance(seg, ray, k); } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Ray_3& ray, + const typename K::Segment_3& seg, + const K& k, + const typename K::FT& d2) +{ + return compare(squared_distance(ray, seg, k), d2); +} + +template +typename K::Comparison_result +compare_squared_distance(const typename K::Segment_3& seg, + const typename K::Ray_3& ray, + const K& k, + const typename K::FT& d2) +{ + return compare_squared_distance(ray, seg, k, d2); +} + } // namespace internal template @@ -177,24 +199,6 @@ squared_distance_parallel(const Segment_3& seg, return internal::squared_distance_parallel(ray, seg, K()); } -template -inline -typename K::FT -squared_distance(const Segment_3& seg, - const Ray_3& ray) -{ - return K().compute_squared_distance_3_object()(seg, ray); -} - -template -inline -typename K::FT -squared_distance(const Ray_3& ray, - const Segment_3& seg) -{ - return K().compute_squared_distance_3_object()(ray, seg); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_SEGMENT_3_RAY_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Segment_3_Segment_3.h b/Distance_3/include/CGAL/Distance_3/Segment_3_Segment_3.h index ad933787204..8967e982a79 100644 --- a/Distance_3/include/CGAL/Distance_3/Segment_3_Segment_3.h +++ b/Distance_3/include/CGAL/Distance_3/Segment_3_Segment_3.h @@ -59,14 +59,6 @@ squared_distance(const typename K::Segment_3& s1, const Vector_3 v1 = cv(p1, q1), v2 = cv(p2, q2); const Vector_3 p1p2 = cv(p1, p2); - // @todo compute these only when needed? - const FT a = sp(v1, v1); - const FT b = - sp(v1, v2); - const FT c = - b; - const FT d = - sp(v2, v2); - const FT e = sp(v1, p1p2); - const FT f = sp(v2, p1p2); - if(p1 == q1) { if(p2 == q2) @@ -77,6 +69,9 @@ squared_distance(const typename K::Segment_3& s1, return res; } + const FT d = - sp(v2, v2); + const FT f = sp(v2, p1p2); + CGAL_assertion(d < 0); res.x = 0; @@ -87,6 +82,9 @@ squared_distance(const typename K::Segment_3& s1, } else if(p2 == q2) { + const FT a = sp(v1, v1); + const FT e = sp(v1, p1p2); + CGAL_assertion(a > 0); res.y = 0; @@ -96,10 +94,17 @@ squared_distance(const typename K::Segment_3& s1, return res; } + const FT a = sp(v1, v1); + const FT b = - sp(v1, v2); + const FT c = - b; + const FT d = - sp(v2, v2); + const FT e = sp(v1, p1p2); + const FT f = sp(v2, p1p2); + CGAL_assertion(a > 0 && d < 0); const FT det = a*d - b*c; - if(det == 0) + if(is_zero(det)) res.x = 0; else res.x = boost::algorithm::clamp((e*d - b*f) / det, 0, 1); @@ -183,26 +188,102 @@ squared_distance(const typename K::Segment_3& seg1, return res.squared_distance; } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Segment_3& s1, + const typename K::Segment_3& s2, + const K& k, + const typename K::FT& d2) +{ + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + typedef typename K::Vector_3 Vector_3; + + typename K::Construct_vertex_3 vertex = k.construct_vertex_3_object(); + typename K::Construct_vector_3 cv = k.construct_vector_3_object(); + typename K::Compute_scalar_product_3 sp = k.compute_scalar_product_3_object(); + typename K::Compute_squared_distance_3 sq_dist = k.compute_squared_distance_3_object(); + typename K::Compare_squared_distance_3 csq_dist = k.compare_squared_distance_3_object(); + + /* The content of this function is very similar with the one above, the difference is we can exit earlier if + the supporting line are farther than d since we do not need the exact distance. */ + +#if 1 + const Point_3& p1 = vertex(s1, 0); + const Point_3& q1 = vertex(s1, 1); + const Point_3& p2 = vertex(s2, 0); + const Point_3& q2 = vertex(s2, 1); + const Vector_3 v1 = cv(p1, q1), v2 = cv(p2, q2); + const Vector_3 p1p2 = cv(p1, p2); + + // If degenerate segment, compare the distance between the point and the other segment + if(p1 == q1) + if(p2 == q2) + return csq_dist(p1,p2,d2); + else + return csq_dist(p1,s2,d2); + else if(p2 == q2) + return csq_dist(s1,p2,d2); + + // Compare first the distance between the lines, if larger we can exit early + typename K::Comparison_result res_ll=csq_dist(s1.supporting_line(), s2.supporting_line(), d2); + if(certainly(res_ll==LARGER)) + return LARGER; + + // Compute the distance between the segments + // TODO some factorization with above function? only the last case is different + + const FT a = sp(v1, v1); + const FT b = - sp(v1, v2); + const FT c = - b; + const FT d = - sp(v2, v2); + const FT e = sp(v1, p1p2); + const FT f = sp(v2, p1p2); + + CGAL_assertion(a > 0 && d < 0); + const FT det = a*d - b*c; + FT res_x; + if(is_zero(det)) + res_x = 0; + else + res_x = boost::algorithm::clamp((e*d - b*f) / det, 0, 1); + + FT xc = res_x*c; + // res.y = (f - xc) / d, by definition, but building it up more efficiently + if(f > xc) // y < 0 <=> f - xc / d < 0 <=> f - xc > 0 (since d is -||v2||) + { + // res_y = 0; + res_x = boost::algorithm::clamp(e/a, 0, 1); // (e + y*c) / a + return compare(sq_dist(p1+res_x*v1,p2), d2); + } + else // y >= 0 + { + FT n = f - xc; // delay the division by d + if(n < d) // y > 1 <=> n / d > 1 <=> n < d (once again, important to note that d is negative!) + { + // res_y = 1; + res_x = boost::algorithm::clamp((e + c) / a, 0, 1); // (e + y*c) / a + return compare(sq_dist(p1+res_x*v1,p2+v2), d2); + } + else if(res_x==0 || res_x==1) // 0 <= y <= 1 + { + FT res_y = n / d; + return compare(sq_dist(p1 + res_x*v1, p2 + res_y*v2), d2); + } + else + { + //Already computed by distance line line + return res_ll; + } + } +#else + // Faster with Simple_cartesian, a bit slower with EPICK or EPECK specifically if d2 is small + return compare(squared_distance(s1, s2 ,k), d2); +#endif +} + } // namespace internal -template -inline -typename K::FT -squared_distance_parallel(const Segment_3& seg1, - const Segment_3& seg2) -{ - return internal::squared_distance_parallel(seg1, seg2, K()); -} - -template -inline -typename K::FT -squared_distance(const Segment_3& seg1, - const Segment_3& seg2) -{ - return K().compute_squared_distance_3_object()(seg1, seg2); -} - } // namespace CGAL #endif // CGAL_DISTANCE_3_SEGMENT_3_SEGMENT_3_H diff --git a/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h b/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h index f6bf77fd39b..9bf27fb6c2a 100644 --- a/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h +++ b/Distance_3/include/CGAL/Distance_3/Triangle_3_Triangle_3.h @@ -213,17 +213,65 @@ squared_distance(const typename K::Triangle_3& tr1, #endif } -} // namespace internal - -template -inline -typename K::FT -squared_distance(const Triangle_3& tr1, - const Triangle_3& tr2) +template +typename K::Comparison_result +compare_squared_distance_disjoint(const typename K::Triangle_3& tr1, + const typename K::Triangle_3& tr2, + const K& k, + const typename K::FT& d2) { - return K().compute_squared_distance_3_object()(tr1, tr2); + typedef typename K::Segment_3 Segment_3; + + typename K::Construct_vertex_3 vertex = k.construct_vertex_3_object(); + typename K::Compare_squared_distance_3 csq_dist = k.compare_squared_distance_3_object(); + + typename K::Comparison_result res(LARGER); + + // The tiangle are supposed to be disjoint + assert(!do_intersect(tr1, tr2)); + + for(int i=0; i<3; ++i) + { + //Compare the distance between edges + for(int j=0; j<3; ++j) + { + typename K::Comparison_result temp_res_ss=csq_dist(Segment_3(vertex(tr1, i%3), vertex(tr1, (i+1)%3)),Segment_3(vertex(tr2, j%3), vertex(tr2, (j+1)%3)),d2); + if(certainly(temp_res_ss==SMALLER)) + return SMALLER; + res=smaller_of(res, temp_res_ss); + } + + //Compare the distance between vertices and triangles + typename K::Comparison_result temp_res_v_pl= csq_dist(vertex(tr1, i), tr2,d2); + if(certainly(temp_res_v_pl==SMALLER)) + return SMALLER; + res=smaller_of(res, temp_res_v_pl); + + temp_res_v_pl= csq_dist(vertex(tr2, i), tr1,d2); + if(certainly(temp_res_v_pl==SMALLER)) + return SMALLER; + res=smaller_of(res, temp_res_v_pl); + } + return res; + } +template +typename K::Comparison_result +compare_squared_distance(const typename K::Triangle_3& tr1, + const typename K::Triangle_3& tr2, + const K& k, + const typename K::FT& d2){ + //TODO did something more intelligent (sq_dist and csq_dist does not exist for Segment-Triangle) + if(tr1.is_degenerate() || tr2.is_degenerate()) + return compare(squared_distance(tr1,tr2, k), d2); + if(do_intersect(tr1, tr2)) + return compare(typename K::FT(0), d2); + return compare_squared_distance_disjoint(tr1, tr2, k, d2); +} + +} // namespace internal + } // namespace CGAL #endif // CGAL_DISTANCE_3_TRIANGLE_3_TRIANGLE_3_H diff --git a/Distance_3/include/CGAL/Distance_3/internal/squared_distance_utils_3.h b/Distance_3/include/CGAL/Distance_3/internal/squared_distance_utils_3.h index 7dbf82e246e..260301cf8b1 100644 --- a/Distance_3/include/CGAL/Distance_3/internal/squared_distance_utils_3.h +++ b/Distance_3/include/CGAL/Distance_3/internal/squared_distance_utils_3.h @@ -23,9 +23,35 @@ #include #include +#include + namespace CGAL { namespace internal { +inline +Comparison_result smaller_of(const Comparison_result& a, const Comparison_result& b) +{ + return (std::min)(a,b); +} + +inline +Uncertain smaller_of(const Uncertain& a, const Uncertain& b) +{ + return Uncertain((std::min)(a.inf(),b.inf()), (std::min)(a.sup(),b.sup())); +} + +inline +Uncertain smaller_of(const Uncertain& a, const Comparison_result& b) +{ + return smaller_of(a,make_uncertain(b)); +} + +inline +Uncertain smaller_of(const Comparison_result& a, const Uncertain& b) +{ + return smaller_of(make_uncertain(a),b); +} + template bool is_null(const typename K::Vector_3 &v, const K&) { @@ -39,7 +65,10 @@ wdot(const typename K::Vector_3 &u, const typename K::Vector_3 &v, const K&) { - return (u.hx()*v.hx() + u.hy()*v.hy() + u.hz()*v.hz()); + if constexpr(std::is_same_v) + return std::fma(u.hx(), v.hx(), std::fma(u.hy(), v.hy(), u.hz()*v.hz())); + else + return (u.hx()*v.hx() + u.hy()*v.hy() + u.hz()*v.hz()); } template @@ -84,6 +113,26 @@ wdot(const typename K::Point_3 &p, return wdot_tag(p, q, r, k, tag); } +inline +double diff_of_products(const double a, const double b, const double c, const double d) +{ +// Kahan method, less numerical error +#if 1 + double w = d * c; + double e = std::fma(c, -d, w); + double f = std::fma(a, b, -w); + return f + e; +#else + return std::fma(a, b, -c*d); +#endif +} + +template +OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d, std::enable_if_t>* = 0) +{ + return a*b - c*d; +} + template typename K::Vector_3 wcross(const typename K::Vector_3 &u, @@ -92,9 +141,9 @@ wcross(const typename K::Vector_3 &u, { typedef typename K::Vector_3 Vector_3; return Vector_3( - u.hy()*v.hz() - u.hz()*v.hy(), - u.hz()*v.hx() - u.hx()*v.hz(), - u.hx()*v.hy() - u.hy()*v.hx()); + diff_of_products(u.hy(),v.hz(),u.hz(),v.hy()), + diff_of_products(u.hz(),v.hx(),u.hx(),v.hz()), + diff_of_products(u.hx(),v.hy(),u.hy(),v.hx())); } template @@ -221,6 +270,16 @@ squared_distance_to_line(const typename K::Vector_3& dir, return Rational_traits().make_rational(num, den); } +template +typename K::Comparison_result +compare_squared_distance_to_line(const typename K::Vector_3& dir, + const typename K::Vector_3& diff, + const K& k, + const typename K::FT &d2) +{ + return compare(squared_distance_to_line(dir,diff,k),d2); +} + template inline bool diff --git a/Distance_3/include/CGAL/global_functions_distance_3.h b/Distance_3/include/CGAL/global_functions_distance_3.h new file mode 100644 index 00000000000..388867ae697 --- /dev/null +++ b/Distance_3/include/CGAL/global_functions_distance_3.h @@ -0,0 +1,109 @@ +// Copyright (c) 2025 +// GeometryFactory (France), +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Léo Valque + +#ifndef CGAL_KERNEL_GLOBAL_FUNCTIONS_DISTANCE_3_H +#define CGAL_KERNEL_GLOBAL_FUNCTIONS_DISTANCE_3_H + +// Distance functions calling the kernel functor. + +#define CGAL_SQUARED_DISTANCE_FUNCTION(A, B) \ +template \ +inline \ +typename K::FT \ +squared_distance(const A& a, const B& b) \ +{ \ + return K().compute_squared_distance_3_object()(a, b); \ +} \ +template \ +inline \ +typename K::FT \ +squared_distance(const B& a, const A& b) \ +{ \ + return K().compute_squared_distance_3_object()(b, a); \ +} + +#define CGAL_SQUARED_DISTANCE_FUNCTION_SELF(A) \ +template \ +inline \ +typename K::FT \ +squared_distance(const A& a, const A& b) \ +{ \ + return K().compute_squared_distance_3_object()(a, b); \ +} + +#define CGAL_COMPARE_SQUARED_DISTANCE_FUNCTION(A, B) \ +template \ +inline \ +typename K::Comparison_result \ +compare_squared_distance(const A& a, \ + const B& b, \ + const typename K::FT& d2) \ +{ \ + return K().compare_squared_distance_3_object()(a, b, d2); \ +} \ +template \ +inline \ +typename K::Comparison_result \ +compare_squared_distance(const B& b, \ + const A& a, \ + const typename K::FT& d2) \ +{ \ + return K().compare_squared_distance_3_object()(b, a, d2); \ +} + +#define CGAL_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(A) \ +template \ +inline \ +typename K::Comparison_result \ +compare_squared_distance(const A& a, \ + const A& b, \ + const typename K::FT& d2) \ +{ \ + return K().compare_squared_distance_3_object()(a, b, d2); \ +} + +#define CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(A) \ +CGAL_SQUARED_DISTANCE_FUNCTION_SELF(A) \ +CGAL_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(A) + +#define CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(A, B) \ +CGAL_SQUARED_DISTANCE_FUNCTION(A, B) \ +CGAL_COMPARE_SQUARED_DISTANCE_FUNCTION(A, B) + +namespace CGAL { + +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Point_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Line_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Ray_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Segment_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Triangle_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION_SELF(Plane_3) + +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Line_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Ray_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Segment_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Plane_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Triangle_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Point_3, Tetrahedron_3) + +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Line_3, Plane_3) + +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Ray_3, Line_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Ray_3, Plane_3) + +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Segment_3, Line_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Segment_3, Ray_3) +CGAL_COMPUTE_AND_COMPARE_SQUARED_DISTANCE_FUNCTION(Segment_3, Plane_3) + +} //namespace CGAL + +#endif // CGAL_KERNEL_GLOBAL_FUNCTIONS_DISTANCE_3_H diff --git a/Distance_3/include/CGAL/squared_distance_3.h b/Distance_3/include/CGAL/squared_distance_3.h index 69436bbe6dc..f2e51c4b51f 100644 --- a/Distance_3/include/CGAL/squared_distance_3.h +++ b/Distance_3/include/CGAL/squared_distance_3.h @@ -20,9 +20,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -45,4 +45,6 @@ #include +#include + #endif // CGAL_DISTANCE_3_H diff --git a/Distance_3/test/Distance_3/test_compare_distance_3.cpp b/Distance_3/test/Distance_3/test_compare_distance_3.cpp new file mode 100644 index 00000000000..fbf0ecb32b4 --- /dev/null +++ b/Distance_3/test/Distance_3/test_compare_distance_3.cpp @@ -0,0 +1,785 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +// #define CGAL_USE_GTE_AS_SANITY_CHECK +#ifdef CGAL_USE_GTE_AS_SANITY_CHECK +#include +#include +#endif + +#include +#include + +struct randomint +{ + randomint() ; + int get() const { return sequence[cur]; } + int next() { + cur = (cur + 1) % 11; + return get(); + } + +private: + int sequence[11]; + int cur; +}; + +inline randomint::randomint() +{ + cur = 0; + sequence[0] = 19; + sequence[1] = 5; + sequence[2] = 17; + sequence[3] = 13; + sequence[4] = 29; + sequence[5] = 2; + sequence[6] = 23; + sequence[7] = 31; + sequence[8] = 3; + sequence[9] = 37; + sequence[10] = 11; +} + +randomint ri; + +template +struct Test +{ + typedef typename K::RT RT; + typedef typename K::FT FT; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_3 P; + typedef typename K::Segment_3 S; + typedef typename K::Vector_3 V; + typedef typename K::Ray_3 R; + typedef typename K::Line_3 L; + typedef typename K::Triangle_3 T; + typedef typename K::Plane_3 Pl; + typedef typename K::Tetrahedron_3 Tet; + typedef typename K::Iso_cuboid_3 Cub; + +private: + CGAL::Random& r; + const double epsilon = 1e-14; + int N = 10; + double m = 0, M = 1; + +public: + Test(CGAL::Random& r, const double epsilon) : r(r), epsilon(epsilon) { } + +private: + inline RT to_nt(int d) const { return RT(d); } + + P p(int x, int y, int z) + { + int w = ri.next(); + return P(to_nt(x*w), to_nt(y*w), to_nt(z*w), to_nt(w)); + } + + P random_point() const + { + return P(FT(r.get_double(m, M)), FT(r.get_double(m, M)), FT(r.get_double(m, M))); + } + + Pl pl(int a, int b, int c, int d) + { + int w = ri.next(); + return Pl(to_nt(a*w), to_nt(b*w), to_nt(c*w), to_nt(d*w)); + } + +private: + template + bool are_equal(const Type& t1, const Type& t2, const bool verbose = true) + { + const FT diff = CGAL::abs(t1 - t2); + if(diff > std::numeric_limits::epsilon() && + diff > epsilon * (CGAL::abs(t1) + CGAL::abs(t2))) + { + if(verbose) + { + std::cerr << "Approximate comparison failed (t1|t2): got " << t1 << " but expected " << t2 << std::endl; + std::cerr << "Diff: " << CGAL::abs(t1 - t2) << " vs eps: " << epsilon * (CGAL::abs(t1) + CGAL::abs(t2)) << std::endl; + } + return false; + } + + return true; + } + + void do_intersect_check(const P&, const P&) { } + + template + void do_intersect_check(const P& p, const O2& o2) + { + if(!o2.is_degenerate() && CGAL::do_intersect(p, o2)) + { + assert(are_equal(CGAL::squared_distance(p, o2), FT(0))); + assert(are_equal(CGAL::squared_distance(o2, p), FT(0))); + } + } + + template + void do_intersect_check(const O1& o1, const O2& o2) + { + if(!o1.is_degenerate() && !o2.is_degenerate() && CGAL::do_intersect(o1, o2)) + { + assert(are_equal(CGAL::squared_distance(o1, o2), FT(0))); + assert(are_equal(CGAL::squared_distance(o2, o1), FT(0))); + } + } + + template + void check_compare_squared_distance(const O1& o1, const O2& o2, const FT& expected_result) + { + // const FT res_o1o2 = K().compare_squared_distance_3_object()(o1, o2, expected_result); + // const FT res_o2o1 = K().compare_squared_distance_3_object()(o2, o1, expected_result); + + // std::cout << std::endl << "Test" << std::endl; + + // std::cout << o1 << std::endl << o2 << std::endl; + // std::cout << CGAL::squared_distance(o1, o2) << " " << expected_result << std::endl; + // std::cout << CGAL::SMALLER << CGAL::EQUAL << CGAL::LARGER << std::endl; + // std::cout << CGAL::compare_squared_distance(o1, o2, expected_result) << std::endl; + + const bool res_e_o1o2 = (CGAL::compare_squared_distance(o1, o2, expected_result) == CGAL::EQUAL); + const bool res_e_o2o1 = (CGAL::compare_squared_distance(o2, o1, expected_result) == CGAL::EQUAL); + const bool res_s_o1o2 = (CGAL::compare_squared_distance(o1, o2, expected_result*(1+epsilon)+1) == CGAL::SMALLER); + const bool res_s_o2o1 = (CGAL::compare_squared_distance(o2, o1, expected_result*(1+epsilon)+1) == CGAL::SMALLER); + const bool res_l_o1o2 = (CGAL::compare_squared_distance(o1, o2, expected_result*(1-epsilon)-1) == CGAL::LARGER); + const bool res_l_o2o1 = (CGAL::compare_squared_distance(o2, o1, expected_result*(1-epsilon)-1) == CGAL::LARGER); + + // The equal result is guaranteed only on exact construction kernel + if(epsilon==0) + { + assert(res_e_o1o2); + assert(res_e_o2o1); + } + assert(res_s_o1o2); + assert(res_s_o2o1); + assert(res_l_o1o2); + assert(res_l_o2o1); + } + + template + void check_compare_squared_distance_with_bound(const O1& o1, const O2& o2, const FT& upper_bound) + { + // const FT res_o1o2 = K().compare_squared_distance_3_object()(o1, o2, expected_result); + // const FT res_o2o1 = K().compare_squared_distance_3_object()(o2, o1, expected_result); + + const FT up = upper_bound * (1 + epsilon) + std::numeric_limits::epsilon(); + + const bool res_o1o2 = (CGAL::compare_squared_distance(o1, o2, up) != CGAL::LARGER); + const bool res_o2o1 = (CGAL::compare_squared_distance(o2, o1, up) != CGAL::LARGER); + + assert(res_o1o2); + assert(res_o2o1); + } + +private: + void P_P() + { + std::cout << "Point - Point" << std::endl; + check_compare_squared_distance(p(0, 0, 0), p(0, 0, 0), 0); + check_compare_squared_distance(p(3, 5, 7), p(0, 0, 0), 83); + } + + void P_S() + { + std::cout << "Point - Segment" << std::endl; + check_compare_squared_distance(p(0, 1, 2), S{p(-3, 0, 0), p( 2, 0, 0)}, 5); + check_compare_squared_distance(p(0, 1, 2), S{p( 3, 0, 0), p( 2, 0, 0)}, 9); + check_compare_squared_distance(p(0, 1, 2), S{p( 2, 0, 0), p( 3, 0, 0)}, 9); + check_compare_squared_distance(p(6, 1, 2), S{p( 2, 0, 0), p( 3, 0, 0)}, 14); + } + + void P_T() + { + std::cout << "Point - Triangle" << std::endl; + check_compare_squared_distance(p(0, 1, 2), T{p(0, 0, 0), p(2, 0, 0), p(0, 2, 0)}, 4); + + T t(p(0,0,0), p(3,0,0), p(3,3,0)); + check_compare_squared_distance (p(-1, -1, 0), t, 2); + check_compare_squared_distance (p(-1, 0, 0), t, 1); + check_compare_squared_distance (p(0, 0, 0), t, 0); + check_compare_squared_distance (p(1, 0, 0), t, 0); + check_compare_squared_distance (p(4, 0, 0), t, 1); + check_compare_squared_distance (p(1, -1, 0), t, 1); + check_compare_squared_distance (p(1, 1, 1), t, 1); + check_compare_squared_distance (p(1, 0, 1), t, 1); + check_compare_squared_distance (p(0, 0, 1), t, 1); + + // // Degenerate + check_compare_squared_distance (p(1, 2, 3), T(p(4,3,2), p(4,3,2), p(4,3,2)), squared_distance(p(1, 2, 3), p(4,3,2))); + check_compare_squared_distance (p(1, 2, 3), T(p(4,3,2), p(10,12,3), p(4,3,2)), squared_distance(p(1, 2, 3), p(4,3,2))); + check_compare_squared_distance (p(0, 0, 0), T(p(4,3,2), p(4,-3,-2), p(4,3,2)), squared_distance(p(0, 0, 0), p(4,0,0))); + + // On the triangle + check_compare_squared_distance (p(7, 1, -5), T(p(2,9,8), p(-4,-3,-5), p(7, 1, -5)), 0); // vertex + check_compare_squared_distance (p(7, 1, -5), T(p(14,2,-10), p(-7,-1,5), p(8, 3, -1)), 0); // edge + check_compare_squared_distance (p(1, 4, -3), T(p(0,-8,-3), p(-5,14,-3), p(10, 1, -3)), 0); // face + + // General + check_compare_squared_distance (p(-15, 1, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 25); + check_compare_squared_distance (p(-5, 0, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(-5, 0, 0), S(p(-10, 1, 0), p(0,0,0)))); + check_compare_squared_distance (p(0, -3, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 9); + check_compare_squared_distance (p(3, -3, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(3, -3, 0), S(p(0,0,0), p(10,0,0)))); + check_compare_squared_distance (p(16, 1, 1), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 38); + check_compare_squared_distance (p(5, 5, 2), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(5, 5, 2), S(p(10,0,0), p(-10,1,0)))); + + for(int i=0; i1) in the code + for(int j=-2;j<4; j+=2) + { + for(int k=-3;k<3; k+=2) + { + P p2{j, k, z}; + P p3{j, k+2, z}; + + // to explicit the expected distances + if(j == -2 && k == -3) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, CGAL::squared_distance(p3, p0)); + else if(j == -2 && k == -1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, 1); + else if(j == -2 && k == 1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, CGAL::squared_distance(p2, p0)); + else if(j == 0 && k == -3) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, 1); + else if(j == 0 && k == -1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, 0); + else if(j == 0 && k == 1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, 1); + else if(j == 2 && k == -3) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, CGAL::squared_distance(p3, p1)); + else if(j == 2 && k == -1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, 1); + else if(j == 2 && k == 1) + check_compare_squared_distance(S{p0, p1}, S{p2, p3}, CGAL::squared_distance(p2, p1)); + } + } + + for(int i=0; i, gte::Segment<3, FT> > GTE_SS_checker; + gte::Segment<3, FT> gte_s1{{p8.x(), p8.y(), p8.z()}, {p9.x(), p9.y(), p9.z()}}; + gte::Segment<3, FT> gte_s2{{p3.x(), p3.y(), p3.z()}, {p2.x(), p2.y(), p2.z()}}; + auto gte_res = GTE_SS_checker(gte_s1, gte_s2); + std::cout << "-------" << std::endl; + std::cout << "old: " << CGAL::internal::squared_distance_old(s89, s32, K()) << std::endl; + std::cout << "dist (GTE) : " << gte_res.sqrDistance << std::endl; +#endif + + // Because do_intersect() with constructions is likely to return 'false' even for overlaps + assert(are_equal(CGAL::squared_distance(s89, s32), result, false /*verbose*/) || + are_equal(CGAL::squared_distance(s32, s89), FT(0))); + } + + // completely generic + S s1{p0, p1}, s2{p2, p3}; + do_intersect_check(s1, s2); + +#ifdef CGAL_USE_GTE_AS_SANITY_CHECK + gte::DCPQuery, gte::Segment<3, FT> > GTE_SS_checker; + gte::Segment<3, FT> gte_s1{{p0.x(), p0.y(), p0.z()}, {p1.x(), p1.y(), p1.z()}}; + gte::Segment<3, FT> gte_s2{{p2.x(), p2.y(), p2.z()}, {p3.x(), p3.y(), p3.z()}}; + auto gte_res = GTE_SS_checker(gte_s1, gte_s2); + + std::cout << "dist (CGAL) : " << CGAL::squared_distance(s1, s2) << std::endl; + std::cout << "dist (GTE) : " << gte_res.sqrDistance << std::endl; + assert(are_equal(CGAL::squared_distance(s1, s2), gte_res.sqrDistance)); +#endif + } + + // a few brute force checks: sample a segments and use squared_distance(P3, S3) + for(int i=0; i<10; ++i) + { + P p0 = random_point(); + P p1 = random_point(); + P p2 = random_point(); + P p3 = random_point(); + + S s01{p0, p1}; + S s23{p2, p3}; + + FT upper_bound = CGAL::squared_distance(p0, p2); + + V p01 = V{p0, p1} / FT(N); + for(int l=0; l, gte::Triangle3 > GTE_TT_checker; + gte::Triangle3 gte_tr1{{p0.x(), p0.y(), p0.z()}, {p1.x(), p1.y(), p1.z()}, {p2.x(), p2.y(), p2.z()}}; + gte::Triangle3 gte_tr2{{p3.x(), p3.y(), p3.z()}, {p4.x(), p4.y(), p4.z()}, {p5.x(), p5.y(), p5.z()}}; + auto gte_res = GTE_TT_checker(gte_tr1, gte_tr2); + + std::cout << "dist (CGAL) : " << CGAL::squared_distance(tr1, tr2) << std::endl; + std::cout << "dist (GTE) : " << gte_res.sqrDistance << std::endl; + std::cout << "diff CGAL GTE : " << (gte_res.sqrDistance - CGAL::squared_distance(tr1, tr2)) << std::endl; + + // don't assert on purpose, GTE has slightly (10^-30 different results, even with an exact NT) + are_equal(CGAL::squared_distance(tr1, tr2), gte_res.sqrDistance); +#endif + } + } + +public: + void run() + { + std::cout << "Kernel: " << typeid(K).name() << std::endl; + + P_P(); + P_S(); + P_R(); + P_L(); + P_T(); + P_Pl(); + P_Tet(); + + S_S(); + S_R(); + S_L(); + S_Pl(); + + R_R(); + R_L(); + R_Pl(); + + L_L(); + L_Pl(); + + T_T(); + + Pl_Pl(); + } +}; + +int main() +{ + std::cout.precision(17); + std::cerr.precision(17); + + std::cout << "3D Distance tests" << std::endl; + + CGAL::Random r; + std::cout << "random seed = " << r.get_seed() << std::endl; + + // @todo Some tests are too difficult for these kernels +// Test >(r, 1e-5).run(); +// Test >(r, 1e-5).run(); +// Test > >(r, 1e-5).run(); + + // Test >(r, 0).run(); + + const double epick_eps = 10 * std::numeric_limits::epsilon(); + Test(r, epick_eps).run(); + + Test(r, 0).run(); + + std::cout << "Done!" << std::endl; + + return EXIT_SUCCESS; +} diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp index f297e93016b..db899ac309f 100644 --- a/Distance_3/test/Distance_3/test_distance_3.cpp +++ b/Distance_3/test/Distance_3/test_distance_3.cpp @@ -241,10 +241,36 @@ private: void P_Tet() { std::cout << "Point - Tetrahedron\n"; + //Degenerate Tetrahedron + check_squared_distance (p(2, 2, 2), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 4); + check_squared_distance (p(3, 3, 0), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 0); + check_squared_distance (p(8, 8, 0), Tet(p(0, 0, 0), p( 6, 0, 0), p( 0, 6, 0), p( 6, 6, 0)), 8); + + //Inside Tetrahedron + check_squared_distance (p(1, 1, 1), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 3, 0), p( 0, 0, 3)), 0); + check_squared_distance (p(1, 1, 1), Tet(p(0, 0, 0), p( 3, 0, 0), p( 0, 0, 3), p( 0, 3, 0)), 0); check_squared_distance (p(0, 0, 0), Tet(p(0, 0, 0), p( 1, 0, 0), p( 0, 1, 0), p( 0, 0, 1)), 0); + + //General check_squared_distance (p(0, 0, 2), Tet(p(0, 0, 0), p( 1, 0, 0), p( 0, 1, 0), p( 0, 0, 1)), 1); check_squared_distance (p(0, 0, -1), Tet(p(0, 0, 0), p( 1, 0, 0), p( 0, 1, 0), p( 0, 0, 1)), 1); check_squared_distance (p(5, 0, 0), Tet(p(0, 0, 0), p( 1, 0, 0), p( 0, 1, 0), p( 4, 0, 1)), 2); + check_squared_distance (p(1, 1, -1), Tet(p(0, 0, 1), p( 0, 0, 0), p( 4, 0, 0), p( 0, 4, 0)), 1); + check_squared_distance (p(1, 1, -1), Tet(p(0, 0, 1), p( 0, 0, 0), p( 0, 4, 0), p( 4, 0, 0)), 1); + + for(int i=0; i void lower_envelope_x_monotone_2 @@ -107,7 +107,7 @@ The upper envelope is represented using the output maximization diagram `diag`. \tparam InputIterator must be an input iterator with value type `EnvelopeDiagram::X_monotone_curve_2`. \tparam EnvelopeDiagram must be a model of the concept `EnvelopeDiagram_1`. -\tparam Traits must be a model of the concept `ArrangementXMonotoneTraits_2`. +\tparam Traits must be a model of the concept `AosXMonotoneTraits_2`. */ template void upper_envelope_x_monotone_2 diff --git a/Envelope_2/doc/Envelope_2/Envelope_2.txt b/Envelope_2/doc/Envelope_2/Envelope_2.txt index 13e94452c13..0bdc3a95a17 100644 --- a/Envelope_2/doc/Envelope_2/Envelope_2.txt +++ b/Envelope_2/doc/Envelope_2/Envelope_2.txt @@ -136,11 +136,11 @@ Any model of the `EnvelopeDiagram_1` concept must define a geometric traits class, which in turn defines the `Point_2` and `X_monotone_curve_2` types defined with the diagram features. The geometric traits class must be a model of the -`ArrangementXMonotoneTraits_2` concept in case we construct +`AosXMonotoneTraits_2` concept in case we construct envelopes of \f$ x\f$-monotone curves. If we are interested in handling arbitrary (not necessarily \f$ x\f$-monotone) curves, the traits class -must be a model of the `ArrangementTraits_2` concept. This -concepts refined the `ArrangementXMonotoneTraits_2` concept; +must be a model of the `AosTraits_2` concept. This +concepts refined the `AosXMonotoneTraits_2` concept; a traits class that models this concepts must also defines a `Curve_2` type, representing an arbitrary planar curve, and provide a functor for subdividing such curves into \f$ x\f$-monotone @@ -199,4 +199,3 @@ that compute envelopes of arbitrary curves. */ } /* namespace CGAL */ - diff --git a/Envelope_3/doc/Envelope_3/Concepts/EnvelopeTraits_3.h b/Envelope_3/doc/Envelope_3/Concepts/EnvelopeTraits_3.h index fc72154073a..7c9b36b783f 100644 --- a/Envelope_3/doc/Envelope_3/Concepts/EnvelopeTraits_3.h +++ b/Envelope_3/doc/Envelope_3/Concepts/EnvelopeTraits_3.h @@ -3,7 +3,7 @@ * * This concept defines the minimal set of geometric predicates and operations * needed to compute the envelope of a set of arbitrary surfaces in \f$ - * \mathbb{R}^3\f$. It refines the `ArrangementXMonotoneTraits_2` concept. In + * \mathbb{R}^3\f$. It refines the `AosXMonotoneTraits_2` concept. In * addition to the `Point_2` and `X_monotone_curve_2` types and the * `Has_boundary_category` category tag listed in the base concept, it also * lists the `Surface_3` and `Xy_monotone_surface_3` types, which represent @@ -12,7 +12,7 @@ * operations usually involve the projection of 3D objects onto the \f$ * xy\f$-plane. * - * \cgalRefines{ArrangementXMonotoneTraits_2} + * \cgalRefines{AosXMonotoneTraits_2} * * \cgalHasModelsBegin * \cgalHasModels{CGAL::Env_triangle_traits_3} diff --git a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h index 3863b149e4f..fcb7e3a9175 100644 --- a/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h +++ b/HalfedgeDS/include/CGAL/boost/graph/properties_HalfedgeDS_base.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace CGAL { diff --git a/HalfedgeDS/package_info/HalfedgeDS/dependencies b/HalfedgeDS/package_info/HalfedgeDS/dependencies index ffbfcd5b201..1015a2da048 100644 --- a/HalfedgeDS/package_info/HalfedgeDS/dependencies +++ b/HalfedgeDS/package_info/HalfedgeDS/dependencies @@ -1,6 +1,7 @@ Algebraic_foundations BGL Circulator +Distance_2 Distance_3 HalfedgeDS Hash_map diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index bdae9dd56fb..8d1c1d09cd4 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -22,6 +22,12 @@ - Introduces two traits decorators, namely `Arr_tracing_traits_2` and `Arr_counting_traits_2`, which can be used to extract debugging and informative metadata about the traits in use while a program is being executed. - Fixed the Landmark point-location strategy so that it can be applied to arrangements on a sphere. +- Fixed a bug in the extensions of vertex and halfedge types of the DCEL when used to instantiate Arrangement_with_history_2 or similar arrangement classes that derive from Arrangement_2. +- Renamed the prefix of the names of all concepts in the Arrangement_on_surface_2 package from "Arrangement" to "Aos". +- Renamed the old concept `AosApproximateTraits_2` to `AosApproximatePointTraits_2` to make room for the new concept `AosApproximateTraits_2`. This concept requires the provision of a functor called `Approximate_2` that has an operator that approximates the coordinates of a point. +- Introduced a new concept called `AosApproximateTraits_2`. It refines the concept `AosApproximatePointTraits_2`. This concept requires the provision of a functor called `Approximate_2`. In addition to an operator that approximates the coordinates of a point, it also requires the provision of (i) an operator that approximates a points, and (ii) an operator that approximates a curve. +- Changed all "typedef" style statements in the user manual to "using" style. (Observe that a similar update to the examples has already been made in a previous release.) +- Fixed do_intersect() of a 2D Arrangement and a curve. ### [3D Mesh Generation](https://doc.cgal.org/6.1/Manual/packages.html#PkgMesh3) diff --git a/Installation/cmake/modules/display-third-party-libs-versions.cmake b/Installation/cmake/modules/display-third-party-libs-versions.cmake index 96ef4e14992..7f7d8695797 100644 --- a/Installation/cmake/modules/display-third-party-libs-versions.cmake +++ b/Installation/cmake/modules/display-third-party-libs-versions.cmake @@ -1,9 +1,27 @@ set(LIBRARIES_TO_CHECK - Eigen3 Qt6 TBB OpenMesh Boost - GMP Threads SuiteSparse MPFI METIS - VTK SCIP OSQP LASLIB GLPK - ITT Ceres MPFR libpointmatcher ITK - OpenGR OpenCV ZLIB + Boost + Ceres + Eigen3 + GLPK + GMP + ITK + ITT + LASLIB + libpointmatcher + METIS + MPFI + MPFR + OpenCV + OpenGR + OpenMesh + OSQP + Qt6 + SCIP + SuiteSparse + TBB + Threads + VTK + ZLIB ) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake) diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h index 4aba04c9e1a..9693b6ce436 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/tetrahedron_lines_intersections_3.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index bbe6179eb88..b71470a6262 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -905,15 +905,14 @@ namespace CommonKernelFunctors { Needs_FT operator()(const T1& p, const T2& q, const FT& d2) const { - return CGAL::compare(internal::squared_distance(p, q, K()), d2); + return internal::compare_squared_distance(p, q, K(), d2); } template Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { - return CGAL::compare(internal::squared_distance(p, q, K()), - internal::squared_distance(r, s, K())); + return internal::compare_squared_distance(p, q, K(), internal::squared_distance(r, s, K())); } }; diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_3.h index f2457073deb..4a2ef5d6b19 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_3.h @@ -412,16 +412,6 @@ compare_slope(const Point_3 &p, return internal::compare_slope(p, q, r, s, K()); } -template < class K > -inline -typename K::Comparison_result -compare_squared_distance(const Point_3 &p, - const Point_3 &q, - const typename K::FT &d2) -{ - return internal::compare_squared_distance(p, q, d2, K()); -} - template < class K > inline typename K::Comparison_result diff --git a/Minkowski_sum_2/doc/Minkowski_sum_2/Minkowski_sum_2.txt b/Minkowski_sum_2/doc/Minkowski_sum_2/Minkowski_sum_2.txt index ca7ec155a42..e8007276ac5 100644 --- a/Minkowski_sum_2/doc/Minkowski_sum_2/Minkowski_sum_2.txt +++ b/Minkowski_sum_2/doc/Minkowski_sum_2/Minkowski_sum_2.txt @@ -562,7 +562,7 @@ function template computes the offset of a given polygon \f$ P\f$ by a rational radius \f$ r\f$ in an exact manner. The input polygon \f$ P\f$ must be either simple or degenerate consisting of two vertices (representing a line segment). The `traits` argument must model the -concept `ArrangementTraits_2` and it should be capable of handling +concept `AosTraits_2` and it should be capable of handling conic arcs in an exact manner---using an instance of the `Arr_conic_traits_2` class template with the number types provided by the \core library is the preferred option; see \ref arr_sssectr_conic @@ -631,7 +631,7 @@ Similarly, the function template \link inset_polygon_2() `inset_polygon_2(P, r, traits, oi)` \endlink computes the exact inset of \f$ P\f$ with radius \f$ r\f$, and returns its output through the given output iterator `oi`. The `traits` parameter -must model the concept `ArrangementTraits_2` and it should be capable of +must model the concept `AosTraits_2` and it should be capable of handling conic arcs in an exact manner, whereas the value-type of `oi` must be an instance of `Gps_traits_2::Polygon_2`. diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h index 7e804e6d094..e21e0a4a0ed 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/locate.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index 7b250380193..da33e68756b 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -611,9 +611,11 @@ bool build_triangulation_from_file(std::istream& is, continue; } - if(line == "Vertices") + if(line.find("Vertices") != std::string::npos) { is >> nv; + if(verbose) + std::cerr << "Reading "<< nv << " vertices" << std::endl; for(int i=0; i> nf; + + if(verbose) + std::cerr << "Reading "<< nf << " triangles" << std::endl; + for(int i=0; i> ntet; + + if(verbose) + std::cerr << "Reading "<< ntet << " tetrahedra" << std::endl; + for(int i=0; i opp_sdi) == (s%2 == 1)) + if(cell_sdi > opp_sdi) std::swap(f[0], f[1]); } else { - if(((cell_sdi == sd_index) == (s%2 == 1)) == normals_point_outside_of_the_subdomain) + if( (cell_sdi == sd_index) == normals_point_outside_of_the_subdomain) std::swap(f[0], f[1]); } diff --git a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/is_pullout_direction.h b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/is_pullout_direction.h index a521d29ed2b..035ccbef593 100644 --- a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/is_pullout_direction.h +++ b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/is_pullout_direction.h @@ -55,7 +55,7 @@ bool is_pullout_direction { //NOT CHECKED AT ALL CGAL_precondition(pgn.is_simple()); - CGAL_precondition(!internal::is_any_edge_colinear(pgn, traits)); + CGAL_precondition(!internal::is_any_edge_collinear(pgn, traits)); auto e_it = pgn.edges_begin(); auto cc_in_between = traits.counterclockwise_in_between_2_object(); @@ -137,7 +137,7 @@ is_pullout_direction(const CGAL::Polygon_2& pgn, typedef typename Polygon_2::Edge_const_iterator Edge_iter; CGAL_precondition(pgn.is_simple()); - CGAL_precondition(!internal::is_any_edge_colinear(pgn, traits)); + CGAL_precondition(!internal::is_any_edge_collinear(pgn, traits)); Edge_iter e_it = pgn.edges_begin(); auto segment_outer_circle = diff --git a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/pullout_directions.h b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/pullout_directions.h index 7073c0392fc..bd3223fea36 100644 --- a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/pullout_directions.h +++ b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/pullout_directions.h @@ -73,7 +73,7 @@ pullout_directions CastingTraits_2& traits) { CGAL_precondition(pgn.is_simple()); - CGAL_precondition(!internal::is_any_edge_colinear(pgn, traits)); + CGAL_precondition(!internal::is_any_edge_collinear(pgn, traits)); CGAL_precondition(pgn.edges_end()!=i); typedef CastingTraits_2 Casting_traits_2; diff --git a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/top_edges.h b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/top_edges.h index 0aa6b3a92b9..748cb8214ff 100644 --- a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/top_edges.h +++ b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/Single_mold_translational_casting/top_edges.h @@ -75,7 +75,7 @@ OutputIterator top_edges(const CGAL::Polygon_2& polygon, typedef CastingTraits_2 Traits; CGAL_precondition(polygon.is_simple()); - CGAL_precondition(!internal::is_any_edge_colinear(polygon, traits)); + CGAL_precondition(!internal::is_any_edge_collinear(polygon, traits)); auto e_it = polygon.edges_begin(); auto segment_outer_circle = diff --git a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/internal/Utils.h b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/internal/Utils.h index 139e6102933..f59c53b41af 100644 --- a/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/internal/Utils.h +++ b/Set_movable_separability_2/include/CGAL/Set_movable_separability_2/internal/Utils.h @@ -41,7 +41,7 @@ get_segment_outer_circle(const typename Kernel::Segment_2 seg, } template -bool is_any_edge_colinear(const CGAL::Polygon_2& pgn, Kernel& kernel) +bool is_any_edge_collinear(const CGAL::Polygon_2& pgn, Kernel& kernel) { typedef typename Kernel::Point_2 Point_2; typedef typename CGAL::Polygon_2 Polygon_2; diff --git a/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h b/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h index 5cc0f58e596..a63d3f20095 100644 --- a/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h +++ b/Snap_rounding_2/doc/Snap_rounding_2/Concepts/SnapRoundingTraits_2.h @@ -9,7 +9,7 @@ the free function \ref CGAL::snap_rounding_2() `CGAL::snap_rounding_2} diff --git a/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h b/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h index 9e8ecee5e02..5175bb1fa82 100644 --- a/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h +++ b/Surface_sweep_2/doc/Surface_sweep_2/CGAL/Surface_sweep_2_algorithms.h @@ -27,7 +27,7 @@ input curves. When the flag `report_endpoints` is `true`, this function reports all the curve endpoints as well. If a curve endpoint is also an intersection point, it is reported once (regardless of the value of the `report_endpoints` flag). The `Traits` type -must be a model of the `ArrangementTraits_2` concept, such that the +must be a model of the `AosTraits_2` concept, such that the value-type of `InputIterator` is `Traits::Curve_2`, and the value-type of `OutputIterator` is `Traits::Point_2`. The output points are reported in an increasing \f$ xy\f$-lexicographical order. @@ -64,7 +64,7 @@ disjoint in their interior, as induced by the input curves. If the flag `multiple_overlaps` is `true`, then a subcurve that represents an overlap of \f$ k\f$ input curves is reported \f$ k\f$ times; otherwise, each subcurve is reported only once. The `Traits` type must be a model -of the `ArrangementTraits_2` concept, such that the value-type of +of the `AosTraits_2` concept, such that the value-type of `InputIterator` is `Traits::Curve_2`, and the value-type of `OutputIterator` is `Traits::X_monotone_curve_2`. */ @@ -94,7 +94,7 @@ Given a range of curves, check whether there is at least one pair of curves that intersect in their interior. The function returns `true` if such a pair is found, and `false` if all curves are pairwise disjoint in their interior. The `Traits` type must be a model -of the `ArrangementTraits_2` concept, such that the value-type of +of the `AosTraits_2` concept, such that the value-type of `InputIterator` is `Traits::Curve_2`. */ template @@ -103,4 +103,3 @@ bool do_curves_intersect (InputIterator curves_begin, Traits traits = Default_traits()); } /* namespace CGAL */ - diff --git a/Surface_sweep_2/doc/Surface_sweep_2/Surface_sweep_2.txt b/Surface_sweep_2/doc/Surface_sweep_2/Surface_sweep_2.txt index 097490409ba..9e16de9d1b9 100644 --- a/Surface_sweep_2/doc/Surface_sweep_2/Surface_sweep_2.txt +++ b/Surface_sweep_2/doc/Surface_sweep_2/Surface_sweep_2.txt @@ -33,7 +33,7 @@ all degenerate cases, including overlapping curves, vertical segments, and tangency between curves. The robustness of the algorithm is guaranteed if the functions are instantiated with a traits class that employs certified computations. This traits class must be a model of -the `ArrangementTraits_2` concept - see the Chapter \ref +the `AosTraits_2` concept - see the Chapter \ref chapterArrangement_on_surface_2 "2D Arrangements" for more details. The complexity of the surface-sweep algorithm is \cgalBigO{(n + diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h index ba8da5bf4f1..8a53ed2ea9e 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/split_long_edges.h @@ -38,6 +38,85 @@ namespace Tetrahedral_remeshing { namespace internal { + +template +bool positive_orientation_after_edge_split(const typename C3t3::Edge& e, + const typename C3t3::Cell_handle circ, + const typename C3t3::Triangulation::Geom_traits::Point_3& steiner, + const C3t3&) +{ + using Point = typename C3t3::Triangulation::Geom_traits::Point_3; + + const auto v1 = e.first->vertex(e.second); + const auto v2 = e.first->vertex(e.third); + + std::array pts = {point(circ->vertex(0)->point()), + point(circ->vertex(1)->point()), + point(circ->vertex(2)->point()), + point(circ->vertex(3)->point())}; + // 1st half-cell + const int i1 = circ->index(v1); + const Point p1 = pts[i1]; + pts[i1] = steiner; + if(CGAL::orientation(pts[0], pts[1], pts[2], pts[3]) != CGAL::POSITIVE) + return false; + + // 2nd half-cell + pts[i1] = p1; + pts[circ->index(v2)] = steiner; + if(CGAL::orientation(pts[0], pts[1], pts[2], pts[3]) != CGAL::POSITIVE) + return false; + + return true; +} + +template +std::optional +construct_steiner_point(const typename C3t3::Edge& e, + const C3t3& c3t3) +{ + using Cell_circulator = typename C3t3::Triangulation::Cell_circulator; + using Cell_handle = typename C3t3::Triangulation::Cell_handle; + using Point = typename C3t3::Triangulation::Geom_traits::Point_3; + using FT = typename C3t3::Triangulation::Geom_traits::FT; + + const auto& gt = c3t3.triangulation().geom_traits(); + const auto& tr = c3t3.triangulation(); + const auto& p1 = point(e.first->vertex(e.second)->point()); + const auto& p2 = point(e.first->vertex(e.third)->point()); + const auto vec = gt.construct_vector_3_object()(p1, p2); + + const std::array coeff = {0.33, 0.66, //1/3 and 2/3 + 0.3, 0.7, // 0.5 +/- 0.2 + 0.25, 0.75}; // 0.5 +/- 0.25 + + std::size_t attempt_id = 0; + while(attempt_id < coeff.size()) + { + Point steiner = gt.construct_translated_point_3_object()( + p1, gt.construct_scaled_vector_3_object()(vec, coeff[attempt_id])); + ++attempt_id; + + bool steiner_successful = true; + Cell_circulator circ = tr.incident_cells(e); + Cell_circulator end = circ; + do + { + Cell_handle c = circ; + if(!positive_orientation_after_edge_split(e, c, steiner, c3t3)) + { + steiner_successful = false; + break; + } + } while(++circ != end); + + if(steiner_successful) + return steiner; + } + + return std::nullopt; +} + template typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, CellSelector cell_selector, @@ -57,7 +136,7 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, const Vertex_handle v1 = e.first->vertex(e.second); const Vertex_handle v2 = e.first->vertex(e.third); - const Point m = tr.geom_traits().construct_midpoint_3_object() + Point m = tr.geom_traits().construct_midpoint_3_object() (point(v1->point()), point(v2->point())); //backup subdomain info of incident cells before making changes @@ -78,8 +157,6 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, // remove complex edge before splitting const Curve_index curve_index = (dimension == 1) ? c3t3.curve_index(e) : Curve_index(); - if (dimension == 1) - c3t3.remove_from_complex(e); struct Cell_info { Subdomain_index subdomain_index_; @@ -93,39 +170,38 @@ typename C3t3::Vertex_handle split_edge(const typename C3t3::Edge& e, boost::unordered_map> facets_info; // check orientation and collect incident cells to avoid circulating twice + bool steiner_point_found = false; boost::container::small_vector inc_cells; Cell_circulator circ = tr.incident_cells(e); Cell_circulator end = circ; do { inc_cells.push_back(circ); - if (tr.is_infinite(circ)) + if (tr.is_infinite(circ) || steiner_point_found) { ++circ; continue; } - //1st half-cell - std::array pts = { point(circ->vertex(0)->point()), - point(circ->vertex(1)->point()), - point(circ->vertex(2)->point()), - point(circ->vertex(3)->point()) }; - const int i1 = circ->index(v1); - const Point p1 = pts[i1]; - pts[i1] = m; - if(CGAL::orientation(pts[0], pts[1], pts[2], pts[3]) != CGAL::POSITIVE) - return Vertex_handle(); - - //2nd half-cell - pts[i1] = p1; - pts[circ->index(v2)] = m; - if (CGAL::orientation(pts[0], pts[1], pts[2], pts[3]) != CGAL::POSITIVE) - return Vertex_handle(); - + const Cell_handle c = circ; + if(!positive_orientation_after_edge_split(e, c, m, c3t3)) + { + const std::optional steiner = construct_steiner_point(e, c3t3); + if (steiner != std::nullopt) + { + m = *steiner; + steiner_point_found = true; + } + else + return Vertex_handle(); + } ++circ; } while (circ != end); + if (dimension == 1) + c3t3.remove_from_complex(e); + for(Cell_handle c : inc_cells) { const int index_v1 = c->index(v1); @@ -311,6 +387,9 @@ void split_long_edges(C3T3& c3t3, #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG debug::dump_edges(long_edges, "long_edges.polylines.txt"); + std::ofstream can_be_split_ofs("can_be_split_edges.polylines.txt"); + std::ofstream split_failed_ofs("split_failed.polylines.txt"); + std::ofstream ofs("midpoints.off"); ofs << "OFF" << std::endl; ofs << long_edges.size() << " 0 0" << std::endl; @@ -335,7 +414,11 @@ void split_long_edges(C3T3& c3t3, auto [splittable, _] = can_be_split(edge, c3t3, protect_boundaries, cell_selector); if (!splittable) continue; - +#ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG + else + can_be_split_ofs << "2 " << edge.first->vertex(edge.second)->point() + << " " << edge.first->vertex(edge.third)->point() << std::endl; +#endif visitor.before_split(tr, edge); Vertex_handle vh = split_edge(edge, cell_selector, c3t3); @@ -343,6 +426,9 @@ void split_long_edges(C3T3& c3t3, visitor.after_split(tr, vh); #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG + else + split_failed_ofs << "2 " << edge.first->vertex(edge.second)->point() << " " + << edge.first->vertex(edge.third)->point() << std::endl; if (vh != Vertex_handle()) ofs << vh->point() << std::endl; #endif @@ -364,8 +450,9 @@ void split_long_edges(C3T3& c3t3, }//end loop on long_edges #ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG - if(ofs.is_open()) - ofs.close(); + if(can_be_split_ofs.is_open()) can_be_split_ofs.close(); + if(split_failed_ofs.is_open()) split_failed_ofs.close(); + if(ofs.is_open()) ofs.close(); #endif #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE