Merge remote-tracking branch 'cgal/master' into Triangulation_3-CDT_3-lrineau

This commit is contained in:
Laurent Rineau 2023-11-07 15:02:43 +01:00
commit 25de4ee6b7
1739 changed files with 123501 additions and 120786 deletions

View File

@ -60,7 +60,7 @@ jobs:
content: 'rocket' content: 'rocket'
}) })
- uses: actions/checkout@v3 - uses: actions/checkout@v4
name: "checkout branch" name: "checkout branch"
if: steps.get_round.outputs.result != 'stop' if: steps.get_round.outputs.result != 'stop'
with: with:

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: | run: |
.github/install.sh .github/install.sh

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: sudo apt-get install -y libboost-dev libboost-program-options-dev libmpfr-dev libeigen3-dev run: sudo apt-get install -y libboost-dev libboost-program-options-dev libmpfr-dev libeigen3-dev
- name: configure all - name: configure all
@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: sudo bash -e .github/install.sh run: sudo bash -e .github/install.sh
- name: configure all - name: configure all

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: delete directory - name: delete directory
run: | run: |
set -x set -x

View File

@ -9,7 +9,7 @@ jobs:
batch_1: batch_1:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: .github/install.sh run: .github/install.sh
- name: run1 - name: run1
@ -17,7 +17,7 @@ jobs:
batch_2: batch_2:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: .github/install.sh run: .github/install.sh
- name: run2 - name: run2
@ -25,7 +25,7 @@ jobs:
batch_3: batch_3:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: .github/install.sh run: .github/install.sh
- name: run3 - name: run3
@ -33,7 +33,7 @@ jobs:
batch_4: batch_4:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: install dependencies - name: install dependencies
run: .github/install.sh run: .github/install.sh
- name: run4 - name: run4

View File

@ -12,7 +12,7 @@
messages: ${{ steps.cat_output.outputs.message }} messages: ${{ steps.cat_output.outputs.message }}
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: run script - name: run script
run: | run: |
chmod +x ./Scripts/developer_scripts/list_cgal_workflows_last_run.sh chmod +x ./Scripts/developer_scripts/list_cgal_workflows_last_run.sh

View File

@ -10,17 +10,17 @@ jobs:
reuse: reuse:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: REUSE version - name: REUSE version
uses: fsfe/reuse-action@v1 uses: fsfe/reuse-action@v2
with: with:
args: --version args: --version
- name: REUSE lint - name: REUSE lint
uses: fsfe/reuse-action@v1 uses: fsfe/reuse-action@v2
with: with:
args: --include-submodules lint args: --include-submodules lint
- name: REUSE SPDX SBOM - name: REUSE SPDX SBOM
uses: fsfe/reuse-action@v1 uses: fsfe/reuse-action@v2
with: with:
args: spdx args: spdx
- name: install dependencies - name: install dependencies
@ -30,6 +30,6 @@ jobs:
mkdir -p ./release mkdir -p ./release
cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
- name: REUSE lint release tarball - name: REUSE lint release tarball
uses: fsfe/reuse-action@v1 uses: fsfe/reuse-action@v2
with: with:
args: --root ./release/CGAL-9.9 --include-submodules lint args: --root ./release/CGAL-9.9 --include-submodules lint

View File

@ -11,7 +11,9 @@ and the primitives stored in the AABB tree.
\cgalRefines{SearchGeomTraits_3} \cgalRefines{SearchGeomTraits_3}
\cgalHasModel All models of the concept `Kernel` \cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>` \sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>` \sa `CGAL::AABB_tree<AABBTraits>`
@ -47,7 +49,7 @@ Provides the operator:
`return_type operator()(const Query& q, const Primitive::Datum& d)`, `return_type operator()(const Query& q, const Primitive::Datum& d)`,
which computes the intersection between `q` and `d`. The type of the returned object which computes the intersection between `q` and `d`. The type of the returned object
must be a `boost::optional` of a `boost::variant` of the possible intersection types. must be a `std::optional` of a `std::variant` of the possible intersection types.
*/ */
typedef unspecified_type Intersect_3; typedef unspecified_type Intersect_3;

View File

@ -12,11 +12,13 @@ The concept `AABBPrimitive` describes the requirements for the primitives stored
The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency. The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency.
\cgalHasModel `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_false,CacheDatum>` \cgalHasModelsBegin
\cgalHasModel `CGAL::AABB_segment_primitive<Iterator,CacheDatum>` \cgalHasModels{CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_false,CacheDatum>}
\cgalHasModel `CGAL::AABB_triangle_primitive<Iterator,CacheDatum>` \cgalHasModels{CGAL::AABB_segment_primitive<Iterator,CacheDatum>}
\cgalHasModel `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_false,CacheDatum>` \cgalHasModels{CGAL::AABB_triangle_primitive<Iterator,CacheDatum>}
\cgalHasModel `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_false,CacheDatum>` \cgalHasModels{CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_false,CacheDatum>}
\cgalHasModels{CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_false,CacheDatum>}
\cgalHasModelsEnd
*/ */
class AABBPrimitive { class AABBPrimitive {

View File

@ -21,9 +21,11 @@ The `Datum` would be a `Triangle_3` and the `Id` a `std::size_t`. The shared dat
`std::vector<Triangle_3>`. `std::vector<Triangle_3>`.
The method `datum(const Shared_data&)` then returns a triangle from the vector. The method `datum(const Shared_data&)` then returns a triangle from the vector.
\cgalHasModel `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_true,CacheDatum>` \cgalHasModelsBegin
\cgalHasModel `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_true,CacheDatum>` \cgalHasModels{CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_true,CacheDatum>}
\cgalHasModel `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_true,CacheDatum>` \cgalHasModels{CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_true,CacheDatum>}
\cgalHasModels{CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_true,CacheDatum>}
\cgalHasModelsEnd
*/ */
class AABBPrimitiveWithSharedData { class AABBPrimitiveWithSharedData {

View File

@ -9,7 +9,9 @@ define the Intersection_distance functor.
\cgalRefines{AABBGeomTraits} \cgalRefines{AABBGeomTraits}
\cgalHasModel All models of the concept `Kernel` \cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>` \sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>` \sa `CGAL::AABB_tree<AABBTraits>`

View File

@ -7,7 +7,9 @@ The concept `AABBRayIntersectionTraits` is a refinement of the concept
`AABBTraits` it also requires function objects to calculate the `AABBTraits` it also requires function objects to calculate the
distance of an intersection along a ray. distance of an intersection along a ray.
\cgalHasModel `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>` \cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>}
\cgalHasModelsEnd
\sa `CGAL::AABB_tree<AABBTraits>` \sa `CGAL::AABB_tree<AABBTraits>`
\sa `AABBPrimitive` \sa `AABBPrimitive`
@ -25,15 +27,15 @@ public:
/*! /*!
A functor object to compute the distance between the source of a ray and its A functor object to compute the distance between the source of a ray and its
closest intersection point between the ray and a primitive or a bounding box. closest intersection point between the ray and a primitive or a bounding box.
An empty `boost::optional` is returned, if there is no intersection. An empty `std::optional` is returned, if there is no intersection.
When there is an intersection, an object of type `FT` is returned such that When there is an intersection, an object of type `FT` is returned such that
if `i1` and `i2` are two intersection points, then `i1` is closer to the source if `i1` and `i2` are two intersection points, then `i1` is closer to the source
of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2` of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2`
respectively. respectively.
Provides the operators: Provides the operators:
`boost::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`. `std::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
`boost::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > > `std::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
operator()(const Ray_3& r, const Primitive& primitive)`. operator()(const Ray_3& r, const Primitive& primitive)`.
A common algorithm to compute the intersection between a bounding box and a ray is <A A common algorithm to compute the intersection between a bounding box and a ray is <A

View File

@ -5,7 +5,9 @@
The concept `AABBTraits` provides the geometric primitive types and methods for the class `CGAL::AABB_tree<AABBTraits>`. The concept `AABBTraits` provides the geometric primitive types and methods for the class `CGAL::AABB_tree<AABBTraits>`.
\cgalHasModel `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>` \cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>}
\cgalHasModelsEnd
\cgalRefines{SearchGeomTraits_3} \cgalRefines{SearchGeomTraits_3}
@ -119,10 +121,10 @@ typedef unspecified_type Do_intersect;
/*! /*!
A functor object to compute the intersection of a query and a primitive. Provides the operator: A functor object to compute the intersection of a query and a primitive. Provides the operator:
`boost::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive. `std::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
\cgalHeading{Note on Backward Compatibility} \cgalHeading{Note on Backward Compatibility}
Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional<Object_and_primitive_id>`. Before the release 4.3 of \cgal, the return type of this function used to be `std::optional<Object_and_primitive_id>`.
*/ */
typedef unspecified_type Intersection; typedef unspecified_type Intersection;

View File

@ -19,8 +19,8 @@ typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive; typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits; typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree; typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection; typedef std::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection;
typedef boost::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection; typedef std::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
typedef Tree::Primitive_id Primitive_id; typedef Tree::Primitive_id Primitive_id;
int main() int main()
@ -57,7 +57,7 @@ int main()
if(intersection) if(intersection)
{ {
// gets intersection object // gets intersection object
const Point* p = boost::get<Point>(&(intersection->first)); const Point* p = std::get_if<Point>(&(intersection->first));
if(p) if(p)
std::cout << "intersection object is a point " << *p << std::endl; std::cout << "intersection object is a point " << *p << std::endl;
@ -81,7 +81,7 @@ int main()
if(plane_intersection) if(plane_intersection)
{ {
if(boost::get<Segment>(&(plane_intersection->first))) if(std::get_if<Segment>(&(plane_intersection->first)))
std::cout << "intersection object is a segment" << std::endl; std::cout << "intersection object is a segment" << std::endl;
} }

View File

@ -23,7 +23,7 @@ typedef boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh> Primitive; typedef CGAL::AABB_face_graph_triangle_primitive<Mesh> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits; typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree; typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection; typedef std::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
struct Skip struct Skip
{ {
@ -70,8 +70,8 @@ int main(int argc, char* argv[])
Ray_intersection intersection = tree.first_intersection(ray, skip); Ray_intersection intersection = tree.first_intersection(ray, skip);
if(intersection) if(intersection)
{ {
if(boost::get<Point>(&(intersection->first))){ if(std::get_if<Point>(&(intersection->first))){
const Point* p = boost::get<Point>(&(intersection->first) ); const Point* p = std::get_if<Point>(&(intersection->first) );
std::cout << *p << std::endl; std::cout << *p << std::endl;
} }
} }

View File

@ -33,7 +33,7 @@ namespace CGAL {
* while the AABB tree holding the primitive is in use. * while the AABB tree holding the primitive is in use.
* The triangle type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Triangle_3`. * The triangle type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Triangle_3`.
* *
* \cgalModels `AABBPrimitiveWithSharedData` * \cgalModels{AABBPrimitiveWithSharedData}
* *
*\tparam FaceGraph is a model of the face graph concept. *\tparam FaceGraph is a model of the face graph concept.
*\tparam VertexPointPMap is a property map with `boost::graph_traits<FaceGraph>::%vertex_descriptor` *\tparam VertexPointPMap is a property map with `boost::graph_traits<FaceGraph>::%vertex_descriptor`

View File

@ -41,8 +41,10 @@ namespace CGAL {
* of `VertexPointPMap` (using the `Kernel_traits` mechanism). * of `VertexPointPMap` (using the `Kernel_traits` mechanism).
* The segment type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Segment_3`. * The segment type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Segment_3`.
* *
* \cgalModels `AABBPrimitive` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_false`, * \cgalModelsBareBegin
* and `AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`. * \cgalModelsBare{`AABBPrimitive` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_false`}
* \cgalModelsBare{`AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`}
* \cgalModelsBareEnd
* *
* \tparam HalfedgeGraph is a model of the halfedge graph concept. * \tparam HalfedgeGraph is a model of the halfedge graph concept.
* as key type and a \cgal Kernel `Point_3` as value type. * as key type and a \cgal Kernel `Point_3` as value type.

View File

@ -42,7 +42,7 @@ namespace CGAL {
/// AABB tree is built should not be deleted while the AABB tree /// AABB tree is built should not be deleted while the AABB tree
/// is in use. /// is in use.
/// ///
/// \cgalModels `AABBPrimitive` /// \cgalModels{AABBPrimitive}
/// \tparam GeomTraits must provide a \c %Point_3 /// \tparam GeomTraits must provide a \c %Point_3
/// type, used as \c Point, and a \c %Segment_3 type, used as \c /// type, used as \c Point, and a \c %Segment_3 type, used as \c
/// Datum and constructible from two arguments of type \c /// Datum and constructible from two arguments of type \c

View File

@ -35,7 +35,7 @@ namespace CGAL {
/// the polyhedron from which the AABB tree is built should not be /// the polyhedron from which the AABB tree is built should not be
/// deleted while the AABB tree is in use. /// deleted while the AABB tree is in use.
/// ///
/// \cgalModels `AABBPrimitive` /// \cgalModels{AABBPrimitive}
/// \tparam GeomTraits must provides a \c %Point_3 /// \tparam GeomTraits must provides a \c %Point_3
/// type, used as \c Point, and a \c %Triangle_3 type, used as \c /// type, used as \c Point, and a \c %Triangle_3 type, used as \c
/// Datum and constructible from three arguments of type \c /// Datum and constructible from three arguments of type \c

View File

@ -53,8 +53,10 @@ public:
* The two property maps which are template parameters of the class enable to get the datum and the reference point of * The two property maps which are template parameters of the class enable to get the datum and the reference point of
* the primitive from the identifier. The last template parameter controls whether the primitive class holds a copy of the datum. * the primitive from the identifier. The last template parameter controls whether the primitive class holds a copy of the datum.
* *
* \cgalModels `AABBPrimitive` if `ExternalPropertyMaps` is `CGAL::Tag_false`. * \cgalModelsBareBegin
* \cgalModels `AABBPrimitiveWithSharedData` if `ExternalPropertyMaps` is `CGAL::Tag_true`. * \cgalModelsBare{`AABBPrimitive` if `ExternalPropertyMaps` is `CGAL::Tag_false`}
* \cgalModelsBare{`AABBPrimitiveWithSharedData` if `ExternalPropertyMaps` is `CGAL::Tag_true`}
* \cgalModelsBareEnd
* *
* \tparam ObjectPropertyMap is a model of `ReadablePropertyMap` with `Id` as * \tparam ObjectPropertyMap is a model of `ReadablePropertyMap` with `Id` as
* `key_type`. It must be a model of `CopyConstructible`, `DefaultConstructible`, and `CopyAssignable`. * `key_type`. It must be a model of `CopyConstructible`, `DefaultConstructible`, and `CopyAssignable`.

View File

@ -54,7 +54,7 @@ namespace internal {
* The iterator from which the primitive is built should not be invalided * The iterator from which the primitive is built should not be invalided
* while the AABB tree holding the primitive is in use. * while the AABB tree holding the primitive is in use.
* *
* \cgalModels `AABBPrimitive` * \cgalModels{AABBPrimitive}
* *
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Segment_3`. * \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Segment_3`.
* It also provides the functor `Construct_source_3` that has an operator taking a `Segment_3` * It also provides the functor `Construct_source_3` that has an operator taking a `Segment_3`

View File

@ -27,7 +27,7 @@
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h> #include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
#include <boost/optional.hpp> #include <optional>
/// \file AABB_traits.h /// \file AABB_traits.h
@ -39,7 +39,7 @@ template <class T>
struct Remove_optional { typedef T type; }; struct Remove_optional { typedef T type; };
template <class T> template <class T>
struct Remove_optional< ::boost::optional<T> > { typedef T type; }; struct Remove_optional< ::std::optional<T> > { typedef T type; };
//helper controlling whether extra data should be stored in the AABB_tree traits class //helper controlling whether extra data should be stored in the AABB_tree traits class
template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value> template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value>
@ -85,7 +85,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
typedef typename CGAL::Bbox_3 Bounding_box; typedef typename CGAL::Bbox_3 Bounding_box;
struct Intersection_distance { struct Intersection_distance {
boost::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const { std::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903 FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903
FT t_far = DBL_MAX; FT t_far = DBL_MAX;
@ -101,7 +101,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) { for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) {
if(*direction_iter == 0) { if(*direction_iter == 0) {
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) { if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
return boost::none; return std::nullopt;
} }
} else { } else {
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter; FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
@ -118,7 +118,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
// t_far = t2; // t_far = t2;
if(t_near > t_far || t_far < FT(0.)) if(t_near > t_far || t_far < FT(0.))
return boost::none; return std::nullopt;
} }
} }
@ -149,9 +149,8 @@ class AABB_tree;
/// computations, and it handles points as query type for distance /// computations, and it handles points as query type for distance
/// queries. /// queries.
/// ///
/// \cgalModels AABBTraits /// \cgalModels{AABBTraits,AABBRayIntersectionTraits}
/// \cgalModels AABBRayIntersectionTraits ///
/// \tparam GeomTraits must be a model of the concept \ref AABBGeomTraits, /// \tparam GeomTraits must be a model of the concept \ref AABBGeomTraits,
/// and provide the geometric types as well as the intersection tests and computations. /// and provide the geometric types as well as the intersection tests and computations.
/// \tparam Primitive provide the type of primitives stored in the AABB_tree. /// \tparam Primitive provide the type of primitives stored in the AABB_tree.
@ -193,7 +192,7 @@ public:
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to /// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
/// the result type of `GeomTraits::Intersect_3::operator()`. If it is /// the result type of `GeomTraits::Intersect_3::operator()`. If it is
/// `boost::optional<T>` then it is `T`, and the result type otherwise. /// `std::optional<T>` then it is `T`, and the result type otherwise.
template<typename Query> template<typename Query>
struct Intersection_and_primitive_id { struct Intersection_and_primitive_id {
typedef decltype( typedef decltype(
@ -364,12 +363,12 @@ public:
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits) Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
:m_traits(traits) {} :m_traits(traits) {}
template<typename Query> template<typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type > std::optional< typename Intersection_and_primitive_id<Query>::Type >
operator()(const Query& query, const typename AT::Primitive& primitive) const { operator()(const Query& query, const typename AT::Primitive& primitive) const {
auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits)); auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits));
if (!inter_res) if (!inter_res)
return boost::none; return std::nullopt;
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) ); return std::make_optional( std::make_pair(*inter_res, primitive.id()) );
} }
}; };

View File

@ -26,7 +26,7 @@
#include <CGAL/AABB_tree/internal/AABB_search_tree.h> #include <CGAL/AABB_tree/internal/AABB_search_tree.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h> #include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h> #include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <boost/optional.hpp> #include <optional>
#ifdef CGAL_HAS_THREADS #ifdef CGAL_HAS_THREADS
#include <CGAL/mutex.h> #include <CGAL/mutex.h>
@ -270,7 +270,7 @@ public:
/// \tparam Query must be a type for which `Do_intersect` operators are /// \tparam Query must be a type for which `Do_intersect` operators are
/// defined in the traits class `AABBTraits`. /// defined in the traits class `AABBTraits`.
template <typename Query> template <typename Query>
boost::optional<Primitive_id> any_intersected_primitive(const Query& query) const; std::optional<Primitive_id> any_intersected_primitive(const Query& query) const;
///@} ///@}
/// \name Intersections /// \name Intersections
@ -293,7 +293,7 @@ public:
/// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are /// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are
/// defined in the traits class `AABBTraits`. /// defined in the traits class `AABBTraits`.
template <typename Query> template <typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type > std::optional< typename Intersection_and_primitive_id<Query>::Type >
any_intersection(const Query& query) const; any_intersection(const Query& query) const;
@ -317,12 +317,12 @@ public:
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to /// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
/// call this member function. /// call this member function.
template<typename Ray, typename SkipFunctor> template<typename Ray, typename SkipFunctor>
boost::optional< typename Intersection_and_primitive_id<Ray>::Type > std::optional< typename Intersection_and_primitive_id<Ray>::Type >
first_intersection(const Ray& query, const SkipFunctor& skip) const; first_intersection(const Ray& query, const SkipFunctor& skip) const;
/// \cond /// \cond
template<typename Ray> template<typename Ray>
boost::optional< typename Intersection_and_primitive_id<Ray>::Type > std::optional< typename Intersection_and_primitive_id<Ray>::Type >
first_intersection(const Ray& query) const first_intersection(const Ray& query) const
{ {
return first_intersection(query, [](Primitive_id){ return false; }); return first_intersection(query, [](Primitive_id){ return false; });
@ -342,12 +342,12 @@ public:
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to /// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
/// call this member function. /// call this member function.
template<typename Ray, typename SkipFunctor> template<typename Ray, typename SkipFunctor>
boost::optional<Primitive_id> std::optional<Primitive_id>
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const; first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
/// \cond /// \cond
template<typename Ray> template<typename Ray>
boost::optional<Primitive_id> std::optional<Primitive_id>
first_intersected_primitive(const Ray& query) const first_intersected_primitive(const Ray& query) const
{ {
return first_intersected_primitive(query, [](Primitive_id){ return false; }); return first_intersected_primitive(query, [](Primitive_id){ return false; });
@ -963,7 +963,7 @@ public:
template <typename Tr> template <typename Tr>
template <typename Query> template <typename Query>
boost::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type > std::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
AABB_tree<Tr>::any_intersection(const Query& query) const AABB_tree<Tr>::any_intersection(const Query& query) const
{ {
using namespace CGAL::internal::AABB_tree; using namespace CGAL::internal::AABB_tree;
@ -975,7 +975,7 @@ public:
template <typename Tr> template <typename Tr>
template <typename Query> template <typename Query>
boost::optional<typename AABB_tree<Tr>::Primitive_id> std::optional<typename AABB_tree<Tr>::Primitive_id>
AABB_tree<Tr>::any_intersected_primitive(const Query& query) const AABB_tree<Tr>::any_intersected_primitive(const Query& query) const
{ {
using namespace CGAL::internal::AABB_tree; using namespace CGAL::internal::AABB_tree;

View File

@ -19,8 +19,7 @@
#include <functional> #include <functional>
#include <type_traits> #include <type_traits>
#include <boost/optional.hpp> #include <optional>
#include <boost/variant/apply_visitor.hpp>
# if defined(BOOST_MSVC) # if defined(BOOST_MSVC)
# pragma warning(push) # pragma warning(push)
# pragma warning(disable: 4996) # pragma warning(disable: 4996)
@ -43,7 +42,7 @@ class AABB_ray_intersection {
public: public:
AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {} AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {}
boost::optional< Ray_intersection_and_primitive_id > std::optional< Ray_intersection_and_primitive_id >
ray_intersection(const Ray& query, SkipFunctor skip) const { ray_intersection(const Ray& query, SkipFunctor skip) const {
// We hit the root, now continue on the children. Keep track of // We hit the root, now continue on the children. Keep track of
// nb_primitives through a variable in each Node on the stack. In // nb_primitives through a variable in each Node on the stack. In
@ -63,7 +62,7 @@ public:
Heap_type pq; Heap_type pq;
// pq.reserve(tree_.size() / 2); // pq.reserve(tree_.size() / 2);
boost::optional< Ray_intersection_and_primitive_id > std::optional< Ray_intersection_and_primitive_id >
intersection, /* the temporary for calculating the result */ intersection, /* the temporary for calculating the result */
p; /* the current best intersection */ p; /* the current best intersection */
@ -84,7 +83,7 @@ public:
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) { if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
intersection = intersection_obj(query, current.node->left_data()); intersection = intersection_obj(query, current.node->left_data());
if(intersection) { if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) { if(ray_distance < t) {
t = ray_distance; t = ray_distance;
p = intersection; p = intersection;
@ -96,7 +95,7 @@ public:
if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) { if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) {
intersection = intersection_obj(query, current.node->right_data()); intersection = intersection_obj(query, current.node->right_data());
if(intersection) { if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) { if(ray_distance < t) {
t = ray_distance; t = ray_distance;
p = intersection; p = intersection;
@ -111,7 +110,7 @@ public:
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) { if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
intersection = intersection_obj(query, current.node->left_data()); intersection = intersection_obj(query, current.node->left_data());
if(intersection) { if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first); FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) { if(ray_distance < t) {
t = ray_distance; t = ray_distance;
p = intersection; p = intersection;
@ -121,7 +120,7 @@ public:
// right child // right child
const Node* child = &(current.node->right_child()); const Node* child = &(current.node->right_child());
boost::optional< FT > dist = intersection_distance_obj(query, child->bbox()); std::optional< FT > dist = intersection_distance_obj(query, child->bbox());
if(dist) if(dist)
pq.push(Node_ptr_with_ft(child, *dist, 2)); pq.push(Node_ptr_with_ft(child, *dist, 2));
@ -130,7 +129,7 @@ public:
default: // Children both inner nodes default: // Children both inner nodes
{ {
const Node* child = &(current.node->left_child()); const Node* child = &(current.node->left_child());
boost::optional<FT> dist = intersection_distance_obj(query, child->bbox()); std::optional<FT> dist = intersection_distance_obj(query, child->bbox());
if(dist) if(dist)
pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2)); pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2));
@ -198,7 +197,7 @@ private:
template<typename AABBTraits> template<typename AABBTraits>
template<typename Ray, typename SkipFunctor> template<typename Ray, typename SkipFunctor>
boost::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type > std::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
AABB_tree<AABBTraits>::first_intersection(const Ray& query, AABB_tree<AABBTraits>::first_intersection(const Ray& query,
const SkipFunctor& skip) const { const SkipFunctor& skip) const {
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value, static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
@ -219,22 +218,22 @@ AABB_tree<AABBTraits>::first_intersection(const Ray& query,
break; break;
} }
} }
return boost::none; return std::nullopt;
} }
template<typename AABBTraits> template<typename AABBTraits>
template<typename Ray, typename SkipFunctor> template<typename Ray, typename SkipFunctor>
boost::optional<typename AABB_tree<AABBTraits>::Primitive_id> std::optional<typename AABB_tree<AABBTraits>::Primitive_id>
AABB_tree<AABBTraits>::first_intersected_primitive(const Ray& query, AABB_tree<AABBTraits>::first_intersected_primitive(const Ray& query,
const SkipFunctor& skip) const const SkipFunctor& skip) const
{ {
boost::optional< std::optional<
typename AABB_tree<AABBTraits>:: typename AABB_tree<AABBTraits>::
template Intersection_and_primitive_id<Ray>::Type > res = template Intersection_and_primitive_id<Ray>::Type > res =
first_intersection(query, skip); first_intersection(query, skip);
if ( (bool) res ) if ( (bool) res )
return boost::make_optional( res->second ); return std::make_optional( res->second );
return boost::none; return std::nullopt;
} }
} }

View File

@ -17,7 +17,7 @@
#include <CGAL/AABB_tree/internal/AABB_node.h> #include <CGAL/AABB_tree/internal/AABB_node.h>
#include <boost/optional.hpp> #include <optional>
namespace CGAL { namespace CGAL {
@ -69,7 +69,7 @@ class First_intersection_traits
public: public:
typedef typedef
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type > std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
Result; Result;
public: public:
First_intersection_traits(const AABBTraits& traits) First_intersection_traits(const AABBTraits& traits)
@ -124,7 +124,7 @@ public:
void intersection(const Query& query, const Primitive& primitive) void intersection(const Query& query, const Primitive& primitive)
{ {
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type > std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
intersection = m_traits.intersection_object()(query, primitive); intersection = m_traits.intersection_object()(query, primitive);
if(intersection) if(intersection)
@ -211,7 +211,7 @@ public:
{ {
if( m_traits.do_intersect_object()(query, primitive) ) if( m_traits.do_intersect_object()(query, primitive) )
{ {
m_result = boost::optional<typename Primitive::Id>(primitive.id()); m_result = std::optional<typename Primitive::Id>(primitive.id());
m_is_found = true; m_is_found = true;
} }
} }
@ -221,12 +221,12 @@ public:
return m_traits.do_intersect_object()(query, node.bbox()); return m_traits.do_intersect_object()(query, node.bbox());
} }
boost::optional<typename Primitive::Id> result() const { return m_result; } std::optional<typename Primitive::Id> result() const { return m_result; }
bool is_intersection_found() const { return m_is_found; } bool is_intersection_found() const { return m_is_found; }
private: private:
bool m_is_found; bool m_is_found;
boost::optional<typename Primitive::Id> m_result; std::optional<typename Primitive::Id> m_result;
const AABBTraits& m_traits; const AABBTraits& m_traits;
}; };

View File

@ -55,7 +55,7 @@ namespace internal {
* The iterator from which the primitive is built should not be invalided * The iterator from which the primitive is built should not be invalided
* while the AABB tree holding the primitive is in use. * while the AABB tree holding the primitive is in use.
* *
* \cgalModels `AABBPrimitive` * \cgalModels{AABBPrimitive}
* *
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Triangle_3`. * \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Triangle_3`.
* It also provides the functor `Construct_vertex_3` that has an operator taking a `Triangle_3` * It also provides the functor `Construct_vertex_3` that has an operator taking a `Triangle_3`

View File

@ -28,7 +28,7 @@ namespace CGAL {
// the TriangleMesh from which the AABB tree is built should not be // the TriangleMesh from which the AABB tree is built should not be
// deleted while the AABB tree is in use. // deleted while the AABB tree is in use.
// //
// \cgalModels `AABBPrimitive` // \cgalModels{AABBPrimitive}
// \tparam GeomTraits must provides a \c %Point_3 // \tparam GeomTraits must provides a \c %Point_3
// type, used as \c Point, and a \c %Triangle_3 type, used as \c // type, used as \c Point, and a \c %Triangle_3 type, used as \c
// Datum and constructible from three arguments of type \c // Datum and constructible from three arguments of type \c

View File

@ -95,20 +95,23 @@ void test_all_intersection_query_types(Tree& tree)
tree.all_intersected_primitives(segment,std::back_inserter(primitives)); tree.all_intersected_primitives(segment,std::back_inserter(primitives));
// any_intersection // any_intersection
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray); std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line); std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment); std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
CGAL_USE(r);
CGAL_USE(l);
CGAL_USE(s);
// any_intersected_primitive // any_intersected_primitive
boost::optional<typename Primitive::Id> optional_primitive; std::optional<typename Primitive::Id> optional_primitive;
optional_primitive = tree.any_intersected_primitive(ray); optional_primitive = tree.any_intersected_primitive(ray);
optional_primitive = tree.any_intersected_primitive(line); optional_primitive = tree.any_intersected_primitive(line);
optional_primitive = tree.any_intersected_primitive(segment); optional_primitive = tree.any_intersected_primitive(segment);
// all_intersections // all_intersections
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r; std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l; std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s; std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
tree.all_intersections(ray,std::back_inserter(intersections_r)); tree.all_intersections(ray,std::back_inserter(intersections_r));
tree.all_intersections(line,std::back_inserter(intersections_l)); tree.all_intersections(line,std::back_inserter(intersections_l));
tree.all_intersections(segment,std::back_inserter(intersections_s)); tree.all_intersections(segment,std::back_inserter(intersections_s));
@ -322,7 +325,7 @@ class Naive_implementations
typedef typename Traits::Point_3 Point; typedef typename Traits::Point_3 Point;
typedef typename Traits::Point_and_primitive_id Point_and_primitive_id; typedef typename Traits::Point_and_primitive_id Point_and_primitive_id;
typedef boost::optional<Object_and_primitive_id> Intersection_result; typedef std::optional<Object_and_primitive_id> Intersection_result;
const Traits& m_traits; const Traits& m_traits;
public: public:
@ -380,7 +383,7 @@ public:
Polyhedron_primitive_iterator it = Pr_generator().begin(p); Polyhedron_primitive_iterator it = Pr_generator().begin(p);
for ( ; it != Pr_generator().end(p) ; ++it ) for ( ; it != Pr_generator().end(p) ; ++it )
{ {
boost::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type > std::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
intersection = m_traits.intersection_object()(query, Pr(it,p)); intersection = m_traits.intersection_object()(query, Pr(it,p));
if ( intersection ) if ( intersection )
*out++ = *intersection; *out++ = *intersection;
@ -653,7 +656,7 @@ private:
} }
// any_intersected_primitive test (do not count time here) // any_intersected_primitive test (do not count time here)
typedef boost::optional<typename Primitive::Id> Any_primitive; typedef std::optional<typename Primitive::Id> Any_primitive;
Any_primitive primitive = tree.any_intersected_primitive(query); Any_primitive primitive = tree.any_intersected_primitive(query);
// Check: verify we do get the result by naive method // Check: verify we do get the result by naive method
@ -723,7 +726,7 @@ private:
} }
// Any intersection test (do not count time here) // Any intersection test (do not count time here)
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type > std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
intersection = tree.any_intersection(query); intersection = tree.any_intersection(query);
// Check: verify we do get the result by naive method // Check: verify we do get the result by naive method

View File

@ -46,7 +46,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo
v.reserve(elements); v.reserve(elements);
for(; b != e; ++b) { for(; b != e; ++b) {
tree.all_intersections(*b, std::back_inserter(v)); tree.all_intersections(*b, std::back_inserter(v));
boost::optional<Obj_type> o = tree.any_intersection(*b); std::optional<Obj_type> o = tree.any_intersection(*b);
if(o) if(o)
++counter; ++counter;
} }

View File

@ -65,7 +65,7 @@ int test()
return EXIT_FAILURE; return EXIT_FAILURE;
} }
boost::optional<Object_and_primitive_id> any; std::optional<Object_and_primitive_id> any;
any = tree.any_intersection(pq); any = tree.any_intersection(pq);
if(!any) if(!any)
{ {

View File

@ -35,7 +35,7 @@ FT point_on_ray_dist(const Ray& ray, const Point& point) {
std::size_t accum = 0; std::size_t accum = 0;
boost::optional< std::optional<
Tree::Intersection_and_primitive_id<Ray>::Type Tree::Intersection_and_primitive_id<Ray>::Type
> >
min_intersection(const Tree& tree, const Ray& ray) { min_intersection(const Tree& tree, const Ray& ray) {
@ -45,12 +45,12 @@ min_intersection(const Tree& tree, const Ray& ray) {
tree.all_intersections(ray, std::back_inserter(all_intersections)); tree.all_intersections(ray, std::back_inserter(all_intersections));
accum += all_intersections.size(); accum += all_intersections.size();
Tree::FT min_distance = DBL_MAX; Tree::FT min_distance = DBL_MAX;
boost::optional< std::optional<
Tree::Intersection_and_primitive_id<Ray>::Type Tree::Intersection_and_primitive_id<Ray>::Type
> mini = boost::none; > mini = std::nullopt;
for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) { for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) {
if(Point* point = boost::get<Point>(&(it2->first))) { if(Point* point = std::get_if<Point>(&(it2->first))) {
Vector i_ray(*point, ray.source()); Vector i_ray(*point, ray.source());
Tree::FT new_distance = i_ray.squared_length(); Tree::FT new_distance = i_ray.squared_length();
if(new_distance < min_distance) { if(new_distance < min_distance) {
@ -124,7 +124,7 @@ int main()
rays.reserve(NB_RAYS); rays.reserve(NB_RAYS);
std::transform(v1.begin(), v1.end(), v2.begin(), std::transform(v1.begin(), v1.end(), v2.begin(),
std::back_inserter(rays), boost::value_factory<Ray>()); std::back_inserter(rays), boost::value_factory<Ray>());
std::vector< boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2; std::vector< std::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2;
primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS); primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS);
@ -139,7 +139,7 @@ int main()
} }
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none); std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), std::nullopt);
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl; std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
std::cout << "Primitive method had to sort " << accum/NB_RAYS std::cout << "Primitive method had to sort " << accum/NB_RAYS
<< " intersections on average." << std::endl; << " intersections on average." << std::endl;

View File

@ -11,7 +11,9 @@ together with a few geometric predicates and constructions on these objects.
\cgalRefines{DelaunayTriangulationTraits_3} \cgalRefines{DelaunayTriangulationTraits_3}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
*/ */
class AdvancingFrontSurfaceReconstructionTraits_3 class AdvancingFrontSurfaceReconstructionTraits_3
{ {

View File

@ -169,8 +169,8 @@ Every \cgal `Kernel` comes with two <I>real number types</I>
(number types embeddable into the real numbers). One of them is a (number types embeddable into the real numbers). One of them is a
`FieldNumberType`, and the other a `RingNumberType`. The `FieldNumberType`, and the other a `RingNumberType`. The
coordinates of the basic kernel objects (points, vectors, etc.) come coordinates of the basic kernel objects (points, vectors, etc.) come
from one of these types (the `FieldNumberType` in case of Cartesian from one of these types (the `FieldNumberType` in case of %Cartesian
kernels, and the `RingNumberType` for Homogeneous kernels). kernels, and the `RingNumberType` for %Homogeneous kernels).
The concept `FieldNumberType` combines the requirements of the The concept `FieldNumberType` combines the requirements of the
concepts `Field` and `RealEmbeddable`, while concepts `Field` and `RealEmbeddable`, while
@ -277,4 +277,3 @@ subsequent chapters.
*/ */
} /* namespace CGAL */ } /* namespace CGAL */

View File

@ -5,7 +5,7 @@ namespace CGAL {
An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where <span class="textsc">T</span> is the associated type. An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where <span class="textsc">T</span> is the associated type.
\cgalModels `AlgebraicStructureTraits` \cgalModels{AlgebraicStructureTraits}
*/ */
template< typename T > template< typename T >
@ -22,7 +22,7 @@ namespace CGAL {
Tag indicating that a type is a model of the Tag indicating that a type is a model of the
`EuclideanRing` concept. `EuclideanRing` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `EuclideanRing` \sa `EuclideanRing`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -38,7 +38,7 @@ struct Euclidean_ring_tag : public Unique_factorization_domain_tag {
Tag indicating that a type is a model of the `Field` concept. Tag indicating that a type is a model of the `Field` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `Field` \sa `Field`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -54,7 +54,7 @@ struct Field_tag : public Integral_domain_tag {
Tag indicating that a type is a model of the `FieldWithKthRoot` concept. Tag indicating that a type is a model of the `FieldWithKthRoot` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `FieldWithKthRoot` \sa `FieldWithKthRoot`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -70,7 +70,7 @@ struct Field_with_kth_root_tag : public Field_with_sqrt_tag {
Tag indicating that a type is a model of the `FieldWithRootOf` concept. Tag indicating that a type is a model of the `FieldWithRootOf` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `FieldWithRootOf` \sa `FieldWithRootOf`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -86,7 +86,7 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag {
Tag indicating that a type is a model of the `FieldWithSqrt` concept. Tag indicating that a type is a model of the `FieldWithSqrt` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `FieldWithSqrt` \sa `FieldWithSqrt`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -102,7 +102,7 @@ struct Field_with_sqrt_tag : public Field_tag {
Tag indicating that a type is a model of the `IntegralDomain` concept. Tag indicating that a type is a model of the `IntegralDomain` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `IntegralDomain` \sa `IntegralDomain`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`
@ -118,7 +118,7 @@ struct Integral_domain_tag : public Integral_domain_without_division_tag {
Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept. Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `IntegralDomainWithoutDivision` \sa `IntegralDomainWithoutDivision`
@ -133,7 +133,7 @@ struct Integral_domain_without_division_tag {
Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept. Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept.
\cgalModels `DefaultConstructible` \cgalModels{DefaultConstructible}
\sa `UniqueFactorizationDomain` \sa `UniqueFactorizationDomain`
\sa `AlgebraicStructureTraits` \sa `AlgebraicStructureTraits`

View File

@ -6,7 +6,7 @@ namespace CGAL {
An instance of `Fraction_traits` is a model of `FractionTraits`, An instance of `Fraction_traits` is a model of `FractionTraits`,
where `T` is the associated type. where `T` is the associated type.
\cgalModels `FractionTraits` \cgalModels{FractionTraits}
*/ */
template< typename T > template< typename T >

View File

@ -6,7 +6,7 @@ namespace CGAL {
An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where <span class="textsc">T</span> is the associated type. An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where <span class="textsc">T</span> is the associated type.
\cgalModels `RealEmbeddableTraits` \cgalModels{RealEmbeddableTraits}
*/ */
template< typename T > template< typename T >

View File

@ -28,7 +28,9 @@ algebraic operations within that structure.
\sa `CGAL::Field_with_kth_root_tag` \sa `CGAL::Field_with_kth_root_tag`
\sa `CGAL::Field_with_root_of_tag` \sa `CGAL::Field_with_root_of_tag`
\cgalHasModel `CGAL::Algebraic_structure_traits<T>` \cgalHasModelsBegin
\cgalHasModels{CGAL::Algebraic_structure_traits<T>}
\cgalHasModelsEnd
*/ */

View File

@ -3,7 +3,7 @@
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain). A model of `EuclideanRing` represents a Euclidean ring (or Euclidean domain).
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$. \f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
Two types `A` and `B` are a model of the `ExplicitInteroperable` Two types `A` and `B` are a model of the `ExplicitInteroperable`
@ -27,4 +27,3 @@ class ExplicitInteroperable {
public: public:
}; /* end ExplicitInteroperable */ }; /* end ExplicitInteroperable */

View File

@ -5,20 +5,22 @@
The concept `FieldNumberType` combines the requirements of the concepts The concept `FieldNumberType` combines the requirements of the concepts
`Field` and `RealEmbeddable`. `Field` and `RealEmbeddable`.
A model of `FieldNumberType` can be used as a template parameter A model of `FieldNumberType` can be used as a template parameter
for Cartesian kernels. for %Cartesian kernels.
\cgalRefines{Field,RealEmbeddable} \cgalRefines{Field,RealEmbeddable}
\cgalHasModel float \cgalHasModelsBegin
\cgalHasModel double \cgalHasModels{float}
\cgalHasModel `CGAL::Gmpq` \cgalHasModels{double}
\cgalHasModel `CGAL::Interval_nt` \cgalHasModels{CGAL::Gmpq}
\cgalHasModel `CGAL::Interval_nt_advanced` \cgalHasModels{CGAL::Interval_nt}
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>` \cgalHasModels{CGAL::Interval_nt_advanced}
\cgalHasModel `CGAL::Quotient<RingNumberType>` \cgalHasModels{CGAL::Lazy_exact_nt<FieldNumberType>}
\cgalHasModel `leda_rational` \cgalHasModels{CGAL::Quotient<RingNumberType>}
\cgalHasModel `leda_bigfloat` \cgalHasModels{leda_rational}
\cgalHasModel `leda_real` \cgalHasModels{leda_bigfloat}
\cgalHasModels{leda_real}
\cgalHasModelsEnd
\sa `RingNumberType` \sa `RingNumberType`
\sa `Kernel` \sa `Kernel`
@ -32,4 +34,3 @@ public:
/// @} /// @}
}; /* end FieldNumberType */ }; /* end FieldNumberType */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsFractionsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A type is considered as a `Fraction`, if there is a reasonable way to A type is considered as a `Fraction`, if there is a reasonable way to
@ -17,4 +17,3 @@ class Fraction {
public: public:
}; /* end Fraction */ }; /* end Fraction */

View File

@ -8,7 +8,9 @@ A model of `FractionTraits` is associated with a type `Type`.
In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well
as the numerator and denominator type. as the numerator and denominator type.
\cgalHasModel `CGAL::Fraction_traits<T>` \cgalHasModelsBegin
\cgalHasModels{CGAL::Fraction_traits<T>}
\cgalHasModelsEnd
\sa `FractionTraits_::Decompose` \sa `FractionTraits_::Decompose`
\sa `FractionTraits_::Compose` \sa `FractionTraits_::Compose`

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A model of the concept `FromDoubleConstructible` is required A model of the concept `FromDoubleConstructible` is required
@ -27,4 +27,3 @@ FromDoubleConstructible(const double& d);
/// @} /// @}
}; /* end FromDoubleConstructible */ }; /* end FromDoubleConstructible */

View File

@ -1,14 +1,16 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
A model of the concept `FromIntConstructible` is required A model of the concept `FromIntConstructible` is required
to be constructible from int. to be constructible from int.
\cgalHasModel int \cgalHasModelsBegin
\cgalHasModel long \cgalHasModels{int}
\cgalHasModel double \cgalHasModels{long}
\cgalHasModels{double}
\cgalHasModelsEnd
*/ */
@ -26,4 +28,3 @@ FromIntConstructible(int& i);
/// @} /// @}
}; /* end FromIntConstructible */ }; /* end FromIntConstructible */

View File

@ -1,6 +1,6 @@
/*! /*!
\ingroup PkgAlgebraicFoundationsInteroperabilityConcepts \ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept \cgalConcept
Two types `A` and `B` are a model of the concept Two types `A` and `B` are a model of the concept
@ -29,4 +29,3 @@ class ImplicitInteroperable {
public: public:
}; /* end ImplicitInteroperable */ }; /* end ImplicitInteroperable */

View File

@ -7,7 +7,9 @@ A model of `RealEmbeddableTraits` is associated to a number type
`Type` and reflects the properties of this type with respect `Type` and reflects the properties of this type with respect
to the concept `RealEmbeddable`. to the concept `RealEmbeddable`.
\cgalHasModel `CGAL::Real_embeddable_traits<T>` \cgalHasModelsBegin
\cgalHasModels{CGAL::Real_embeddable_traits<T>}
\cgalHasModelsEnd
*/ */
class RealEmbeddableTraits { class RealEmbeddableTraits {

View File

@ -6,23 +6,25 @@
The concept `RingNumberType` combines the requirements of the concepts The concept `RingNumberType` combines the requirements of the concepts
`IntegralDomainWithoutDivision` and `RealEmbeddable`. `IntegralDomainWithoutDivision` and `RealEmbeddable`.
A model of `RingNumberType` can be used as a template parameter A model of `RingNumberType` can be used as a template parameter
for Homogeneous kernels. for homogeneous kernels.
\cgalRefines{IntegralDomainWithoutDivision,RealEmbeddable} \cgalRefines{IntegralDomainWithoutDivision,RealEmbeddable}
\cgalHasModel \cpp built-in number types \cgalHasModelsBegin
\cgalHasModel `CGAL::Gmpq` \cgalHasModelsBare{\cpp built-in number types}
\cgalHasModel `CGAL::Gmpz` \cgalHasModels{CGAL::Gmpq}
\cgalHasModel `CGAL::Interval_nt` \cgalHasModels{CGAL::Gmpz}
\cgalHasModel `CGAL::Interval_nt_advanced` \cgalHasModels{CGAL::Interval_nt}
\cgalHasModel `CGAL::Lazy_exact_nt<RingNumberType>` \cgalHasModels{CGAL::Interval_nt_advanced}
\cgalHasModel `CGAL::MP_Float` \cgalHasModels{CGAL::Lazy_exact_nt<RingNumberType>}
\cgalHasModel `CGAL::Gmpzf` \cgalHasModels{CGAL::MP_Float}
\cgalHasModel `CGAL::Quotient<RingNumberType>` \cgalHasModels{CGAL::Gmpzf}
\cgalHasModel `leda_integer` \cgalHasModels{CGAL::Quotient<RingNumberType>}
\cgalHasModel `leda_rational` \cgalHasModels{leda_integer}
\cgalHasModel `leda_bigfloat` \cgalHasModels{leda_rational}
\cgalHasModel `leda_real` \cgalHasModels{leda_bigfloat}
\cgalHasModels{leda_real}
\cgalHasModelsEnd
\sa `FieldNumberType` \sa `FieldNumberType`
@ -32,4 +34,3 @@ class RingNumberType {
public: public:
}; /* end RingNumberType */ }; /* end RingNumberType */

View File

@ -27,7 +27,7 @@ approximation of an algebraic real root is a slightly modified
(filtered) version of the one presented in \cgalCite{abbott-qir-06}. The (filtered) version of the one presented in \cgalCite{abbott-qir-06}. The
method has quadratic convergence. method has quadratic convergence.
\cgalModels `AlgebraicKernel_d_1` \cgalModels{AlgebraicKernel_d_1}
\sa `AlgebraicKernel_d_1` \sa `AlgebraicKernel_d_1`
\sa `Polynomial_d` \sa `Polynomial_d`

View File

@ -47,7 +47,7 @@ above. `ROOT` should be one of the integer types. See also the
documentation of `Sqrt_extension<NT,ROOT>`. documentation of `Sqrt_extension<NT,ROOT>`.
\cgalAdvancedEnd \cgalAdvancedEnd
\cgalModels `AlgebraicKernel_d_2` \cgalModels{AlgebraicKernel_d_2}
\sa `AlgebraicKernel_d_1` \sa `AlgebraicKernel_d_1`
\sa `AlgebraicKernel_d_2` \sa `AlgebraicKernel_d_2`

View File

@ -12,7 +12,7 @@ rational univariate polynomial root isolation. It is a model of the
isolate integer polynomials, the operations of this kernel have the isolate integer polynomials, the operations of this kernel have the
overhead of converting the polynomials to integer. overhead of converting the polynomials to integer.
\cgalModels `AlgebraicKernel_d_1` \cgalModels{AlgebraicKernel_d_1}
\sa `Algebraic_kernel_rs_gmpz_d_1` \sa `Algebraic_kernel_rs_gmpz_d_1`

View File

@ -10,7 +10,7 @@ This univariate algebraic kernel uses the Rs library to perform
integer univariate polynomial root isolation. It is a model of the integer univariate polynomial root isolation. It is a model of the
`AlgebraicKernel_d_1` concept. `AlgebraicKernel_d_1` concept.
\cgalModels `AlgebraicKernel_d_1` \cgalModels{AlgebraicKernel_d_1}
\sa `Algebraic_kernel_rs_gmpz_d_1` \sa `Algebraic_kernel_rs_gmpz_d_1`

View File

@ -8,8 +8,10 @@ algebraic functionalities on univariate polynomials of general degree \f$ d\f$.
\cgalRefines{CopyConstructible,Assignable} \cgalRefines{CopyConstructible,Assignable}
\cgalHasModel `CGAL::Algebraic_kernel_rs_gmpz_d_1` \cgalHasModelsBegin
\cgalHasModel `CGAL::Algebraic_kernel_rs_gmpq_d_1` \cgalHasModels{CGAL::Algebraic_kernel_rs_gmpz_d_1}
\cgalHasModels{CGAL::Algebraic_kernel_rs_gmpq_d_1}
\cgalHasModelsEnd
\sa `AlgebraicKernel_d_2` \sa `AlgebraicKernel_d_2`

View File

@ -27,7 +27,7 @@
#include <type_traits> #include <type_traits>
#include <CGAL/iterator.h> #include <CGAL/iterator.h>
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
#include <boost/optional.hpp> #include <optional>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/config.h> #include <CGAL/config.h>
@ -359,7 +359,7 @@ public:
Unary_compose(const Unary_compose& other) = default; Unary_compose(const Unary_compose& other) = default;
Unary_compose& operator=(const Unary_compose& other) = default; Unary_compose& operator=(const Unary_compose& other) = default;
Unary_compose() : _inner(::boost::none),_outer(::boost::none) {} Unary_compose() : _inner(::std::nullopt),_outer(::std::nullopt) {}
typedef typename InnerFunctor::argument_type argument_type; typedef typename InnerFunctor::argument_type argument_type;
typedef typename OuterFunctor::result_type result_type; typedef typename OuterFunctor::result_type result_type;
@ -368,11 +368,11 @@ public:
result_type operator() (const argument_type& arg) const { result_type operator() (const argument_type& arg) const {
CGAL_assertion(bool(_inner)); CGAL_assertion(bool(_inner));
CGAL_assertion(bool(_outer)); CGAL_assertion(bool(_outer));
return _outer.get()(_inner.get()(arg)); return _outer.value()(_inner.value()(arg));
} }
private: private:
::boost::optional<InnerFunctor> _inner; ::std::optional<InnerFunctor> _inner;
::boost::optional<OuterFunctor> _outer; ::std::optional<OuterFunctor> _outer;
}; };
template<typename InnerFunctor,typename OuterFunctor> template<typename InnerFunctor,typename OuterFunctor>

View File

@ -174,7 +174,7 @@ public:
long old_precision = get_precision( BFI() ); long old_precision = get_precision( BFI() );
set_precision( BFI(), 53 ); set_precision( BFI(), 53 );
std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this))); std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this)));
this->ptr()->interval_option = boost::optional< std::pair<double, double> >(interval); this->ptr()->interval_option = std::optional< std::pair<double, double> >(interval);
set_precision( BFI(), old_precision ); set_precision( BFI(), old_precision );
return *(this->ptr()->interval_option); return *(this->ptr()->interval_option);
} }

View File

@ -86,10 +86,10 @@ private:
CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1> CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1>
::Other::Type BFI_polynomial; ::Other::Type BFI_polynomial;
mutable boost::optional mutable std::optional
< BFI_polynomial > f_bfi_; < BFI_polynomial > f_bfi_;
mutable boost::optional<BFI> low_bfi_, f_low_bfi_, mutable std::optional<BFI> low_bfi_, f_low_bfi_,
high_bfi_, f_high_bfi_; high_bfi_, f_high_bfi_;
mutable long N; mutable long N;
@ -113,8 +113,8 @@ private:
low_bfi_ = CGAL::convert_to_bfi(this->low()); low_bfi_ = CGAL::convert_to_bfi(this->low());
high_bfi_ = CGAL::convert_to_bfi(this->high()); high_bfi_ = CGAL::convert_to_bfi(this->high());
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
} }
@ -125,7 +125,7 @@ private:
} }
m_bfi = CGAL::convert_to_bfi(m); m_bfi = CGAL::convert_to_bfi(m);
f_m_bfi = f_bfi_.get().evaluate(m_bfi); f_m_bfi = f_bfi_.value().evaluate(m_bfi);
if(CGAL::zero_in(f_m_bfi)) { if(CGAL::zero_in(f_m_bfi)) {
@ -229,21 +229,21 @@ protected:
bool poly_changed = (P!=this->polynomial()); bool poly_changed = (P!=this->polynomial());
if(poly_changed) { if(poly_changed) {
f_bfi_ = boost::none; f_bfi_ = std::nullopt;
} }
if(poly_changed || LOW != this->low()) { if(poly_changed || LOW != this->low()) {
f_low_bfi_ = low_bfi_ = boost::none; f_low_bfi_ = low_bfi_ = std::nullopt;
} }
if(poly_changed || HIGH != this->high()) { if(poly_changed || HIGH != this->high()) {
f_high_bfi_ = high_bfi_ = boost::none; f_high_bfi_ = high_bfi_ = std::nullopt;
} }
Base::set_implicit_rep(P,LOW,HIGH,dummy_bool); Base::set_implicit_rep(P,LOW,HIGH,dummy_bool);
} }
virtual void set_explicit_rep(const Field& m) const { virtual void set_explicit_rep(const Field& m) const {
f_bfi_ = boost::none; f_bfi_ = std::nullopt;
f_low_bfi_ = low_bfi_ = boost::none; f_low_bfi_ = low_bfi_ = std::nullopt;
f_high_bfi_ = high_bfi_ = boost::none; f_high_bfi_ = high_bfi_ = std::nullopt;
Base::set_explicit_rep(m); Base::set_explicit_rep(m);
} }
@ -256,13 +256,13 @@ public:
if(this->is_rational()) return; if(this->is_rational()) return;
if(old_low_!=this->low_) { if(old_low_!=this->low_) {
f_low_bfi_ = low_bfi_ = boost::none; f_low_bfi_ = low_bfi_ = std::nullopt;
} }
if(old_high_!=this->high_) { if(old_high_!=this->high_) {
f_high_bfi_ = high_bfi_ = boost::none; f_high_bfi_ = high_bfi_ = std::nullopt;
} }
if(old_pol != this->polynomial()) { if(old_pol != this->polynomial()) {
f_bfi_ = boost::none; f_bfi_ = std::nullopt;
} }
} }
@ -329,25 +329,25 @@ private:
low_bfi_ = CGAL::convert_to_bfi(this->low()); low_bfi_ = CGAL::convert_to_bfi(this->low());
} }
if(! f_low_bfi_) { if(! f_low_bfi_) {
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get()); f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
} }
if(! high_bfi_) { if(! high_bfi_) {
high_bfi_ = CGAL::convert_to_bfi(this->high()); high_bfi_ = CGAL::convert_to_bfi(this->high());
} }
if(! f_high_bfi_) { if(! f_high_bfi_) {
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get()); f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
} }
Integer i; Integer i;
while(true) { while(true) {
if(CGAL::zero_in(f_low_bfi_.get() - f_high_bfi_.get())) { if(CGAL::zero_in(f_low_bfi_.value() - f_high_bfi_.value())) {
_set_prec(2*prec_); _set_prec(2*prec_);
continue; continue;
} }
BFI denom = f_low_bfi_.get()-f_high_bfi_.get(); BFI denom = f_low_bfi_.value()-f_high_bfi_.value();
BFI z = f_low_bfi_.get() / denom; BFI z = f_low_bfi_.value() / denom;
std::pair<Integer, Integer> int_pair = _to_integer_interval(z,N); std::pair<Integer, Integer> int_pair = _to_integer_interval(z,N);
Integer i_low = int_pair.first; Integer i_low = int_pair.first;
@ -458,7 +458,7 @@ protected:
f_bfi_ = _convert_polynomial_to_bfi(this->polynomial()); f_bfi_ = _convert_polynomial_to_bfi(this->polynomial());
} }
BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m)); BFI eval = f_bfi_.value().evaluate(convert_to_bfi(m));
CGAL::Sign s = CGAL::sign(CGAL::lower(eval)); CGAL::Sign s = CGAL::sign(CGAL::lower(eval));
@ -490,7 +490,7 @@ public:
Poly f_old = this->polynomial(); Poly f_old = this->polynomial();
Base::simplify(); Base::simplify();
if(f_old != this->polynomial()) { if(f_old != this->polynomial()) {
f_bfi_ = boost::none; f_bfi_ = std::nullopt;
} }
} }
}; };

View File

@ -23,7 +23,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Polynomial_type_generator.h> #include <CGAL/Polynomial_type_generator.h>
#include <CGAL/Polynomial_traits_d.h> #include <CGAL/Polynomial_traits_d.h>
#include <boost/optional.hpp> #include <optional>
namespace CGAL { namespace CGAL {
@ -56,7 +56,7 @@ private:
typedef Algebraic_real_rep <Coefficient,Rational> Self; typedef Algebraic_real_rep <Coefficient,Rational> Self;
public: public:
typedef boost::optional< std::pair<double, double> > Interval_option; typedef std::optional< std::pair<double, double> > Interval_option;
mutable Poly polynomial_; //!< square free polynomial mutable Poly polynomial_; //!< square free polynomial
mutable Rational low_; //!< lower endpoint of interval mutable Rational low_; //!< lower endpoint of interval

View File

@ -31,7 +31,7 @@
#include <CGAL/Random.h> #include <CGAL/Random.h>
#include <CGAL/tss.h> #include <CGAL/tss.h>
#include <boost/optional.hpp> #include <optional>
/* /*
* AUXILIARY CLASSES AND FUNCTIONS * AUXILIARY CLASSES AND FUNCTIONS

View File

@ -196,7 +196,7 @@ private:
size_type index_of_content_root; size_type index_of_content_root;
size_type mult_of_prim_lcoeff_root; size_type mult_of_prim_lcoeff_root;
size_type index_of_prim_lcoeff_root; size_type index_of_prim_lcoeff_root;
boost::optional<Status_line_1> stack; std::optional<Status_line_1> stack;
}; };
// Functor to get the X_coordinate of an Event_coordinate // Functor to get the X_coordinate of an Event_coordinate
@ -210,14 +210,14 @@ private:
//! The object holding the information about events, as an optional //! The object holding the information about events, as an optional
mutable boost::optional<std::vector<Event_coordinate_1> > mutable std::optional<std::vector<Event_coordinate_1> >
event_coordinates; event_coordinates;
//! The algebraic kernel to use //! The algebraic kernel to use
Algebraic_kernel_with_analysis_2* _m_kernel; Algebraic_kernel_with_analysis_2* _m_kernel;
//! The polynomial defining the curve //! The polynomial defining the curve
boost::optional<Polynomial_2> f; std::optional<Polynomial_2> f;
//! How degenerate situations are handled //! How degenerate situations are handled
CGAL::Degeneracy_strategy degeneracy_strategy; CGAL::Degeneracy_strategy degeneracy_strategy;
@ -230,24 +230,24 @@ private:
* \c f/cont(f). The corresponding curve is equal to the curve of \c f, * \c f/cont(f). The corresponding curve is equal to the curve of \c f,
* only without vertical line components. * only without vertical line components.
*/ */
mutable boost::optional<Polynomial_2> f_primitive; mutable std::optional<Polynomial_2> f_primitive;
//! the polynomial containing all roots of the resultant of the primitive //! the polynomial containing all roots of the resultant of the primitive
//! part of f and its y-derivative //! part of f and its y-derivative
mutable boost::optional<Polynomial_1> mutable std::optional<Polynomial_1>
resultant_of_primitive_and_derivative_y; resultant_of_primitive_and_derivative_y;
//! the polynomial containing all roots of the resultant of the primitive //! the polynomial containing all roots of the resultant of the primitive
//! part of f and its x-derivative //! part of f and its x-derivative
mutable boost::optional<Polynomial_1> mutable std::optional<Polynomial_1>
resultant_of_primitive_and_derivative_x; resultant_of_primitive_and_derivative_x;
//! The Sturm-Habicht polynomials of f //! The Sturm-Habicht polynomials of f
mutable boost::optional<std::vector<Polynomial_2> > mutable std::optional<std::vector<Polynomial_2> >
sturm_habicht_of_primitive; sturm_habicht_of_primitive;
//! The content of f //! The content of f
mutable boost::optional<Polynomial_1> content; mutable std::optional<Polynomial_1> content;
//! The non-working shear factors, as far as known //! The non-working shear factors, as far as known
mutable std::set<Integer> bad_shears; mutable std::set<Integer> bad_shears;
@ -256,10 +256,10 @@ private:
mutable std::map<Integer,Handle> sheared_curves; mutable std::map<Integer,Handle> sheared_curves;
//! Has the curve vertical line components //! Has the curve vertical line components
mutable boost::optional<bool> has_vertical_component; mutable std::optional<bool> has_vertical_component;
//! The intermediate values //! The intermediate values
mutable boost::optional<std::vector<boost::optional<Bound> > > mutable std::optional<std::vector<std::optional<Bound> > >
intermediate_values; intermediate_values;
//! stores Y_values at rational coordinate //! stores Y_values at rational coordinate
@ -272,7 +272,7 @@ private:
* are asymptotic to y=beta, * are asymptotic to y=beta,
* or go to +/- infty also in y-direction * or go to +/- infty also in y-direction
*/ */
mutable boost::optional<std::vector<CGAL::Object> > mutable std::optional<std::vector<CGAL::Object> >
horizontal_asymptotes_left, horizontal_asymptotes_right; horizontal_asymptotes_left, horizontal_asymptotes_right;
//! friends //! friends
@ -546,7 +546,7 @@ private:
if(! this->ptr()->intermediate_values) { if(! this->ptr()->intermediate_values) {
this->ptr()->intermediate_values this->ptr()->intermediate_values
= std::vector<boost::optional<Bound> > = std::vector<std::optional<Bound> >
(number_of_status_lines_with_event()+1); (number_of_status_lines_with_event()+1);
} }
@ -583,7 +583,7 @@ public:
*/ */
void set_f(Polynomial_2 f) { void set_f(Polynomial_2 f) {
CGAL_precondition(! has_defining_polynomial()); CGAL_precondition(! has_defining_polynomial());
if((! this->ptr()->f) || f!=this->ptr()->f.get()) { if((! this->ptr()->f) || f!=this->ptr()->f.value()) {
this->copy_on_write(); this->copy_on_write();
this->ptr()->f=f; this->ptr()->f=f;
} }
@ -630,7 +630,7 @@ public:
event_coordinates(); event_coordinates();
CGAL_assertion(this->ptr()->has_vertical_component); CGAL_assertion(this->ptr()->has_vertical_component);
} }
return this->ptr()->has_vertical_component.get(); return this->ptr()->has_vertical_component.value();
} }
public: public:
@ -638,7 +638,7 @@ public:
//! Returns the defining polynomial //! Returns the defining polynomial
Polynomial_2 polynomial_2() const { Polynomial_2 polynomial_2() const {
CGAL_precondition(bool(this->ptr()->f)); CGAL_precondition(bool(this->ptr()->f));
return this->ptr()->f.get(); return this->ptr()->f.value();
} }
public: public:
@ -713,8 +713,8 @@ public:
= event_line; = event_line;
event_coordinates()[i].stack = event_line; event_coordinates()[i].stack = event_line;
} }
CGAL_postcondition(event_coordinates()[i].stack.get().is_event()); CGAL_postcondition(event_coordinates()[i].stack.value().is_event());
return event_coordinates()[i].stack.get(); return event_coordinates()[i].stack.value();
} }
public: public:
@ -1348,7 +1348,7 @@ public:
} }
} }
} }
return intermediate_values()[i].get(); return intermediate_values()[i].value();
} }
@ -1369,7 +1369,7 @@ public:
if(! this->ptr()->content) { if(! this->ptr()->content) {
compute_content_and_primitive_part(); compute_content_and_primitive_part();
} }
return this->ptr()->content.get(); return this->ptr()->content.value();
} }
public: public:
@ -1388,7 +1388,7 @@ public:
if(! this->ptr()->f_primitive) { if(! this->ptr()->f_primitive) {
compute_content_and_primitive_part(); compute_content_and_primitive_part();
} }
return this->ptr()->f_primitive.get(); return this->ptr()->f_primitive.value();
} }
Algebraic_kernel_with_analysis_2* kernel() const { Algebraic_kernel_with_analysis_2* kernel() const {
@ -1436,7 +1436,7 @@ private:
if(! this->ptr()->sturm_habicht_of_primitive) { if(! this->ptr()->sturm_habicht_of_primitive) {
compute_sturm_habicht_of_primitive(); compute_sturm_habicht_of_primitive();
} }
return this->ptr()->sturm_habicht_of_primitive.get(); return this->ptr()->sturm_habicht_of_primitive.value();
} }
public: public:
@ -1557,7 +1557,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_y) { if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0]; this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0];
if(this->ptr()->resultant_of_primitive_and_derivative_y. if(this->ptr()->resultant_of_primitive_and_derivative_y.
get().is_zero()) { value().is_zero()) {
throw internal::Zero_resultant_exception<Polynomial_2> throw internal::Zero_resultant_exception<Polynomial_2>
(polynomial_2()); (polynomial_2());
} }
@ -1581,7 +1581,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_y) { if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
compute_resultant_of_primitive_and_derivative_y(); compute_resultant_of_primitive_and_derivative_y();
} }
return this->ptr()->resultant_of_primitive_and_derivative_y.get(); return this->ptr()->resultant_of_primitive_and_derivative_y.value();
} }
private: private:
@ -1592,7 +1592,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_x) { if(! this->ptr()->resultant_of_primitive_and_derivative_x) {
compute_resultant_of_primitive_and_derivative_x(); compute_resultant_of_primitive_and_derivative_x();
} }
return this->ptr()->resultant_of_primitive_and_derivative_x.get(); return this->ptr()->resultant_of_primitive_and_derivative_x.value();
} }
private: private:
@ -1713,20 +1713,20 @@ private:
if(! this->ptr()->event_coordinates) { if(! this->ptr()->event_coordinates) {
compute_event_coordinates(); compute_event_coordinates();
} }
return this->ptr()->event_coordinates.get(); return this->ptr()->event_coordinates.value();
} }
private: private:
// Returns the intermediate values for intervals between events // Returns the intermediate values for intervals between events
std::vector<boost::optional<Bound> >& intermediate_values() const std::vector<std::optional<Bound> >& intermediate_values() const
{ {
if(! this->ptr()->intermediate_values) { if(! this->ptr()->intermediate_values) {
// This is created during event_coordiantes() // This is created during event_coordiantes()
event_coordinates(); event_coordinates();
CGAL_assertion(bool(this->ptr()->intermediate_values)); CGAL_assertion(bool(this->ptr()->intermediate_values));
} }
return this->ptr()->intermediate_values.get(); return this->ptr()->intermediate_values.value();
} }
@ -1915,7 +1915,7 @@ private:
static_cast<size_type>(content_roots.size())); static_cast<size_type>(content_roots.size()));
this->ptr()->intermediate_values this->ptr()->intermediate_values
= std::vector<boost::optional<Bound> > = std::vector<std::optional<Bound> >
(event_coordinate_vector.size()+1); (event_coordinate_vector.size()+1);
this->ptr()->event_coordinates = event_coordinate_vector; this->ptr()->event_coordinates = event_coordinate_vector;
@ -2110,7 +2110,7 @@ public:
compute_horizontal_asymptotes(); compute_horizontal_asymptotes();
} }
std::vector<Asymptote_y>& asym_info std::vector<Asymptote_y>& asym_info
= this->ptr()->horizontal_asymptotes_left.get(); = this->ptr()->horizontal_asymptotes_left.value();
CGAL_precondition(arcno>=0 && CGAL_precondition(arcno>=0 &&
arcno<static_cast<size_type>(asym_info.size())); arcno<static_cast<size_type>(asym_info.size()));
return asym_info[arcno]; return asym_info[arcno];
@ -2120,7 +2120,7 @@ public:
compute_horizontal_asymptotes(); compute_horizontal_asymptotes();
} }
std::vector<Asymptote_y>& asym_info std::vector<Asymptote_y>& asym_info
= this->ptr()->horizontal_asymptotes_right.get(); = this->ptr()->horizontal_asymptotes_right.value();
CGAL_precondition(arcno>=0 && CGAL_precondition(arcno>=0 &&
arcno<static_cast<size_type>(asym_info.size())); arcno<static_cast<size_type>(asym_info.size()));
return asym_info[arcno]; return asym_info[arcno];

View File

@ -22,7 +22,7 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <boost/optional.hpp> #include <optional>
#include <CGAL/Handle_with_policy.h> #include <CGAL/Handle_with_policy.h>
#include <CGAL/boost/iterator/transform_iterator.hpp> #include <CGAL/boost/iterator/transform_iterator.hpp>
@ -136,9 +136,9 @@ public:
typedef std::vector<Slice_element> Slice_info; typedef std::vector<Slice_element> Slice_info;
typedef boost::optional<Slice_info> Lazy_slice_info; typedef std::optional<Slice_info> Lazy_slice_info;
typedef boost::optional<Bound> Lazy_bound; typedef std::optional<Bound> Lazy_bound;
typedef CGAL::internal::Event_indices<size_type> Event_indices; typedef CGAL::internal::Event_indices<size_type> Event_indices;
@ -151,11 +151,11 @@ public:
typedef std::vector<std::vector<Intersection_info> > typedef std::vector<std::vector<Intersection_info> >
Intersection_info_container; Intersection_info_container;
typedef boost::optional<Intersection_info_container> typedef std::optional<Intersection_info_container>
Lazy_intersection_info_container; Lazy_intersection_info_container;
// For lazy evaluation of Status_line_CPA_1s. // For lazy evaluation of Status_line_CPA_1s.
typedef boost::optional<Status_line_CPA_1> Lazy_status_line_CPA_1; typedef std::optional<Status_line_CPA_1> Lazy_status_line_CPA_1;
//! @} //! @}
@ -191,31 +191,31 @@ private:
Polynomial_2 g; Polynomial_2 g;
mutable boost::optional<std::vector<Polynomial_2> > subresultants; mutable std::optional<std::vector<Polynomial_2> > subresultants;
mutable boost::optional<std::vector<Polynomial_1> > mutable std::optional<std::vector<Polynomial_1> >
principal_subresultants; principal_subresultants;
mutable boost::optional<std::vector<Polynomial_1> > mutable std::optional<std::vector<Polynomial_1> >
coprincipal_subresultants; coprincipal_subresultants;
mutable boost::optional<Polynomial_1> resultant; mutable std::optional<Polynomial_1> resultant;
mutable boost::optional<std::vector<Algebraic_real_1> > resultant_roots; mutable std::optional<std::vector<Algebraic_real_1> > resultant_roots;
mutable boost::optional<std::vector<Algebraic_real_1> > mutable std::optional<std::vector<Algebraic_real_1> >
event_x_coordinates; event_x_coordinates;
mutable boost::optional<std::vector<size_type> > mutable std::optional<std::vector<size_type> >
multiplicities_of_resultant_roots; multiplicities_of_resultant_roots;
mutable boost::optional<std::vector<Bound> > stripe_values; mutable std::optional<std::vector<Bound> > stripe_values;
mutable std::vector< Lazy_status_line_CPA_1 > event_slices; mutable std::vector< Lazy_status_line_CPA_1 > event_slices;
mutable boost::optional<std::vector< Lazy_bound > > intermediate_values; mutable std::optional<std::vector< Lazy_bound > > intermediate_values;
mutable boost::optional< std::vector< Lazy_status_line_CPA_1 > > mutable std::optional< std::vector< Lazy_status_line_CPA_1 > >
intermediate_slices; intermediate_slices;
mutable boost::optional<std::vector<Event_indices> > event_indices; mutable std::optional<std::vector<Event_indices> > event_indices;
mutable Lazy_intersection_info_container intersection_info_container; mutable Lazy_intersection_info_container intersection_info_container;
@ -530,7 +530,7 @@ private:
/* /*
* \brief Computes the intermediate x-coordinates and their status lines * \brief Computes the intermediate x-coordinates and their status lines
* *
* In fact, it only fills the data fields with boost::none instances, * In fact, it only fills the data fields with std::nullopt instances,
* according to the lazy philosophy of the whole class. * according to the lazy philosophy of the whole class.
*/ */
void compute_intermediate_values_and_slices() const; void compute_intermediate_values_and_slices() const;
@ -547,7 +547,7 @@ public:
compute_resultant(); compute_resultant();
} }
CGAL_assertion(bool(this->ptr()->resultant)); CGAL_assertion(bool(this->ptr()->resultant));
return this->ptr()->resultant.get(); return this->ptr()->resultant.value();
} }
std::vector<Algebraic_real_1>& resultant_roots() const { std::vector<Algebraic_real_1>& resultant_roots() const {
@ -555,7 +555,7 @@ public:
compute_resultant_roots_with_multiplicities(); compute_resultant_roots_with_multiplicities();
} }
CGAL_assertion(bool(this->ptr()->resultant_roots)); CGAL_assertion(bool(this->ptr()->resultant_roots));
return this->ptr()->resultant_roots.get(); return this->ptr()->resultant_roots.value();
} }
Algebraic_real_1& resultant_roots(size_type i) const { Algebraic_real_1& resultant_roots(size_type i) const {
@ -569,7 +569,7 @@ public:
compute_resultant_roots_with_multiplicities(); compute_resultant_roots_with_multiplicities();
} }
CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots)); CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots));
return this->ptr()->multiplicities_of_resultant_roots.get(); return this->ptr()->multiplicities_of_resultant_roots.value();
} }
size_type multiplicities_of_resultant_roots(size_type i) const { size_type multiplicities_of_resultant_roots(size_type i) const {
@ -586,10 +586,10 @@ public:
(kernel(), (kernel(),
resultant_roots().begin(), resultant_roots().begin(),
resultant_roots().end(), resultant_roots().end(),
std::back_inserter(this->ptr()->stripe_values.get())); std::back_inserter(this->ptr()->stripe_values.value()));
} }
CGAL_assertion(bool(this->ptr()->stripe_values)); CGAL_assertion(bool(this->ptr()->stripe_values));
return this->ptr()->stripe_values.get(); return this->ptr()->stripe_values.value();
} }
std::vector<Algebraic_real_1>& event_x_coordinates() const { std::vector<Algebraic_real_1>& event_x_coordinates() const {
@ -597,7 +597,7 @@ public:
compute_event_x_coordinates_with_event_indices(); compute_event_x_coordinates_with_event_indices();
} }
CGAL_assertion(bool(this->ptr()->event_x_coordinates)); CGAL_assertion(bool(this->ptr()->event_x_coordinates));
return this->ptr()->event_x_coordinates.get(); return this->ptr()->event_x_coordinates.value();
} }
std::vector<Event_indices>& event_indices() const { std::vector<Event_indices>& event_indices() const {
@ -605,7 +605,7 @@ public:
compute_event_x_coordinates_with_event_indices(); compute_event_x_coordinates_with_event_indices();
} }
CGAL_assertion(bool(this->ptr()->event_indices)); CGAL_assertion(bool(this->ptr()->event_indices));
return this->ptr()->event_indices.get(); return this->ptr()->event_indices.value();
} }
public: public:
@ -613,7 +613,7 @@ public:
/* /*
* \brief returns the indices of the <tt>i</tt>th event value * \brief returns the indices of the <tt>i</tt>th event value
* *
* Returns a Event_indices <tt>(fg,ffy,ggy)</tt> such that * Returns an `Event_indices` <tt>(fg,ffy,ggy)</tt> such that
* the <tt>i</tt>th event root is the <tt>fg</tt>th root of the * the <tt>i</tt>th event root is the <tt>fg</tt>th root of the
* resultant of \c f and \c g, the <tt>ffy</tt>th root of the * resultant of \c f and \c g, the <tt>ffy</tt>th root of the
* discriminant of \c f, and the <tt>ggy</tt>th root of the * discriminant of \c f, and the <tt>ggy</tt>th root of the
@ -633,7 +633,7 @@ private:
compute_intermediate_values_and_slices(); compute_intermediate_values_and_slices();
} }
CGAL_assertion(bool(this->ptr()->intermediate_values)); CGAL_assertion(bool(this->ptr()->intermediate_values));
return this->ptr()->intermediate_values.get(); return this->ptr()->intermediate_values.value();
} }
std::vector<Lazy_status_line_CPA_1>& intermediate_slices() const { std::vector<Lazy_status_line_CPA_1>& intermediate_slices() const {
@ -641,7 +641,7 @@ private:
compute_intermediate_values_and_slices(); compute_intermediate_values_and_slices();
} }
CGAL_assertion(bool(this->ptr()->intermediate_slices)); CGAL_assertion(bool(this->ptr()->intermediate_slices));
return this->ptr()->intermediate_slices.get(); return this->ptr()->intermediate_slices.value();
} }
@ -652,7 +652,7 @@ private:
compute_subresultants(); compute_subresultants();
} }
CGAL_assertion(bool(this->ptr()->subresultants)); CGAL_assertion(bool(this->ptr()->subresultants));
return this->ptr()->subresultants.get(); return this->ptr()->subresultants.value();
} }
Polynomial_2& subresultants(size_type i) const { Polynomial_2& subresultants(size_type i) const {
@ -666,7 +666,7 @@ private:
compute_subresultants(); compute_subresultants();
} }
CGAL_assertion(bool(this->ptr()->principal_subresultants)); CGAL_assertion(bool(this->ptr()->principal_subresultants));
return this->ptr()->principal_subresultants.get(); return this->ptr()->principal_subresultants.value();
} }
Polynomial_1& principal_subresultants(size_type i) const { Polynomial_1& principal_subresultants(size_type i) const {
@ -681,7 +681,7 @@ private:
compute_subresultants(); compute_subresultants();
} }
CGAL_assertion(bool(this->ptr()->coprincipal_subresultants)); CGAL_assertion(bool(this->ptr()->coprincipal_subresultants));
return this->ptr()->coprincipal_subresultants.get(); return this->ptr()->coprincipal_subresultants.value();
} }
Polynomial_1& coprincipal_subresultants(size_type i) const { Polynomial_1& coprincipal_subresultants(size_type i) const {
@ -1030,7 +1030,7 @@ public:
this->ptr()->event_slices[i] = create_event_slice(i); this->ptr()->event_slices[i] = create_event_slice(i);
} }
CGAL_assertion(bool(this->ptr()->event_slices[i])); CGAL_assertion(bool(this->ptr()->event_slices[i]));
return this->ptr()->event_slices[i].get(); return this->ptr()->event_slices[i].value();
} }
@ -1045,7 +1045,7 @@ public:
} }
return intermediate_slices()[i].get(); return intermediate_slices()[i].value();
} }
//! Returns bound representative value at the <tt>i</tt>th interval //! Returns bound representative value at the <tt>i</tt>th interval
@ -1074,7 +1074,7 @@ public:
} }
} }
CGAL_assertion(bool(intermediate_values()[i])); CGAL_assertion(bool(intermediate_values()[i]));
return intermediate_values()[i].get(); return intermediate_values()[i].value();
} }
@ -1312,11 +1312,11 @@ void Curve_pair_analysis_2<AlgebraicKernelWithAnalysis_2>::compute_resultant()
compute_subresultants(); compute_subresultants();
this->ptr()->resultant this->ptr()->resultant
= this->ptr()->principal_subresultants.get()[0]; = this->ptr()->principal_subresultants.value()[0];
} }
if(this->ptr()->resultant.get().is_zero()) { if(this->ptr()->resultant.value().is_zero()) {
throw CGAL::internal::Zero_resultant_exception<Polynomial_2> throw CGAL::internal::Zero_resultant_exception<Polynomial_2>
(this->ptr()->f, (this->ptr()->f,
this->ptr()->g); this->ptr()->g);
@ -1345,8 +1345,8 @@ compute_resultant_roots_with_multiplicities() const {
solve_1(resultant(), std::back_inserter(res_pairs)); solve_1(resultant(), std::back_inserter(res_pairs));
for(int i=0; i < static_cast<int>(res_pairs.size()); i++ ) { for(int i=0; i < static_cast<int>(res_pairs.size()); i++ ) {
this->ptr()->resultant_roots.get().push_back(res_pairs[i].first); this->ptr()->resultant_roots.value().push_back(res_pairs[i].first);
this->ptr()->multiplicities_of_resultant_roots.get() this->ptr()->multiplicities_of_resultant_roots.value()
.push_back(res_pairs[i].second); .push_back(res_pairs[i].second);
} }
@ -1357,13 +1357,13 @@ compute_resultant_roots_with_multiplicities() const {
#if CGAL_ACK_DEBUG_FLAG #if CGAL_ACK_DEBUG_FLAG
for(size_type i = 0; for(size_type i = 0;
i<static_cast<size_type> i<static_cast<size_type>
(this->ptr()->resultant_roots.get().size()); (this->ptr()->resultant_roots.value().size());
i++) { i++) {
CGAL_ACK_DEBUG_PRINT CGAL_ACK_DEBUG_PRINT
<< "Root at " << "Root at "
<< CGAL::to_double(this->ptr()->resultant_roots.get()[i]) << CGAL::to_double(this->ptr()->resultant_roots.value()[i])
<< " with multiplicity " << " with multiplicity "
<< this->ptr()->multiplicities_of_resultant_roots.get()[i] << this->ptr()->multiplicities_of_resultant_roots.value()[i]
<< std::endl; << std::endl;
} }
#endif #endif
@ -1401,18 +1401,18 @@ compute_event_x_coordinates_with_event_indices() const {
one_curve_events.end(), one_curve_events.end(),
resultant_roots().begin(), resultant_roots().begin(),
resultant_roots().end(), resultant_roots().end(),
std::back_inserter(this->ptr()->event_x_coordinates.get()), std::back_inserter(this->ptr()->event_x_coordinates.value()),
std::back_inserter(events_type), std::back_inserter(events_type),
compare); compare);
std::vector<Algebraic_real_1>& events std::vector<Algebraic_real_1>& events
= this->ptr()->event_x_coordinates.get(); = this->ptr()->event_x_coordinates.value();
typename std::vector<CGAL::internal::Three_valued>::iterator one_curve_it typename std::vector<CGAL::internal::Three_valued>::iterator one_curve_it
=one_curve_events_type.begin(); =one_curve_events_type.begin();
size_type inter_count=0, f_count=0,g_count=0; size_type inter_count=0, f_count=0,g_count=0;
this->ptr()->event_indices = std::vector<Event_indices>(); this->ptr()->event_indices = std::vector<Event_indices>();
std::vector<Event_indices>& event_indices std::vector<Event_indices>& event_indices
= this->ptr()->event_indices.get(); = this->ptr()->event_indices.value();
for(size_type i=0;i<static_cast<size_type>(events.size());i++) { for(size_type i=0;i<static_cast<size_type>(events.size());i++) {
/* /*
#if CGAL_ACK_DEBUG_FLAG #if CGAL_ACK_DEBUG_FLAG
@ -1519,8 +1519,8 @@ compute_intermediate_values_and_slices() const {
std::size_t size = event_x_coordinates().size()+1; std::size_t size = event_x_coordinates().size()+1;
this->ptr()->intermediate_values=std::vector<Lazy_bound>(); this->ptr()->intermediate_values=std::vector<Lazy_bound>();
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>(); this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
this->ptr()->intermediate_values.get().resize(size); this->ptr()->intermediate_values.value().resize(size);
this->ptr()->intermediate_slices.get().resize(size); this->ptr()->intermediate_slices.value().resize(size);
#if CGAL_ACK_DEBUG_FLAG #if CGAL_ACK_DEBUG_FLAG
CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
#endif #endif
@ -1539,25 +1539,25 @@ compute_subresultants() const {
if(CGAL::degree(f,1)<CGAL::degree(g,1)) { if(CGAL::degree(f,1)<CGAL::degree(g,1)) {
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS #if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
CGAL::internal::bezout_polynomial_subresultants CGAL::internal::bezout_polynomial_subresultants
(g,f,std::back_inserter(this->ptr()->subresultants.get())); (g,f,std::back_inserter(this->ptr()->subresultants.value()));
#else #else
typename CGAL::Polynomial_traits_d<Polynomial_2> typename CGAL::Polynomial_traits_d<Polynomial_2>
::Polynomial_subresultants() ::Polynomial_subresultants()
(g,f,std::back_inserter(this->ptr()->subresultants.get())); (g,f,std::back_inserter(this->ptr()->subresultants.value()));
#endif #endif
} else { } else {
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS #if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
CGAL::internal::bezout_polynomial_subresultants CGAL::internal::bezout_polynomial_subresultants
(f,g,std::back_inserter(this->ptr()->subresultants.get())); (f,g,std::back_inserter(this->ptr()->subresultants.value()));
#else #else
typename CGAL::Polynomial_traits_d<Polynomial_2> typename CGAL::Polynomial_traits_d<Polynomial_2>
::Polynomial_subresultants() ::Polynomial_subresultants()
(f,g,std::back_inserter(this->ptr()->subresultants.get())); (f,g,std::back_inserter(this->ptr()->subresultants.value()));
#endif #endif
} }
std::vector<Polynomial_2>& subresultants std::vector<Polynomial_2>& subresultants
= this->ptr()->subresultants.get(); = this->ptr()->subresultants.value();
size_type n = static_cast<size_type>(subresultants.size()); size_type n = static_cast<size_type>(subresultants.size());
@ -1584,11 +1584,11 @@ compute_subresultants() const {
// This must be corrected, if f and g have same degree: // This must be corrected, if f and g have same degree:
if(CGAL::degree(f,1) == CGAL::degree(g,1)) { if(CGAL::degree(f,1) == CGAL::degree(g,1)) {
if(n>=1) { if(n>=1) {
this->ptr()->principal_subresultants.get()[n-1] this->ptr()->principal_subresultants.value()[n-1]
= Polynomial_1(CGAL::leading_coefficient(g)); = Polynomial_1(CGAL::leading_coefficient(g));
} }
if(n>=2) { if(n>=2) {
this->ptr()->coprincipal_subresultants.get()[n-2] this->ptr()->coprincipal_subresultants.value()[n-2]
= Polynomial_1(g[CGAL::degree(g,1)-1]); = Polynomial_1(g[CGAL::degree(g,1)-1]);
} }
} }

View File

@ -127,7 +127,7 @@ public:
//Arc_pair _m_num_arcs; //Arc_pair _m_num_arcs;
//! sequence of arcs crossing this status line (valid only event lines) //! sequence of arcs crossing this status line (valid only event lines)
mutable boost::optional<Arc_container> _m_arcs; mutable std::optional<Arc_container> _m_arcs;
//! number of arcs intersecting this status line //! number of arcs intersecting this status line
mutable int _m_total_arcs; mutable int _m_total_arcs;
@ -160,10 +160,10 @@ public:
std::vector< int > multiplicities_;*/ std::vector< int > multiplicities_;*/
// stores algebraic real over the vertical line // stores algebraic real over the vertical line
mutable std::vector<boost::optional< Algebraic_real_2 > >_m_xy_coords; mutable std::vector<std::optional< Algebraic_real_2 > >_m_xy_coords;
// stores the isolator instance // stores the isolator instance
mutable boost::optional<Bitstream_descartes> isolator; mutable std::optional<Bitstream_descartes> isolator;
// befriending the handle // befriending the handle
friend class Status_line_CA_1<Curve_analysis_2, Self>; friend class Status_line_CA_1<Curve_analysis_2, Self>;
@ -555,7 +555,7 @@ public:
//! Returns the isolator instance //! Returns the isolator instance
Bitstream_descartes& isolator() const { Bitstream_descartes& isolator() const {
CGAL_assertion(bool(this->ptr()->isolator)); CGAL_assertion(bool(this->ptr()->isolator));
return this->ptr()->isolator.get(); return this->ptr()->isolator.value();
} }
//! Returns whether an isolator has been given for that status line //! Returns whether an isolator has been given for that status line

View File

@ -75,7 +75,7 @@ public:
// represents x-coordinate of event of rational value over interval // represents x-coordinate of event of rational value over interval
// computed only by demand // computed only by demand
mutable boost::optional<Algebraic_real_1> _m_x; mutable std::optional<Algebraic_real_1> _m_x;
// for each event point stores a pair of arcnos of the 1st and 2nd curve // for each event point stores a pair of arcnos of the 1st and 2nd curve
// or -1 if respective curve is not involved // or -1 if respective curve is not involved

View File

@ -81,10 +81,10 @@ public:
mutable int _m_arcno; mutable int _m_arcno;
// y-coordinate // y-coordinate
mutable boost::optional< Algebraic_real_1 > _m_y; mutable std::optional< Algebraic_real_1 > _m_y;
//! A bounding box for the given point //! A bounding box for the given point
mutable boost::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair; mutable std::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair;
}; };
@ -254,7 +254,7 @@ public:
/*! /*!
* \brief y-coordinate of this point * \brief y-coordinate of this point
* *
* Note: In general, this method results in a extremely large polynomial * Note: In general, this method results in an extremely large polynomial
* for the y-coordinate. It is recommended to use it carefully, * for the y-coordinate. It is recommended to use it carefully,
* and using get_approximation_y() instead whenever approximations suffice. * and using get_approximation_y() instead whenever approximations suffice.
*/ */

View File

@ -16,7 +16,7 @@ if `Alpha_shape_face_base_2` is intended to be used with an alpha-shape class ba
\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description \link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description
provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeFace_2` \cgalModels{AlphaShapeFace_2}
\sa `Triangulation_face_base_2` \sa `Triangulation_face_base_2`
\sa `Regular_triangulation_face_base_2` \sa `Regular_triangulation_face_base_2`

View File

@ -17,7 +17,7 @@ if `Alpha_shape_vertex_base_2` is intended to be used with an alpha-shape class
\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description \link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description
provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink. provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeVertex_2` \cgalModels{AlphaShapeVertex_2}
\sa `Triangulation_vertex_base_2` \sa `Triangulation_vertex_base_2`
\sa `Regular_triangulation_vertex_base_2` \sa `Regular_triangulation_vertex_base_2`

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeFace_2` describes the requirements for the base face of a
RegularTriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a regular triangulation, RegularTriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_2TriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_2TriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_face_base_2` (templated with the appropriate triangulation face base class). \cgalHasModelsBegin
\cgalHasModels{CGAL::Alpha_shape_face_base_2 (templated with the appropriate triangulation face base class)}
\cgalHasModelsEnd
*/ */
class AlphaShapeFace_2 { class AlphaShapeFace_2 {

View File

@ -9,8 +9,10 @@ class of the underlying Delaunay triangulation of a basic alpha shape.
\cgalRefines{DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a Delaunay triangulation, \cgalRefines{DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a Delaunay triangulation,
Periodic_2DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation} Periodic_2DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`. \cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsBare{Projection traits such as `CGAL::Projection_traits_xy_3<K>`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel) \sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/ */

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeVertex_2` describes the requirements for the base vertex
RegularTriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a regular triangulation, RegularTriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_2TriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_2TriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_vertex_base_2` (templated with the appropriate triangulation vertex base class). \cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Alpha_shape_vertex_base_2` (templated with the appropriate triangulation vertex base class)}
\cgalHasModelsEnd
*/ */
class AlphaShapeVertex_2 { class AlphaShapeVertex_2 {
public: public:

View File

@ -9,8 +9,10 @@ of the underlying regular triangulation of a weighted alpha shape.
\cgalRefines{RegularTriangulationTraits_2 if the underlying triangulation of the alpha shape is a regular triangulation.} \cgalRefines{RegularTriangulationTraits_2 if the underlying triangulation of the alpha shape is a regular triangulation.}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`. \cgalHasModelsBare{All models of `Kernel`,}
\cgalHasModelsBare{Projection traits such as `CGAL::Projection_traits_xy_3<K>`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel) \sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/ */

View File

@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
//members //members
//the members can be updated when calling method exact() //the members can be updated when calling method exact()
mutable boost::optional<NT_exact> exact_; mutable std::optional<NT_exact> exact_;
mutable NT_approx approx_; mutable NT_approx approx_;
//private functions //private functions
@ -235,7 +235,7 @@ public:
const NT_exact& exact() const const NT_exact& exact() const
{ {
if (exact_ == boost::none) { if (exact_ == std::nullopt) {
update_exact(); update_exact();
approx_=to_interval(*exact_); approx_=to_interval(*exact_);
} }

View File

@ -19,7 +19,7 @@ provided in the documentation of `Alpha_shape_3` for more details. The default v
must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation
and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink. and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeCell_3` \cgalModels{AlphaShapeCell_3}
\sa `Delaunay_triangulation_cell_base_3` \sa `Delaunay_triangulation_cell_base_3`
\sa `Regular_triangulation_cell_base_3` \sa `Regular_triangulation_cell_base_3`

View File

@ -19,7 +19,7 @@ provided in the documentation of `Alpha_shape_3` for more details. The default v
must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation
and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink. and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeVertex_3` \cgalModels{AlphaShapeVertex_3}
\sa `Triangulation_vertex_base_3` \sa `Triangulation_vertex_base_3`
\sa `Regular_triangulation_vertex_base_3` \sa `Regular_triangulation_vertex_base_3`

View File

@ -13,7 +13,7 @@ to the `Alpha_shape_3` class.
By default, it is instantiated with `Delaunay_triangulation_cell_base_3<Traits>`, By default, it is instantiated with `Delaunay_triangulation_cell_base_3<Traits>`,
which is appropriate for basic alpha shapes. which is appropriate for basic alpha shapes.
\cgalModels `FixedAlphaShapeCell_3` \cgalModels{FixedAlphaShapeCell_3}
\sa `Alpha_shape_cell_base_3` \sa `Alpha_shape_cell_base_3`
\sa `Delaunay_triangulation_cell_base_3` \sa `Delaunay_triangulation_cell_base_3`

View File

@ -13,7 +13,7 @@ to the `Alpha_shape_3` class.
By default, it is instantiated with `Triangulation_vertex_base_3<Traits>`, By default, it is instantiated with `Triangulation_vertex_base_3<Traits>`,
which is appropriate for basic alpha shapes. which is appropriate for basic alpha shapes.
\cgalModels `FixedAlphaShapeVertex_3` \cgalModels{FixedAlphaShapeVertex_3}
\sa `Alpha_shape_vertex_base_3` \sa `Alpha_shape_vertex_base_3`
\sa `Triangulation_vertex_base_3` \sa `Triangulation_vertex_base_3`

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeCell_3` describes the requirements for the base cell of a
RegularTriangulationCellBase_3 if the underlying triangulation of the alpha shape is a regular triangulation, RegularTriangulationCellBase_3 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_3TriangulationDSCellBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_3TriangulationDSCellBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_cell_base_3` (templated with the appropriate triangulation cell base class). \cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Alpha_shape_cell_base_3` (templated with the appropriate triangulation cell base class)}
\cgalHasModelsEnd
\sa `CGAL::Alpha_status` \sa `CGAL::Alpha_status`

View File

@ -10,7 +10,9 @@ of the underlying Delaunay triangulation of a basic alpha shape.
\cgalRefines{DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a Delaunay triangulation, \cgalRefines{DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a Delaunay triangulation,
Periodic_3DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation} Periodic_3DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel) \sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/ */

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeVertex_3` describes the requirements for the base vertex
RegularTriangulationVertexBase_3 if the underlying triangulation of the alpha shape is a regular triangulation. RegularTriangulationVertexBase_3 if the underlying triangulation of the alpha shape is a regular triangulation.
Periodic_3TriangulationDSVertexBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_3TriangulationDSVertexBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_vertex_base_3` (templated with the appropriate triangulation vertex base class). \cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Alpha_shape_vertex_base_3` (templated with the appropriate triangulation vertex base class)}
\cgalHasModelsEnd
\sa `CGAL::Alpha_status` \sa `CGAL::Alpha_status`

View File

@ -9,7 +9,9 @@ The concept `FixedAlphaShapeCell_3` describes the requirements for the base cell
RegularTriangulationCellBase_3 if the underlying triangulation of the alpha shape is a regular triangulation, RegularTriangulationCellBase_3 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_3TriangulationDSCellBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_3TriangulationDSCellBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Fixed_alpha_shape_cell_base_3` (templated with the appropriate triangulation cell base class). \cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Fixed_alpha_shape_cell_base_3` (templated with the appropriate triangulation cell base class)}
\cgalHasModelsEnd
*/ */
class FixedAlphaShapeCell_3 { class FixedAlphaShapeCell_3 {
public: public:

View File

@ -10,7 +10,9 @@ of the underlying Delaunay triangulation of a basic alpha shape with a fixed val
\cgalRefines{DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a Delaunay triangulation, \cgalRefines{DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a Delaunay triangulation,
Periodic_3DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation} Periodic_3DelaunayTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsEnd
\sa CGAL::Exact_predicates_inexact_constructions_kernel (recommended kernel) \sa CGAL::Exact_predicates_inexact_constructions_kernel (recommended kernel)
*/ */

View File

@ -9,7 +9,9 @@ The concept `FixedAlphaShapeVertex_3` describes the requirements for the base ve
RegularTriangulationVertexBase_3 if the underlying triangulation of the alpha shape is a regular triangulation, RegularTriangulationVertexBase_3 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_3TriangulationDSVertexBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation} Periodic_3TriangulationDSVertexBase_3 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Fixed_alpha_shape_vertex_base_3` (templated with the appropriate triangulation vertex base class). \cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Fixed_alpha_shape_vertex_base_3` (templated with the appropriate triangulation vertex base class)}
\cgalHasModelsEnd
*/ */
class FixedAlphaShapeVertex_3 { class FixedAlphaShapeVertex_3 {

View File

@ -9,7 +9,9 @@ for the geometric traits class of the underlying regular triangulation of a weig
\cgalRefines{RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a regular triangulation, \cgalRefines{RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_3RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic regular triangulation} Periodic_3RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic regular triangulation}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel) \sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/ */

View File

@ -10,7 +10,9 @@ of the underlying regular triangulation of a weighted alpha shape.
\cgalRefines{RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a regular triangulation, \cgalRefines{RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_3RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic regular triangulation} Periodic_3RegularTriangulationTraits_3 if the underlying triangulation of the alpha shape is a periodic regular triangulation}
\cgalHasModel All models of `Kernel`. \cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel) \sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/ */

View File

@ -22,7 +22,7 @@
#include <memory> #include <memory>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#include <boost/optional.hpp> #include <optional>
#include <iostream> #include <iostream>
@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
//members //members
//the members can be updated when calling method exact() //the members can be updated when calling method exact()
mutable boost::optional<NT_exact> exact_; mutable std::optional<NT_exact> exact_;
mutable NT_approx approx_; mutable NT_approx approx_;
//private functions //private functions
@ -229,7 +229,7 @@ public:
} }
const NT_exact& exact() const { const NT_exact& exact() const {
if (exact_ == boost::none){ if (exact_ == std::nullopt){
update_exact(); update_exact();
approx_=to_interval(*exact_); approx_=to_interval(*exact_);
} }

View File

@ -9,10 +9,12 @@ The concept `AlphaWrapOracle` defines the requirements for an Alpha Wrap <em>Ora
that answers a number of queries over the input of the algorithm. that answers a number of queries over the input of the algorithm.
The oracle is the template parameter of the class `CGAL::Alpha_wraps_3_::Alpha_wrap_3`. The oracle is the template parameter of the class `CGAL::Alpha_wraps_3_::Alpha_wrap_3`.
\cgalHasModel `CGAL::Alpha_wraps_3_::Point_set_oracle` \cgalHasModelsBegin
\cgalHasModel `CGAL::Alpha_wraps_3_::Segment_soup_oracle` \cgalHasModels{CGAL::Alpha_wraps_3_::Point_set_oracle}
\cgalHasModel `CGAL::Alpha_wraps_3_::Triangle_mesh_oracle` \cgalHasModels{CGAL::Alpha_wraps_3_::Segment_soup_oracle}
\cgalHasModel `CGAL::Alpha_wraps_3_::Triangle_soup_oracle` \cgalHasModels{CGAL::Alpha_wraps_3_::Triangle_mesh_oracle}
\cgalHasModels{CGAL::Alpha_wraps_3_::Triangle_soup_oracle}
\cgalHasModelsEnd
*/ */
template <typename GeomTraits> template <typename GeomTraits>

View File

@ -11,7 +11,9 @@ you require Kernel. Stitch_borders doesn't even have clear geometric traits requ
The concept `AlphaWrapTraits_3` defines the requirements for the geometric traits class The concept `AlphaWrapTraits_3` defines the requirements for the geometric traits class
of an alpha wrap oracle. of an alpha wrap oracle.
\cgalHasModel Any 3D %kernel is a model of this traits concept. \cgalHasModelsBegin
\cgalHasModelsBare{Any 3D %kernel is a model of this traits concept}
\cgalHasModelsEnd
*/ */
class AlphaWrapTraits_3 class AlphaWrapTraits_3

View File

@ -12,3 +12,4 @@ create_single_source_cgal_program("triangle_soup_wrap.cpp")
create_single_source_cgal_program("point_set_wrap.cpp") create_single_source_cgal_program("point_set_wrap.cpp")
create_single_source_cgal_program("wrap_from_cavity.cpp") create_single_source_cgal_program("wrap_from_cavity.cpp")
create_single_source_cgal_program("mixed_inputs_wrap.cpp") create_single_source_cgal_program("mixed_inputs_wrap.cpp")
create_single_source_cgal_program("volumetric_wrap.cpp")

View File

@ -16,9 +16,9 @@ using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point_3 = K::Point_3; using Point_3 = K::Point_3;
using Segment_3 = K::Segment_3; using Segment_3 = K::Segment_3;
using Face = std::array<std::size_t, 3>;
using Segments = std::vector<Segment_3>; using Segments = std::vector<Segment_3>;
using Points = std::vector<Point_3>; using Points = std::vector<Point_3>;
using Face = std::array<std::size_t, 3>;
using Faces = std::vector<Face>; using Faces = std::vector<Face>;
using Mesh = CGAL::Surface_mesh<Point_3>; using Mesh = CGAL::Surface_mesh<Point_3>;

View File

@ -0,0 +1,173 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/alpha_wrap_3.h>
#include <CGAL/tetrahedral_remeshing.h>
#include <CGAL/Tetrahedral_remeshing/Remeshing_cell_base_3.h>
#include <CGAL/Tetrahedral_remeshing/Remeshing_vertex_base_3.h>
#include <CGAL/Simplicial_mesh_cell_base_3.h>
#include <CGAL/Simplicial_mesh_vertex_base_3.h>
#include <CGAL/Polygon_mesh_processing/bbox.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <CGAL/property_map.h>
#include <CGAL/Real_timer.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/draw_triangulation_3.h>
#include <CGAL/IO/Triangulation_off_ostream_3.h>
#include <CGAL/IO/File_medit.h>
#include <iostream>
#include <string>
namespace PMP = CGAL::Polygon_mesh_processing;
namespace AW3i = CGAL::Alpha_wraps_3::internal;
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point_3 = K::Point_3;
using Points = std::vector<Point_3>;
using Face = std::array<std::size_t, 3>;
using Faces = std::vector<Face>;
using Mesh = CGAL::Surface_mesh<Point_3>;
// If we provide a triangulation, AW3 uses its Gt, so we have to make the Gt stack explicit
using Gtb = AW3i::Alpha_wrap_AABB_geom_traits<K>; // provides Ball_3
using Gt = CGAL::Robust_circumcenter_filtered_traits_3<Gtb>; // better inexact constructions (not mandatory)
// Since we are going to use tetrahedral remeshing on the underlying triangulation,
// we need special vertex and cell base types that meets the requirements of the
// tetrahedral remeshing concepts
using Vbbb = AW3i::Alpha_wrap_triangulation_vertex_base_3<K>;
using Vbb = CGAL::Simplicial_mesh_vertex_base_3<K, int, int, int, int, Vbbb>;
using Vb = CGAL::Tetrahedral_remeshing::Remeshing_vertex_base_3<K, Vbb>;
using Cbbb = AW3i::Alpha_wrap_triangulation_cell_base_3<K>;
using Cbb = CGAL::Simplicial_mesh_cell_base_3<K, int, int, Cbbb>;
using Cb = CGAL::Tetrahedral_remeshing::Remeshing_cell_base_3<K, Cbb>;
using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
using Delaunay_triangulation = CGAL::Delaunay_triangulation_3<Gt, Tds, CGAL::Fast_location>;
// because the Fast_location does all kinds of rebinding shenanigans + T3_hierarchy is in the stack...
using Triangulation = CGAL::Triangulation_3<typename Delaunay_triangulation::Geom_traits,
typename Delaunay_triangulation::Triangulation_data_structure>;
using Facet = Triangulation::Facet;
int main(int argc, char** argv)
{
// Read the input
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/bull.off");
std::cout << "Reading " << filename << "..." << std::endl;
Points points;
Faces faces;
if(!CGAL::IO::read_polygon_soup(filename, points, faces) || faces.empty())
{
std::cerr << "Invalid input." << std::endl;
return EXIT_FAILURE;
}
std::cout << "Input: " << points.size() << " vertices, " << faces.size() << " faces" << std::endl;
// Compute the alpha and offset values
const double relative_alpha = (argc > 2) ? std::stod(argv[2]) : 20.;
const double relative_offset = (argc > 3) ? std::stod(argv[3]) : 600.;
CGAL::Bbox_3 bbox;
for(const Point_3& p : points)
bbox += p.bbox();
const double diag_length = std::sqrt(CGAL::square(bbox.xmax() - bbox.xmin()) +
CGAL::square(bbox.ymax() - bbox.ymin()) +
CGAL::square(bbox.zmax() - bbox.zmin()));
const double alpha = diag_length / relative_alpha;
const double offset = diag_length / relative_offset;
std::cout << "alpha: " << alpha << ", offset: " << offset << std::endl;
// Construct the wrap
CGAL::Real_timer t;
t.start();
using Oracle = CGAL::Alpha_wraps_3::internal::Triangle_soup_oracle<K>;
Oracle oracle(K{});
oracle.add_triangle_soup(points, faces, CGAL::parameters::default_values());
CGAL::Alpha_wraps_3::internal::Alpha_wrap_3<Oracle, Delaunay_triangulation> aw3(oracle);
Mesh wrap;
aw3(alpha, offset, wrap);
t.stop();
std::cout << "Result: " << num_vertices(wrap) << " vertices, " << num_faces(wrap) << " faces" << std::endl;
std::cout << "Took " << t.time() << " s." << std::endl;
// Get the interior tetrahedrization
auto dt = aw3.triangulation();
// Save the result
std::string input_name = std::string(filename);
input_name = input_name.substr(input_name.find_last_of("/") + 1, input_name.length() - 1);
input_name = input_name.substr(0, input_name.find_last_of("."));
std::string output_name = input_name
+ "_" + std::to_string(static_cast<int>(relative_alpha))
+ "_" + std::to_string(static_cast<int>(relative_offset)) + ".off";
std::cout << "Writing to " << output_name << std::endl;
CGAL::IO::write_polygon_mesh(output_name, wrap, CGAL::parameters::stream_precision(17));
// Remesh the interior of the wrap
const Delaunay_triangulation& aw3_dt = aw3.triangulation();
const Triangulation& aw3_tr = static_cast<const Triangulation&>(aw3_dt);
Triangulation tr = aw3_tr; // intentional copy
std::cout << "BEFORE: " << tr.number_of_vertices() << " vertices, " << tr.number_of_cells() << " cells" << std::endl;
// Set up the c3t3 information
for(auto v : tr.finite_vertex_handles())
v->set_dimension(3);
for(auto c : tr.finite_cell_handles())
{
if(c->is_outside())
c->set_subdomain_index(0);
else
c->set_subdomain_index(1);
// if the neighboring cell has a different outside info, put the vertices
// of the common face on the surface boundary
for(int i=0; i<4; ++i)
{
if(c->neighbor(i)->is_outside() != c->is_outside())
{
c->set_surface_patch_index(i, 1);
for(int j=1; j<4; ++j)
c->vertex((i+j)%4)->set_dimension(2);
}
}
}
std::ofstream out_before("before_remeshing.mesh");
CGAL::IO::write_MEDIT(out_before, tr);
// edge length of equilateral triangle with circumradius alpha
// const double l = 2 * alpha * 0.8660254037844386; // sqrt(3)/2
// edge length of regular tetrahedron with circumradius alpha
const double l = 1.6329931618554521 * alpha; // sqrt(8/3)
CGAL::tetrahedral_isotropic_remeshing(tr, l, CGAL::parameters::remesh_boundaries(false));
std::cout << "AFTER: " << tr.number_of_vertices() << " vertices, " << tr.number_of_cells() << " cells" << std::endl;
std::ofstream out_after("after_remeshing.mesh");
CGAL::IO::write_MEDIT(out_after, tr);
return EXIT_SUCCESS;
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2019-2022 Google LLC (USA). // Copyright (c) 2019-2023 Google LLC (USA).
// All rights reserved. // All rights reserved.
// //
// This file is part of CGAL (www.cgal.org). // This file is part of CGAL (www.cgal.org).
@ -29,16 +29,25 @@
#include <CGAL/license/Alpha_wrap_3.h> #include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_cell_base_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_triangulation_vertex_base_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h> #include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/gate_priority_queue.h> #include <CGAL/Alpha_wrap_3/internal/gate_priority_queue.h>
#include <CGAL/Alpha_wrap_3/internal/geometry_utils.h> #include <CGAL/Alpha_wrap_3/internal/geometry_utils.h>
#include <CGAL/Alpha_wrap_3/internal/oracles.h> #include <CGAL/Alpha_wrap_3/internal/oracles.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h>
#include <CGAL/Robust_weighted_circumcenter_filtered_traits_3.h>
#include <CGAL/Cartesian_converter.h> #include <CGAL/Cartesian_converter.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/boost/graph/Euler_operations.h> #include <CGAL/boost/graph/Euler_operations.h>
#include <CGAL/boost/graph/named_params_helper.h> #include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Default.h>
#include <CGAL/Named_function_parameters.h> #include <CGAL/Named_function_parameters.h>
#include <CGAL/Modifiable_priority_queue.h> #include <CGAL/Modifiable_priority_queue.h>
#include <CGAL/Polygon_mesh_processing/bbox.h> #include <CGAL/Polygon_mesh_processing/bbox.h>
@ -50,16 +59,9 @@
#include <CGAL/Polygon_mesh_processing/stitch_borders.h> // only if non-manifoldness is not treated #include <CGAL/Polygon_mesh_processing/stitch_borders.h> // only if non-manifoldness is not treated
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
#include <CGAL/Real_timer.h> #include <CGAL/Real_timer.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
#include <CGAL/Triangulation_cell_base_with_info_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Robust_weighted_circumcenter_filtered_traits_3.h>
#include <array>
#include <algorithm> #include <algorithm>
#include <array>
#include <fstream> #include <fstream>
#include <functional> #include <functional>
#include <iostream> #include <iostream>
@ -74,30 +76,11 @@ namespace CGAL {
namespace Alpha_wraps_3 { namespace Alpha_wraps_3 {
namespace internal { namespace internal {
template <typename Cb> namespace {
class Cell_base_with_timestamp
: public Cb
{
std::size_t time_stamp_;
public: namespace AW3i = ::CGAL::Alpha_wraps_3::internal;
template <typename... Args>
Cell_base_with_timestamp(const Args&... args) : Cb(args...), time_stamp_(-1) { }
Cell_base_with_timestamp(const Cell_base_with_timestamp& other) : Cb(other), time_stamp_(other.time_stamp_) { } } // unnamed namespace
typedef CGAL::Tag_true Has_timestamp;
std::size_t time_stamp() const { return time_stamp_; }
void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; }
template <class TDS>
struct Rebind_TDS
{
typedef typename Cb::template Rebind_TDS<TDS>::Other Cb2;
typedef Cell_base_with_timestamp<Cb2> Other;
};
};
struct Wrapping_default_visitor struct Wrapping_default_visitor
{ {
@ -125,11 +108,34 @@ struct Wrapping_default_visitor
void on_alpha_wrapping_end(const AlphaWrapper&) { }; void on_alpha_wrapping_end(const AlphaWrapper&) { };
}; };
template <typename Oracle> template <typename Oracle_,
typename Triangulation_ = CGAL::Default>
class Alpha_wrap_3 class Alpha_wrap_3
{ {
using Oracle = Oracle_;
// Triangulation
using Base_GT = typename Oracle::Geom_traits; using Base_GT = typename Oracle::Geom_traits;
using Geom_traits = Robust_circumcenter_filtered_traits_3<Base_GT>; using Default_Gt = CGAL::Robust_circumcenter_filtered_traits_3<Base_GT>;
using Default_Vb = Alpha_wrap_triangulation_vertex_base_3<Default_Gt>;
using Default_Cb = Alpha_wrap_triangulation_cell_base_3<Default_Gt>;
using Default_Cbt = Cell_base_with_timestamp<Default_Cb>; // determinism
using Default_Tds = CGAL::Triangulation_data_structure_3<Default_Vb, Default_Cbt>;
using Default_Triangulation = CGAL::Delaunay_triangulation_3<Default_Gt, Default_Tds, Fast_location>;
using Triangulation = typename Default::Get<Triangulation_, Default_Triangulation>::type;
using Cell_handle = typename Triangulation::Cell_handle;
using Facet = typename Triangulation::Facet;
using Vertex_handle = typename Triangulation::Vertex_handle;
using Locate_type = typename Triangulation::Locate_type;
using Gate = internal::Gate<Triangulation>;
using Alpha_PQ = Modifiable_priority_queue<Gate, Less_gate, Gate_ID_PM<Triangulation>, CGAL_BOOST_PAIRING_HEAP>;
// Use the geom traits from the triangulation, and trust the (advanced) user that provided it
using Geom_traits = typename Triangulation::Geom_traits;
using FT = typename Geom_traits::FT; using FT = typename Geom_traits::FT;
using Point_3 = typename Geom_traits::Point_3; using Point_3 = typename Geom_traits::Point_3;
@ -143,34 +149,6 @@ class Alpha_wrap_3
using SC_Iso_cuboid_3 = SC::Iso_cuboid_3; using SC_Iso_cuboid_3 = SC::Iso_cuboid_3;
using SC2GT = Cartesian_converter<SC, Geom_traits>; using SC2GT = Cartesian_converter<SC, Geom_traits>;
struct Cell_info
{
bool is_outside = false;
};
enum Vertex_info
{
DEFAULT = 0,
BBOX_VERTEX,
SEED_VERTEX
};
using Vb = Triangulation_vertex_base_3<Geom_traits>;
using Vbi = Triangulation_vertex_base_with_info_3<Vertex_info, Geom_traits, Vb>;
using Cbb = Delaunay_triangulation_cell_base_3<Geom_traits>;
using Cb = Delaunay_triangulation_cell_base_with_circumcenter_3<Geom_traits, Cbb>;
using Cbi = Triangulation_cell_base_with_info_3<Cell_info, Geom_traits, Cb>;
using Cbt = Cell_base_with_timestamp<Cbi>;
using Tds = Triangulation_data_structure_3<Vbi, Cbt>;
using Dt = Delaunay_triangulation_3<Geom_traits, Tds, Fast_location>;
using Cell_handle = typename Dt::Cell_handle;
using Facet = typename Dt::Facet;
using Vertex_handle = typename Dt::Vertex_handle;
using Locate_type = typename Dt::Locate_type;
using Gate = internal::Gate<Dt>;
using Alpha_PQ = Modifiable_priority_queue<Gate, Less_gate, Gate_ID_PM<Dt>, CGAL_BOOST_PAIRING_HEAP>;
protected: protected:
const Oracle m_oracle; const Oracle m_oracle;
@ -179,7 +157,7 @@ protected:
FT m_alpha, m_sq_alpha; FT m_alpha, m_sq_alpha;
FT m_offset, m_sq_offset; FT m_offset, m_sq_offset;
Dt m_dt; Triangulation m_tr;
Alpha_PQ m_queue; Alpha_PQ m_queue;
public: public:
@ -187,7 +165,7 @@ public:
Alpha_wrap_3(const Oracle& oracle) Alpha_wrap_3(const Oracle& oracle)
: :
m_oracle(oracle), m_oracle(oracle),
m_dt(Geom_traits(oracle.geom_traits())), m_tr(Geom_traits(oracle.geom_traits())),
// used to set up the initial MPQ, use some arbitrary not-too-small value // used to set up the initial MPQ, use some arbitrary not-too-small value
m_queue(4096) m_queue(4096)
{ {
@ -197,9 +175,9 @@ public:
} }
public: public:
const Geom_traits& geom_traits() const { return m_dt.geom_traits(); } const Geom_traits& geom_traits() const { return m_tr.geom_traits(); }
Dt& triangulation() { return m_dt; } Triangulation& triangulation() { return m_tr; }
const Dt& triangulation() const { return m_dt; } const Triangulation& triangulation() const { return m_tr; }
const Alpha_PQ& queue() const { return m_queue; } const Alpha_PQ& queue() const { return m_queue; }
double default_alpha() const double default_alpha() const
@ -216,13 +194,13 @@ private:
const Point_3& circumcenter(const Cell_handle c) const const Point_3& circumcenter(const Cell_handle c) const
{ {
// We only cross an infinite facet once, so this isn't going to be recomputed many times // We only cross an infinite facet once, so this isn't going to be recomputed many times
if(m_dt.is_infinite(c)) if(m_tr.is_infinite(c))
{ {
const int inf_index = c->index(m_dt.infinite_vertex()); const int inf_index = c->index(m_tr.infinite_vertex());
c->set_circumcenter( c->set_circumcenter(
geom_traits().construct_circumcenter_3_object()(m_dt.point(c, (inf_index+1)&3), geom_traits().construct_circumcenter_3_object()(m_tr.point(c, (inf_index+1)&3),
m_dt.point(c, (inf_index+2)&3), m_tr.point(c, (inf_index+2)&3),
m_dt.point(c, (inf_index+3)&3))); m_tr.point(c, (inf_index+3)&3)));
} }
return c->circumcenter(geom_traits()); return c->circumcenter(geom_traits());
@ -418,11 +396,11 @@ private:
for(int i=0; i<8; ++i) for(int i=0; i<8; ++i)
{ {
const Point_3 bp = SC2GT()(m_bbox.vertex(i)); const Point_3 bp = SC2GT()(m_bbox.vertex(i));
Vertex_handle bv = m_dt.insert(bp); Vertex_handle bv = m_tr.insert(bp);
#ifdef CGAL_AW3_DEBUG_INITIALIZATION #ifdef CGAL_AW3_DEBUG_INITIALIZATION
std::cout << "\t" << bp << std::endl; std::cout << "\t" << bp << std::endl;
#endif #endif
bv->info() = BBOX_VERTEX; bv->type() = AW3i::Vertex_type:: BBOX_VERTEX;
} }
} }
@ -433,7 +411,7 @@ private:
// that the refinement point is separated from the existing point set. // that the refinement point is separated from the existing point set.
bool cavity_cell_outside_tag(const Cell_handle ch) bool cavity_cell_outside_tag(const Cell_handle ch)
{ {
CGAL_precondition(!m_dt.is_infinite(ch)); CGAL_precondition(!m_tr.is_infinite(ch));
const Tetrahedron_with_outside_info<Geom_traits> tet(ch, geom_traits()); const Tetrahedron_with_outside_info<Geom_traits> tet(ch, geom_traits());
if(m_oracle.do_intersect(tet)) if(m_oracle.do_intersect(tet))
@ -536,8 +514,8 @@ private:
// This problem only appears when the seed and icosahedron vertices are close to the offset surface, // This problem only appears when the seed and icosahedron vertices are close to the offset surface,
// which usually happens for large alpha values. // which usually happens for large alpha values.
Vertex_handle seed_v = m_dt.insert(seed_p); Vertex_handle seed_v = m_tr.insert(seed_p);
seed_v->info() = SEED_VERTEX; seed_v->type() = AW3i::Vertex_type:: SEED_VERTEX;
seed_vs.push_back(seed_v); seed_vs.push_back(seed_v);
// Icosahedron vertices (see also BGL::make_icosahedron()) // Icosahedron vertices (see also BGL::make_icosahedron())
@ -573,8 +551,8 @@ private:
if(bbox.has_on_unbounded_side(seed_neighbor_p)) if(bbox.has_on_unbounded_side(seed_neighbor_p))
continue; continue;
Vertex_handle ico_v = m_dt.insert(seed_neighbor_p, seed_v /*hint*/); Vertex_handle ico_v = m_tr.insert(seed_neighbor_p, seed_v /*hint*/);
ico_v->info() = SEED_VERTEX; ico_v->type() = AW3i::Vertex_type:: SEED_VERTEX;
} }
} }
@ -587,26 +565,26 @@ private:
} }
#ifdef CGAL_AW3_DEBUG_INITIALIZATION #ifdef CGAL_AW3_DEBUG_INITIALIZATION
std::cout << m_dt.number_of_vertices() - 8 /*bbox*/ << " vertice(s) due to seeds" << std::endl; std::cout << m_tr.number_of_vertices() - 8 /*bbox*/ << " vertice(s) due to seeds" << std::endl;
#endif #endif
for(Vertex_handle seed_v : seed_vs) for(Vertex_handle seed_v : seed_vs)
{ {
std::vector<Cell_handle> inc_cells; std::vector<Cell_handle> inc_cells;
inc_cells.reserve(64); inc_cells.reserve(64);
m_dt.incident_cells(seed_v, std::back_inserter(inc_cells)); m_tr.incident_cells(seed_v, std::back_inserter(inc_cells));
for(Cell_handle ch : inc_cells) for(Cell_handle ch : inc_cells)
ch->info().is_outside = cavity_cell_outside_tag(ch); ch->is_outside() = cavity_cell_outside_tag(ch);
} }
// Might as well go through the full triangulation since only seeds should have been inserted // Might as well go through the full triangulation since only seeds should have been inserted
for(Cell_handle ch : m_dt.all_cell_handles()) for(Cell_handle ch : m_tr.all_cell_handles())
{ {
if(!ch->info().is_outside) if(!ch->is_outside())
continue; continue;
// When the algorithm starts from a manually dug hole, infinite cells are tagged "inside" // When the algorithm starts from a manually dug hole, infinite cells are tagged "inside"
CGAL_assertion(!m_dt.is_infinite(ch)); CGAL_assertion(!m_tr.is_infinite(ch));
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
push_facet(std::make_pair(ch, i)); push_facet(std::make_pair(ch, i));
@ -627,17 +605,17 @@ private:
// init queue with all convex hull facets // init queue with all convex hull facets
bool initialize_from_infinity() bool initialize_from_infinity()
{ {
for(Cell_handle ch : m_dt.all_cell_handles()) for(Cell_handle ch : m_tr.all_cell_handles())
{ {
if(m_dt.is_infinite(ch)) if(m_tr.is_infinite(ch))
{ {
ch->info().is_outside = true; ch->is_outside() = true;
const int inf_index = ch->index(m_dt.infinite_vertex()); const int inf_index = ch->index(m_tr.infinite_vertex());
push_facet(std::make_pair(ch, inf_index)); push_facet(std::make_pair(ch, inf_index));
} }
else else
{ {
ch->info().is_outside = false; ch->is_outside() = false;
} }
} }
@ -659,13 +637,13 @@ public:
clear(output_mesh); clear(output_mesh);
CGAL_assertion_code(for(auto cit=m_dt.finite_cells_begin(), cend=m_dt.finite_cells_end(); cit!=cend; ++cit)) CGAL_assertion_code(for(auto cit=m_tr.finite_cells_begin(), cend=m_tr.finite_cells_end(); cit!=cend; ++cit))
CGAL_assertion(cit->tds_data().is_clear()); CGAL_assertion(cit->tds_data().is_clear());
for(auto cit=m_dt.finite_cells_begin(), cend=m_dt.finite_cells_end(); cit!=cend; ++cit) for(auto cit=m_tr.finite_cells_begin(), cend=m_tr.finite_cells_end(); cit!=cend; ++cit)
{ {
Cell_handle seed = cit; Cell_handle seed = cit;
if(seed->info().is_outside || seed->tds_data().processed()) if(seed->is_outside() || seed->tds_data().processed())
continue; continue;
std::queue<Cell_handle> to_visit; std::queue<Cell_handle> to_visit;
@ -678,7 +656,7 @@ public:
while(!to_visit.empty()) while(!to_visit.empty())
{ {
const Cell_handle cell = to_visit.front(); const Cell_handle cell = to_visit.front();
CGAL_assertion(!cell->info().is_outside && !m_dt.is_infinite(cell)); CGAL_assertion(!cell->is_outside() && !m_tr.is_infinite(cell));
to_visit.pop(); to_visit.pop();
@ -690,17 +668,17 @@ public:
for(int fid=0; fid<4; ++fid) for(int fid=0; fid<4; ++fid)
{ {
const Cell_handle neighbor = cell->neighbor(fid); const Cell_handle neighbor = cell->neighbor(fid);
if(neighbor->info().is_outside) if(neighbor->is_outside())
{ {
// There shouldn't be any artificial vertex on the inside/outside boundary // There shouldn't be any artificial vertex on the inside/outside boundary
// (past initialization) // (past initialization)
// CGAL_assertion(cell->vertex((fid + 1)&3)->info() == DEFAULT); // CGAL_assertion(cell->vertex((fid + 1)&3)->type() == AW3i::Vertex_type:: DEFAULT);
// CGAL_assertion(cell->vertex((fid + 2)&3)->info() == DEFAULT); // CGAL_assertion(cell->vertex((fid + 2)&3)->type() == AW3i::Vertex_type:: DEFAULT);
// CGAL_assertion(cell->vertex((fid + 3)&3)->info() == DEFAULT); // CGAL_assertion(cell->vertex((fid + 3)&3)->type() == AW3i::Vertex_type:: DEFAULT);
points.push_back(m_dt.point(cell, Dt::vertex_triple_index(fid, 0))); points.push_back(m_tr.point(cell, Triangulation::vertex_triple_index(fid, 0)));
points.push_back(m_dt.point(cell, Dt::vertex_triple_index(fid, 1))); points.push_back(m_tr.point(cell, Triangulation::vertex_triple_index(fid, 1)));
points.push_back(m_dt.point(cell, Dt::vertex_triple_index(fid, 2))); points.push_back(m_tr.point(cell, Triangulation::vertex_triple_index(fid, 2)));
faces.push_back({idx, idx + 1, idx + 2}); faces.push_back({idx, idx + 1, idx + 2});
idx += 3; idx += 3;
} }
@ -722,7 +700,7 @@ public:
CGAL_assertion(is_closed(output_mesh)); CGAL_assertion(is_closed(output_mesh));
} }
for(auto cit=m_dt.finite_cells_begin(), cend=m_dt.finite_cells_end(); cit!=cend; ++cit) for(auto cit=m_tr.finite_cells_begin(), cend=m_tr.finite_cells_end(); cit!=cend; ++cit)
cit->tds_data().clear(); cit->tds_data().clear();
CGAL_postcondition(!is_empty(output_mesh)); CGAL_postcondition(!is_empty(output_mesh));
@ -742,7 +720,7 @@ public:
std::cout << "> Extract wrap... ()" << std::endl; std::cout << "> Extract wrap... ()" << std::endl;
#endif #endif
CGAL_assertion_code(for(Vertex_handle v : m_dt.finite_vertex_handles())) CGAL_assertion_code(for(Vertex_handle v : m_tr.finite_vertex_handles()))
CGAL_assertion(!is_non_manifold(v)); CGAL_assertion(!is_non_manifold(v));
clear(output_mesh); clear(output_mesh);
@ -754,26 +732,26 @@ public:
std::unordered_map<Vertex_handle, std::size_t> vertex_to_id; std::unordered_map<Vertex_handle, std::size_t> vertex_to_id;
std::size_t nv = 0; std::size_t nv = 0;
for(auto fit=m_dt.finite_facets_begin(), fend=m_dt.finite_facets_end(); fit!=fend; ++fit) for(auto fit=m_tr.finite_facets_begin(), fend=m_tr.finite_facets_end(); fit!=fend; ++fit)
{ {
Facet f = *fit; Facet f = *fit;
if(!f.first->info().is_outside) if(!f.first->is_outside())
f = m_dt.mirror_facet(f); f = m_tr.mirror_facet(f);
const Cell_handle c = f.first; const Cell_handle c = f.first;
const int s = f.second; const int s = f.second;
const Cell_handle nh = c->neighbor(s); const Cell_handle nh = c->neighbor(s);
if(c->info().is_outside == nh->info().is_outside) if(c->is_outside() == nh->is_outside())
continue; continue;
std::array<std::size_t, 3> ids; std::array<std::size_t, 3> ids;
for(int pos=0; pos<3; ++pos) for(int pos=0; pos<3; ++pos)
{ {
Vertex_handle vh = c->vertex(Dt::vertex_triple_index(s, pos)); Vertex_handle vh = c->vertex(Triangulation::vertex_triple_index(s, pos));
auto insertion_res = vertex_to_id.emplace(vh, nv); auto insertion_res = vertex_to_id.emplace(vh, nv);
if(insertion_res.second) // successful insertion, never-seen-before vertex if(insertion_res.second) // successful insertion, never-seen-before vertex
{ {
points.push_back(m_dt.point(vh)); points.push_back(m_tr.point(vh));
++nv; ++nv;
} }
@ -817,14 +795,14 @@ public:
private: private:
bool is_traversable(const Facet& f) const bool is_traversable(const Facet& f) const
{ {
return less_squared_radius_of_min_empty_sphere(m_sq_alpha, f, m_dt); return less_squared_radius_of_min_empty_sphere(m_sq_alpha, f, m_tr);
} }
bool compute_steiner_point(const Cell_handle ch, bool compute_steiner_point(const Cell_handle ch,
const Cell_handle neighbor, const Cell_handle neighbor,
Point_3& steiner_point) const Point_3& steiner_point) const
{ {
CGAL_precondition(!m_dt.is_infinite(neighbor)); CGAL_precondition(!m_tr.is_infinite(neighbor));
typename Geom_traits::Construct_ball_3 ball = geom_traits().construct_ball_3_object(); typename Geom_traits::Construct_ball_3 ball = geom_traits().construct_ball_3_object();
typename Geom_traits::Construct_vector_3 vector = geom_traits().construct_vector_3_object(); typename Geom_traits::Construct_vector_3 vector = geom_traits().construct_vector_3_object();
@ -920,7 +898,7 @@ private:
// e.g. from DT3 // e.g. from DT3
Facet_queue_status facet_status(const Facet& f) const Facet_queue_status facet_status(const Facet& f) const
{ {
CGAL_precondition(!m_dt.is_infinite(f)); CGAL_precondition(!m_tr.is_infinite(f));
#ifdef CGAL_AW3_DEBUG_FACET_STATUS #ifdef CGAL_AW3_DEBUG_FACET_STATUS
std::cout << "facet status: " std::cout << "facet status: "
@ -933,10 +911,10 @@ private:
const Cell_handle ch = f.first; const Cell_handle ch = f.first;
const int id = f.second; const int id = f.second;
const Cell_handle nh = ch->neighbor(id); const Cell_handle nh = ch->neighbor(id);
if(m_dt.is_infinite(nh)) if(m_tr.is_infinite(nh))
return TRAVERSABLE; return TRAVERSABLE;
if(nh->info().is_outside) if(nh->is_outside())
{ {
#ifdef CGAL_AW3_DEBUG_FACET_STATUS #ifdef CGAL_AW3_DEBUG_FACET_STATUS
std::cout << "Neighbor already outside" << std::endl; std::cout << "Neighbor already outside" << std::endl;
@ -947,8 +925,9 @@ private:
// push if facet is connected to artificial vertices // push if facet is connected to artificial vertices
for(int i=0; i<3; ++i) for(int i=0; i<3; ++i)
{ {
const Vertex_handle vh = ch->vertex(Dt::vertex_triple_index(id, i)); const Vertex_handle vh = ch->vertex(Triangulation::vertex_triple_index(id, i));
if(vh->info() == BBOX_VERTEX || vh->info() == SEED_VERTEX) if(vh->type() == AW3i::Vertex_type:: BBOX_VERTEX ||
vh->type() == AW3i::Vertex_type:: SEED_VERTEX)
{ {
#ifdef CGAL_AW3_DEBUG_FACET_STATUS #ifdef CGAL_AW3_DEBUG_FACET_STATUS
std::cout << "artificial facet due to artificial vertex #" << i << std::endl; std::cout << "artificial facet due to artificial vertex #" << i << std::endl;
@ -974,7 +953,7 @@ private:
bool push_facet(const Facet& f) bool push_facet(const Facet& f)
{ {
CGAL_precondition(f.first->info().is_outside); CGAL_precondition(f.first->is_outside());
// skip if f is already in queue // skip if f is already in queue
if(m_queue.contains_with_bounds_check(Gate(f))) if(m_queue.contains_with_bounds_check(Gate(f)))
@ -986,9 +965,9 @@ private:
const Cell_handle ch = f.first; const Cell_handle ch = f.first;
const int id = f.second; const int id = f.second;
const Point_3& p0 = m_dt.point(ch, (id+1)&3); const Point_3& p0 = m_tr.point(ch, (id+1)&3);
const Point_3& p1 = m_dt.point(ch, (id+2)&3); const Point_3& p1 = m_tr.point(ch, (id+2)&3);
const Point_3& p2 = m_dt.point(ch, (id+3)&3); const Point_3& p2 = m_tr.point(ch, (id+3)&3);
// @todo should prob be the real value we compare to alpha instead of squared_radius // @todo should prob be the real value we compare to alpha instead of squared_radius
const FT sqr = geom_traits().compute_squared_radius_3_object()(p0, p1, p2); const FT sqr = geom_traits().compute_squared_radius_3_object()(p0, p1, p2);
@ -1022,7 +1001,7 @@ private:
m_offset = FT(offset); m_offset = FT(offset);
m_sq_offset = square(m_offset); m_sq_offset = square(m_offset);
m_dt.clear(); m_tr.clear();
m_queue.clear(); m_queue.clear();
insert_bbox_corners(); insert_bbox_corners();
@ -1052,7 +1031,7 @@ private:
// const& to something that will be popped, but safe as `ch` && `id` are extracted before the pop // const& to something that will be popped, but safe as `ch` && `id` are extracted before the pop
const Gate& gate = m_queue.top(); const Gate& gate = m_queue.top();
const Facet& f = gate.facet(); const Facet& f = gate.facet();
CGAL_precondition(!m_dt.is_infinite(f)); CGAL_precondition(!m_tr.is_infinite(f));
const Cell_handle ch = f.first; const Cell_handle ch = f.first;
const int id = f.second; const int id = f.second;
@ -1060,11 +1039,11 @@ private:
#ifdef CGAL_AW3_DEBUG_QUEUE #ifdef CGAL_AW3_DEBUG_QUEUE
static int fid = 0; static int fid = 0;
std::cout << m_dt.number_of_vertices() << " DT vertices" << std::endl; std::cout << m_tr.number_of_vertices() << " DT vertices" << std::endl;
std::cout << m_queue.size() << " facets in the queue" << std::endl; std::cout << m_queue.size() << " facets in the queue" << std::endl;
std::cout << "Face " << fid++ << "\n" std::cout << "Face " << fid++ << "\n"
<< "c = " << &*ch << " (" << m_dt.is_infinite(ch) << "), n = " << &*neighbor << " (" << m_dt.is_infinite(neighbor) << ")" << "\n" << "c = " << &*ch << " (" << m_tr.is_infinite(ch) << "), n = " << &*neighbor << " (" << m_tr.is_infinite(neighbor) << ")" << "\n"
<< m_dt.point(ch, (id+1)&3) << "\n" << m_dt.point(ch, (id+2)&3) << "\n" << m_dt.point(ch, (id+3)&3) << std::endl; << m_tr.point(ch, (id+1)&3) << "\n" << m_tr.point(ch, (id+2)&3) << "\n" << m_tr.point(ch, (id+3)&3) << std::endl;
std::cout << "Priority: " << gate.priority() << std::endl; std::cout << "Priority: " << gate.priority() << std::endl;
#endif #endif
@ -1080,13 +1059,13 @@ private:
std::string face_name = "results/steps/face_" + std::to_string(static_cast<int>(i++)) + ".xyz"; std::string face_name = "results/steps/face_" + std::to_string(static_cast<int>(i++)) + ".xyz";
std::ofstream face_out(face_name); std::ofstream face_out(face_name);
face_out.precision(17); face_out.precision(17);
face_out << "3\n" << m_dt.point(ch, (id+1)&3) << "\n" << m_dt.point(ch, (id+2)&3) << "\n" << m_dt.point(ch, (id+3)&3) << std::endl; face_out << "3\n" << m_tr.point(ch, (id+1)&3) << "\n" << m_tr.point(ch, (id+2)&3) << "\n" << m_tr.point(ch, (id+3)&3) << std::endl;
face_out.close(); face_out.close();
#endif #endif
if(m_dt.is_infinite(neighbor)) if(m_tr.is_infinite(neighbor))
{ {
neighbor->info().is_outside = true; neighbor->is_outside() = true;
continue; continue;
} }
@ -1100,14 +1079,16 @@ private:
// locate cells that are going to be destroyed and remove their facet from the queue // locate cells that are going to be destroyed and remove their facet from the queue
int li, lj = 0; int li, lj = 0;
Locate_type lt; Locate_type lt;
const Cell_handle conflict_cell = m_dt.locate(steiner_point, lt, li, lj, neighbor); const Cell_handle conflict_cell = m_tr.locate(steiner_point, lt, li, lj, neighbor);
CGAL_assertion(lt != Dt::VERTEX); CGAL_assertion(lt != Triangulation::VERTEX);
// Using small vectors like in Triangulation_3 does not bring any runtime improvement
std::vector<Facet> boundary_facets; std::vector<Facet> boundary_facets;
std::vector<Cell_handle> conflict_zone; std::vector<Cell_handle> conflict_zone;
boundary_facets.reserve(32); boundary_facets.reserve(32);
conflict_zone.reserve(32); conflict_zone.reserve(32);
m_dt.find_conflicts(steiner_point, conflict_cell,
m_tr.find_conflicts(steiner_point, conflict_cell,
std::back_inserter(boundary_facets), std::back_inserter(boundary_facets),
std::back_inserter(conflict_zone)); std::back_inserter(conflict_zone));
@ -1125,7 +1106,7 @@ private:
for(const Facet& f : boundary_facets) for(const Facet& f : boundary_facets)
{ {
const Facet mf = m_dt.mirror_facet(f); // boundary facets have incident cells in the CZ const Facet mf = m_tr.mirror_facet(f); // boundary facets have incident cells in the CZ
if(m_queue.contains_with_bounds_check(Gate(mf))) if(m_queue.contains_with_bounds_check(Gate(mf)))
m_queue.erase(Gate(mf)); m_queue.erase(Gate(mf));
} }
@ -1133,18 +1114,20 @@ private:
visitor.before_Steiner_point_insertion(*this, steiner_point); visitor.before_Steiner_point_insertion(*this, steiner_point);
// Actual insertion of the Steiner point // Actual insertion of the Steiner point
Vertex_handle vh = m_dt.insert(steiner_point, lt, conflict_cell, li, lj); // We could use TDS functions to avoid recomputing the conflict zone, but in practice
vh->info() = DEFAULT; // it does not bring any runtime improvements
Vertex_handle vh = m_tr.insert(steiner_point, lt, conflict_cell, li, lj);
vh->type() = AW3i::Vertex_type:: DEFAULT;
visitor.after_Steiner_point_insertion(*this, vh); visitor.after_Steiner_point_insertion(*this, vh);
std::vector<Cell_handle> new_cells; std::vector<Cell_handle> new_cells;
new_cells.reserve(32); new_cells.reserve(32);
m_dt.incident_cells(vh, std::back_inserter(new_cells)); m_tr.incident_cells(vh, std::back_inserter(new_cells));
for(const Cell_handle& ch : new_cells) for(const Cell_handle& ch : new_cells)
{ {
// std::cout << "new cell has time stamp " << ch->time_stamp() << std::endl; // std::cout << "new cell has time stamp " << ch->time_stamp() << std::endl;
ch->info().is_outside = m_dt.is_infinite(ch); ch->is_outside() = m_tr.is_infinite(ch);
} }
// Push all new boundary facets to the queue. // Push all new boundary facets to the queue.
@ -1156,25 +1139,25 @@ private:
{ {
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
{ {
if(m_dt.is_infinite(ch, i)) if(m_tr.is_infinite(ch, i))
continue; continue;
const Cell_handle nh = ch->neighbor(i); const Cell_handle nh = ch->neighbor(i);
if(nh->info().is_outside == ch->info().is_outside) // not on the boundary if(nh->is_outside() == ch->is_outside()) // not on the boundary
continue; continue;
const Facet boundary_f = std::make_pair(ch, i); const Facet boundary_f = std::make_pair(ch, i);
if(ch->info().is_outside) if(ch->is_outside())
push_facet(boundary_f); push_facet(boundary_f);
else else
push_facet(m_dt.mirror_facet(boundary_f)); push_facet(m_tr.mirror_facet(boundary_f));
} }
} }
} }
else else
{ {
// tag neighbor as OUTSIDE // tag neighbor as OUTSIDE
neighbor->info().is_outside = true; neighbor->is_outside() = true;
// for each finite facet of neighbor, push it to the queue // for each finite facet of neighbor, push it to the queue
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
@ -1188,10 +1171,10 @@ private:
visitor.on_flood_fill_end(*this); visitor.on_flood_fill_end(*this);
// Check that no useful facet has been ignored // Check that no useful facet has been ignored
CGAL_postcondition_code(for(auto fit=m_dt.finite_facets_begin(), fend=m_dt.finite_facets_end(); fit!=fend; ++fit) {) CGAL_postcondition_code(for(auto fit=m_tr.finite_facets_begin(), fend=m_tr.finite_facets_end(); fit!=fend; ++fit) {)
CGAL_postcondition_code( if(fit->first->info().is_outside == fit->first->neighbor(fit->second)->info().is_outside) continue;) CGAL_postcondition_code( if(fit->first->is_outside() == fit->first->neighbor(fit->second)->is_outside()) continue;)
CGAL_postcondition_code( Facet f = *fit;) CGAL_postcondition_code( Facet f = *fit;)
CGAL_postcondition_code( if(!fit->first->info().is_outside) f = m_dt.mirror_facet(f);) CGAL_postcondition_code( if(!fit->first->is_outside()) f = m_tr.mirror_facet(f);)
CGAL_postcondition( facet_status(f) == IRRELEVANT); CGAL_postcondition( facet_status(f) == IRRELEVANT);
CGAL_postcondition_code(}) CGAL_postcondition_code(})
} }
@ -1199,13 +1182,13 @@ private:
private: private:
bool is_non_manifold(Vertex_handle v) const bool is_non_manifold(Vertex_handle v) const
{ {
CGAL_precondition(!m_dt.is_infinite(v)); CGAL_precondition(!m_tr.is_infinite(v));
bool is_non_manifold = false; bool is_non_manifold = false;
std::vector<Cell_handle> inc_cells; std::vector<Cell_handle> inc_cells;
inc_cells.reserve(64); inc_cells.reserve(64);
m_dt.incident_cells(v, std::back_inserter(inc_cells)); m_tr.incident_cells(v, std::back_inserter(inc_cells));
// Flood one inside and outside CC. // Flood one inside and outside CC.
// Process both an inside and an outside CC to also detect edge pinching. // Process both an inside and an outside CC to also detect edge pinching.
@ -1218,7 +1201,7 @@ private:
for(Cell_handle ic : inc_cells) for(Cell_handle ic : inc_cells)
{ {
ic->tds_data().clear(); ic->tds_data().clear();
if(ic->info().is_outside) if(ic->is_outside())
outside_start = ic; outside_start = ic;
else if(inside_start == Cell_handle()) else if(inside_start == Cell_handle())
inside_start = ic; inside_start = ic;
@ -1253,7 +1236,7 @@ private:
CGAL_assertion(neigh_c->has_vertex(v)); CGAL_assertion(neigh_c->has_vertex(v));
if(neigh_c->tds_data().processed() || if(neigh_c->tds_data().processed() ||
neigh_c->info().is_outside != curr_c->info().is_outside) // do not cross the boundary neigh_c->is_outside() != curr_c->is_outside()) // do not cross the boundary
continue; continue;
cells_to_visit.push(neigh_c); cells_to_visit.push(neigh_c);
@ -1278,7 +1261,7 @@ private:
bool is_non_manifold(Cell_handle c) const bool is_non_manifold(Cell_handle c) const
{ {
CGAL_precondition(!m_dt.is_infinite(c)); CGAL_precondition(!m_tr.is_infinite(c));
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
{ {
@ -1294,7 +1277,7 @@ private:
{ {
// Not the best complexity, but it's not important: this function is purely for information // Not the best complexity, but it's not important: this function is purely for information
// Better complexity --> see PMP::non_manifold_vertices + throw // Better complexity --> see PMP::non_manifold_vertices + throw
for(const Vertex_handle v : m_dt.finite_vertex_handles()) for(const Vertex_handle v : m_tr.finite_vertex_handles())
if(is_non_manifold(v)) if(is_non_manifold(v))
return true; return true;
@ -1307,18 +1290,18 @@ private:
bool remove_bbox_vertices() bool remove_bbox_vertices()
{ {
bool do_remove = true; bool do_remove = true;
auto vit = m_dt.finite_vertices_begin(); auto vit = m_tr.finite_vertices_begin();
for(std::size_t i=0; i<8; ++i) for(std::size_t i=0; i<8; ++i)
{ {
Vertex_handle v = vit++; Vertex_handle v = vit++;
std::vector<Cell_handle> inc_cells; std::vector<Cell_handle> inc_cells;
inc_cells.reserve(64); inc_cells.reserve(64);
m_dt.finite_incident_cells(v, std::back_inserter(inc_cells)); m_tr.finite_incident_cells(v, std::back_inserter(inc_cells));
for(Cell_handle c : inc_cells) for(Cell_handle c : inc_cells)
{ {
if(!c->info().is_outside) if(!c->is_outside())
{ {
do_remove = false; do_remove = false;
break; break;
@ -1333,11 +1316,11 @@ private:
if(!do_remove) if(!do_remove)
return false; return false;
vit = m_dt.finite_vertices_begin(); vit = m_tr.finite_vertices_begin();
for(std::size_t i=0; i<8; ++i) for(std::size_t i=0; i<8; ++i)
{ {
Vertex_handle v = vit++; Vertex_handle v = vit++;
m_dt.remove(v); m_tr.remove(v);
} }
return true; return true;
@ -1355,7 +1338,7 @@ public:
// remove_bbox_vertices(); // remove_bbox_vertices();
std::stack<Vertex_handle> non_manifold_vertices; // @todo sort somehow? std::stack<Vertex_handle> non_manifold_vertices; // @todo sort somehow?
for(Vertex_handle v : m_dt.finite_vertex_handles()) for(Vertex_handle v : m_tr.finite_vertex_handles())
{ {
if(is_non_manifold(v)) if(is_non_manifold(v))
non_manifold_vertices.push(v); non_manifold_vertices.push(v);
@ -1365,15 +1348,20 @@ public:
auto has_artificial_vertex = [](Cell_handle c) -> bool auto has_artificial_vertex = [](Cell_handle c) -> bool
{ {
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
if(c->vertex(i)->info() == BBOX_VERTEX || c->vertex(i)->info() == SEED_VERTEX) {
if(c->vertex(i)->type() == AW3i::Vertex_type:: BBOX_VERTEX ||
c->vertex(i)->type() == AW3i::Vertex_type:: SEED_VERTEX)
{
return true; return true;
}
}
return false; return false;
}; };
auto is_on_boundary = [](Cell_handle c, int i) -> bool auto is_on_boundary = [](Cell_handle c, int i) -> bool
{ {
return (c->info().is_outside != c->neighbor(i)->info().is_outside); return (c->is_outside() != c->neighbor(i)->is_outside());
}; };
auto count_boundary_facets = [&](Cell_handle c, Vertex_handle v) -> int auto count_boundary_facets = [&](Cell_handle c, Vertex_handle v) -> int
@ -1395,17 +1383,17 @@ public:
// auto sq_circumradius = [&](Cell_handle c) -> FT // auto sq_circumradius = [&](Cell_handle c) -> FT
// { // {
// const Point_3& cc = circumcenter(c); // const Point_3& cc = circumcenter(c);
// return geom_traits().compute_squared_distance_3_object()(m_dt.point(c, 0), cc); // return geom_traits().compute_squared_distance_3_object()(m_tr.point(c, 0), cc);
// }; // };
auto sq_longest_edge = [&](Cell_handle c) -> FT auto sq_longest_edge = [&](Cell_handle c) -> FT
{ {
return (std::max)({ squared_distance(m_dt.point(c, 0), m_dt.point(c, 1)), return (std::max)({ squared_distance(m_tr.point(c, 0), m_tr.point(c, 1)),
squared_distance(m_dt.point(c, 0), m_dt.point(c, 2)), squared_distance(m_tr.point(c, 0), m_tr.point(c, 2)),
squared_distance(m_dt.point(c, 0), m_dt.point(c, 3)), squared_distance(m_tr.point(c, 0), m_tr.point(c, 3)),
squared_distance(m_dt.point(c, 1), m_dt.point(c, 2)), squared_distance(m_tr.point(c, 1), m_tr.point(c, 2)),
squared_distance(m_dt.point(c, 3), m_dt.point(c, 3)), squared_distance(m_tr.point(c, 3), m_tr.point(c, 3)),
squared_distance(m_dt.point(c, 2), m_dt.point(c, 3)) }); squared_distance(m_tr.point(c, 2), m_tr.point(c, 3)) });
}; };
#ifdef CGAL_AW3_DEBUG_MANIFOLDNESS #ifdef CGAL_AW3_DEBUG_MANIFOLDNESS
@ -1450,7 +1438,7 @@ public:
std::vector<Cell_handle> inc_cells; std::vector<Cell_handle> inc_cells;
inc_cells.reserve(64); inc_cells.reserve(64);
m_dt.finite_incident_cells(v, std::back_inserter(inc_cells)); m_tr.finite_incident_cells(v, std::back_inserter(inc_cells));
#define CGAL_AW3_USE_BRUTE_FORCE_MUTABLE_PRIORITY_QUEUE #define CGAL_AW3_USE_BRUTE_FORCE_MUTABLE_PRIORITY_QUEUE
#ifndef CGAL_AW3_USE_BRUTE_FORCE_MUTABLE_PRIORITY_QUEUE #ifndef CGAL_AW3_USE_BRUTE_FORCE_MUTABLE_PRIORITY_QUEUE
@ -1464,10 +1452,10 @@ public:
std::sort(cit, cend, comparer); std::sort(cit, cend, comparer);
#endif #endif
Cell_handle ic = *cit; Cell_handle ic = *cit;
CGAL_assertion(!m_dt.is_infinite(ic)); CGAL_assertion(!m_tr.is_infinite(ic));
// This is where new material is added // This is where new material is added
ic->info().is_outside = false; ic->is_outside() = false;
#ifdef CGAL_AW3_DEBUG_DUMP_EVERY_STEP #ifdef CGAL_AW3_DEBUG_DUMP_EVERY_STEP
static int i = 0; static int i = 0;
@ -1484,14 +1472,14 @@ public:
std::vector<Vertex_handle> adj_vertices; std::vector<Vertex_handle> adj_vertices;
adj_vertices.reserve(64); adj_vertices.reserve(64);
m_dt.finite_adjacent_vertices(v, std::back_inserter(adj_vertices)); m_tr.finite_adjacent_vertices(v, std::back_inserter(adj_vertices));
for(Vertex_handle nv : adj_vertices) for(Vertex_handle nv : adj_vertices)
if(is_non_manifold(nv)) if(is_non_manifold(nv))
non_manifold_vertices.push(nv); non_manifold_vertices.push(nv);
} }
CGAL_assertion_code(for(Vertex_handle v : m_dt.finite_vertex_handles())) CGAL_assertion_code(for(Vertex_handle v : m_tr.finite_vertex_handles()))
CGAL_assertion(!is_non_manifold(v)); CGAL_assertion(!is_non_manifold(v));
} }
@ -1508,12 +1496,12 @@ private:
const Facet& current_f = current_gate.facet(); const Facet& current_f = current_gate.facet();
const Cell_handle ch = current_f.first; const Cell_handle ch = current_f.first;
const int id = current_f.second; const int id = current_f.second;
const Point_3& p0 = m_dt.point(ch, (id+1)&3); const Point_3& p0 = m_tr.point(ch, (id+1)&3);
const Point_3& p1 = m_dt.point(ch, (id+2)&3); const Point_3& p1 = m_tr.point(ch, (id+2)&3);
const Point_3& p2 = m_dt.point(ch, (id+3)&3); const Point_3& p2 = m_tr.point(ch, (id+3)&3);
const FT sqr = geom_traits().compute_squared_radius_3_object()(p0, p1, p2); const FT sqr = geom_traits().compute_squared_radius_3_object()(p0, p1, p2);
std::cout << "At Facet with VID " << get(Gate_ID_PM<Dt>(), current_gate) << std::endl; std::cout << "At Facet with VID " << get(Gate_ID_PM<Triangulation>(), current_gate) << std::endl;
if(current_gate.priority() != sqr) if(current_gate.priority() != sqr)
std::cerr << "Error: facet in queue has wrong priority" << std::endl; std::cerr << "Error: facet in queue has wrong priority" << std::endl;
@ -1546,13 +1534,13 @@ private:
std::size_t nv = 0; std::size_t nv = 0;
std::size_t nf = 0; std::size_t nf = 0;
for(auto fit=m_dt.finite_facets_begin(), fend=m_dt.finite_facets_end(); fit!=fend; ++fit) for(auto fit=m_tr.finite_facets_begin(), fend=m_tr.finite_facets_end(); fit!=fend; ++fit)
{ {
Cell_handle c = fit->first; Cell_handle c = fit->first;
int s = fit->second; int s = fit->second;
Cell_handle nc = c->neighbor(s); Cell_handle nc = c->neighbor(s);
if(only_boundary_faces && (c->info().is_outside == nc->info().is_outside)) if(only_boundary_faces && (c->is_outside() == nc->is_outside()))
continue; continue;
std::array<std::size_t, 3> ids; std::array<std::size_t, 3> ids;
@ -1562,7 +1550,7 @@ private:
auto insertion_res = vertex_to_id.emplace(v, nv); auto insertion_res = vertex_to_id.emplace(v, nv);
if(insertion_res.second) if(insertion_res.second)
{ {
vertices_ss << m_dt.point(v) << "\n"; vertices_ss << m_tr.point(v) << "\n";
++nv; ++nv;
} }

View File

@ -36,24 +36,24 @@ struct Tetrahedron_with_outside_info
using Triangle_3 = typename Kernel::Triangle_3; using Triangle_3 = typename Kernel::Triangle_3;
template <typename CellHandle> template <typename CellHandle>
Tetrahedron_with_outside_info(const CellHandle ch, const K& k) Tetrahedron_with_outside_info(const CellHandle c, const K& k)
{ {
typename K::Construct_bbox_3 bbox = k.construct_bbox_3_object(); typename K::Construct_bbox_3 bbox = k.construct_bbox_3_object();
typename K::Construct_tetrahedron_3 tetrahedron = k.construct_tetrahedron_3_object(); typename K::Construct_tetrahedron_3 tetrahedron = k.construct_tetrahedron_3_object();
typename K::Construct_triangle_3 triangle = k.construct_triangle_3_object(); typename K::Construct_triangle_3 triangle = k.construct_triangle_3_object();
m_tet = tetrahedron(ch->vertex(0)->point(), ch->vertex(1)->point(), m_tet = tetrahedron(c->vertex(0)->point(), c->vertex(1)->point(),
ch->vertex(2)->point(), ch->vertex(3)->point()); c->vertex(2)->point(), c->vertex(3)->point());
m_bbox = bbox(m_tet); m_bbox = bbox(m_tet);
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
{ {
if(ch->neighbor(i)->info().is_outside) if(c->neighbor(i)->is_outside())
m_b.set(i, true); m_b.set(i, true);
m_triangles[i] = triangle(ch->vertex((i+1)& 3)->point(), m_triangles[i] = triangle(c->vertex((i+1)& 3)->point(),
ch->vertex((i+2)& 3)->point(), c->vertex((i+2)& 3)->point(),
ch->vertex((i+3)& 3)->point()); c->vertex((i+3)& 3)->point());
m_tbox[i] = bbox(m_triangles[i]); m_tbox[i] = bbox(m_triangles[i]);
} }
} }

View File

@ -0,0 +1,97 @@
// Copyright (c) 2019-2023 Google LLC (USA).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Mael Rouxel-Labbé
#ifndef CGAL_ALPHA_WRAP_TRIANGULATION_CELL_BASE_3_H
#define CGAL_ALPHA_WRAP_TRIANGULATION_CELL_BASE_3_H
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h>
namespace CGAL {
namespace Alpha_wraps_3 {
namespace internal {
template < typename GT,
typename Cb = CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3<GT> >
class Alpha_wrap_triangulation_cell_base_3
: public Cb
{
private:
bool outside = false;
public:
typedef typename Cb::Vertex_handle Vertex_handle;
typedef typename Cb::Cell_handle Cell_handle;
template < typename TDS2 >
struct Rebind_TDS
{
using Cb2 = typename Cb::template Rebind_TDS<TDS2>::Other;
using Other = Alpha_wrap_triangulation_cell_base_3<GT, Cb2>;
};
Alpha_wrap_triangulation_cell_base_3()
: Cb()
{}
Alpha_wrap_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1,
Vertex_handle v2, Vertex_handle v3)
: Cb(v0, v1, v2, v3)
{}
Alpha_wrap_triangulation_cell_base_3(Vertex_handle v0, Vertex_handle v1,
Vertex_handle v2, Vertex_handle v3,
Cell_handle n0, Cell_handle n1,
Cell_handle n2, Cell_handle n3)
: Cb(v0, v1, v2, v3, n0, n1, n2, n3)
{}
bool is_outside() const { return outside; }
bool& is_outside() { return outside; }
};
template <typename Cb>
class Cell_base_with_timestamp
: public Cb
{
std::size_t time_stamp_;
public:
using Has_timestamp = CGAL::Tag_true;
template <class TDS>
struct Rebind_TDS
{
using Cb2 = typename Cb::template Rebind_TDS<TDS>::Other;
using Other = Cell_base_with_timestamp<Cb2>;
};
public:
template <typename... Args>
Cell_base_with_timestamp(const Args&... args)
: Cb(args...), time_stamp_(-1)
{ }
Cell_base_with_timestamp(const Cell_base_with_timestamp& other)
: Cb(other), time_stamp_(other.time_stamp_)
{ }
public:
std::size_t time_stamp() const { return time_stamp_; }
void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; }
};
} // namespace internal
} // namespace Alpha_wraps_3
} // namespace CGAL
#endif // CGAL_ALPHA_WRAP_TRIANGULATION_CELL_BASE_3_H

View File

@ -0,0 +1,71 @@
// Copyright (c) 2019-2023 Google LLC (USA).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Mael Rouxel-Labbé
#ifndef CGAL_ALPHA_WRAP_TRIANGULATION_VERTEX_BASE_3_H
#define CGAL_ALPHA_WRAP_TRIANGULATION_VERTEX_BASE_3_H
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Triangulation_vertex_base_3.h>
namespace CGAL {
namespace Alpha_wraps_3 {
namespace internal {
enum class Vertex_type
{
DEFAULT = 0,
BBOX_VERTEX,
SEED_VERTEX
};
template <typename GT,
typename Vb = Triangulation_vertex_base_3<GT> >
class Alpha_wrap_triangulation_vertex_base_3
: public Vb
{
private:
Vertex_type vertex_type = Vertex_type::DEFAULT;
public:
using Cell_handle = typename Vb::Cell_handle;
using Point = typename Vb::Point;
template <typename TDS2>
struct Rebind_TDS
{
using Vb2 = typename Vb::template Rebind_TDS<TDS2>::Other;
using Other = Alpha_wrap_triangulation_vertex_base_3<GT, Vb2>;
};
public:
Alpha_wrap_triangulation_vertex_base_3()
: Vb() {}
Alpha_wrap_triangulation_vertex_base_3(const Point& p)
: Vb(p) {}
Alpha_wrap_triangulation_vertex_base_3(const Point& p, Cell_handle c)
: Vb(p, c) {}
Alpha_wrap_triangulation_vertex_base_3(Cell_handle c)
: Vb(c) {}
public:
const Vertex_type& type() const { return vertex_type; }
Vertex_type& type() { return vertex_type; }
};
} // namespace internal
} // namespace Alpha_wraps_3
} // namespace CGAL
#endif // CGAL_ALPHA_WRAP_TRIANGULATION_VERTEX_BASE_3_H

View File

@ -46,7 +46,7 @@ ag.incident_edges(ag.infinite_vertex());
ag.incident_edges(ag.infinite_vertex(), f); ag.incident_edges(ag.infinite_vertex(), f);
\endcode \endcode
\cgalModels `DelaunayGraph_2` \cgalModels{DelaunayGraph_2}
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
@ -608,24 +608,22 @@ Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
/*! /*!
Returns the Returns the
dual corresponding to the face handle `f`. The returned object can dual corresponding to the face handle `f`. The returned object can
be assignable to one of the following: `Site_2`, `Gt::Line_2`. be assigned to one of the following: `Site_2`, `Gt::Line_2`.
*/ */
Gt::Object_2 dual(Face_handle f) const; Gt::Object_2 dual(Face_handle f) const;
/*! /*!
Returns the Returns the
dual of the face to which `it` points to. The returned object can dual of the face to which `it` points to. The returned object can
be assignable to one of the following: `Site_2`, `Gt::Line_2`. be assigned to one of the following: `Site_2`, `Gt::Line_2`.
*/ */
Gt::Object_2 dual(All_faces_iterator it) const; Gt::Object_2 dual(All_faces_iterator it) const;
/*! /*!
Returns Returns
the dual of the face to which `it` points to. The returned the dual of the face to which `it` points to.
object can be assignable to one of the following: `Site_2`,
`Gt::Line_2`.
*/ */
Gt::Object_2 dual(Finite_faces_iterator it) const; Site dual(Finite_faces_iterator it) const;
/// @} /// @}

View File

@ -37,7 +37,7 @@ The default values for the template parameters are as follows:
`FK = CGAL::Simple_cartesian<CGAL::Interval_nt<false> >`, `FK = CGAL::Simple_cartesian<CGAL::Interval_nt<false> >`,
`FM = CM`. `FM = CM`.
\cgalModels `ApolloniusGraphTraits_2` \cgalModels{ApolloniusGraphTraits_2}
\sa `Kernel` \sa `Kernel`
\sa `ApolloniusGraphTraits_2` \sa `ApolloniusGraphTraits_2`

View File

@ -11,7 +11,7 @@ vertex base required by the
`Apollonius_graph_hierarchy_vertex_base_2` is templated by a class `Agvb` which must be a model `Apollonius_graph_hierarchy_vertex_base_2` is templated by a class `Agvb` which must be a model
of the `ApolloniusGraphVertexBase_2` concept. of the `ApolloniusGraphVertexBase_2` concept.
\cgalModels `ApolloniusGraphHierarchyVertexBase_2` \cgalModels{ApolloniusGraphHierarchyVertexBase_2}
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>` \sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>` \sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`

View File

@ -20,7 +20,7 @@ default value for `Method_tag` is `CGAL::Integral_domain_without_division_tag`.
The way the predicates are evaluated is discussed in The way the predicates are evaluated is discussed in
\cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}. \cgalCite{cgal:ke-ppawv-02}, \cgalCite{cgal:ke-rctac-03}.
\cgalModels `ApolloniusGraphTraits_2` \cgalModels{ApolloniusGraphTraits_2}
\sa `CGAL::Apollonius_graph_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_2<Gt,Agds>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`

View File

@ -7,9 +7,12 @@ namespace CGAL {
The class `Apollonius_graph_vertex_base_2` provides a model for the The class `Apollonius_graph_vertex_base_2` provides a model for the
`ApolloniusGraphVertexBase_2` concept which is the vertex base `ApolloniusGraphVertexBase_2` concept which is the vertex base
required by the `ApolloniusGraphDataStructure_2` concept. The required by the `ApolloniusGraphDataStructure_2` concept. The
class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the class `Apollonius_graph_vertex_base_2` has three template arguments.
geometric traits of the Apollonius graph and should be a model of the
concept `ApolloniusGraphTraits_2`. The second is a Boolean which \tparam Gt is the geometric traits of the Apollonius graph and must be a model of the
concept `ApolloniusGraphTraits_2`.
\tparam StoreHidden is a Boolean which
controls whether hidden sites are actually stored. Such a controls whether hidden sites are actually stored. Such a
control is important if the user is not interested in hidden sites control is important if the user is not interested in hidden sites
and/or if only insertions are made, in which case no hidden and/or if only insertions are made, in which case no hidden
@ -17,13 +20,17 @@ site can become visible. If `StoreHidden` is set to
`true`, hidden sites are stored, otherwise they are `true`, hidden sites are stored, otherwise they are
discarded. By default `StoreHidden` is set to `true`. discarded. By default `StoreHidden` is set to `true`.
\cgalModels `ApolloniusGraphVertexBase_2` \tparam Vb must be a model of the concept `TriangulationDSVertexBase_2`
By default this parameter is
instantiated by `Triangulation_ds_vertex_base_2<>`.
\cgalModels{ApolloniusGraphVertexBase_2}
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>` \sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>` \sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
*/ */
template< typename Gt, typename StoreHidden > template< typename Gt, typename StoreHidden, typename Vb >
class Apollonius_graph_vertex_base_2 { class Apollonius_graph_vertex_base_2 : public Vb {
public: public:
/// \name Creation /// \name Creation

View File

@ -8,7 +8,7 @@ The class `Apollonius_site_2` is a model for the concept
`ApolloniusSite_2`. It is parametrized by a template parameter `ApolloniusSite_2`. It is parametrized by a template parameter
`K` which must be a model of the `Kernel` concept. `K` which must be a model of the `Kernel` concept.
\cgalModels `ApolloniusSite_2` \cgalModels{ApolloniusSite_2}
\cgalHeading{Types} \cgalHeading{Types}

View File

@ -27,7 +27,9 @@ We only describe the additional requirements with respect to the
\cgalRefines{TriangulationDataStructure_2} \cgalRefines{TriangulationDataStructure_2}
\cgalHasModel `CGAL::Triangulation_data_structure_2<Vb,Fb>` \cgalHasModelsBegin
\cgalHasModels{CGAL::Triangulation_data_structure_2<Vb,Fb>}
\cgalHasModelsEnd
\sa `TriangulationDataStructure_2` \sa `TriangulationDataStructure_2`
\sa `ApolloniusGraphVertexBase_2` \sa `ApolloniusGraphVertexBase_2`

View File

@ -19,7 +19,9 @@ next and previous level graphs.
`ApolloniusGraphHierarchyVertexBase_2` does not introduce any `ApolloniusGraphHierarchyVertexBase_2` does not introduce any
types in addition to those of `ApolloniusGraphVertexBase_2`. types in addition to those of `ApolloniusGraphVertexBase_2`.
\cgalHasModel `CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> >` \cgalHasModelsBegin
\cgalHasModels{CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> >}
\cgalHasModelsEnd
\sa `ApolloniusGraphDataStructure_2` \sa `ApolloniusGraphDataStructure_2`
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`

View File

@ -12,8 +12,10 @@ it provides a type `Site_2`, which must be a model of the concept
constructions for sites and several function object constructions for sites and several function object
types for the predicates. types for the predicates.
\cgalHasModel `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \cgalHasModelsBegin
\cgalHasModel `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \cgalHasModels{CGAL::Apollonius_graph_traits_2<K,Method_tag>}
\cgalHasModels{CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>}
\cgalHasModelsEnd
\sa `CGAL::Apollonius_graph_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_2<Gt,Agds>`
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`

Some files were not shown because too many files have changed in this diff Show More