mirror of https://github.com/CGAL/cgal
Merge branch 'CGAL:master' into gsoc2023-polygon_repair-kenohori
This commit is contained in:
commit
c20d01c2d6
|
|
@ -0,0 +1,35 @@
|
|||
# SPDX-FileCopyrightText: 2020 Free Software Foundation Europe e.V. <https://fsfe.org>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
name: REUSE Compliance Check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
reuse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: REUSE version
|
||||
uses: fsfe/reuse-action@v2
|
||||
with:
|
||||
args: --version
|
||||
- name: REUSE lint
|
||||
uses: fsfe/reuse-action@v2
|
||||
with:
|
||||
args: --include-submodules lint
|
||||
- name: REUSE SPDX SBOM
|
||||
uses: fsfe/reuse-action@v2
|
||||
with:
|
||||
args: spdx
|
||||
- name: install dependencies
|
||||
run: sudo apt-get install -y cmake
|
||||
- name: Create CGAL internal release
|
||||
run: |
|
||||
mkdir -p ./release
|
||||
cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
|
||||
- name: REUSE lint release tarball
|
||||
uses: fsfe/reuse-action@v2
|
||||
with:
|
||||
args: --root ./release/CGAL-9.9 --include-submodules lint
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: CGAL
|
||||
Upstream-Contact: CGAL Editorial Board <info@cgal.org>
|
||||
Source: https://github.com/CGAL/cgal
|
||||
|
||||
Files: .* *.cmake *.md .github/* Maintenance/* */TODO */doc/* */deb/* */applications/* */doc_html/* */scripts/* */developer_scripts/* */demo/* */examples/* */src/* */test/* */benchmarks/* */benchmark/* */package_info/* */data/* */cmake/*
|
||||
Copyright: 1995-2023 The CGAL Project
|
||||
License: CC0-1.0
|
||||
|
||||
Files: CMakeLists.txt GraphicsView/include/CGAL/Qt/ImageInterface.ui GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm Installation/AUTHORS Installation/CMakeLists.txt Installation/README Installation/auxiliary/cgal_create_cmake_script.1 Installation/auxiliary/gmp/README Installation/include/CGAL/license/gpl_package_list.txt MacOSX/auxiliary/cgal_app.icns copyright
|
||||
Copyright: 1995-2023 The CGAL Project
|
||||
License: CC0-1.0
|
||||
|
|
@ -47,7 +47,7 @@ Provides the operator:
|
|||
`return_type operator()(const Query& q, const Primitive::Datum& d)`,
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@ public:
|
|||
/*!
|
||||
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.
|
||||
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
|
||||
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`
|
||||
respectively.
|
||||
|
||||
Provides the operators:
|
||||
`boost::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<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
|
||||
`std::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
|
||||
operator()(const Ray_3& r, const Primitive& primitive)`.
|
||||
|
||||
A common algorithm to compute the intersection between a bounding box and a ray is <A
|
||||
|
|
|
|||
|
|
@ -119,10 +119,10 @@ typedef unspecified_type Do_intersect;
|
|||
|
||||
/*!
|
||||
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}
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ typedef CGAL::Polyhedron_3<K> Polyhedron;
|
|||
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
||||
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
||||
typedef CGAL::AABB_tree<Traits> Tree;
|
||||
typedef boost::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<Segment>::Type > Segment_intersection;
|
||||
typedef std::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
|
||||
typedef Tree::Primitive_id Primitive_id;
|
||||
|
||||
int main()
|
||||
|
|
@ -57,7 +57,7 @@ int main()
|
|||
if(intersection)
|
||||
{
|
||||
// gets intersection object
|
||||
const Point* p = boost::get<Point>(&(intersection->first));
|
||||
const Point* p = std::get_if<Point>(&(intersection->first));
|
||||
if(p)
|
||||
std::cout << "intersection object is a point " << *p << std::endl;
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ int main()
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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_traits<K, Primitive> Traits;
|
||||
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
|
||||
{
|
||||
|
|
@ -70,8 +70,8 @@ int main(int argc, char* argv[])
|
|||
Ray_intersection intersection = tree.first_intersection(ray, skip);
|
||||
if(intersection)
|
||||
{
|
||||
if(boost::get<Point>(&(intersection->first))){
|
||||
const Point* p = boost::get<Point>(&(intersection->first) );
|
||||
if(std::get_if<Point>(&(intersection->first))){
|
||||
const Point* p = std::get_if<Point>(&(intersection->first) );
|
||||
std::cout << *p << std::endl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <iterator>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <CGAL/type_traits/is_iterator.h>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <CGAL/Default.h>
|
||||
|
|
@ -34,7 +33,7 @@ namespace CGAL {
|
|||
|
||||
/*!
|
||||
* \ingroup PkgAABBTreeRef
|
||||
* Primitive type for a edge of a polyhedral surface.
|
||||
* Primitive type for an edge of a polyhedral surface.
|
||||
* It wraps an `edge_descriptor` into a 3D segment.
|
||||
* The class model of `HalfedgeGraph` from which the primitive is built should not be deleted
|
||||
* while the AABB tree holding the primitive is in use.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
|
||||
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
/// \file AABB_traits.h
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ template <class T>
|
|||
struct Remove_optional { typedef T type; };
|
||||
|
||||
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
|
||||
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;
|
||||
|
||||
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_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) {
|
||||
if(*direction_iter == 0) {
|
||||
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
} else {
|
||||
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
|
||||
|
|
@ -118,7 +118,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
|
|||
// t_far = t2;
|
||||
|
||||
if(t_near > t_far || t_far < FT(0.))
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ public:
|
|||
|
||||
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
|
||||
/// 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>
|
||||
struct Intersection_and_primitive_id {
|
||||
typedef decltype(
|
||||
|
|
@ -364,12 +364,12 @@ public:
|
|||
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
||||
:m_traits(traits) {}
|
||||
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 {
|
||||
auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits));
|
||||
if (!inter_res)
|
||||
return boost::none;
|
||||
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
|
||||
return std::nullopt;
|
||||
return std::make_optional( std::make_pair(*inter_res, primitive.id()) );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
#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/Primitive_helper.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
#include <optional>
|
||||
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
#include <CGAL/mutex.h>
|
||||
|
|
@ -143,7 +142,7 @@ namespace CGAL {
|
|||
/// An explicit call to `build()` must be made to ensure that the next call to
|
||||
/// a query function will not trigger the construction of the data structure.
|
||||
/// A call to `AABBTraits::set_shared_data(t...)` is made using the internally stored traits.
|
||||
/// This procedure has a complexity of \f$O(n log(n))\f$, where \f$n\f$ is the number of
|
||||
/// This procedure has a complexity of \cgalBigO{n log(n)}, where \f$n\f$ is the number of
|
||||
/// primitives of the tree.
|
||||
template<typename ... T>
|
||||
void build(T&& ...);
|
||||
|
|
@ -271,7 +270,7 @@ public:
|
|||
/// \tparam Query must be a type for which `Do_intersect` operators are
|
||||
/// defined in the traits class `AABBTraits`.
|
||||
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
|
||||
|
|
@ -294,7 +293,7 @@ public:
|
|||
/// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are
|
||||
/// defined in the traits class `AABBTraits`.
|
||||
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;
|
||||
|
||||
|
||||
|
|
@ -318,15 +317,15 @@ public:
|
|||
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
||||
/// call this member function.
|
||||
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;
|
||||
|
||||
/// \cond
|
||||
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
|
||||
{
|
||||
return first_intersection(query, boost::lambda::constant(false));
|
||||
return first_intersection(query, [](Primitive_id){ return false; });
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
|
|
@ -343,15 +342,15 @@ public:
|
|||
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
||||
/// call this member function.
|
||||
template<typename Ray, typename SkipFunctor>
|
||||
boost::optional<Primitive_id>
|
||||
std::optional<Primitive_id>
|
||||
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
|
||||
|
||||
/// \cond
|
||||
template<typename Ray>
|
||||
boost::optional<Primitive_id>
|
||||
std::optional<Primitive_id>
|
||||
first_intersected_primitive(const Ray& query) const
|
||||
{
|
||||
return first_intersected_primitive(query, boost::lambda::constant(false));
|
||||
return first_intersected_primitive(query, [](Primitive_id){ return false; });
|
||||
}
|
||||
/// \endcond
|
||||
///@}
|
||||
|
|
@ -964,7 +963,7 @@ public:
|
|||
|
||||
template <typename Tr>
|
||||
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
|
||||
{
|
||||
using namespace CGAL::internal::AABB_tree;
|
||||
|
|
@ -976,7 +975,7 @@ public:
|
|||
|
||||
template <typename Tr>
|
||||
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
|
||||
{
|
||||
using namespace CGAL::internal::AABB_tree;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <optional>
|
||||
# if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4996)
|
||||
|
|
@ -43,7 +42,7 @@ class AABB_ray_intersection {
|
|||
public:
|
||||
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 {
|
||||
// We hit the root, now continue on the children. Keep track of
|
||||
// nb_primitives through a variable in each Node on the stack. In
|
||||
|
|
@ -63,7 +62,7 @@ public:
|
|||
|
||||
Heap_type pq;
|
||||
// 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 */
|
||||
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()) */) {
|
||||
intersection = intersection_obj(query, current.node->left_data());
|
||||
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) {
|
||||
t = ray_distance;
|
||||
p = intersection;
|
||||
|
|
@ -96,7 +95,7 @@ public:
|
|||
if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) {
|
||||
intersection = intersection_obj(query, current.node->right_data());
|
||||
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) {
|
||||
t = ray_distance;
|
||||
p = intersection;
|
||||
|
|
@ -111,7 +110,7 @@ public:
|
|||
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
|
||||
intersection = intersection_obj(query, current.node->left_data());
|
||||
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) {
|
||||
t = ray_distance;
|
||||
p = intersection;
|
||||
|
|
@ -121,7 +120,7 @@ public:
|
|||
|
||||
// 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)
|
||||
pq.push(Node_ptr_with_ft(child, *dist, 2));
|
||||
|
||||
|
|
@ -130,7 +129,7 @@ public:
|
|||
default: // Children both inner nodes
|
||||
{
|
||||
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)
|
||||
pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2));
|
||||
|
||||
|
|
@ -198,10 +197,10 @@ private:
|
|||
|
||||
template<typename AABBTraits>
|
||||
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,
|
||||
const SkipFunctor& skip) const {
|
||||
CGAL_static_assertion_msg((std::is_same<Ray, typename AABBTraits::Ray_3>::value),
|
||||
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
|
||||
"Ray and Ray_3 must be the same type");
|
||||
|
||||
switch(size()) // copy-paste from AABB_tree::traversal
|
||||
|
|
@ -219,22 +218,22 @@ AABB_tree<AABBTraits>::first_intersection(const Ray& query,
|
|||
break;
|
||||
}
|
||||
}
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
template<typename AABBTraits>
|
||||
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,
|
||||
const SkipFunctor& skip) const
|
||||
{
|
||||
boost::optional<
|
||||
std::optional<
|
||||
typename AABB_tree<AABBTraits>::
|
||||
template Intersection_and_primitive_id<Ray>::Type > res =
|
||||
first_intersection(query, skip);
|
||||
if ( (bool) res )
|
||||
return boost::make_optional( res->second );
|
||||
return boost::none;
|
||||
return std::make_optional( res->second );
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
|
||||
#include <CGAL/AABB_tree/internal/AABB_node.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ class First_intersection_traits
|
|||
|
||||
public:
|
||||
typedef
|
||||
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
||||
std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
||||
Result;
|
||||
public:
|
||||
First_intersection_traits(const AABBTraits& traits)
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
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);
|
||||
|
||||
if(intersection)
|
||||
|
|
@ -211,7 +211,7 @@ public:
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -221,12 +221,12 @@ public:
|
|||
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; }
|
||||
|
||||
private:
|
||||
bool m_is_found;
|
||||
boost::optional<typename Primitive::Id> m_result;
|
||||
std::optional<typename Primitive::Id> m_result;
|
||||
const AABBTraits& m_traits;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -95,20 +95,23 @@ void test_all_intersection_query_types(Tree& tree)
|
|||
tree.all_intersected_primitives(segment,std::back_inserter(primitives));
|
||||
|
||||
// any_intersection
|
||||
boost::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);
|
||||
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<Ray>::Type > r = tree.any_intersection(ray);
|
||||
std::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<Segment>::Type > s = tree.any_intersection(segment);
|
||||
CGAL_USE(r);
|
||||
CGAL_USE(l);
|
||||
CGAL_USE(s);
|
||||
|
||||
// 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(line);
|
||||
optional_primitive = tree.any_intersected_primitive(segment);
|
||||
|
||||
// all_intersections
|
||||
std::list< boost::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< 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<Ray>::Type > > intersections_r;
|
||||
std::list< std::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<Segment>::Type > > intersections_s;
|
||||
tree.all_intersections(ray,std::back_inserter(intersections_r));
|
||||
tree.all_intersections(line,std::back_inserter(intersections_l));
|
||||
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_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;
|
||||
public:
|
||||
|
|
@ -380,7 +383,7 @@ public:
|
|||
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
||||
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));
|
||||
if ( intersection )
|
||||
*out++ = *intersection;
|
||||
|
|
@ -653,7 +656,7 @@ private:
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
||||
// Check: verify we do get the result by naive method
|
||||
|
|
@ -723,7 +726,7 @@ private:
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
||||
// Check: verify we do get the result by naive method
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo
|
|||
v.reserve(elements);
|
||||
for(; b != e; ++b) {
|
||||
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)
|
||||
++counter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ int test()
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
boost::optional<Object_and_primitive_id> any;
|
||||
std::optional<Object_and_primitive_id> any;
|
||||
any = tree.any_intersection(pq);
|
||||
if(!any)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,16 +26,16 @@ int main()
|
|||
{
|
||||
using namespace CGAL::internal::AABB_tree;
|
||||
|
||||
CGAL_static_assertion_msg(
|
||||
static_assert(
|
||||
(Is_ray_intersection_geomtraits<CGAL::Epeck>::value),
|
||||
"CGAL::Epeck should be a RayIntersectionGeomTraits");
|
||||
CGAL_static_assertion_msg(
|
||||
static_assert(
|
||||
(Is_ray_intersection_geomtraits< CGAL::Simple_cartesian<double> >::value),
|
||||
"CGAL::Epeck should be a RayIntersectionGeomTraits");
|
||||
CGAL_static_assertion_msg(
|
||||
static_assert(
|
||||
(!Is_ray_intersection_geomtraits<AABBGeomTraits>::value),
|
||||
"Pure AABBGeomTraits shouldn't be a RayIntersectionGeomTraits");
|
||||
CGAL_static_assertion_msg(
|
||||
static_assert(
|
||||
(!Is_ray_intersection_geomtraits<nope>::value),
|
||||
"The empty struct shouldn't be a RayIntersectionGeomTraits");
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <iterator>
|
||||
|
||||
#include <boost/functional/value_factory.hpp>
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <iterator>
|
||||
|
||||
#include <boost/functional/value_factory.hpp>
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
|
@ -36,7 +35,7 @@ FT point_on_ray_dist(const Ray& ray, const Point& point) {
|
|||
|
||||
std::size_t accum = 0;
|
||||
|
||||
boost::optional<
|
||||
std::optional<
|
||||
Tree::Intersection_and_primitive_id<Ray>::Type
|
||||
>
|
||||
min_intersection(const Tree& tree, const Ray& ray) {
|
||||
|
|
@ -46,12 +45,12 @@ min_intersection(const Tree& tree, const Ray& ray) {
|
|||
tree.all_intersections(ray, std::back_inserter(all_intersections));
|
||||
accum += all_intersections.size();
|
||||
Tree::FT min_distance = DBL_MAX;
|
||||
boost::optional<
|
||||
std::optional<
|
||||
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) {
|
||||
if(Point* point = boost::get<Point>(&(it2->first))) {
|
||||
if(Point* point = std::get_if<Point>(&(it2->first))) {
|
||||
Vector i_ray(*point, ray.source());
|
||||
Tree::FT new_distance = i_ray.squared_length();
|
||||
if(new_distance < min_distance) {
|
||||
|
|
@ -92,7 +91,7 @@ int main()
|
|||
Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2,
|
||||
(bbox.ymin() + bbox.ymax()) / 2,
|
||||
(bbox.zmin() + bbox.zmax()) / 2);
|
||||
boost::array<double, 3> extents;
|
||||
std::array<double, 3> extents;
|
||||
extents[0] = bbox.xmax() - bbox.xmin();
|
||||
extents[1] = bbox.ymax() - bbox.ymin();
|
||||
extents[2] = bbox.zmax() - bbox.zmin();
|
||||
|
|
@ -125,7 +124,7 @@ int main()
|
|||
rays.reserve(NB_RAYS);
|
||||
std::transform(v1.begin(), v1.end(), v2.begin(),
|
||||
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);
|
||||
|
||||
|
||||
|
|
@ -140,7 +139,7 @@ int main()
|
|||
}
|
||||
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
|
||||
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 << "Primitive method had to sort " << accum/NB_RAYS
|
||||
<< " intersections on average." << std::endl;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||
\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
|
||||
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$.
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ int main(){
|
|||
typedef FT::Numerator_type Numerator_type;
|
||||
typedef FT::Denominator_type Denominator_type;
|
||||
|
||||
CGAL_static_assertion((std::is_same<Numerator_type,CGAL::Gmpz>::value));
|
||||
CGAL_static_assertion((std::is_same<Denominator_type,CGAL::Gmpz>::value));
|
||||
static_assert(std::is_same<Numerator_type,CGAL::Gmpz>::value);
|
||||
static_assert(std::is_same<Denominator_type,CGAL::Gmpz>::value);
|
||||
|
||||
Numerator_type numerator;
|
||||
Denominator_type denominator;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ binary_func(const A& a , const B& b){
|
|||
typedef CGAL::Coercion_traits<A,B> CT;
|
||||
|
||||
// check for explicit interoperability
|
||||
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
|
||||
static_assert(CT::Are_explicit_interoperable::value);
|
||||
|
||||
// CT::Cast is used to to convert both types into the coercion type
|
||||
typename CT::Cast cast;
|
||||
|
|
|
|||
|
|
@ -353,8 +353,7 @@ class Algebraic_structure_traits_base< Type_,
|
|||
typedef Coercion_traits< NT1, NT2 > CT;
|
||||
typedef typename CT::Type Coercion_type_NT1_NT2;
|
||||
CGAL_USE_TYPE(Coercion_type_NT1_NT2);
|
||||
CGAL_static_assertion((
|
||||
::std::is_same<Coercion_type_NT1_NT2 , Type >::value));
|
||||
static_assert(::std::is_same<Coercion_type_NT1_NT2 , Type >::value);
|
||||
|
||||
typename Coercion_traits< NT1, NT2 >::Cast cast;
|
||||
operator()( cast(x), cast(y), q, r );
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@
|
|||
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, Result_type ) \
|
||||
template < class CT_Type_1, class CT_Type_2 > \
|
||||
Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \
|
||||
CGAL_static_assertion((::std::is_same< \
|
||||
static_assert(::std::is_same< \
|
||||
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT \
|
||||
>::value)); \
|
||||
>::value) ; \
|
||||
\
|
||||
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Cast cast; \
|
||||
return operator()( cast(x), cast(y) ); \
|
||||
|
|
|
|||
|
|
@ -85,13 +85,13 @@ public:
|
|||
|
||||
// determine extractable scalar factor
|
||||
Scalar operator () (const NT& a) {
|
||||
CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value));
|
||||
static_assert(::std::is_same< NT,Scalar >::value);
|
||||
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
|
||||
return scalar_factor(a, SAT());
|
||||
}
|
||||
// determine extractable scalar factor
|
||||
Scalar operator () (const NT& a, const Scalar& d) {
|
||||
CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value));
|
||||
static_assert(::std::is_same< NT,Scalar >::value);
|
||||
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
|
||||
return scalar_factor(a,d,SAT());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
template <typename AdaptableFunctor, typename ResultType>
|
||||
void check_result_type(AdaptableFunctor, ResultType){
|
||||
typedef typename AdaptableFunctor::result_type result_type;
|
||||
CGAL_static_assertion((::std::is_same<result_type,ResultType>::value));
|
||||
static_assert(::std::is_same<result_type,ResultType>::value);
|
||||
CGAL_USE_TYPE(result_type);
|
||||
}
|
||||
// check nothing for CGAL::Null_functor
|
||||
|
|
@ -122,12 +122,11 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) {
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
CGAL_static_assertion(
|
||||
(!::std::is_same< Integral_division, Null_functor >::value));
|
||||
CGAL_static_assertion((!::std::is_same< Divides, Null_functor >::value));
|
||||
CGAL_static_assertion((!::std::is_same< Is_zero, Null_functor >::value));
|
||||
CGAL_static_assertion((!::std::is_same< Is_one, Null_functor >::value));
|
||||
CGAL_static_assertion((!::std::is_same< Square, Null_functor >::value));
|
||||
static_assert(!::std::is_same< Integral_division, Null_functor >::value);
|
||||
static_assert(!::std::is_same< Divides, Null_functor >::value);
|
||||
static_assert(!::std::is_same< Is_zero, Null_functor >::value);
|
||||
static_assert(!::std::is_same< Is_one, Null_functor >::value);
|
||||
static_assert(!::std::is_same< Square, Null_functor >::value);
|
||||
|
||||
// functor
|
||||
const Is_zero is_zero = Is_zero();
|
||||
|
|
@ -206,7 +205,7 @@ void test_algebraic_structure_intern(
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
CGAL_static_assertion((!::std::is_same< Gcd, Null_functor>::value));
|
||||
static_assert(!::std::is_same< Gcd, Null_functor>::value);
|
||||
|
||||
const Gcd gcd = Gcd();
|
||||
assert( gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) );
|
||||
|
|
@ -268,9 +267,9 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) {
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
CGAL_static_assertion((!::std::is_same< Div, Null_functor>::value));
|
||||
CGAL_static_assertion((!::std::is_same< Mod, Null_functor>::value));
|
||||
CGAL_static_assertion((!::std::is_same< Div_mod, Null_functor>::value));
|
||||
static_assert(!::std::is_same< Div, Null_functor>::value);
|
||||
static_assert(!::std::is_same< Mod, Null_functor>::value);
|
||||
static_assert(!::std::is_same< Div_mod, Null_functor>::value);
|
||||
|
||||
const Div div=Div();
|
||||
const Mod mod=Mod();
|
||||
|
|
@ -387,7 +386,7 @@ void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) {
|
|||
|
||||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
CGAL_static_assertion((!::std::is_same< Sqrt, Null_functor>::value));
|
||||
static_assert(!::std::is_same< Sqrt, Null_functor>::value);
|
||||
const Sqrt sqrt =Sqrt();
|
||||
AS a(4);
|
||||
|
||||
|
|
@ -613,11 +612,9 @@ class Test_is_square {
|
|||
CGAL_USE_TYPE(First_argument_type);
|
||||
CGAL_USE_TYPE(Second_argument_type);
|
||||
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same< AS , First_argument_type>::value));
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same< AS& , Second_argument_type>::value));
|
||||
//CGAL_static_assertion(( ::std::is_same< bool , Result_type>::value));
|
||||
static_assert(::std::is_same< AS , First_argument_type>::value);
|
||||
static_assert(::std::is_same< AS& , Second_argument_type>::value);
|
||||
//static_assert(::std::is_same< bool , Result_type>::value);
|
||||
bool b = Result_type(true); CGAL_USE(b);
|
||||
|
||||
AS test_number = AS(3)*AS(3);
|
||||
|
|
@ -649,8 +646,8 @@ public:
|
|||
typedef typename Sqrt::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::std::is_same< AS , Argument_type>::value));
|
||||
CGAL_static_assertion(( ::std::is_same< AS , Result_type>::value));
|
||||
static_assert(::std::is_same< AS , Argument_type>::value);
|
||||
static_assert(::std::is_same< AS , Result_type>::value);
|
||||
typedef Algebraic_structure_traits<AS> AST;
|
||||
typedef typename AST::Is_exact Is_exact;
|
||||
assert( !Is_exact::value || AS (3) == sqrt( AS (9)));
|
||||
|
|
@ -675,12 +672,9 @@ public:
|
|||
CGAL_USE_TYPE(First_argument_type);
|
||||
CGAL_USE_TYPE(Second_argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same<int, First_argument_type>::value));
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same< AS , Second_argument_type>::value));
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same< AS , Result_type>::value));
|
||||
static_assert(::std::is_same<int, First_argument_type>::value);
|
||||
static_assert(::std::is_same< AS , Second_argument_type>::value);
|
||||
static_assert(::std::is_same< AS , Result_type>::value);
|
||||
AS epsilon(1);
|
||||
assert( test_equality_epsilon( AS (2),
|
||||
root( 4, AS (16) ), epsilon ) );
|
||||
|
|
@ -803,7 +797,7 @@ void test_algebraic_structure(){
|
|||
typedef CGAL::Algebraic_structure_traits< AS > AST;
|
||||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
CGAL_static_assertion((::std::is_same<AS,typename AST::Type>::value));
|
||||
static_assert(::std::is_same<AS,typename AST::Type>::value);
|
||||
|
||||
typedef typename AST::Boolean Boolean;
|
||||
assert(!Boolean());
|
||||
|
|
@ -816,14 +810,13 @@ void test_algebraic_structure(){
|
|||
using CGAL::Integral_domain_without_division_tag;
|
||||
using CGAL::Null_functor;
|
||||
// Test for desired exactness
|
||||
CGAL_static_assertion(
|
||||
( ::std::is_same< typename AST::Is_exact, Is_exact >::value));
|
||||
static_assert(::std::is_same< typename AST::Is_exact, Is_exact >::value);
|
||||
static_assert(::std::is_convertible< Tag,
|
||||
Integral_domain_without_division_tag >::value );
|
||||
static_assert(::std::is_same< Tag, Algebraic_category>::value);
|
||||
static_assert(!::std::is_same< Simplify, Null_functor>::value);
|
||||
static_assert(!::std::is_same< Unit_part, Null_functor>::value);
|
||||
|
||||
CGAL_static_assertion(( ::boost::is_convertible< Tag,
|
||||
Integral_domain_without_division_tag >::value ));
|
||||
CGAL_static_assertion(( ::std::is_same< Tag, Algebraic_category>::value));
|
||||
CGAL_static_assertion((!::std::is_same< Simplify, Null_functor>::value));
|
||||
CGAL_static_assertion((!::std::is_same< Unit_part, Null_functor>::value));
|
||||
const Simplify simplify=Simplify();;
|
||||
const Unit_part unit_part= Unit_part();
|
||||
|
||||
|
|
@ -943,8 +936,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) {
|
|||
|
||||
typedef CGAL::Algebraic_structure_traits<AS> AST;
|
||||
typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive;
|
||||
CGAL_static_assertion(
|
||||
!(::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value));
|
||||
static_assert(!::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value);
|
||||
CGAL_USE_TYPE(Is_numerical_sensitive);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ void test_implicit_interoperable_one_way() {
|
|||
typedef typename CT::Type C;
|
||||
typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable;
|
||||
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(::std::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
|
||||
assert((::std::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
|
||||
|
||||
|
|
@ -346,9 +346,9 @@ void test_explicit_interoperable_one_way(){
|
|||
typedef typename CT::Cast Cast;
|
||||
typedef typename Cast::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<result_type,Type>::value));
|
||||
CGAL_static_assertion((::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
|
||||
CGAL_static_assertion((::std::is_same<Type,RT>::value));
|
||||
static_assert(::std::is_same<result_type,Type>::value);
|
||||
static_assert(::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value);
|
||||
static_assert(::std::is_same<Type,RT>::value);
|
||||
typename CT::Cast cast;
|
||||
|
||||
A a(3);
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ void test_fraction_traits(){
|
|||
typedef typename FT::Compose Compose;
|
||||
|
||||
CGAL_USE_TYPE(Is_fraction);
|
||||
CGAL_static_assertion( (::std::is_same<Type,T>::value));
|
||||
CGAL_static_assertion( (::std::is_same<Is_fraction,Tag_true>::value));
|
||||
CGAL_static_assertion(!(::std::is_same<Common_factor,Null_functor>::value));
|
||||
CGAL_static_assertion(!(::std::is_same<Decompose,Null_functor>::value));
|
||||
CGAL_static_assertion(!(::std::is_same<Compose,Null_functor>::value));
|
||||
static_assert(::std::is_same<Type,T>::value);
|
||||
static_assert(::std::is_same<Is_fraction,Tag_true>::value);
|
||||
static_assert(!::std::is_same<Common_factor,Null_functor>::value);
|
||||
static_assert(!::std::is_same<Decompose,Null_functor>::value);
|
||||
static_assert(!::std::is_same<Compose,Null_functor>::value);
|
||||
|
||||
|
||||
// Decompose
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void test_rational_traits(){
|
|||
|
||||
typedef Rational_traits<Rational> Rational_traits;
|
||||
typedef typename Rational_traits::RT RT;
|
||||
CGAL_static_assertion((::std::is_same<RT,RT>::value));
|
||||
static_assert(::std::is_same<RT,RT>::value);
|
||||
|
||||
assert( Rational_traits().numerator(x) == RT(7));
|
||||
assert( Rational_traits().denominator(x) == RT(2));
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ namespace CGAL {
|
|||
void operator() (const ToDouble& to_double) {
|
||||
typedef typename ToDouble::argument_type Argument_type;
|
||||
typedef typename ToDouble::result_type Result_type;
|
||||
CGAL_static_assertion(( ::std::is_same<Type, Argument_type>::value));
|
||||
static_assert( ::std::is_same<Type, Argument_type>::value);
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_static_assertion(( ::std::is_same<double, Result_type>::value));
|
||||
static_assert( ::std::is_same<double, Result_type>::value);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
assert(42.0 == to_double(Type(42)));
|
||||
}
|
||||
|
|
@ -71,9 +71,9 @@ namespace CGAL {
|
|||
typedef typename To_interval::argument_type Argument_type;
|
||||
typedef typename To_interval::result_type Result_type;
|
||||
typedef std::pair<double,double> Interval_type;
|
||||
CGAL_static_assertion(( ::std::is_same<Type, Argument_type>::value));
|
||||
static_assert( ::std::is_same<Type, Argument_type>::value);
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_static_assertion(( ::std::is_same<Interval_type, Result_type>::value));
|
||||
static_assert( ::std::is_same<Interval_type, Result_type>::value);
|
||||
CGAL_USE_TYPE(Result_type); CGAL_USE_TYPE(Interval_type);
|
||||
|
||||
// assert(NiX::in(42.0,to_Interval(Type(42))));
|
||||
|
|
@ -139,7 +139,7 @@ void test_real_embeddable() {
|
|||
CGAL_SNAP_RET_FUNCTORS(RET);
|
||||
typedef typename RET::Is_real_embeddable Is_real_embeddable;
|
||||
using CGAL::Tag_true;
|
||||
CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_true>::value));
|
||||
static_assert(::std::is_same< Is_real_embeddable, Tag_true>::value);
|
||||
CGAL_USE_TYPE(Is_real_embeddable);
|
||||
|
||||
typedef typename RET::Boolean Boolean;
|
||||
|
|
@ -246,7 +246,7 @@ void test_not_real_embeddable() {
|
|||
typedef CGAL::Real_embeddable_traits<Type> RET;
|
||||
typedef typename RET::Is_real_embeddable Is_real_embeddable;
|
||||
using CGAL::Tag_false;
|
||||
CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_false>::value));
|
||||
static_assert(::std::is_same< Is_real_embeddable, Tag_false>::value);
|
||||
CGAL_USE_TYPE(Is_real_embeddable);
|
||||
}
|
||||
|
||||
|
|
@ -254,13 +254,13 @@ void test_not_real_embeddable() {
|
|||
//template <class Type, class CeilLog2Abs>
|
||||
//void test_rounded_log2_abs(Type zero, CGAL::Null_functor, CeilLog2Abs) {
|
||||
// typedef CGAL::Null_functor Null_functor;
|
||||
// CGAL_static_assertion(( ::std::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
// static_assert(::std::is_same< CeilLog2Abs, Null_functor>::value);
|
||||
//}
|
||||
//
|
||||
//template <class Type, class FloorLog2Abs, class CeilLog2Abs>
|
||||
//void test_rounded_log2_abs(Type zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
|
||||
// typedef CGAL::Null_functor Null_functor;
|
||||
// CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
// static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value);
|
||||
//
|
||||
// assert( fl_log(Type( 7)) == 2 );
|
||||
// assert( cl_log(Type( 7)) == 3 );
|
||||
|
|
|
|||
|
|
@ -9,21 +9,21 @@ int main(){
|
|||
|
||||
typedef AET::Type Type;
|
||||
CGAL_USE_TYPE(Type);
|
||||
CGAL_static_assertion((::std::is_same<int,Type>::value));
|
||||
static_assert(::std::is_same<int,Type>::value);
|
||||
|
||||
typedef AET::Is_extended Is_extended;
|
||||
CGAL_USE_TYPE(Is_extended);
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(::std::is_same<CGAL::Tag_false,Is_extended>::value));
|
||||
|
||||
typedef AET::Normalization_factor Normalization_factor;
|
||||
{
|
||||
typedef Normalization_factor::argument_type argument_type;
|
||||
CGAL_USE_TYPE(argument_type);
|
||||
CGAL_static_assertion((::std::is_same<argument_type,int>::value));
|
||||
static_assert(::std::is_same<argument_type,int>::value);
|
||||
typedef Normalization_factor::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<result_type,int>::value));
|
||||
static_assert(::std::is_same<result_type,int>::value);
|
||||
Normalization_factor nfac;
|
||||
assert(nfac(3)==1);
|
||||
}
|
||||
|
|
@ -31,10 +31,10 @@ int main(){
|
|||
{
|
||||
typedef DFAI::argument_type argument_type;
|
||||
CGAL_USE_TYPE(argument_type);
|
||||
CGAL_static_assertion((::std::is_same<argument_type,int>::value));
|
||||
static_assert(::std::is_same<argument_type,int>::value);
|
||||
typedef DFAI::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<result_type,int>::value));
|
||||
static_assert(::std::is_same<result_type,int>::value);
|
||||
DFAI dfai;
|
||||
assert(dfai(3)==1);
|
||||
}
|
||||
|
|
@ -45,21 +45,21 @@ int main(){
|
|||
|
||||
typedef AET::Type Type;
|
||||
CGAL_USE_TYPE(Type);
|
||||
CGAL_static_assertion((::std::is_same<EXT,Type>::value));
|
||||
static_assert(::std::is_same<EXT,Type>::value);
|
||||
|
||||
typedef AET::Is_extended Is_extended;
|
||||
CGAL_USE_TYPE(Is_extended);
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(::std::is_same<CGAL::Tag_true,Is_extended>::value));
|
||||
|
||||
typedef AET::Normalization_factor Normalization_factor;
|
||||
{
|
||||
typedef Normalization_factor::argument_type argument_type;
|
||||
CGAL_USE_TYPE(argument_type);
|
||||
CGAL_static_assertion((::std::is_same<argument_type,EXT>::value));
|
||||
static_assert(::std::is_same<argument_type,EXT>::value);
|
||||
typedef Normalization_factor::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<result_type,EXT>::value));
|
||||
static_assert(::std::is_same<result_type,EXT>::value);
|
||||
Normalization_factor nfac;
|
||||
assert(nfac(EXT(3))==1);
|
||||
assert(nfac(EXT(3,0,5))==1);
|
||||
|
|
@ -69,10 +69,10 @@ int main(){
|
|||
{
|
||||
typedef DFAI::argument_type argument_type;
|
||||
CGAL_USE_TYPE(argument_type);
|
||||
CGAL_static_assertion((::std::is_same<argument_type,EXT>::value));
|
||||
static_assert(::std::is_same<argument_type,EXT>::value);
|
||||
typedef DFAI::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<result_type,EXT>::value));
|
||||
static_assert(::std::is_same<result_type,EXT>::value);
|
||||
DFAI dfai;
|
||||
assert(dfai(EXT(3))==1);
|
||||
assert(dfai(EXT(3,0,5))==1);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
{ \
|
||||
typedef AST::NAME NAME; \
|
||||
CGAL_USE_TYPE(NAME); \
|
||||
CGAL_static_assertion( \
|
||||
static_assert( \
|
||||
(::std::is_same<CGAL::Null_functor,NAME>::value)); \
|
||||
}
|
||||
|
||||
|
|
@ -16,19 +16,19 @@ int main(){
|
|||
|
||||
typedef AST::Type Type;
|
||||
CGAL_USE_TYPE(Type);
|
||||
CGAL_static_assertion((::std::is_same<void,Type>::value));
|
||||
static_assert(::std::is_same<void,Type>::value);
|
||||
|
||||
typedef AST::Algebraic_category Algebraic_category;
|
||||
CGAL_USE_TYPE(Algebraic_category);
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(::std::is_same<CGAL::Null_tag,Algebraic_category>::value));
|
||||
|
||||
typedef AST::Is_exact Is_exact;
|
||||
CGAL_USE_TYPE(Is_exact);
|
||||
CGAL_static_assertion((::std::is_same<CGAL::Null_tag,Is_exact>::value));
|
||||
static_assert(::std::is_same<CGAL::Null_tag,Is_exact>::value);
|
||||
typedef AST::Is_numerical_sensitive Is_sensitive;
|
||||
CGAL_USE_TYPE(Is_sensitive);
|
||||
CGAL_static_assertion((::std::is_same<CGAL::Null_tag,Is_sensitive>::value));
|
||||
static_assert(::std::is_same<CGAL::Null_tag,Is_sensitive>::value);
|
||||
|
||||
CGAL_IS_AST_NULL_FUNCTOR ( Simplify);
|
||||
CGAL_IS_AST_NULL_FUNCTOR ( Unit_part);
|
||||
|
|
|
|||
|
|
@ -6,22 +6,17 @@ int main(){
|
|||
{
|
||||
typedef CGAL::Coercion_traits<int,int> CT;
|
||||
CGAL_USE_TYPE(CT);
|
||||
CGAL_static_assertion(( std::is_same<CT::Type,int>::value));
|
||||
CGAL_static_assertion(
|
||||
( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_true>::value));
|
||||
CGAL_static_assertion(
|
||||
( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
|
||||
static_assert( std::is_same<CT::Type,int>::value);
|
||||
static_assert( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_true>::value);
|
||||
static_assert( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_true>::value);
|
||||
assert( 5 == CT::Cast()(5));
|
||||
}
|
||||
{
|
||||
typedef CGAL::Coercion_traits<CGAL::Tag_true,CGAL::Tag_false> CT;
|
||||
CGAL_USE_TYPE(CT);
|
||||
// CGAL_static_assertion(( std::is_same<CT::Type,CGAL::Null_type>::value));
|
||||
CGAL_static_assertion(
|
||||
( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_false>::value));
|
||||
CGAL_static_assertion(
|
||||
( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_false>::value));
|
||||
CGAL_static_assertion(
|
||||
( std::is_same<CT::Cast,CGAL::Null_functor>::value));
|
||||
// static_assert( std::is_same<CT::Type,CGAL::Null_type>::value);
|
||||
static_assert(std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_false>::value);
|
||||
static_assert(std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_false>::value);
|
||||
static_assert(std::is_same<CT::Cast,CGAL::Null_functor>::value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
{ \
|
||||
typedef RET::NAME NAME; \
|
||||
CGAL_USE_TYPE(NAME); \
|
||||
CGAL_static_assertion( \
|
||||
static_assert( \
|
||||
(::std::is_same<CGAL::Null_functor,NAME>::value)); \
|
||||
}
|
||||
|
||||
|
|
@ -16,11 +16,11 @@ int main(){
|
|||
|
||||
typedef RET::Type Type;
|
||||
CGAL_USE_TYPE(Type);
|
||||
CGAL_static_assertion((::std::is_same<void,Type>::value));
|
||||
static_assert(::std::is_same<void,Type>::value);
|
||||
|
||||
typedef RET::Is_real_embeddable Is_real_embeddable;
|
||||
CGAL_USE_TYPE(Is_real_embeddable);
|
||||
CGAL_static_assertion((::std::is_same<CGAL::Tag_false,Is_real_embeddable>::value));
|
||||
static_assert(::std::is_same<CGAL::Tag_false,Is_real_embeddable>::value);
|
||||
|
||||
CGAL_IS_RET_NULL_FUNCTOR(Abs);
|
||||
CGAL_IS_RET_NULL_FUNCTOR(Sgn);
|
||||
|
|
|
|||
|
|
@ -7,33 +7,31 @@
|
|||
int main(){
|
||||
typedef CGAL::Scalar_factor_traits<int> SFT;
|
||||
CGAL_USE_TYPE(SFT);
|
||||
CGAL_static_assertion((::std::is_same<int, SFT::Type>::value));
|
||||
CGAL_static_assertion((::std::is_same<int, SFT::Scalar>::value));
|
||||
static_assert(::std::is_same<int, SFT::Type>::value);
|
||||
static_assert(::std::is_same<int, SFT::Scalar>::value);
|
||||
|
||||
typedef SFT::Scalar_factor Scalar_factor;
|
||||
{
|
||||
typedef Scalar_factor::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<int, result_type>::value));
|
||||
static_assert(::std::is_same<int, result_type>::value);
|
||||
|
||||
typedef Scalar_factor::argument_type argument_type;
|
||||
CGAL_USE_TYPE(argument_type);
|
||||
CGAL_static_assertion((::std::is_same<int, argument_type>::value));
|
||||
static_assert(::std::is_same<int, argument_type>::value);
|
||||
}
|
||||
typedef SFT::Scalar_div Scalar_div;
|
||||
{
|
||||
typedef Scalar_div::result_type result_type;
|
||||
CGAL_USE_TYPE(result_type);
|
||||
CGAL_static_assertion((::std::is_same<void, result_type>::value));
|
||||
static_assert(::std::is_same<void, result_type>::value);
|
||||
|
||||
typedef Scalar_div::first_argument_type first_argument_type;
|
||||
CGAL_USE_TYPE(first_argument_type);
|
||||
CGAL_static_assertion(
|
||||
(::std::is_same<int&, first_argument_type>::value));
|
||||
static_assert(::std::is_same<int&, first_argument_type>::value);
|
||||
typedef Scalar_div::second_argument_type second_argument_type;
|
||||
CGAL_USE_TYPE(second_argument_type);
|
||||
CGAL_static_assertion(
|
||||
(::std::is_same<int, second_argument_type>::value));
|
||||
static_assert(::std::is_same<int, second_argument_type>::value);
|
||||
}
|
||||
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include <type_traits>
|
||||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/config.h>
|
||||
|
|
@ -359,7 +359,7 @@ public:
|
|||
Unary_compose(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 OuterFunctor::result_type result_type;
|
||||
|
|
@ -368,11 +368,11 @@ public:
|
|||
result_type operator() (const argument_type& arg) const {
|
||||
CGAL_assertion(bool(_inner));
|
||||
CGAL_assertion(bool(_outer));
|
||||
return _outer.get()(_inner.get()(arg));
|
||||
return _outer.value()(_inner.value()(arg));
|
||||
}
|
||||
private:
|
||||
::boost::optional<InnerFunctor> _inner;
|
||||
::boost::optional<OuterFunctor> _outer;
|
||||
::std::optional<InnerFunctor> _inner;
|
||||
::std::optional<OuterFunctor> _outer;
|
||||
};
|
||||
|
||||
template<typename InnerFunctor,typename OuterFunctor>
|
||||
|
|
@ -481,18 +481,18 @@ public:
|
|||
Curve_analysis_2 _construct_defining_polynomial_from(Bound b) const {
|
||||
typedef CGAL::Fraction_traits<Bound> FT;
|
||||
// We rely on the fact that the Bound is a fraction
|
||||
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
static_assert(::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value);
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
|
||||
CGAL_static_assertion((::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Coefficient,
|
||||
typename Num_coercion::Type>::value));
|
||||
typename Num_coercion::Type>::value);
|
||||
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
|
||||
CGAL_static_assertion((::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Coefficient,
|
||||
typename Denom_coercion::Type>::value));
|
||||
typename Denom_coercion::Type>::value);
|
||||
typename Num_coercion::Cast num_cast;
|
||||
typename Denom_coercion::Cast denom_cast;
|
||||
typename FT::Decompose decompose;
|
||||
|
|
@ -2541,18 +2541,18 @@ public:
|
|||
Polynomial_1 operator() (const Polynomial_2& f, Bound b) const {
|
||||
typedef CGAL::Fraction_traits<Bound> FT;
|
||||
// We rely on the fact that the Bound is a fraction
|
||||
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
static_assert(::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value);
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
|
||||
CGAL_static_assertion((::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Coefficient,
|
||||
typename Num_coercion::Type>::value));
|
||||
typename Num_coercion::Type>::value);
|
||||
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
|
||||
CGAL_static_assertion((::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Coefficient,
|
||||
typename Denom_coercion::Type>::value));
|
||||
typename Denom_coercion::Type>::value);
|
||||
typename Num_coercion::Cast num_cast;
|
||||
typename Denom_coercion::Cast denom_cast;
|
||||
typename FT::Decompose decompose;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class Algebraic_real_d_1 :
|
|||
public ::CGAL::Handle_with_policy< AlgebraicRealRep_d_1, HandlePolicy > {
|
||||
|
||||
// currently Rational is the only supported Bound type.
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
( ::std::is_same <Rational_,
|
||||
typename Get_arithmetic_kernel<Coefficient_>::Arithmetic_kernel::Rational>::value));
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ public:
|
|||
long old_precision = get_precision( BFI() );
|
||||
set_precision( BFI(), 53 );
|
||||
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 );
|
||||
return *(this->ptr()->interval_option);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ private:
|
|||
CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1>
|
||||
::Other::Type BFI_polynomial;
|
||||
|
||||
mutable boost::optional
|
||||
mutable std::optional
|
||||
< 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_;
|
||||
|
||||
mutable long N;
|
||||
|
|
@ -113,8 +113,8 @@ private:
|
|||
low_bfi_ = CGAL::convert_to_bfi(this->low());
|
||||
|
||||
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
||||
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get());
|
||||
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get());
|
||||
f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
|
||||
f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ private:
|
|||
}
|
||||
|
||||
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)) {
|
||||
|
||||
|
|
@ -229,21 +229,21 @@ protected:
|
|||
|
||||
bool poly_changed = (P!=this->polynomial());
|
||||
if(poly_changed) {
|
||||
f_bfi_ = boost::none;
|
||||
f_bfi_ = std::nullopt;
|
||||
}
|
||||
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()) {
|
||||
f_high_bfi_ = high_bfi_ = boost::none;
|
||||
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||
}
|
||||
Base::set_implicit_rep(P,LOW,HIGH,dummy_bool);
|
||||
}
|
||||
|
||||
virtual void set_explicit_rep(const Field& m) const {
|
||||
f_bfi_ = boost::none;
|
||||
f_low_bfi_ = low_bfi_ = boost::none;
|
||||
f_high_bfi_ = high_bfi_ = boost::none;
|
||||
f_bfi_ = std::nullopt;
|
||||
f_low_bfi_ = low_bfi_ = std::nullopt;
|
||||
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||
Base::set_explicit_rep(m);
|
||||
}
|
||||
|
||||
|
|
@ -256,13 +256,13 @@ public:
|
|||
if(this->is_rational()) return;
|
||||
|
||||
if(old_low_!=this->low_) {
|
||||
f_low_bfi_ = low_bfi_ = boost::none;
|
||||
f_low_bfi_ = low_bfi_ = std::nullopt;
|
||||
}
|
||||
if(old_high_!=this->high_) {
|
||||
f_high_bfi_ = high_bfi_ = boost::none;
|
||||
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||
}
|
||||
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());
|
||||
}
|
||||
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_) {
|
||||
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
||||
}
|
||||
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;
|
||||
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_);
|
||||
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);
|
||||
Integer i_low = int_pair.first;
|
||||
|
|
@ -458,7 +458,7 @@ protected:
|
|||
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));
|
||||
|
||||
|
|
@ -490,7 +490,7 @@ public:
|
|||
Poly f_old = this->polynomial();
|
||||
Base::simplify();
|
||||
if(f_old != this->polynomial()) {
|
||||
f_bfi_ = boost::none;
|
||||
f_bfi_ = std::nullopt;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Polynomial_type_generator.h>
|
||||
#include <CGAL/Polynomial_traits_d.h>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ private:
|
|||
|
||||
typedef Algebraic_real_rep <Coefficient,Rational> Self;
|
||||
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 Rational low_; //!< lower endpoint of interval
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <CGAL/Random.h>
|
||||
#include <CGAL/tss.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
/*
|
||||
* AUXILIARY CLASSES AND FUNCTIONS
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <type_traits>
|
||||
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/logical.hpp>
|
||||
|
||||
|
|
@ -66,14 +65,14 @@ namespace internal {
|
|||
|
||||
template<typename Comparable,bool has_template_typedefs>
|
||||
struct Is_derived_from_Handle_with_policy {
|
||||
typedef boost::false_type Tag;
|
||||
typedef std::false_type Tag;
|
||||
};
|
||||
|
||||
template<typename Comparable>
|
||||
struct Is_derived_from_Handle_with_policy<Comparable,true> {
|
||||
|
||||
typedef typename
|
||||
boost::is_base_of< CGAL::Handle_with_policy
|
||||
std::is_base_of< CGAL::Handle_with_policy
|
||||
< typename Comparable::T,
|
||||
typename Comparable::Handle_policy,
|
||||
typename Comparable::Allocator >,
|
||||
|
|
@ -90,7 +89,7 @@ template<typename Comparable,typename Tag> struct Compare_for_vert_line_map_
|
|||
};
|
||||
|
||||
template<typename Comparable>
|
||||
struct Compare_for_vert_line_map_<Comparable,boost::true_type> {
|
||||
struct Compare_for_vert_line_map_<Comparable,std::true_type> {
|
||||
|
||||
bool operator() (const Comparable& a, const Comparable& b) const {
|
||||
return CGAL::Handle_id_less_than< Comparable >()(a,b);
|
||||
|
|
@ -197,7 +196,7 @@ private:
|
|||
size_type index_of_content_root;
|
||||
size_type mult_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
|
||||
|
|
@ -211,14 +210,14 @@ private:
|
|||
|
||||
|
||||
//! 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;
|
||||
|
||||
//! The algebraic kernel to use
|
||||
Algebraic_kernel_with_analysis_2* _m_kernel;
|
||||
|
||||
//! The polynomial defining the curve
|
||||
boost::optional<Polynomial_2> f;
|
||||
std::optional<Polynomial_2> f;
|
||||
|
||||
//! How degenerate situations are handled
|
||||
CGAL::Degeneracy_strategy degeneracy_strategy;
|
||||
|
|
@ -231,24 +230,24 @@ private:
|
|||
* \c f/cont(f). The corresponding curve is equal to the curve of \c f,
|
||||
* 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
|
||||
//! part of f and its y-derivative
|
||||
mutable boost::optional<Polynomial_1>
|
||||
mutable std::optional<Polynomial_1>
|
||||
resultant_of_primitive_and_derivative_y;
|
||||
|
||||
//! the polynomial containing all roots of the resultant of the primitive
|
||||
//! part of f and its x-derivative
|
||||
mutable boost::optional<Polynomial_1>
|
||||
mutable std::optional<Polynomial_1>
|
||||
resultant_of_primitive_and_derivative_x;
|
||||
|
||||
//! The Sturm-Habicht polynomials of f
|
||||
mutable boost::optional<std::vector<Polynomial_2> >
|
||||
mutable std::optional<std::vector<Polynomial_2> >
|
||||
sturm_habicht_of_primitive;
|
||||
|
||||
//! 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
|
||||
mutable std::set<Integer> bad_shears;
|
||||
|
|
@ -257,10 +256,10 @@ private:
|
|||
mutable std::map<Integer,Handle> sheared_curves;
|
||||
|
||||
//! Has the curve vertical line components
|
||||
mutable boost::optional<bool> has_vertical_component;
|
||||
mutable std::optional<bool> has_vertical_component;
|
||||
|
||||
//! The intermediate values
|
||||
mutable boost::optional<std::vector<boost::optional<Bound> > >
|
||||
mutable std::optional<std::vector<std::optional<Bound> > >
|
||||
intermediate_values;
|
||||
|
||||
//! stores Y_values at rational coordinate
|
||||
|
|
@ -273,7 +272,7 @@ private:
|
|||
* are asymptotic to y=beta,
|
||||
* 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;
|
||||
|
||||
//! friends
|
||||
|
|
@ -547,7 +546,7 @@ private:
|
|||
|
||||
if(! 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);
|
||||
}
|
||||
|
||||
|
|
@ -584,7 +583,7 @@ public:
|
|||
*/
|
||||
void set_f(Polynomial_2 f) {
|
||||
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->ptr()->f=f;
|
||||
}
|
||||
|
|
@ -631,7 +630,7 @@ public:
|
|||
event_coordinates();
|
||||
CGAL_assertion(this->ptr()->has_vertical_component);
|
||||
}
|
||||
return this->ptr()->has_vertical_component.get();
|
||||
return this->ptr()->has_vertical_component.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -639,7 +638,7 @@ public:
|
|||
//! Returns the defining polynomial
|
||||
Polynomial_2 polynomial_2() const {
|
||||
CGAL_precondition(bool(this->ptr()->f));
|
||||
return this->ptr()->f.get();
|
||||
return this->ptr()->f.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -714,8 +713,8 @@ public:
|
|||
= event_line;
|
||||
event_coordinates()[i].stack = event_line;
|
||||
}
|
||||
CGAL_postcondition(event_coordinates()[i].stack.get().is_event());
|
||||
return event_coordinates()[i].stack.get();
|
||||
CGAL_postcondition(event_coordinates()[i].stack.value().is_event());
|
||||
return event_coordinates()[i].stack.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -1349,7 +1348,7 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
return intermediate_values()[i].get();
|
||||
return intermediate_values()[i].value();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1370,7 +1369,7 @@ public:
|
|||
if(! this->ptr()->content) {
|
||||
compute_content_and_primitive_part();
|
||||
}
|
||||
return this->ptr()->content.get();
|
||||
return this->ptr()->content.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -1389,7 +1388,7 @@ public:
|
|||
if(! this->ptr()->f_primitive) {
|
||||
compute_content_and_primitive_part();
|
||||
}
|
||||
return this->ptr()->f_primitive.get();
|
||||
return this->ptr()->f_primitive.value();
|
||||
}
|
||||
|
||||
Algebraic_kernel_with_analysis_2* kernel() const {
|
||||
|
|
@ -1437,7 +1436,7 @@ private:
|
|||
if(! this->ptr()->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:
|
||||
|
|
@ -1558,7 +1557,7 @@ private:
|
|||
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
|
||||
this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0];
|
||||
if(this->ptr()->resultant_of_primitive_and_derivative_y.
|
||||
get().is_zero()) {
|
||||
value().is_zero()) {
|
||||
throw internal::Zero_resultant_exception<Polynomial_2>
|
||||
(polynomial_2());
|
||||
}
|
||||
|
|
@ -1582,7 +1581,7 @@ private:
|
|||
if(! this->ptr()->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:
|
||||
|
|
@ -1593,7 +1592,7 @@ private:
|
|||
if(! this->ptr()->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:
|
||||
|
|
@ -1714,20 +1713,20 @@ private:
|
|||
if(! this->ptr()->event_coordinates) {
|
||||
compute_event_coordinates();
|
||||
}
|
||||
return this->ptr()->event_coordinates.get();
|
||||
return this->ptr()->event_coordinates.value();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// 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) {
|
||||
// This is created during event_coordiantes()
|
||||
event_coordinates();
|
||||
CGAL_assertion(bool(this->ptr()->intermediate_values));
|
||||
}
|
||||
return this->ptr()->intermediate_values.get();
|
||||
return this->ptr()->intermediate_values.value();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1916,7 +1915,7 @@ private:
|
|||
static_cast<size_type>(content_roots.size()));
|
||||
|
||||
this->ptr()->intermediate_values
|
||||
= std::vector<boost::optional<Bound> >
|
||||
= std::vector<std::optional<Bound> >
|
||||
(event_coordinate_vector.size()+1);
|
||||
this->ptr()->event_coordinates = event_coordinate_vector;
|
||||
|
||||
|
|
@ -2111,7 +2110,7 @@ public:
|
|||
compute_horizontal_asymptotes();
|
||||
}
|
||||
std::vector<Asymptote_y>& asym_info
|
||||
= this->ptr()->horizontal_asymptotes_left.get();
|
||||
= this->ptr()->horizontal_asymptotes_left.value();
|
||||
CGAL_precondition(arcno>=0 &&
|
||||
arcno<static_cast<size_type>(asym_info.size()));
|
||||
return asym_info[arcno];
|
||||
|
|
@ -2121,7 +2120,7 @@ public:
|
|||
compute_horizontal_asymptotes();
|
||||
}
|
||||
std::vector<Asymptote_y>& asym_info
|
||||
= this->ptr()->horizontal_asymptotes_right.get();
|
||||
= this->ptr()->horizontal_asymptotes_right.value();
|
||||
CGAL_precondition(arcno>=0 &&
|
||||
arcno<static_cast<size_type>(asym_info.size()));
|
||||
return asym_info[arcno];
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <CGAL/Handle_with_policy.h>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
|
|
@ -136,9 +136,9 @@ public:
|
|||
|
||||
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;
|
||||
|
||||
|
|
@ -151,11 +151,11 @@ public:
|
|||
typedef std::vector<std::vector<Intersection_info> >
|
||||
Intersection_info_container;
|
||||
|
||||
typedef boost::optional<Intersection_info_container>
|
||||
typedef std::optional<Intersection_info_container>
|
||||
Lazy_intersection_info_container;
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
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;
|
||||
mutable boost::optional<std::vector<Polynomial_1> >
|
||||
mutable std::optional<std::vector<Polynomial_1> >
|
||||
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 boost::optional<std::vector<Algebraic_real_1> >
|
||||
mutable std::optional<std::vector<Algebraic_real_1> > resultant_roots;
|
||||
mutable std::optional<std::vector<Algebraic_real_1> >
|
||||
event_x_coordinates;
|
||||
mutable boost::optional<std::vector<size_type> >
|
||||
mutable std::optional<std::vector<size_type> >
|
||||
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 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;
|
||||
|
||||
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;
|
||||
|
||||
|
|
@ -530,7 +530,7 @@ private:
|
|||
/*
|
||||
* \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.
|
||||
*/
|
||||
void compute_intermediate_values_and_slices() const;
|
||||
|
|
@ -547,7 +547,7 @@ public:
|
|||
compute_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 {
|
||||
|
|
@ -555,7 +555,7 @@ public:
|
|||
compute_resultant_roots_with_multiplicities();
|
||||
}
|
||||
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 {
|
||||
|
|
@ -569,7 +569,7 @@ public:
|
|||
compute_resultant_roots_with_multiplicities();
|
||||
}
|
||||
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 {
|
||||
|
|
@ -586,10 +586,10 @@ public:
|
|||
(kernel(),
|
||||
resultant_roots().begin(),
|
||||
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));
|
||||
return this->ptr()->stripe_values.get();
|
||||
return this->ptr()->stripe_values.value();
|
||||
}
|
||||
|
||||
std::vector<Algebraic_real_1>& event_x_coordinates() const {
|
||||
|
|
@ -597,7 +597,7 @@ public:
|
|||
compute_event_x_coordinates_with_event_indices();
|
||||
}
|
||||
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 {
|
||||
|
|
@ -605,7 +605,7 @@ public:
|
|||
compute_event_x_coordinates_with_event_indices();
|
||||
}
|
||||
CGAL_assertion(bool(this->ptr()->event_indices));
|
||||
return this->ptr()->event_indices.get();
|
||||
return this->ptr()->event_indices.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -613,7 +613,7 @@ public:
|
|||
/*
|
||||
* \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
|
||||
* 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
|
||||
|
|
@ -633,7 +633,7 @@ private:
|
|||
compute_intermediate_values_and_slices();
|
||||
}
|
||||
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 {
|
||||
|
|
@ -641,7 +641,7 @@ private:
|
|||
compute_intermediate_values_and_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();
|
||||
}
|
||||
CGAL_assertion(bool(this->ptr()->subresultants));
|
||||
return this->ptr()->subresultants.get();
|
||||
return this->ptr()->subresultants.value();
|
||||
}
|
||||
|
||||
Polynomial_2& subresultants(size_type i) const {
|
||||
|
|
@ -666,7 +666,7 @@ private:
|
|||
compute_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 {
|
||||
|
|
@ -681,7 +681,7 @@ private:
|
|||
compute_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 {
|
||||
|
|
@ -1030,7 +1030,7 @@ public:
|
|||
this->ptr()->event_slices[i] = create_event_slice(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
|
||||
|
|
@ -1074,7 +1074,7 @@ public:
|
|||
}
|
||||
}
|
||||
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();
|
||||
|
||||
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>
|
||||
(this->ptr()->f,
|
||||
this->ptr()->g);
|
||||
|
|
@ -1345,8 +1345,8 @@ compute_resultant_roots_with_multiplicities() const {
|
|||
solve_1(resultant(), std::back_inserter(res_pairs));
|
||||
|
||||
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()->multiplicities_of_resultant_roots.get()
|
||||
this->ptr()->resultant_roots.value().push_back(res_pairs[i].first);
|
||||
this->ptr()->multiplicities_of_resultant_roots.value()
|
||||
.push_back(res_pairs[i].second);
|
||||
}
|
||||
|
||||
|
|
@ -1357,13 +1357,13 @@ compute_resultant_roots_with_multiplicities() const {
|
|||
#if CGAL_ACK_DEBUG_FLAG
|
||||
for(size_type i = 0;
|
||||
i<static_cast<size_type>
|
||||
(this->ptr()->resultant_roots.get().size());
|
||||
(this->ptr()->resultant_roots.value().size());
|
||||
i++) {
|
||||
CGAL_ACK_DEBUG_PRINT
|
||||
<< "Root at "
|
||||
<< CGAL::to_double(this->ptr()->resultant_roots.get()[i])
|
||||
<< CGAL::to_double(this->ptr()->resultant_roots.value()[i])
|
||||
<< " with multiplicity "
|
||||
<< this->ptr()->multiplicities_of_resultant_roots.get()[i]
|
||||
<< this->ptr()->multiplicities_of_resultant_roots.value()[i]
|
||||
<< std::endl;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1401,18 +1401,18 @@ compute_event_x_coordinates_with_event_indices() const {
|
|||
one_curve_events.end(),
|
||||
resultant_roots().begin(),
|
||||
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),
|
||||
compare);
|
||||
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
|
||||
=one_curve_events_type.begin();
|
||||
size_type inter_count=0, f_count=0,g_count=0;
|
||||
this->ptr()->event_indices = std::vector<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++) {
|
||||
/*
|
||||
#if CGAL_ACK_DEBUG_FLAG
|
||||
|
|
@ -1519,8 +1519,8 @@ compute_intermediate_values_and_slices() const {
|
|||
std::size_t size = event_x_coordinates().size()+1;
|
||||
this->ptr()->intermediate_values=std::vector<Lazy_bound>();
|
||||
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
|
||||
this->ptr()->intermediate_values.get().resize(size);
|
||||
this->ptr()->intermediate_slices.get().resize(size);
|
||||
this->ptr()->intermediate_values.value().resize(size);
|
||||
this->ptr()->intermediate_slices.value().resize(size);
|
||||
#if CGAL_ACK_DEBUG_FLAG
|
||||
CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
|
||||
#endif
|
||||
|
|
@ -1539,25 +1539,25 @@ compute_subresultants() const {
|
|||
if(CGAL::degree(f,1)<CGAL::degree(g,1)) {
|
||||
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_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
|
||||
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
||||
::Polynomial_subresultants()
|
||||
(g,f,std::back_inserter(this->ptr()->subresultants.get()));
|
||||
(g,f,std::back_inserter(this->ptr()->subresultants.value()));
|
||||
#endif
|
||||
} else {
|
||||
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_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
|
||||
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
||||
::Polynomial_subresultants()
|
||||
(f,g,std::back_inserter(this->ptr()->subresultants.get()));
|
||||
(f,g,std::back_inserter(this->ptr()->subresultants.value()));
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<Polynomial_2>& subresultants
|
||||
= this->ptr()->subresultants.get();
|
||||
= this->ptr()->subresultants.value();
|
||||
|
||||
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:
|
||||
if(CGAL::degree(f,1) == CGAL::degree(g,1)) {
|
||||
if(n>=1) {
|
||||
this->ptr()->principal_subresultants.get()[n-1]
|
||||
this->ptr()->principal_subresultants.value()[n-1]
|
||||
= Polynomial_1(CGAL::leading_coefficient(g));
|
||||
}
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public:
|
|||
//Arc_pair _m_num_arcs;
|
||||
|
||||
//! 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
|
||||
mutable int _m_total_arcs;
|
||||
|
|
@ -160,10 +160,10 @@ public:
|
|||
std::vector< int > multiplicities_;*/
|
||||
|
||||
// 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
|
||||
mutable boost::optional<Bitstream_descartes> isolator;
|
||||
mutable std::optional<Bitstream_descartes> isolator;
|
||||
|
||||
// befriending the handle
|
||||
friend class Status_line_CA_1<Curve_analysis_2, Self>;
|
||||
|
|
@ -555,7 +555,7 @@ public:
|
|||
//! Returns the isolator instance
|
||||
Bitstream_descartes& isolator() const {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public:
|
|||
|
||||
// represents x-coordinate of event of rational value over interval
|
||||
// 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
|
||||
// or -1 if respective curve is not involved
|
||||
|
|
|
|||
|
|
@ -81,10 +81,10 @@ public:
|
|||
mutable int _m_arcno;
|
||||
|
||||
// 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
|
||||
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
|
||||
*
|
||||
* 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,
|
||||
* and using get_approximation_y() instead whenever approximations suffice.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ template<typename AlgebraicKernel_1,
|
|||
InputIterator start,
|
||||
InputIterator end,
|
||||
OutputIterator output) {
|
||||
CGAL_static_assertion
|
||||
static_assert
|
||||
((::std::is_same
|
||||
<typename AlgebraicKernel_1::Algebraic_real_1,
|
||||
typename std::iterator_traits<InputIterator>::value_type >::value));
|
||||
|
|
@ -224,14 +224,14 @@ template<typename Poly_coer_1,typename Polynomial_1>
|
|||
void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) {
|
||||
// We can assume that both template arguments are polynomial types
|
||||
typedef CGAL::Fraction_traits<Poly_coer_1> FT;
|
||||
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
static_assert(::std::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value);
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Polynomial_1> Num_coercion;
|
||||
CGAL_static_assertion((::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Polynomial_1,
|
||||
typename Num_coercion::Type>::value));
|
||||
typename Num_coercion::Type>::value);
|
||||
Numerator p_num;
|
||||
Denominator p_denom;
|
||||
typename FT::Decompose()(p,p_num,p_denom);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
typedef typename Floor::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::std::is_same<Integer, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same<Integer, Result_type>::value);
|
||||
assert(Integer(42) == floor(NT(42)));
|
||||
assert(Integer(-42) == floor(NT(-42)));
|
||||
}
|
||||
|
|
@ -59,8 +59,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
typedef typename Floor_log2_abs::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::std::is_same<long, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same<long, Result_type>::value);
|
||||
|
||||
assert(long(0) == floor_log2_abs(NT(1)));
|
||||
assert(long(0) == floor_log2_abs(NT(-1)));
|
||||
|
|
@ -86,8 +86,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
typedef typename Ceil::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::std::is_same<Integer, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same<Integer, Result_type>::value);
|
||||
assert(Integer(42) == ceil(NT(42)));
|
||||
assert(Integer(-42) == ceil(NT(-42)));
|
||||
}
|
||||
|
|
@ -98,8 +98,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
typedef typename Ceil_log2_abs::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::std::is_same<long, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same<long, Result_type>::value);
|
||||
|
||||
assert(long(0) == ceil_log2_abs(NT(1)));
|
||||
assert(long(0) == ceil_log2_abs(NT(-1)));
|
||||
|
|
|
|||
|
|
@ -62,20 +62,20 @@ void test_algebraic_curve_kernel_2() {
|
|||
|
||||
typedef AlgebraicCurveKernel_2 AK_2;
|
||||
|
||||
/* CGAL_static_assertion( (::std::is_same<
|
||||
Algebraic_real_1, typename AK::Algebraic_real_1 >::value) );
|
||||
/* static_assert(::std::is_same<
|
||||
Algebraic_real_1, typename AK::Algebraic_real_1 >::value);
|
||||
|
||||
CGAL_static_assertion((::std::is_same<
|
||||
static_assert(::std::is_same<
|
||||
Isolator,
|
||||
typename AK::Isolator >::value) );
|
||||
typename AK::Isolator >::value);
|
||||
|
||||
CGAL_static_assertion((::std::is_same<
|
||||
static_assert(::std::is_same<
|
||||
Coefficient,
|
||||
typename AK::Coefficient >::value));
|
||||
typename AK::Coefficient >::value);
|
||||
|
||||
CGAL_static_assertion((::std::is_same<
|
||||
static_assert(::std::is_same<
|
||||
Polynomial_1,
|
||||
typename AK::Polynomial_1 >::value));*/
|
||||
typename AK::Polynomial_1 >::value);*/
|
||||
|
||||
typedef typename AK_2::Polynomial_2 Poly_2;
|
||||
typedef typename AK_2::Curve_analysis_2 Curve_analysis_2;
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
|
|||
typedef typename Name::result_type RT_; \
|
||||
CGAL_USE_TYPE(AT_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT,AT_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
|
||||
{static_assert(::std::is_same<AT,AT_>::value);} \
|
||||
{static_assert(::std::is_same<RT,RT_>::value);} \
|
||||
}
|
||||
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
|
||||
{ \
|
||||
|
|
@ -120,9 +120,9 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
|
|||
CGAL_USE_TYPE(AT1_); \
|
||||
CGAL_USE_TYPE(AT2_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT1,AT1_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT2,AT2_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
|
||||
{static_assert(::std::is_same<AT1,AT1_>::value);} \
|
||||
{static_assert(::std::is_same<AT2,AT2_>::value);} \
|
||||
{static_assert(::std::is_same<RT,RT_>::value);} \
|
||||
}
|
||||
|
||||
// TODO: missing check for Construct_algebraic_real_1
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
typedef typename Name::result_type RT_; \
|
||||
CGAL_USE_TYPE(AT_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT,AT_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
|
||||
{static_assert(::std::is_same<AT,AT_>::value);} \
|
||||
{static_assert(::std::is_same<RT,RT_>::value);} \
|
||||
}
|
||||
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
|
||||
{ \
|
||||
|
|
@ -104,22 +104,22 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
CGAL_USE_TYPE(AT1_); \
|
||||
CGAL_USE_TYPE(AT2_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT1,AT1_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<AT2,AT2_>::value));} \
|
||||
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
|
||||
{static_assert(::std::is_same<AT1,AT1_>::value);} \
|
||||
{static_assert(::std::is_same<AT2,AT2_>::value);} \
|
||||
{static_assert(::std::is_same<RT,RT_>::value);} \
|
||||
}
|
||||
|
||||
|
||||
CGAL_static_assertion(( ::std::is_same
|
||||
static_assert(::std::is_same
|
||||
<Algebraic_real_2,
|
||||
typename Construct_algebraic_real_2::result_type>
|
||||
::value));
|
||||
::value);
|
||||
CGAL_CHECK_UFUNCTION(Is_square_free_2,Polynomial_2,bool);
|
||||
CGAL_CHECK_UFUNCTION(Make_square_free_2,Polynomial_2,Polynomial_2);
|
||||
// TODO: missing check for Square_free_factorize_2
|
||||
CGAL_CHECK_BFUNCTION(Is_coprime_2,Polynomial_2,Polynomial_2,bool);
|
||||
CGAL_static_assertion(( ::std::is_same
|
||||
<bool,typename Make_coprime_2::result_type>::value));
|
||||
static_assert(::std::is_same
|
||||
<bool,typename Make_coprime_2::result_type>::value);
|
||||
CGAL_CHECK_BFUNCTION(Number_of_solutions_2,Polynomial_2,Polynomial_2,
|
||||
size_type);
|
||||
CGAL_CHECK_UFUNCTION(Compute_x_2,Algebraic_real_2,Algebraic_real_1);
|
||||
|
|
@ -128,8 +128,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
CGAL_CHECK_UFUNCTION(Compute_polynomial_y_2,Algebraic_real_2,Polynomial_1);
|
||||
CGAL_CHECK_BFUNCTION(Isolate_x_2,Algebraic_real_2,Polynomial_1,BInterval);
|
||||
CGAL_CHECK_BFUNCTION(Isolate_y_2,Algebraic_real_2,Polynomial_1,BInterval);
|
||||
CGAL_static_assertion(( ::std::is_same
|
||||
< BArray,typename Isolate_2::result_type>::value));
|
||||
static_assert(::std::is_same
|
||||
< BArray,typename Isolate_2::result_type>::value);
|
||||
CGAL_CHECK_BFUNCTION(Sign_at_2,Polynomial_2,Algebraic_real_2,Sign);
|
||||
CGAL_CHECK_BFUNCTION(Is_zero_at_2,Polynomial_2,Algebraic_real_2,bool);
|
||||
CGAL_CHECK_BFUNCTION(Compare_x_2,Algebraic_real_2,Algebraic_real_2,Sign);
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ namespace internal {
|
|||
void operator() (ToDouble to_double) {
|
||||
typedef typename ToDouble::argument_type Argument_type;
|
||||
typedef typename ToDouble::result_type Result_type;
|
||||
CGAL_static_assertion((::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion((::std::is_same<double, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same<double, Result_type>::value);
|
||||
assert(42.0 == to_double(NT(42)));
|
||||
}
|
||||
};
|
||||
|
|
@ -59,8 +59,8 @@ namespace internal {
|
|||
void operator() (ToInterval to_Interval) {
|
||||
typedef typename ToInterval::argument_type Argument_type;
|
||||
typedef typename ToInterval::result_type Result_type;
|
||||
CGAL_static_assertion((::std::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion((::std::is_same< typename Argument_type::Interval, Result_type>::value));
|
||||
static_assert(::std::is_same<NT, Argument_type>::value);
|
||||
static_assert(::std::is_same< typename Argument_type::Interval, Result_type>::value);
|
||||
|
||||
// TODO: NiX::in not available!?
|
||||
//assert(NiX::in(42.0,to_Interval(NT(42))));
|
||||
|
|
@ -99,7 +99,7 @@ void test_real_comparable() {
|
|||
typedef CGAL::Real_embeddable_traits<NT> Traits;
|
||||
typedef typename Traits::Is_real_embeddable Is_real_comparable;
|
||||
using ::CGAL::Tag_true;
|
||||
CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_true>::value));
|
||||
static_assert(::std::is_same< Is_real_comparable, Tag_true>::value);
|
||||
typename Traits::Compare compare;
|
||||
typename Traits::Sign sign;
|
||||
typename Traits::Abs abs;
|
||||
|
|
@ -168,20 +168,20 @@ void test_not_real_comparable() {
|
|||
typedef CGAL::Real_embeddable_traits<NT> Traits;
|
||||
typedef typename Traits::Is_real_embeddable Is_real_comparable;
|
||||
using ::CGAL::Tag_false;
|
||||
CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_false>::value));
|
||||
static_assert(::std::is_same< Is_real_comparable, Tag_false>::value);
|
||||
}
|
||||
|
||||
|
||||
template <class NT, class CeilLog2Abs>
|
||||
void test_rounded_log2_abs(NT zero, ::CGAL::Null_functor, CeilLog2Abs) {
|
||||
typedef ::CGAL::Null_functor Nulltype;
|
||||
CGAL_static_assertion((::std::is_same< CeilLog2Abs, Nulltype>::value));
|
||||
static_assert(::std::is_same< CeilLog2Abs, Nulltype>::value);
|
||||
}
|
||||
|
||||
template <class NT, class FloorLog2Abs, class CeilLog2Abs>
|
||||
void test_rounded_log2_abs(NT zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
|
||||
typedef ::CGAL::Null_functor Null_functor;
|
||||
CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value);
|
||||
|
||||
assert( fl_log(NT( 7)) == 2 );
|
||||
assert( cl_log(NT( 7)) == 3 );
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ use binary search.
|
|||
`Alpha_shape_2::number_of_solid_components()` performs a graph traversal and takes time
|
||||
linear in the number of faces of the underlying triangulation.
|
||||
`Alpha_shape_2::find_optimal_alpha()` uses binary search and takes time
|
||||
\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points.
|
||||
\cgalBigO{n \log n}, where \f$ n\f$ is the number of points.
|
||||
|
||||
*/
|
||||
template< typename Dt, typename ExactAlphaComparisonTag >
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
// because the periodic triangulations' point() function returns a temporary
|
||||
// value while the lazy predicate evaluations that are used when the Exact tag
|
||||
// is set to true rely on a permanent and safe access to the points.
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(std::is_same<ExactAlphaComparisonTag, Tag_false>::value) ||
|
||||
(std::is_same<typename Dt::Periodic_tag, Tag_false>::value));
|
||||
|
||||
|
|
@ -76,8 +76,8 @@ public:
|
|||
typedef Type_of_alpha FT;
|
||||
|
||||
// check that simplices are correctly instantiated
|
||||
CGAL_static_assertion( (std::is_same<NT, typename Dt::Face::NT>::value) );
|
||||
CGAL_static_assertion( (std::is_same<NT, typename Dt::Vertex::NT>::value) );
|
||||
static_assert(std::is_same<NT, typename Dt::Face::NT>::value);
|
||||
static_assert(std::is_same<NT, typename Dt::Vertex::NT>::value);
|
||||
|
||||
typedef typename Dt::Point Point;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <utility>
|
||||
#include <CGAL/Triangulation_vertex_base_2.h>
|
||||
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
namespace CGAL {
|
||||
|
|
|
|||
|
|
@ -148,8 +148,8 @@ class Lazy_alpha_nt_2
|
|||
Approx_point to_approx(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
static_assert(Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
|
||||
|
||||
To_approx converter;
|
||||
return converter(wp);
|
||||
|
|
@ -158,8 +158,8 @@ class Lazy_alpha_nt_2
|
|||
Exact_point to_exact(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
static_assert(Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
|
||||
|
||||
To_exact converter;
|
||||
return converter(wp);
|
||||
|
|
@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
|
|||
|
||||
//members
|
||||
//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_;
|
||||
|
||||
//private functions
|
||||
|
|
@ -235,7 +235,7 @@ public:
|
|||
|
||||
const NT_exact& exact() const
|
||||
{
|
||||
if (exact_ == boost::none) {
|
||||
if (exact_ == std::nullopt) {
|
||||
update_exact();
|
||||
approx_=to_interval(*exact_);
|
||||
}
|
||||
|
|
@ -448,7 +448,7 @@ struct Alpha_nt_selector_2
|
|||
GeomTraits,
|
||||
// If the base traits is already exact then we don't need to do anything,
|
||||
// and we can simply directly use the traits class
|
||||
Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::value &&
|
||||
Boolean_tag<std::is_floating_point<typename GeomTraits::FT>::value &&
|
||||
ExactAlphaComparisonTag::value >,
|
||||
Weighted_tag>
|
||||
{ };
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ Algebraic_foundations
|
|||
Alpha_shapes_2
|
||||
Arithmetic_kernel
|
||||
Cartesian_kernel
|
||||
Filtered_kernel
|
||||
Hash_map
|
||||
Homogeneous_kernel
|
||||
Installation
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ use binary search.
|
|||
`Alpha_shape_3::number_of_solid_components()` performs a graph traversal and takes time
|
||||
linear in the number of cells of the underlying triangulation.
|
||||
`Alpha_shape_3::find_optimal_alpha()` uses binary search and takes time
|
||||
\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points.
|
||||
\cgalBigO{n \log n}, where \f$ n\f$ is the number of points.
|
||||
|
||||
*/
|
||||
template< typename Dt, typename ExactAlphaComparisonTag >
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
// because the periodic triangulations' point() function returns a temporary
|
||||
// value while the lazy predicate evaluations that are used when the Exact tag
|
||||
// is set to true rely on a permanent and safe access to the points.
|
||||
CGAL_static_assertion(
|
||||
static_assert(
|
||||
(std::is_same<ExactAlphaComparisonTag, Tag_false>::value) ||
|
||||
(std::is_same<typename Dt::Periodic_tag, Tag_false>::value));
|
||||
|
||||
|
|
@ -108,8 +108,8 @@ public:
|
|||
typedef typename Gt::FT Coord_type;
|
||||
|
||||
//checks whether tags are correctly set in Vertex and Cell classes
|
||||
CGAL_static_assertion( (std::is_same<NT,typename Dt::Cell::NT>::value) );
|
||||
CGAL_static_assertion( (std::is_same<NT,typename Dt::Vertex::Alpha_status::NT>::value) );
|
||||
static_assert(std::is_same<NT,typename Dt::Cell::NT>::value);
|
||||
static_assert(std::is_same<NT,typename Dt::Vertex::Alpha_status::NT>::value);
|
||||
|
||||
typedef typename Dt::Point Point;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <memory>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -139,8 +139,8 @@ class Lazy_alpha_nt_3{
|
|||
Approx_point to_approx(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
static_assert(Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
|
||||
|
||||
To_approx converter;
|
||||
return converter(wp);
|
||||
|
|
@ -149,8 +149,8 @@ class Lazy_alpha_nt_3{
|
|||
Exact_point to_exact(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
static_assert(Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
|
||||
|
||||
To_exact converter;
|
||||
return converter(wp);
|
||||
|
|
@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
|
|||
|
||||
//members
|
||||
//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_;
|
||||
|
||||
//private functions
|
||||
|
|
@ -229,7 +229,7 @@ public:
|
|||
}
|
||||
|
||||
const NT_exact& exact() const {
|
||||
if (exact_ == boost::none){
|
||||
if (exact_ == std::nullopt){
|
||||
update_exact();
|
||||
approx_=to_interval(*exact_);
|
||||
}
|
||||
|
|
@ -417,7 +417,7 @@ struct Alpha_nt_selector_3
|
|||
GeomTraits,
|
||||
// If the base traits is already exact then we don't need to do anything,
|
||||
// and we can simply directly use the traits class
|
||||
Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::value &&
|
||||
Boolean_tag<std::is_floating_point<typename GeomTraits::FT>::value &&
|
||||
ExactAlphaComparisonTag::value >,
|
||||
Weighted_tag>
|
||||
{ };
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include <utility>
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <boost/next_prior.hpp>
|
||||
|
||||
#include <CGAL/Triangulation_utils_3.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
|
|
@ -255,7 +254,7 @@ public:
|
|||
std::back_inserter(cells),
|
||||
Emptyset_iterator()));
|
||||
|
||||
Facet facet=*boost::prior(facets_on_the_boundary_of_the_hole.end());
|
||||
Facet facet=*std::prev(facets_on_the_boundary_of_the_hole.end());
|
||||
|
||||
// Remember the points that are hidden by the conflicting cells,
|
||||
// as they will be deleted during the insertion.
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ using Mesh = CGAL::Surface_mesh<Point_3>;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout.precision(17);
|
||||
|
||||
// Read the inputs
|
||||
const std::string ts_filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/armadillo.off"); // triangle soup
|
||||
const std::string ss_filename = (argc > 2) ? argv[2] : CGAL::data_file_path("images/420.polylines.txt"); // segment soup
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace AW3 = CGAL::Alpha_wraps_3;
|
||||
|
||||
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
using Point_3 = K::Point_3;
|
||||
|
||||
|
|
@ -18,8 +16,6 @@ using Mesh = CGAL::Surface_mesh<Point_3>;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout.precision(17);
|
||||
|
||||
// Read the input
|
||||
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/oni.pwn");
|
||||
std::cout << "Reading " << filename << "..." << std::endl;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace AW3 = CGAL::Alpha_wraps_3;
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
|
|
@ -19,8 +18,6 @@ using Mesh = CGAL::Surface_mesh<Point_3>;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout.precision(17);
|
||||
|
||||
// Read the input
|
||||
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/armadillo.off");
|
||||
std::cout << "Reading " << filename << "..." << std::endl;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
namespace AW3 = CGAL::Alpha_wraps_3;
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
|
|
@ -18,8 +17,6 @@ using Mesh = CGAL::Surface_mesh<Point_3>;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout.precision(17);
|
||||
|
||||
// Read the input
|
||||
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/armadillo.off");
|
||||
std::cout << "Reading " << filename << "..." << std::endl;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class Alpha_wrap_3
|
|||
using Alpha_PQ = Modifiable_priority_queue<Gate, Less_gate, Gate_ID_PM<Dt>, CGAL_BOOST_PAIRING_HEAP>;
|
||||
|
||||
protected:
|
||||
const Oracle& m_oracle;
|
||||
const Oracle m_oracle;
|
||||
SC_Iso_cuboid_3 m_bbox;
|
||||
|
||||
FT m_alpha, m_sq_alpha;
|
||||
|
|
@ -193,7 +193,7 @@ public:
|
|||
{
|
||||
// Due to the Steiner point computation being a dichotomy, the algorithm is inherently inexact
|
||||
// and passing exact kernels is explicitly disabled to ensure no misunderstanding.
|
||||
CGAL_static_assertion((std::is_floating_point<FT>::value));
|
||||
static_assert(std::is_floating_point<FT>::value);
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -1343,6 +1343,7 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
// Not the best complexity, but it's very cheap compared to the rest of the algorithm.
|
||||
void make_manifold()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public:
|
|||
|
||||
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_const_property_map(vertex_point, tmesh));
|
||||
CGAL_static_assertion((std::is_same<typename boost::property_traits<VPM>::value_type, Point_3>::value));
|
||||
static_assert(std::is_same<typename boost::property_traits<VPM>::value_type, Point_3>::value);
|
||||
|
||||
Splitter_base::reserve(num_faces(tmesh));
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ public:
|
|||
#endif
|
||||
|
||||
PPM pm = choose_parameter<PPM>(get_parameter(np, internal_np::point_map));
|
||||
CGAL_static_assertion((std::is_same<typename boost::property_traits<PPM>::value_type, Point_3>::value));
|
||||
static_assert(std::is_same<typename boost::property_traits<PPM>::value_type, Point_3>::value);
|
||||
|
||||
Splitter_base::reserve(faces.size());
|
||||
|
||||
|
|
|
|||
|
|
@ -608,24 +608,22 @@ Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
|
|||
/*!
|
||||
Returns the
|
||||
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;
|
||||
|
||||
/*!
|
||||
Returns the
|
||||
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;
|
||||
|
||||
/*!
|
||||
Returns
|
||||
the 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`.
|
||||
the dual of the face to which `it` points to.
|
||||
*/
|
||||
Gt::Object_2 dual(Finite_faces_iterator it) const;
|
||||
Site dual(Finite_faces_iterator it) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ namespace CGAL {
|
|||
The class `Apollonius_graph_vertex_base_2` provides a model for the
|
||||
`ApolloniusGraphVertexBase_2` concept which is the vertex base
|
||||
required by the `ApolloniusGraphDataStructure_2` concept. The
|
||||
class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the
|
||||
geometric traits of the Apollonius graph and should be a model of the
|
||||
concept `ApolloniusGraphTraits_2`. The second is a Boolean which
|
||||
class `Apollonius_graph_vertex_base_2` has three template arguments.
|
||||
|
||||
\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
|
||||
control is important if the user is not interested in hidden sites
|
||||
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
|
||||
discarded. By default `StoreHidden` is set to `true`.
|
||||
|
||||
\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::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
|
||||
*/
|
||||
template< typename Gt, typename StoreHidden >
|
||||
class Apollonius_graph_vertex_base_2 {
|
||||
template< typename Gt, typename StoreHidden, typename Vb >
|
||||
class Apollonius_graph_vertex_base_2 : public Vb {
|
||||
public:
|
||||
|
||||
/// \name Creation
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ if(GMP_FOUND)
|
|||
create_single_source_cgal_program("Arithmetic_kernel.cpp")
|
||||
create_single_source_cgal_program("LEDA_arithmetic_kernel.cpp")
|
||||
create_single_source_cgal_program("CORE_arithmetic_kernel.cpp")
|
||||
create_single_source_cgal_program("GMPXX_arithmetic_kernel.cpp")
|
||||
create_single_source_cgal_program("Get_arithmetic_kernel.cpp")
|
||||
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ int main() {
|
|||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<Integer>::Arithmetic_kernel AK_;
|
||||
CGAL_USE_TYPE(AK_);
|
||||
CGAL_static_assertion((std::is_same<AK,AK_>::value));
|
||||
static_assert(std::is_same<AK,AK_>::value);
|
||||
}
|
||||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<Rational>::Arithmetic_kernel AK_;
|
||||
CGAL_USE_TYPE(AK_);
|
||||
CGAL_static_assertion((std::is_same<AK,AK_>::value));
|
||||
static_assert(std::is_same<AK,AK_>::value);
|
||||
}
|
||||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<BFI>::Arithmetic_kernel AK_;
|
||||
CGAL_USE_TYPE(AK_);
|
||||
CGAL_static_assertion((std::is_same<AK,AK_>::value));
|
||||
static_assert(std::is_same<AK,AK_>::value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ char * Option_parser::s_strategy_opts[] = {
|
|||
};
|
||||
|
||||
template <class MyId>
|
||||
void Option_parser::my_validate(boost::any & v,
|
||||
void Option_parser::my_validate(std::any & v,
|
||||
const std::vector<std::string> & values)
|
||||
{
|
||||
typedef std::vector<MyId> Vector_id;
|
||||
|
|
@ -28,11 +28,11 @@ void Option_parser::my_validate(boost::any & v,
|
|||
if (v.empty()) {
|
||||
Vector_id vec;
|
||||
vec.push_back(MyId(i));
|
||||
v = boost::any(vec);
|
||||
v = std::any(vec);
|
||||
} else {
|
||||
Vector_id vec = boost::any_cast<Vector_id>(v);
|
||||
Vector_id vec = std::any_cast<Vector_id>(v);
|
||||
vec.push_back(MyId(i));
|
||||
v = boost::any(vec);
|
||||
v = std::any(vec);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -41,14 +41,14 @@ void Option_parser::my_validate(boost::any & v,
|
|||
}
|
||||
|
||||
/* Overload the 'validate' function for the user-defined class */
|
||||
void validate(boost::any & v, const std::vector<std::string> & values,
|
||||
void validate(std::any & v, const std::vector<std::string> & values,
|
||||
Option_parser::Vector_type_id * target_type, int)
|
||||
{
|
||||
Option_parser::my_validate<Option_parser::Type_id>(v, values);
|
||||
}
|
||||
|
||||
/* Overload the 'validate' function for the user-defined class */
|
||||
void validate(boost::any & v, const std::vector<std::string> & values,
|
||||
void validate(std::any & v, const std::vector<std::string> & values,
|
||||
Option_parser::Vector_strategy_id * target_type, int)
|
||||
{
|
||||
Option_parser::my_validate<Option_parser::Strategy_id>(v, values);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ public:
|
|||
unsigned int get_height() const { return m_win_height; }
|
||||
|
||||
template <class MyId>
|
||||
static void my_validate(boost::any & v,
|
||||
static void my_validate(std::any & v,
|
||||
const std::vector<std::string> & values);
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// Author(s): Saurabh Singh <ssingh@cs.iitr.ac.in>
|
||||
// Ahmed Essam <theartful.ae@gmail.com>
|
||||
|
|
@ -135,7 +135,7 @@ static inline bool hasValidChars(const std::string& expression, int dimension)
|
|||
}
|
||||
|
||||
template <typename Polynomial_d>
|
||||
boost::optional<Polynomial_d>
|
||||
std::optional<Polynomial_d>
|
||||
AlgebraicCurveParser<Polynomial_d>::operator()(const std::string& expression)
|
||||
{
|
||||
using Traits = CGAL::Polynomial_traits_d<Polynomial_d>;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
//
|
||||
// Author(s): Saurabh Singh <ssingh@cs.iitr.ac.in>
|
||||
// Ahmed Essam <theartful.ae@gmail.com>
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
template <typename Polynomial_d>
|
||||
struct AlgebraicCurveParser
|
||||
{
|
||||
boost::optional<Polynomial_d> operator()(const std::string& expression);
|
||||
std::optional<Polynomial_d> operator()(const std::string& expression);
|
||||
};
|
||||
|
||||
#endif //ARRANGEMENT_ON_SURFACE_2_DEMO_ALGEBRAICCURVEPARSERNEW_H
|
||||
|
|
|
|||
|
|
@ -961,15 +961,16 @@ findOtherInterestingPoints<demo_types::DemoTypes::Alg_seg_arr>
|
|||
const CGAL::Bbox_2& allowable_range) {
|
||||
using Traits = demo_types::DemoTypes::Alg_seg_traits;
|
||||
CGAL::Bbox_2 bb = {};
|
||||
std::vector<CGAL::Object> intersections;
|
||||
typedef std::pair<typename Traits::Point_2, unsigned int> Pt_m;
|
||||
std::vector<Pt_m> intersections;
|
||||
for (auto it = arr->edges_begin(); it != arr->edges_end(); ++it) {
|
||||
for (auto& arc : getXyCurves(arr->traits()))
|
||||
{
|
||||
if (arc.is_vertical() != it->curve().is_vertical())
|
||||
it->curve().intersections(arc, std::back_inserter(intersections));
|
||||
it->curve().intersections(arc, CGAL::dispatch_or_drop_output<Pt_m>(std::back_inserter(intersections)));
|
||||
}
|
||||
for (auto it = intersections.begin(); it != intersections.end(); it++) {
|
||||
std::pair<typename Traits::Point_2, unsigned int> point_multiplicity;
|
||||
CGAL::assign(point_multiplicity, *it);
|
||||
}
|
||||
for (auto point_multiplicity :intersections) {
|
||||
auto& point = point_multiplicity.first;
|
||||
if (point.location() == CGAL::ARR_INTERIOR) {
|
||||
auto xy = point.to_double();
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ void EnvelopeCallback< Arr_>::updateEnvelope( bool lower )
|
|||
{
|
||||
if (!e->is_empty())
|
||||
{
|
||||
boost::optional<Point_2> leftPoint, rightPoint;
|
||||
std::optional<Point_2> leftPoint, rightPoint;
|
||||
if (e->left())
|
||||
leftPoint = e->left()->point();
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ void GraphicsViewCurveInput<Arr_>::generate(CGAL::Object o) {
|
|||
template <typename Arr_>
|
||||
void GraphicsViewCurveInput<Arr_>::
|
||||
curveInputDoneEvent(const std::vector<Point_2>& clickedPoints, CurveType type) {
|
||||
boost::optional<Curve_2> cv =
|
||||
std::optional<Curve_2> cv =
|
||||
this->curveGenerator.generate(clickedPoints, type);
|
||||
if (cv) {
|
||||
Insert_curve<Arrangement>{}(this->arrangement, *cv);
|
||||
|
|
@ -135,9 +135,9 @@ curveInputDoneEvent(const std::vector<Point_2>& clickedPoints, CurveType type) {
|
|||
template <typename ArrTraits_>
|
||||
auto CurveGeneratorBase<ArrTraits_>::
|
||||
generate(const std::vector<Point_2>& clickedPoints, CurveType type)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
boost::optional<Curve_2> res;
|
||||
std::optional<Curve_2> res;
|
||||
switch (type) {
|
||||
case CurveType::Segment:
|
||||
res = generateSegment(clickedPoints);
|
||||
|
|
@ -180,7 +180,7 @@ void CurveGeneratorBase<ArrTraits_>::setTraits(const ArrTraits* traits_)
|
|||
template <typename Kernel_>
|
||||
auto CurveGenerator<CGAL::Arr_segment_traits_2<Kernel_>>::
|
||||
generateSegment(const std::vector<Point_2>& clickedPoints)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
Curve_2 res{clickedPoints[0], clickedPoints[1]};
|
||||
return res;
|
||||
|
|
@ -190,7 +190,7 @@ generateSegment(const std::vector<Point_2>& clickedPoints)
|
|||
template <typename SegmentTraits>
|
||||
auto CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
|
||||
generatePolyline(const std::vector<Point_2>& clickedPoints)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
if (clickedPoints.size() < 2) return {};
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ auto CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
|
|||
// Curve Generator Linear Traits
|
||||
template <typename Kernel_>
|
||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<Kernel_>>::
|
||||
generateSegment(const std::vector<Point_2>& points) -> boost::optional<Curve_2>
|
||||
generateSegment(const std::vector<Point_2>& points) -> std::optional<Curve_2>
|
||||
{
|
||||
Curve_2 res = Curve_2(Segment_2(points[0], points[1]));
|
||||
return res;
|
||||
|
|
@ -211,7 +211,7 @@ generateSegment(const std::vector<Point_2>& points) -> boost::optional<Curve_2>
|
|||
//
|
||||
template <typename Kernel_>
|
||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<Kernel_>>::
|
||||
generateRay(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||
generateRay(const std::vector<Point_2>& points) -> std::optional<Curve_2> {
|
||||
Curve_2 res = Curve_2(Ray_2(points[0], points[1]));
|
||||
return res;
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ generateRay(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
|||
//
|
||||
template <typename Kernel_>
|
||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<Kernel_>>::
|
||||
generateLine(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||
generateLine(const std::vector<Point_2>& points) -> std::optional<Curve_2> {
|
||||
Curve_2 res = Curve_2(Line_2(points[0], points[1]));
|
||||
return res;
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ generateLine(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
|||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
generateSegment(const std::vector<Point_2>& points)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
auto ctr_cv = this->traits->construct_curve_2_object();
|
||||
Curve_2 res = ctr_cv(Rat_segment_2(points[0], points[1]));
|
||||
|
|
@ -238,7 +238,7 @@ generateSegment(const std::vector<Point_2>& points)
|
|||
//
|
||||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
generateCircle(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||
generateCircle(const std::vector<Point_2>& points) -> std::optional<Curve_2> {
|
||||
auto sq_rad =
|
||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
||||
(points[0].y() - points[1].y()) * (points[0].y() - points[1].y());
|
||||
|
|
@ -251,7 +251,7 @@ generateCircle(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
|||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
generateEllipse(const std::vector<Point_2>& points)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
auto x1 = (CGAL::min)(points[0].x(), points[1].x());
|
||||
auto y1 = (CGAL::min)(points[0].y(), points[1].y());
|
||||
|
|
@ -281,7 +281,7 @@ generateEllipse(const std::vector<Point_2>& points)
|
|||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
generateThreePointCircularArc(const std::vector<Point_2>& points)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
auto& qp1 = points[0];
|
||||
auto& qp2 = points[1];
|
||||
|
|
@ -305,7 +305,7 @@ generateThreePointCircularArc(const std::vector<Point_2>& points)
|
|||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
generateFivePointConicArc(const std::vector<Point_2>& points)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
auto& qp0 = points[0];
|
||||
auto& qp1 = points[1];
|
||||
|
|
@ -333,7 +333,7 @@ generateFivePointConicArc(const std::vector<Point_2>& points)
|
|||
// CurveGenerator Algebraic Traits
|
||||
template <typename Coefficient_>
|
||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||
generateLine(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||
generateLine(const std::vector<Point_2>& points) -> std::optional<Curve_2> {
|
||||
RationalTraits ratTraits;
|
||||
|
||||
Rational dx = points[1].x() - points[0].x();
|
||||
|
|
@ -369,7 +369,7 @@ generateLine(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
|||
//
|
||||
template <typename Coefficient_>
|
||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||
generateCircle(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||
generateCircle(const std::vector<Point_2>& points) -> std::optional<Curve_2> {
|
||||
auto sq_rad =
|
||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
||||
(points[0].y() - points[1].y()) * (points[0].y() - points[1].y());
|
||||
|
|
@ -379,7 +379,7 @@ generateCircle(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
|||
template <typename Coefficient_>
|
||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||
generateEllipse(const std::vector<Point_2>& points)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
auto rx =
|
||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) / 4.;
|
||||
|
|
@ -394,7 +394,7 @@ generateEllipse(const std::vector<Point_2>& points)
|
|||
template <typename Coefficient_>
|
||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||
generateEllipse_(const Point_2& center, Rational rxRat, Rational ryRat)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
RationalTraits ratTraits;
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ template <typename RatKernel, typename AlgKernel, typename NtTraits,
|
|||
auto CurveGenerator
|
||||
<Arr_Bezier_curve_traits_2<RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
||||
generateBezier(const std::vector<Point_2>& clickedPoints)
|
||||
-> boost::optional<Curve_2>
|
||||
-> std::optional<Curve_2>
|
||||
{
|
||||
if (clickedPoints.size() < 2) return {};
|
||||
return Curve_2{clickedPoints.begin(), clickedPoints.end()};
|
||||
|
|
|
|||
|
|
@ -42,34 +42,34 @@ public:
|
|||
|
||||
void setTraits(const ArrTraits* traits_);
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generate(const std::vector<Point_2>& clickedPoints, CurveType type);
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateSegment(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateRay(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateLine(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generatePolyline(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateCircle(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateEllipse(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateThreePointCircularArc(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateFivePointConicArc(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
virtual boost::optional<Curve_2>
|
||||
virtual std::optional<Curve_2>
|
||||
generateBezier(const std::vector<Point_2>&) { return {}; }
|
||||
|
||||
const ArrTraits* traits;
|
||||
|
|
@ -91,7 +91,7 @@ struct CurveGenerator<CGAL::Arr_segment_traits_2<Kernel_>> :
|
|||
using Super = CurveGeneratorBase<ArrTraits>;
|
||||
using Point_2 = typename Super::Point_2;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateSegment(const std::vector<Point_2>&) override;
|
||||
};
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ struct CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>> :
|
|||
using Super = CurveGeneratorBase<ArrTraits>;
|
||||
using Point_2 = typename Super::Point_2;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generatePolyline(const std::vector<Point_2>&) override;
|
||||
};
|
||||
|
||||
|
|
@ -125,18 +125,18 @@ struct CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>> :
|
|||
using Super = CurveGeneratorBase<ArrTraits>;
|
||||
using Point_2 = typename Super::Point_2;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateSegment(const std::vector<Point_2>&) override;
|
||||
|
||||
boost::optional<Curve_2> generateCircle(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2> generateCircle(const std::vector<Point_2>&) override;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateEllipse(const std::vector<Point_2>&) override;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateThreePointCircularArc(const std::vector<Point_2>&) override;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateFivePointConicArc(const std::vector<Point_2>&) override;
|
||||
};
|
||||
|
||||
|
|
@ -154,10 +154,10 @@ struct CurveGenerator<CGAL::Arr_linear_traits_2<Kernel_>> :
|
|||
using Super = CurveGeneratorBase<ArrTraits>;
|
||||
using Point_2 = typename Super::Point_2;
|
||||
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2>
|
||||
generateSegment(const std::vector<Point_2>&) override;
|
||||
boost::optional<Curve_2> generateRay(const std::vector<Point_2>&) override;
|
||||
boost::optional<Curve_2> generateLine(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2> generateRay(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2> generateLine(const std::vector<Point_2>&) override;
|
||||
};
|
||||
|
||||
template <typename Coefficient_>
|
||||
|
|
@ -176,13 +176,13 @@ struct CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>> :
|
|||
using Super = CurveGeneratorBase<ArrTraits>;
|
||||
using Point_2 = typename Super::Point_2;
|
||||
|
||||
boost::optional<Curve_2> generateLine(const std::vector<Point_2>&) override;
|
||||
boost::optional<Curve_2> generateCircle(const std::vector<Point_2>&) override;
|
||||
boost::optional<Curve_2>
|
||||
std::optional<Curve_2> generateLine(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2> generateCircle(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2>
|
||||
generateEllipse(const std::vector<Point_2>&) override;
|
||||
|
||||
private:
|
||||
boost::optional<Curve_2> generateEllipse_(const Point_2&, Rational, Rational);
|
||||
std::optional<Curve_2> generateEllipse_(const Point_2&, Rational, Rational);
|
||||
};
|
||||
|
||||
template <
|
||||
|
|
@ -199,7 +199,7 @@ struct CurveGenerator<
|
|||
using Point_2 = typename Super::Point_2;
|
||||
using Curve_2 = typename ArrTraits::Curve_2;
|
||||
|
||||
boost::optional<Curve_2> generateBezier(const std::vector<Point_2>&) override;
|
||||
std::optional<Curve_2> generateBezier(const std::vector<Point_2>&) override;
|
||||
};
|
||||
|
||||
template <typename ArrTraits>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "ArrangementTypesUtils.h"
|
||||
#include "PointSnapper.h"
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
template <typename Arr_>
|
||||
class PointSnapper : public PointSnapperBase
|
||||
|
|
@ -26,7 +26,7 @@ class PointSnapper : public PointSnapperBase
|
|||
|
||||
public:
|
||||
PointSnapper(QGraphicsScene*, GridGraphicsItem*, Arrangement*);
|
||||
boost::optional<Point_2> snapToArrangement(const QPointF& qpt) override;
|
||||
std::optional<Point_2> snapToArrangement(const QPointF& qpt) override;
|
||||
|
||||
private:
|
||||
Arrangement* arr;
|
||||
|
|
@ -170,7 +170,7 @@ PointSnapper<Arr_>::PointSnapper(
|
|||
}
|
||||
|
||||
template <typename Arrangement>
|
||||
inline boost::optional<PointSnapperBase::Point_2> snapToArrangement(
|
||||
inline std::optional<PointSnapperBase::Point_2> snapToArrangement(
|
||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||
{
|
||||
using Point_2 = PointSnapperBase::Point_2;
|
||||
|
|
@ -215,7 +215,7 @@ struct SnapToArrangement
|
|||
{
|
||||
using Point_2 = PointSnapperBase::Point_2;
|
||||
template <typename Arrangement>
|
||||
boost::optional<Point_2>
|
||||
std::optional<Point_2>
|
||||
operator()(const QPointF& qpt, const QTransform&, Arrangement*)
|
||||
{
|
||||
return Point_2{qpt.x(), qpt.y()};
|
||||
|
|
@ -226,7 +226,7 @@ struct SnapToArrangement<CGAL::Arr_linear_traits_2<Kernel>>
|
|||
{
|
||||
using Point_2 = PointSnapperBase::Point_2;
|
||||
template <typename Arrangement>
|
||||
boost::optional<Point_2> operator()(
|
||||
std::optional<Point_2> operator()(
|
||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||
{
|
||||
return snapToArrangement(qpt, worldTransform, arr);
|
||||
|
|
@ -237,7 +237,7 @@ struct SnapToArrangement<CGAL::Arr_segment_traits_2<Kernel>>
|
|||
{
|
||||
using Point_2 = PointSnapperBase::Point_2;
|
||||
template <typename Arrangement>
|
||||
boost::optional<Point_2> operator()(
|
||||
std::optional<Point_2> operator()(
|
||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||
{
|
||||
return snapToArrangement(qpt, worldTransform, arr);
|
||||
|
|
@ -248,7 +248,7 @@ struct SnapToArrangement<CGAL::Arr_polyline_traits_2<Kernel>>
|
|||
{
|
||||
using Point_2 = PointSnapperBase::Point_2;
|
||||
template <typename Arrangement>
|
||||
boost::optional<Point_2> operator()(
|
||||
std::optional<Point_2> operator()(
|
||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||
{
|
||||
return snapToArrangement(qpt, worldTransform, arr);
|
||||
|
|
@ -257,7 +257,7 @@ struct SnapToArrangement<CGAL::Arr_polyline_traits_2<Kernel>>
|
|||
|
||||
template <typename Arr_>
|
||||
auto PointSnapper<Arr_>::snapToArrangement(const QPointF& qpt)
|
||||
-> boost::optional<Point_2>
|
||||
-> std::optional<Point_2>
|
||||
{
|
||||
using Traits = typename Arrangement::Geometry_traits_2;
|
||||
auto view = getView();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public:
|
|||
protected:
|
||||
PointSnapperBase(QGraphicsScene* scene, GridGraphicsItem* grid);
|
||||
Point_2 snapToGrid(const QPointF& qpt);
|
||||
virtual boost::optional<Point_2> snapToArrangement(const QPointF& qpt) = 0;
|
||||
virtual std::optional<Point_2> snapToArrangement(const QPointF& qpt) = 0;
|
||||
|
||||
GridGraphicsItem* gridGraphicsItem;
|
||||
bool snapToGridEnabled;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include "IntersectCurves.h"
|
||||
#include "ArrangementTypes.h"
|
||||
#include <boost/function_output_iterator.hpp>
|
||||
|
||||
|
||||
template <typename Traits_>
|
||||
Intersect_curves<Traits_>::Intersect_curves(const Traits* traits) :
|
||||
|
|
@ -18,12 +20,26 @@ Intersect_curves<Traits_>::Intersect_curves(const Traits* traits) :
|
|||
{
|
||||
}
|
||||
|
||||
struct Object_putter
|
||||
{
|
||||
std::reference_wrapper<std::vector<CGAL::Object>> v;
|
||||
Object_putter(std::vector<CGAL::Object>& v_)
|
||||
: v(std::ref(v_))
|
||||
{}
|
||||
|
||||
template <class T>
|
||||
void operator()(const T& t)
|
||||
{
|
||||
v.get().push_back(make_object(t));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Traits_>
|
||||
void Intersect_curves<Traits_>::operator()(
|
||||
const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2,
|
||||
std::vector<CGAL::Object>& output)
|
||||
{
|
||||
this->intersect(cv1, cv2, std::back_inserter(output));
|
||||
this->intersect(cv1, cv2, boost::make_function_output_iterator(Object_putter(output)));
|
||||
}
|
||||
|
||||
ARRANGEMENT_DEMO_SPECIALIZE_TRAITS(Intersect_curves)
|
||||
|
|
|
|||
|
|
@ -391,8 +391,8 @@ Construct_x_monotone_subcurve_2<ArrTraits>::Construct_x_monotone_subcurve_2(
|
|||
//
|
||||
template <typename ArrTraits>
|
||||
auto Construct_x_monotone_subcurve_2<ArrTraits>::operator()(
|
||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
{
|
||||
Point_2 pMin, pMax;
|
||||
bool unbounded_min = false;
|
||||
|
|
@ -442,8 +442,8 @@ template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
|||
auto Construct_x_monotone_subcurve_2
|
||||
<CGAL::Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||
operator()(const X_monotone_curve_2& curve,
|
||||
const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
{
|
||||
// TODO: handle when pLeft or pRight is null
|
||||
|
||||
|
|
@ -486,8 +486,8 @@ template <typename RatKernel, typename AlgKernel, typename NtTraits,
|
|||
auto Construct_x_monotone_subcurve_2<CGAL::Arr_Bezier_curve_traits_2<
|
||||
RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
||||
operator()(
|
||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
{
|
||||
auto pMin = this->construct_min_vertex_2(curve);
|
||||
auto pMax = this->construct_max_vertex_2(curve);
|
||||
|
|
@ -545,8 +545,8 @@ template <typename AlgebraicKernel_d_1>
|
|||
auto Construct_x_monotone_subcurve_2<
|
||||
CGAL::Arr_rational_function_traits_2<AlgebraicKernel_d_1>>::
|
||||
operator()(
|
||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||
{
|
||||
Point_2 pMin, pMax;
|
||||
bool unbounded_min = false;
|
||||
|
|
@ -625,14 +625,14 @@ operator()(const X_monotone_curve_2& curve, const CoordinateType& x,
|
|||
Point_2 p2c1(x, CoordinateType(clipRect.ymax() + 1));
|
||||
|
||||
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
||||
CGAL::Object o;
|
||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
||||
std::vector<IntersectionResult> pairs;
|
||||
|
||||
this->intersectCurves(curve, verticalLine, oi);
|
||||
this->intersectCurves(curve, verticalLine,
|
||||
CGAL::dispatch_or_drop_output<IntersectionResult>(std::back_inserter(pairs)));
|
||||
|
||||
IntersectionResult pair;
|
||||
if (CGAL::assign(pair, o)) {
|
||||
Point_2 pt = pair.first;
|
||||
if (!pairs.empty()) {
|
||||
Point_2 pt = pairs[0].first;
|
||||
res = pt.y();
|
||||
}
|
||||
return res;
|
||||
|
|
@ -654,14 +654,13 @@ operator()(const X_monotone_curve_2& curve, const CoordinateType& x,
|
|||
Point_2 p2c1(x, CoordinateType(10000000)); // upper bounding box
|
||||
|
||||
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
||||
CGAL::Object o;
|
||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
||||
std::vector<IntersectionResult> pairs;
|
||||
|
||||
this->intersectCurves(curve, verticalLine, oi);
|
||||
this->intersectCurves(curve, verticalLine,
|
||||
CGAL::dispatch_or_drop_output<IntersectionResult>(std::back_inserter(pairs)));
|
||||
|
||||
IntersectionResult pair;
|
||||
if (CGAL::assign(pair, o)) {
|
||||
Point_2 pt = pair.first;
|
||||
if (!pairs.empty()) {
|
||||
Point_2 pt = pairs[0].first;
|
||||
res = pt.y();
|
||||
}
|
||||
return res;
|
||||
|
|
@ -681,15 +680,15 @@ operator()(const X_monotone_curve_2& curve, const Coordinate_type& x)
|
|||
Point_2 p2c1(x, Coordinate_type(clip_rect.ymax() + 1));
|
||||
|
||||
const X_monotone_curve_2 vertical_line = ctr_xcv(p1c1, p2c1);
|
||||
CGAL::Object o;
|
||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
||||
|
||||
this->intersect_curves(curve, vertical_line, oi);
|
||||
std::vector<IntersectionResult> pairs;
|
||||
|
||||
this->intersect_curves(curve, vertical_line,
|
||||
CGAL::dispatch_or_drop_output<IntersectionResult>(std::back_inserter(pairs)));
|
||||
|
||||
Coordinate_type res(0);
|
||||
IntersectionResult pair;
|
||||
if (CGAL::assign(pair, o)) {
|
||||
Point_2 pt = pair.first;
|
||||
if (!pairs.empty()) {
|
||||
Point_2 pt = pairs[0].first;
|
||||
res = pt.y();
|
||||
}
|
||||
return res;
|
||||
|
|
@ -708,15 +707,15 @@ auto Arr_compute_y_at_x_2<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
|||
operator()(const X_monotone_curve_2& curve, const CoordinateType& x)
|
||||
-> CoordinateType
|
||||
{
|
||||
CGAL::Object o;
|
||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
||||
Intersect_2 intersect = traits->intersect_2_object();
|
||||
X_monotone_curve_2 c2 = this->makeVerticalLine(x);
|
||||
intersect(curve, c2, oi);
|
||||
std::pair<Point_2, Multiplicity> res;
|
||||
if (CGAL::assign(res, o)) {
|
||||
typedef std::pair<Point_2, Multiplicity> PtM;
|
||||
|
||||
std::vector<PtM> res;
|
||||
intersect(curve, c2, CGAL::dispatch_or_drop_output<PtM>(std::back_inserter(res)));
|
||||
if (!res.empty()) {
|
||||
// TODO: handle failure case
|
||||
const Point_2& p = res.first;
|
||||
const Point_2& p = res[0].first;
|
||||
CoordinateType coord = p.y();
|
||||
return coord;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -479,8 +479,8 @@ public:
|
|||
* projection.
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||
const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight);
|
||||
const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight);
|
||||
|
||||
protected:
|
||||
const ArrTraits* traits;
|
||||
|
|
@ -524,8 +524,8 @@ public:
|
|||
/* Return the subcurve of curve bracketed by pLeft and pRight.
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||
const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight );
|
||||
const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight );
|
||||
|
||||
private:
|
||||
const Traits& m_traits;
|
||||
|
|
@ -558,8 +558,8 @@ public:
|
|||
Return the subcurve of curve bracketed by pLeft and pRight.
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||
const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight);
|
||||
const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight);
|
||||
|
||||
protected:
|
||||
const ArrTraits* traits;
|
||||
|
|
@ -600,8 +600,8 @@ public:
|
|||
* projection.
|
||||
*/
|
||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||
const boost::optional<Point_2>& pLeft,
|
||||
const boost::optional<Point_2>& pRight);
|
||||
const std::optional<Point_2>& pLeft,
|
||||
const std::optional<Point_2>& pRight);
|
||||
|
||||
protected:
|
||||
const Traits* traits;
|
||||
|
|
|
|||
|
|
@ -1223,10 +1223,10 @@ halfedge \f$e_{\mathrm{pred}}\f$ directed toward \f$v\f$, such that
|
|||
\f$c\f$ is located between the curves associated with
|
||||
\f$e_{\mathrm{pred}}\f$ and the next halfedge in the clockwise order
|
||||
in the circular list of halfedges around \f$v\f$; see
|
||||
\cgalFigureRef{aos_fig-insert}. This search may take \f$O(d)\f$ time,
|
||||
\cgalFigureRef{aos_fig-insert}. This search may take \cgalBigO{d} time,
|
||||
where \f$d\f$ is the degree of the vertex \f$v\f$. \cgalFootnote{We
|
||||
can store the handles to the halfedges incident to \f$v\f$ in an efficient
|
||||
search structure to obtain \f$O(\log d)\f$ access time. However, as
|
||||
search structure to obtain \cgalBigO{\log d} access time. However, as
|
||||
\f$d\f$ is usually very small, this may lead to a waste of storage
|
||||
space without a meaningful improvement in running time in practice.}
|
||||
However, if the halfedge \f$e_{\mathrm{pred}}\f$ is known in advance,
|
||||
|
|
@ -1320,7 +1320,7 @@ Arrangement_on_surface_2::Face_const_handle
|
|||
`Face_const_handle`\endlink. Depending on whether the query point is
|
||||
located inside a face, lies on an edge, or coincides with a vertex,
|
||||
the appropriate handle can be obtained with <em>value retrieval</em>
|
||||
by `boost::get` as demonstrated in the example below.
|
||||
by `std::get` as demonstrated in the example below.
|
||||
|
||||
Note that the handles returned by the \link
|
||||
ArrangementPointLocation_2::locate() `locate()`\endlink functions are
|
||||
|
|
@ -1361,7 +1361,7 @@ The function template `locate_point()` calls an instance of the
|
|||
function template `print_point_location()`, which inserts the
|
||||
result of the query into the standard output-stream. It is listed
|
||||
below, and defined in the header file `point_location_utils.h`.
|
||||
Observe how the function `boost::get()` is used to cast the
|
||||
Observe how the function `std::get()` is used to cast the
|
||||
resulting object into a handle to an arrangement feature. The
|
||||
point-location object `pl` is assumed to be already attached
|
||||
to an arrangement.
|
||||
|
|
@ -1383,13 +1383,13 @@ void print_point_location
|
|||
const Face_const_handle* f;
|
||||
|
||||
std::cout << "The point (" << q << ") is located ";
|
||||
if (f = boost::get<Face_const_handle>(&obj)) // located inside a face
|
||||
if (f = std::get_if<Face_const_handle>(&obj)) // located inside a face
|
||||
std::cout << "inside "
|
||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||
<< " face.\n";
|
||||
else if (e = boost::get<Halfedge_const_handle>(&obj)) // located on an edge
|
||||
else if (e = std::get_if<Halfedge_const_handle>(&obj)) // located on an edge
|
||||
std::cout << "on an edge: " << (*e)->curve() << std::endl;
|
||||
else if (v = boost::get<Vertex_const_handle>(&obj)) // located on a vertex
|
||||
else if (v = std::get_if<Vertex_const_handle>(&obj)) // located on a vertex
|
||||
std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||
<< " vertex: " << (*v)->point() << std::endl;
|
||||
else CGAL_error_msg("Invalid object.");
|
||||
|
|
@ -1488,9 +1488,9 @@ keep up-to-date as this arrangement changes.
|
|||
As mentioned above, the triangulation strategy is provided only for
|
||||
educational purposes, and thus we do not elaborate on this strategy.
|
||||
The data structure needed by the landmark and the trapezoidal map RIC
|
||||
strategies can be constructed in \f$O(N \log N)\f$ time, where \f$N\f$
|
||||
strategies can be constructed in \cgalBigO{N \log N} time, where \f$N\f$
|
||||
is the overall number of edges in the arrangement, but the constant
|
||||
hidden in the \f$O()\f$ notation for the trapezoidal map RIC strategy
|
||||
hidden in the \cgalBigO{ } notation for the trapezoidal map RIC strategy
|
||||
is much larger. Thus, construction needed by the landmark algorithm is
|
||||
in practice significantly faster than the construction needed by the
|
||||
trapezoidal map RIC strategy. In addition, although both resulting
|
||||
|
|
@ -1603,12 +1603,12 @@ void shoot_vertical_ray(const RayShoot& vrs,
|
|||
const Face_const_handle* f;
|
||||
|
||||
std::cout << "Shooting up from (" << q << ") : ";
|
||||
if (v = boost::get<Vertex_const_handle>(&obj)) // we hit a vertex
|
||||
if (v = std::get_if<Vertex_const_handle>(&obj)) // we hit a vertex
|
||||
std::cout << "hit " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||
<< " vertex: " << (*v)->point() << std::endl;
|
||||
else if (e = boost::get<Halfedge_const_handle>(&obj)) // we hit an edge
|
||||
else if (e = std::get_if<Halfedge_const_handle>(&obj)) // we hit an edge
|
||||
std::cout << "hit an edge: " << (*e)->curve() << std::endl;
|
||||
else if (f = boost::get<Face_const_handle>(&obj)) { // we hit nothing
|
||||
else if (f = std::get_if<Face_const_handle>(&obj)) { // we hit nothing
|
||||
CGAL_assertion((*f)->is_unbounded());
|
||||
std::cout << "hit nothing.\n";
|
||||
}
|
||||
|
|
@ -1647,7 +1647,7 @@ Section \ref arr_ssecpl. The output pairs are sorted in increasing
|
|||
\f$xy\f$-lexicographical order of the query point.
|
||||
|
||||
The batched point-location operation is carried out by sweeping the
|
||||
arrangement. Thus, it takes \f$O((m+N)\log{(m+N)})\f$ time, where
|
||||
arrangement. Thus, it takes \cgalBigO{(m+N)\log{(m+N)}} time, where
|
||||
\f$N\f$ is the number of edges in the arrangement. Issuing separate
|
||||
queries exploiting a point-location strategy with logarithmic query
|
||||
time per query, such as the trapezoidal map RIC strategy (see Section
|
||||
|
|
@ -2037,11 +2037,11 @@ so it must be construct from scratch.
|
|||
|
||||
In the first case, we sweep over the input curves, compute their
|
||||
intersection points, and construct the \dcel that represents their
|
||||
arrangement. This process is performed in \f$O\left((n + k)\log
|
||||
n\right)\f$ time, where \f$k\f$ is the total number of intersection
|
||||
arrangement. This process is performed in \cgalBigO{left((n + k)\log
|
||||
n\right} time, where \f$k\f$ is the total number of intersection
|
||||
points. The running time is asymptotically better than the time needed
|
||||
for incremental insertion if the arrangement is relatively sparse
|
||||
(when \f$k\f$ is \f$O(\frac{n^2}{\log n}\f$)), but it is recommended
|
||||
(when \f$k\f$ is \cgalBigO{\frac{n^2}{\log n}}), but it is recommended
|
||||
that this aggregate construction process be used even for dense
|
||||
arrangements, since the plane-sweep algorithm performs fewer geometric
|
||||
operations compared to the incremental insertion algorithms, and hence
|
||||
|
|
@ -4346,7 +4346,7 @@ a point with respect to an \f$x\f$-monotone polyline, we use binary
|
|||
search to locate the relevant segment that contains the point in its
|
||||
\f$x\f$-range. Then, we compute the position of the point with respect
|
||||
to this segment. Thus, operations on \f$x\f$-monotone polylines of
|
||||
size \f$m\f$ typically take \f$O(\log m)\f$ time.
|
||||
size \f$m\f$ typically take \cgalBigO{\log m} time.
|
||||
|
||||
You are free to choose the underlying segment traits class. Your
|
||||
decision could be based, for example, on the number of expected
|
||||
|
|
|
|||
|
|
@ -22,19 +22,7 @@ the output sequence.
|
|||
`std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
|
||||
</UL>
|
||||
|
||||
\cgalHeading{A Note on Backwards Compatibility}
|
||||
This function used to return `CGAL::Object` up to
|
||||
\cgal version 4.2. Starting with \cgal version 4.3 the return type
|
||||
is determined by the metafunction `CGAL::Arr_point_location_result`.
|
||||
To preserve backwards compatibility
|
||||
`CGAL::Object` can be constructed from the new return type
|
||||
implicitly, but switching to the new style is recommended. To enable
|
||||
the old style without any overhead, the macro
|
||||
`::CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any
|
||||
\cgal header is included.
|
||||
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
template<typename Traits, typename Dcel,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ of both types
|
|||
`CGAL::Line_arc_2<CircularKernel>` or
|
||||
`CGAL::Circular_arc_2<CircularKernel>`.
|
||||
|
||||
It uses the <A HREF="https://www.boost.org/doc/html/variant.html">boost::variant</A>.
|
||||
It uses the <A HREF="https://www.boost.org/doc/html/variant.html">std::variant</A>.
|
||||
|
||||
\cgalModels `ArrangementTraits_2`
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ insertions of curves and not deletions of them.
|
|||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
template< typename Arrangement, typename Generator >
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ time-consuming process when applied to dense arrangements.
|
|||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
template< typename Arrangement >
|
||||
|
|
|
|||
|
|
@ -1,26 +1,3 @@
|
|||
/*!
|
||||
\ingroup PkgArrangementOnSurface2PointLocation
|
||||
|
||||
The macro `CGAL_ARR_POINT_LOCATION_VERSION` can be used to configure
|
||||
the point-location query API. In particular, it determines which version
|
||||
of the result type of the point-location and vertical ray-shooting queries
|
||||
should be used by models of the concepts `ArrangementPointLocation_2`
|
||||
and `ArrangementVerticalRayShoot_2`, and by the free function
|
||||
`locate`. The `CGAL_ARR_POINT_LOCATION_VERSION` should be defined before any \cgal header
|
||||
is included.
|
||||
|
||||
- `CGAL_ARR_POINT_LOCATION_VERSION` == 1, the result type is set to be `CGAL::Object`.
|
||||
- `CGAL_ARR_POINT_LOCATION_VERSION` == 2, the result type is set to be
|
||||
`boost::variant<Vertex_const_handle,Halfedge_const_handle,Face_const_handle>`, where `Vertex_const_handle`, `Halfedge_const_handle`, and
|
||||
`Face_const_handle` are the corresponding nested types in a `CGAL::Arrangement_2` instance.
|
||||
|
||||
|
||||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
*/
|
||||
#define CGAL_ARR_POINT_LOCATION_VERSION
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
|
|
@ -37,16 +14,13 @@ or vertical ray-shoot query.
|
|||
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
*/
|
||||
template <class Arrangement>
|
||||
struct Arr_point_location_result
|
||||
{
|
||||
/*! The type of the arrangement feature that is the result of a
|
||||
* point-location query or a vertical ray-shoot query, namely,
|
||||
* `boost::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>`
|
||||
* if `::CGAL_ARR_POINT_LOCATION_VERSION` == 2, which is the default, otherwise
|
||||
* `CGAL::Object`.
|
||||
* `std::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>`
|
||||
*/
|
||||
typedef unspecified_type Type;
|
||||
}; /* end Arr_point_location_result */
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ Seidel \cgalCite{s-sfira-91} (see also [\cgalCite{bkos-cgaa-00} Chapter 6).
|
|||
It subdivides each arrangement face to pseudo-trapezoidal cells, each
|
||||
of constant complexity, and constructs and maintains a linear-size search
|
||||
structure on top of these cells, such that each query can be answered
|
||||
in \f$ O(\log n)\f$ time, where \f$ n\f$ is the complexity of the arrangement.
|
||||
in \cgalBigO{\log n} time, where \f$ n\f$ is the complexity of the arrangement.
|
||||
|
||||
Constructing the search structures takes \f$ O(n \log n)\f$ expected time
|
||||
Constructing the search structures takes \cgalBigO{n \log n} expected time
|
||||
and may require a small number of rebuilds \cgalCite{hkh-iiplgtds-12}. Therefore
|
||||
attaching a trapezoidal point-location object to an existing arrangement
|
||||
may incur some overhead in running times. In addition, the point-location
|
||||
|
|
@ -32,7 +32,6 @@ This strategy supports arbitrary subdivisions, including unbounded ones.
|
|||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
template< typename Arrangement >
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ namespace CGAL {
|
|||
* \sa `ArrangementPointLocation_2`
|
||||
* \sa `ArrangementVerticalRayShoot_2`
|
||||
* \sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
* \sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
*/
|
||||
|
||||
template <typename Arrangement_>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ of issued queries is not large.
|
|||
\sa `ArrangementPointLocation_2`
|
||||
\sa `ArrangementVerticalRayShoot_2`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
template< typename Arrangement >
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public:
|
|||
/*! computes the intersections of `xc1` and `xc2` and writes them <I>in an
|
||||
* ascending lexicographic \f$xy\f$-order</I> into a range beginning at
|
||||
* `oi`. The type `OutputIterator` must dereference a polymorphic object of
|
||||
* type `boost::variant` that wraps objects of type either type
|
||||
* type `std::variant` that wraps objects of type either type
|
||||
* `pair<ArrTraits::Point_2, ArrTraits::Multiplicity>` or
|
||||
* `ArrTraits::X_monotone_curve_2`. An object of the former type represents an
|
||||
* intersection point with its multiplicity (in case the multiplicity is
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public:
|
|||
/*! subdivides the input curve `c` into \f$x\f$-monotone subcurves and
|
||||
* isolated points, and inserts the results into a range beginning at the given
|
||||
* output iterator `oi`. The type `OutputIterator` dereferences a
|
||||
* `boost::variant` that wraps either an `ArrTraits::Point_2` object or an
|
||||
* `std::variant` that wraps either an `ArrTraits::Point_2` object or an
|
||||
* `ArrTraits::X_monotone_curve_2` object. The operator returns a past-the-end
|
||||
* iterator for the output sequence.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,16 +10,6 @@ containing it. In the general case, the query point is contained inside an
|
|||
arrangement face, but in degenerate situations it may lie on an edge or
|
||||
coincide with an arrangement vertex.
|
||||
|
||||
\cgalHeading{A note on Backwards compatibility}
|
||||
The `locate` member function used to return `CGAL::Object` up to
|
||||
\cgal version 4.2. Starting with \cgal version 4.3 the return type
|
||||
is determined by a metafunction. To preserve backwards compatibility
|
||||
`CGAL::Object` can be constructed from the new return types
|
||||
implicitly, but switching to the new style is recommended. To enable
|
||||
the old style without any overhead, the macro
|
||||
`CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any
|
||||
\cgal header is included.
|
||||
|
||||
\cgalHasModel `CGAL::Arr_naive_point_location<Arrangement>`
|
||||
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||
\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
|
|
@ -30,7 +20,6 @@ the old style without any overhead, the macro
|
|||
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -18,16 +18,6 @@ emanating from the query point goes to infinity without hitting any
|
|||
arrangement feature on its way. In this case the unbounded face is
|
||||
returned.
|
||||
|
||||
\cgalHeading{A Note on Backwards Compatibility}
|
||||
The `ray_shoot_up` and `ray_shoot_down` member functions used
|
||||
to return `CGAL::Object` up to \cgal version 4.2. Starting with
|
||||
\cgal version 4.3 the return type is determined by a metafunction. To
|
||||
preserve backwards compatibility `CGAL::Object` can be constructed
|
||||
from the new return types implicitly, but switching to the new style
|
||||
is recommended. To enable the old style without any overhead, the macro
|
||||
`CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any
|
||||
\cgal header is included.
|
||||
|
||||
\cgalHasModel `CGAL::Arr_naive_point_location<Arrangement>`
|
||||
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||
\cgalHasModel `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
|
|
@ -38,7 +28,6 @@ is recommended. To enable the old style without any overhead, the macro
|
|||
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
||||
*/
|
||||
|
||||
class ArrangementVerticalRayShoot_2 {
|
||||
|
|
|
|||
|
|
@ -239,9 +239,6 @@ implemented as peripheral classes or as free (global) functions.
|
|||
- `CGAL::Arr_unb_planar_topology_traits_2<GeometryTraits_2,Dcel>`
|
||||
- `CGAL::Arr_spherical_topology_traits_2<GeometryTraits_2,Dcel>`
|
||||
|
||||
\cgalCRPSection{Macros}
|
||||
- \link CGAL_ARR_POINT_LOCATION_VERSION `CGAL_ARR_POINT_LOCATION_VERSION` \endlink
|
||||
|
||||
\cgalCRPSection{Functions}
|
||||
|
||||
- `CGAL::is_valid()`
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ typedef Traits::Algebraic_real_1 Algebraic_real;
|
|||
typedef Traits::X_monotone_curve_2 X_monotone_curve;
|
||||
typedef Traits::Point_2 Point;
|
||||
|
||||
typedef boost::variant<Point, X_monotone_curve> Make_x_monotone_result;
|
||||
typedef std::variant<Point, X_monotone_curve> Make_x_monotone_result;
|
||||
|
||||
int main() {
|
||||
Traits traits;
|
||||
|
|
@ -52,7 +52,7 @@ int main() {
|
|||
// but not in this case).
|
||||
std::vector<X_monotone_curve> segs;
|
||||
for(size_t i = 0; i < pre_segs.size(); ++i) {
|
||||
auto* curr_p = boost::get<X_monotone_curve>(&pre_segs[i]);
|
||||
auto* curr_p = std::get_if<X_monotone_curve>(&pre_segs[i]);
|
||||
assert(curr_p);
|
||||
segs.push_back(*curr_p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include <CGAL/Arr_circular_line_arc_traits_2.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ typedef Circular_k::Circle_2 Circle_2;
|
|||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
|
||||
typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2;
|
||||
typedef std::variant< Circular_arc_2, Line_arc_2> Arc_2;
|
||||
typedef std::vector< Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits_2<Circular_k> Traits;
|
||||
|
|
@ -52,7 +52,7 @@ int main() {
|
|||
} while((x1 == x2) && (y1 == y2));
|
||||
|
||||
std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v =
|
||||
std::variant< Circular_arc_2, Line_arc_2 > v =
|
||||
Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||
ac.push_back( v);
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ int main() {
|
|||
y1 = theRandom.get_int(random_min,random_max);
|
||||
}
|
||||
while(x1==0 && y1==0);
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v =
|
||||
std::variant< Circular_arc_2, Line_arc_2 > v =
|
||||
Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac.push_back(v);
|
||||
}
|
||||
|
|
@ -72,7 +72,8 @@ int main() {
|
|||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) {
|
||||
//insert(arr,_pl,*it);
|
||||
insert(arr, *it, _pl);
|
||||
//DONOTCOMMIT
|
||||
//~ insert(arr, *it, _pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ int main() {
|
|||
Point_location pl(arr);
|
||||
const Point q{_7_halves, 7};
|
||||
Point_location::result_type obj = pl.locate(q);
|
||||
auto* e = boost::get<Arr_with_hist::Halfedge_const_handle>(&obj);
|
||||
auto* e = std::get_if<Arr_with_hist::Halfedge_const_handle>(&obj);
|
||||
|
||||
// Split the edge e to two edges e1 and e2;
|
||||
auto e1 = arr.split_edge(arr.non_const_handle(*e), q);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue