From e20cfc56b5f98227952ac2e2f5ef5072c2f6ac4b Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Thu, 14 Aug 2025 18:30:32 +0300 Subject: [PATCH] Introduced ApproximateUnbounded_2 concept --- .../AosApproximateUnboundedTraits_2.h | 40 +++++++++++++++ .../AosTraits--ApproximateUnbounded_2.h | 49 +++++++++++++++++++ .../Concepts/AosTraits--Approximate_2.h | 2 +- .../PackageDescription.txt | 2 + 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateUnboundedTraits_2.h create mode 100644 Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ApproximateUnbounded_2.h diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateUnboundedTraits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateUnboundedTraits_2.h new file mode 100644 index 00000000000..ba50e318af9 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosApproximateUnboundedTraits_2.h @@ -0,0 +1,40 @@ +/*! \ingroup PkgArrangementOnSurface2ConceptsTraits + * \cgalConcept + * + * The concept `AosApproximateUnboundedTraits_2` refines the concept + * `AosApproximateTraits_2`. A model of this concept is able to approximate a + * curve constrained to a given bounding box (in addition to the ability to + * approximate a point and a curve without constraints). + * + * \cgalRefines{AosApproximateTraits_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{CGAL::Arr_linear_traits_2} + * \cgalHasModelsEnd + * + * \sa `AosApproximateTraits_2` + * \sa `draw()` + */ +class AosApproximateUnboundedTraits_2 { +public: + /// \name Types + /// @{ + + /// @} + + /// \name Functor Types + /// @{ + + /// models the concept `AosTraits::ApproximateUnbounded_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/AosTraits--ApproximateUnbounded_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ApproximateUnbounded_2.h new file mode 100644 index 00000000000..a341a50e722 --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/AosTraits--ApproximateUnbounded_2.h @@ -0,0 +1,49 @@ +namespace AosTraits { + +/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects + * \cgalConcept + * + * \cgalRefines{Approximate_2} + * + * \cgalHasModelsBegin + * \cgalHasModels{AosApproximatePointTraits_2::Approximate_2} + * \cgalHasModels{AosApproximateTraits_2::Approximate_2} + * \cgalHasModels{AosApproximateUnboundedTraits_2::Approximate_2} + * \cgalHasModelsEnd + */ +class ApproximateUnbounded_2 { +public: + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! approximates a given \f$x\f$-monotone curve constrained to a bounding + * box. It computes one or more sequences of approximate points that represent + * the disconnected portions of a polyline that approximates `xcv` within the + * bounding box `bbox`, and inserts them into output containers given through + * the output iterator `oi`. The first point of the first sequence and the + * last point of the last 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 containers. + * \param bbox the bounding box. + * \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 the type of which is a + * container, where the value type of this container is + * `AosApproximateTraits_2::Approximate_point_2`. + */ + template + OutputIterator operator()(const X_monotone_curve_2& xcv, double error, OutputIterator oi, + const BBox& bbox, bool l2r = true) const; + + /// @} +}; /* end AosTraits::Approximate_2 */ + +} 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 index 22cfdfaee3e..eb6f206082b 100644 --- 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 @@ -36,7 +36,7 @@ public: * \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`. + * `AosApproximateTraits_2::Approximate_point_2`. */ template OutputIterator operator()(const X_monotone_curve_2& xcv, double error, 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 d7ccb6ba0bc..a9bd90fa4dd 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 @@ -113,6 +113,7 @@ implemented as peripheral classes or as free (global) functions. - `AosApproximateTraits_2` - `AosApproximatePointTraits_2` +- `AosApproximateUnboundedTraits_2` - `AosBasicTopologyTraits` - `AosBasicTraits_2` - `AosBottomSideTraits_2` @@ -168,6 +169,7 @@ implemented as peripheral classes or as free (global) functions. - `AosTraits::Approximate_2` - `AosTraits::ApproximatePoint_2` +- `AosTraits::ApproximateUnbounded_2` - `AosTraits::AreMergeable_2` - `AosTraits::CompareX_2` - `AosTraits::CompareXy_2`