mirror of https://github.com/CGAL/cgal
Merge branch 'master' into PMP-add_sizing_in_isotropic_remeshing-GF
This commit is contained in:
commit
613b0a8914
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,7 +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 <optional>
|
||||
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
#include <CGAL/mutex.h>
|
||||
|
|
@ -270,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
|
||||
|
|
@ -293,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;
|
||||
|
||||
|
||||
|
|
@ -317,12 +317,12 @@ 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, [](Primitive_id){ return false; });
|
||||
|
|
@ -342,12 +342,12 @@ 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, [](Primitive_id){ return false; });
|
||||
|
|
@ -963,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;
|
||||
|
|
@ -975,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,7 +197,7 @@ 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 {
|
||||
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,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) {
|
||||
|
|
@ -45,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) {
|
||||
|
|
@ -124,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);
|
||||
|
||||
|
||||
|
|
@ -139,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$.
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -196,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
|
||||
|
|
@ -210,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;
|
||||
|
|
@ -230,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;
|
||||
|
|
@ -256,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
|
||||
|
|
@ -272,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
|
||||
|
|
@ -546,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);
|
||||
}
|
||||
|
||||
|
|
@ -583,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;
|
||||
}
|
||||
|
|
@ -630,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:
|
||||
|
|
@ -638,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:
|
||||
|
|
@ -713,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:
|
||||
|
|
@ -1348,7 +1348,7 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
return intermediate_values()[i].get();
|
||||
return intermediate_values()[i].value();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1369,7 +1369,7 @@ public:
|
|||
if(! this->ptr()->content) {
|
||||
compute_content_and_primitive_part();
|
||||
}
|
||||
return this->ptr()->content.get();
|
||||
return this->ptr()->content.value();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -1388,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 {
|
||||
|
|
@ -1436,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:
|
||||
|
|
@ -1557,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());
|
||||
}
|
||||
|
|
@ -1581,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:
|
||||
|
|
@ -1592,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:
|
||||
|
|
@ -1713,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();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1915,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;
|
||||
|
||||
|
|
@ -2110,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];
|
||||
|
|
@ -2120,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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <memory>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -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_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.");
|
||||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ int main() {
|
|||
// the boundary of the face that contains it.
|
||||
Point q(4, 1);
|
||||
auto obj = pl.locate(q);
|
||||
auto* f = boost::get<Arrangement::Face_const_handle>(&obj);
|
||||
auto* f = std::get_if<Arrangement::Face_const_handle>(&obj);
|
||||
|
||||
std::cout << "The query point (" << q << ") is located in: ";
|
||||
print_face<Arrangement>(*f);
|
||||
|
|
|
|||
|
|
@ -4,33 +4,6 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Print the result of a point-location query.
|
||||
//
|
||||
#if CGAL_ARR_POINT_LOCATION_VERSION < 2
|
||||
template <typename Arrangement_>
|
||||
void print_point_location(const typename Arrangement_::Point_2& q,
|
||||
CGAL::Object obj)
|
||||
{
|
||||
typedef Arrangement_ Arrangement_2;
|
||||
typename Arrangement_2::Vertex_const_handle v;
|
||||
typename Arrangement_2::Halfedge_const_handle e;
|
||||
typename Arrangement_2::Face_const_handle f;
|
||||
|
||||
std::cout << "The point (" << q << ") is located ";
|
||||
if (CGAL::assign(f, obj)) { // q is located inside a face
|
||||
if (f->is_unbounded())
|
||||
std::cout << "inside the unbounded face." << std::endl;
|
||||
else std::cout << "inside a bounded face." << std::endl;
|
||||
}
|
||||
else if (CGAL::assign(e, obj)) { // q is located on an edge
|
||||
std::cout << "on an edge: " << e->curve() << std::endl;
|
||||
}
|
||||
else if (CGAL::assign(v, obj)) { // q is located on a vertex
|
||||
if (v->is_isolated())
|
||||
std::cout << "on an isolated vertex: " << v->point() << std::endl;
|
||||
else std::cout << "on a vertex: " << v->point() << std::endl;
|
||||
}
|
||||
else CGAL_error_msg( "Invalid object.");
|
||||
}
|
||||
#else
|
||||
template <typename Arrangement_>
|
||||
void print_point_location
|
||||
(const typename Arrangement_::Point_2& q,
|
||||
|
|
@ -46,18 +19,17 @@ void print_point_location
|
|||
const Face_const_handle* f;
|
||||
|
||||
std::cout << "The point (" << q << ") is located ";
|
||||
if ((f = boost::get<Face_const_handle>(&obj))) // inside a face
|
||||
if ((f = std::get_if<Face_const_handle>(&obj))) // inside a face
|
||||
std::cout << "inside "
|
||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||
<< " face." << std::endl;
|
||||
else if ((e = boost::get<Halfedge_const_handle>(&obj))) // on an edge
|
||||
else if ((e = std::get_if<Halfedge_const_handle>(&obj))) // on an edge
|
||||
std::cout << "on an edge: " << (*e)->curve() << std::endl;
|
||||
else if ((v = boost::get<Vertex_const_handle>(&obj))) // on a vertex
|
||||
else if ((v = std::get_if<Vertex_const_handle>(&obj))) // on a vertex
|
||||
std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||
<< " vertex: " << (*v)->point() << std::endl;
|
||||
else CGAL_error_msg("Invalid object.");
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Perform a point-location query and print the result.
|
||||
|
|
@ -101,12 +73,12 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs,
|
|||
|
||||
std::cout << "Shooting up from (" << q << ") : hit ";
|
||||
|
||||
if ((v = boost::get<Vertex_const_handle>(&obj))) // hit a vertex
|
||||
if ((v = std::get_if<Vertex_const_handle>(&obj))) // hit a vertex
|
||||
std::cout << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||
<< " vertex: " << (*v)->point() << std::endl;
|
||||
else if ((e = boost::get<Halfedge_const_handle>(&obj)) ) // hit an edge
|
||||
else if ((e = std::get_if<Halfedge_const_handle>(&obj)) ) // hit an edge
|
||||
std::cout << "an edge: " << (*e)->curve() << std::endl;
|
||||
else if ((f = boost::get<Face_const_handle>(&obj))) { // hit nothing
|
||||
else if ((f = std::get_if<Face_const_handle>(&obj))) { // hit nothing
|
||||
assert((*f)->is_unbounded());
|
||||
std::cout << "nothing." << std::endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ typedef Polycurve_bezier_traits::Point_2 Point;
|
|||
typedef Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve;
|
||||
typedef CGAL::Arrangement_2<Polycurve_bezier_traits> Arrangement_2;
|
||||
|
||||
typedef boost::variant<Point, Bezier_x_monotone_curve> Make_x_monotone_result;
|
||||
typedef std::variant<Point, Bezier_x_monotone_curve> Make_x_monotone_result;
|
||||
|
||||
int main() {
|
||||
Polycurve_bezier_traits pc_traits;
|
||||
|
|
@ -58,7 +58,7 @@ int main() {
|
|||
// convert it into x-monotone bezier curve.
|
||||
std::vector<Make_x_monotone_result> obj_vector;
|
||||
bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector));
|
||||
auto* x_seg_p = boost::get<Bezier_x_monotone_curve>(&obj_vector[0]);
|
||||
auto* x_seg_p = std::get_if<Bezier_x_monotone_curve>(&obj_vector[0]);
|
||||
x_curves.push_back(*x_seg_p);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,15 +99,15 @@ protected:
|
|||
for (auto it = results.begin(); it != results.end(); ++it) {
|
||||
std::cout << "The point (" << it->first << ") is located ";
|
||||
if (const Face_const_handle* f =
|
||||
boost::get<Face_const_handle>(&(it->second))) // inside a face
|
||||
std::get_if<Face_const_handle>(&(it->second))) // inside a face
|
||||
std::cout << "inside "
|
||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||
<< " face.\n";
|
||||
else if (const Halfedge_const_handle* e =
|
||||
boost::get<Halfedge_const_handle>(&(it->second))) // on an edge
|
||||
std::get_if<Halfedge_const_handle>(&(it->second))) // on an edge
|
||||
std::cout << "on an edge: " << (*e)->curve() << std::endl;
|
||||
else if (const Vertex_const_handle* v =
|
||||
boost::get<Vertex_const_handle>(&(it->second))) // on a vertex
|
||||
std::get_if<Vertex_const_handle>(&(it->second))) // on a vertex
|
||||
std::cout << "on "
|
||||
<< (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||
<< " vertex: " << (*v)->point() << std::endl;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include "arr_linear.h"
|
||||
|
||||
typedef boost::variant<Vertex_const_handle, Halfedge_const_handle,
|
||||
typedef std::variant<Vertex_const_handle, Halfedge_const_handle,
|
||||
Face_const_handle> Cell_type;
|
||||
typedef boost::optional<Cell_type> Vert_decomp_type;
|
||||
typedef std::optional<Cell_type> Vert_decomp_type;
|
||||
typedef std::pair<Vert_decomp_type, Vert_decomp_type> Vert_decomp_pair;
|
||||
typedef std::pair<Vertex_const_handle, Vert_decomp_pair> Vert_decomp_entry;
|
||||
typedef std::list<Vert_decomp_entry> Vert_decomp_list;
|
||||
|
|
@ -41,10 +41,10 @@ int main() {
|
|||
std::cout << " feature below: ";
|
||||
if (! curr.first) std::cout << "EMPTY";
|
||||
else {
|
||||
auto* vh = boost::get<Vertex_const_handle>(&*(curr.first));;
|
||||
auto* vh = std::get_if<Vertex_const_handle>(&*(curr.first));;
|
||||
if (vh) std::cout << '(' << (*vh)->point() << ')';
|
||||
else {
|
||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.first));
|
||||
auto* hh = std::get_if<Halfedge_const_handle>(&*(curr.first));
|
||||
if (! (*hh)->is_fictitious())
|
||||
std::cout << '[' << (*hh)->curve() << ']';
|
||||
else std::cout << "NONE";
|
||||
|
|
@ -54,10 +54,10 @@ int main() {
|
|||
std::cout << " feature above: ";
|
||||
if (! curr.second) std::cout << "EMPTY\n";
|
||||
else {
|
||||
auto* vh = boost::get<Vertex_const_handle>(&*(curr.second));;
|
||||
auto* vh = std::get_if<Vertex_const_handle>(&*(curr.second));;
|
||||
if (vh) std::cout << '(' << (*vh)->point() << ")\n";
|
||||
else {
|
||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second));
|
||||
auto* hh = std::get_if<Halfedge_const_handle>(&*(curr.second));
|
||||
if (! (*hh)->is_fictitious())
|
||||
std::cout << '[' << (*hh)->curve() << "]\n";
|
||||
else std::cout << "NONE\n";
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ public:
|
|||
template <typename OutputIterator>
|
||||
OutputIterator operator() (const Curve_2& B, OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
typedef typename Bounding_traits::Vertical_tangency_point
|
||||
Vertical_tangency_point;
|
||||
|
|
|
|||
|
|
@ -114,13 +114,13 @@ public:
|
|||
auto obj = p_arr->topology_traits()->locate_curve_end(cv, ind, ps_x, ps_y);
|
||||
|
||||
// Return a handle to the DCEL feature.
|
||||
DFace** f_p = boost::get<DFace*>(&obj);
|
||||
DFace** f_p = std::get_if<DFace*>(&obj);
|
||||
if (f_p) return (Pl_result::make_result(p_arr->_const_handle_for(*f_p)));
|
||||
|
||||
DHalfedge** he_p = boost::get<DHalfedge*>(&obj);
|
||||
DHalfedge** he_p = std::get_if<DHalfedge*>(&obj);
|
||||
if (he_p) return (Pl_result::make_result(p_arr->_const_handle_for(*he_p)));
|
||||
|
||||
DVertex** v_p = boost::get<DVertex*>(&obj);
|
||||
DVertex** v_p = std::get_if<DVertex*>(&obj);
|
||||
if (v_p) return (Pl_result::make_result(p_arr->_const_handle_for(*v_p)));
|
||||
|
||||
// We should never reach here:
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <optional>
|
||||
#include <boost/none.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -267,11 +267,11 @@ public:
|
|||
template <typename OutputIterator> OutputIterator
|
||||
x_monotone_segment(Curve_2 cv,
|
||||
Point_2 p,
|
||||
boost::optional<Point_2> start,
|
||||
boost::optional<Point_2> end,
|
||||
std::optional<Point_2> start,
|
||||
std::optional<Point_2> end,
|
||||
OutputIterator out) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
//CGAL_assertion(is_one_one(cv,p));
|
||||
|
||||
|
|
@ -286,46 +286,46 @@ public:
|
|||
this->_ckva()->make_x_monotone_2_object()(cv, std::back_inserter(arcs));
|
||||
auto it = arcs.begin();
|
||||
auto helper = it;
|
||||
const auto* it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
const auto* it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
while (it != arcs.end()) {
|
||||
if ( on_arc(p, *it_seg_p) ) break;
|
||||
it++;
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
}
|
||||
|
||||
bool left_on_arc = start && on_arc(start.get(), *it_seg_p);
|
||||
bool right_on_arc = end && on_arc(end.get(), *it_seg_p);
|
||||
bool left_on_arc = start && on_arc(start.value(), *it_seg_p);
|
||||
bool right_on_arc = end && on_arc(end.value(), *it_seg_p);
|
||||
|
||||
if ( left_on_arc && right_on_arc ) {
|
||||
segs.push_back(it_seg_p->trim(start.get(),end.get()));
|
||||
segs.push_back(it_seg_p->trim(start.value(),end.value()));
|
||||
}
|
||||
if (left_on_arc && (!right_on_arc)) {
|
||||
if (!it_seg_p->is_finite(CGAL::ARR_MAX_END) ||
|
||||
!equal(start.get(),right(*it_seg_p))) {
|
||||
!equal(start.value(),right(*it_seg_p))) {
|
||||
if (it_seg_p->is_finite(CGAL::ARR_MIN_END) &&
|
||||
equal(start.get(),left(*it_seg_p)))
|
||||
equal(start.value(),left(*it_seg_p)))
|
||||
{
|
||||
segs.push_back(*it_seg_p);
|
||||
}
|
||||
else {
|
||||
X_monotone_curve_2 split1,split2;
|
||||
it_seg_p->split(start.get(),split1,split2);
|
||||
it_seg_p->split(start.value(),split1,split2);
|
||||
segs.push_back(split2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!left_on_arc) && right_on_arc) {
|
||||
if (!it_seg_p->is_finite(CGAL::ARR_MIN_END) ||
|
||||
! equal(left(*it_seg_p), end.get()))
|
||||
! equal(left(*it_seg_p), end.value()))
|
||||
{
|
||||
if (it_seg_p->is_finite(CGAL::ARR_MAX_END) &&
|
||||
equal(end.get(), right(*it_seg_p)))
|
||||
equal(end.value(), right(*it_seg_p)))
|
||||
{
|
||||
segs.push_back(*it_seg_p);
|
||||
}
|
||||
else {
|
||||
X_monotone_curve_2 split1,split2;
|
||||
it_seg_p->split(end.get(), split1, split2);
|
||||
it_seg_p->split(end.value(), split1, split2);
|
||||
segs.push_back(split1);
|
||||
}
|
||||
}
|
||||
|
|
@ -348,14 +348,14 @@ public:
|
|||
}
|
||||
CGAL_assertion(it != arcs.begin());
|
||||
it--;
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
while (! on_arc(point_it, *it_seg_p)) {
|
||||
CGAL_assertion(it != arcs.begin());
|
||||
it--;
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
}
|
||||
if (start && on_arc(start.get(),*it_seg_p)) {
|
||||
segs.push_front(it_seg_p->trim(start.get(), right(*it_seg_p)));
|
||||
if (start && on_arc(start.value(),*it_seg_p)) {
|
||||
segs.push_front(it_seg_p->trim(start.value(), right(*it_seg_p)));
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
@ -365,7 +365,7 @@ public:
|
|||
}
|
||||
if (! right_on_arc) {
|
||||
it = helper; // reset
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
Point_2 point_it;
|
||||
while (true) {
|
||||
if (it_seg_p->is_finite(CGAL::ARR_MAX_END) &&
|
||||
|
|
@ -378,14 +378,14 @@ public:
|
|||
}
|
||||
it++;
|
||||
CGAL_assertion(it != arcs.end());
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
while(! on_arc(point_it, *it_seg_p)) {
|
||||
it++;
|
||||
CGAL_assertion(it != arcs.end());
|
||||
it_seg_p = boost::get<X_monotone_curve_2>(&(*it));
|
||||
it_seg_p = std::get_if<X_monotone_curve_2>(&(*it));
|
||||
}
|
||||
if(end && on_arc(end.get(),*it_seg_p)) {
|
||||
segs.push_back(it_seg_p->trim(left(*it_seg_p),end.get()));
|
||||
if(end && on_arc(end.value(),*it_seg_p)) {
|
||||
segs.push_back(it_seg_p->trim(left(*it_seg_p),end.value()));
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
@ -407,19 +407,19 @@ public:
|
|||
Site_of_point site_of_p,
|
||||
OutputIterator out) const {
|
||||
if(site_of_p==POINT_IN_INTERIOR) {
|
||||
return x_monotone_segment(cv,p,boost::none, boost::none,out);
|
||||
return x_monotone_segment(cv,p,std::nullopt, std::nullopt,out);
|
||||
} else if(site_of_p==MIN_ENDPOINT) {
|
||||
return x_monotone_segment(cv,
|
||||
p,
|
||||
boost::optional<Point_2>(p),
|
||||
boost::none,
|
||||
std::optional<Point_2>(p),
|
||||
std::nullopt,
|
||||
out);
|
||||
}
|
||||
CGAL_assertion(site_of_p==MAX_ENDPOINT);
|
||||
return x_monotone_segment(cv,
|
||||
p,
|
||||
boost::none,
|
||||
boost::optional<Point_2>(p),
|
||||
std::nullopt,
|
||||
std::optional<Point_2>(p),
|
||||
out);
|
||||
}
|
||||
|
||||
|
|
@ -468,15 +468,15 @@ public:
|
|||
return x_monotone_segment
|
||||
(cv,
|
||||
end_left,
|
||||
boost::optional<Point_2>(end_left),
|
||||
boost::optional<Point_2>(end_right),
|
||||
std::optional<Point_2>(end_left),
|
||||
std::optional<Point_2>(end_right),
|
||||
out);
|
||||
} else {
|
||||
return x_monotone_segment
|
||||
(cv,
|
||||
end_right,
|
||||
boost::optional<Point_2>(end_left),
|
||||
boost::optional<Point_2>(end_right),
|
||||
std::optional<Point_2>(end_left),
|
||||
std::optional<Point_2>(end_right),
|
||||
out);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Ss2 = Surface_sweep_2;
|
|||
* \param oi Output: An output iterator for the query results.
|
||||
* \pre The value-type of PointsIterator is Arrangement::Point_2,
|
||||
* and the value-type of OutputIterator is is pair<Point_2, Result>,
|
||||
* where Result is boost::optional<boost::variant<Vertex_const_handle,
|
||||
* where Result is std::optional<std::variant<Vertex_const_handle,
|
||||
* Halfedge_const_handle,
|
||||
* Face_const_handle> >.
|
||||
* It represents the arrangement feature containing the point.
|
||||
|
|
@ -105,7 +105,7 @@ locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
}
|
||||
}
|
||||
|
||||
// Obtain a extended traits-class object.
|
||||
// Obtain an extended traits-class object.
|
||||
const Gt2* geom_traits = arr.geometry_traits();
|
||||
|
||||
/* We would like to avoid copy construction of the geometry traits class.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#ifndef CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
#define CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ public:
|
|||
* \pre The curve has a boundary condition in either x or y.
|
||||
* \return An object that wraps the curve end.
|
||||
*/
|
||||
boost::optional<boost::variant<Vertex*, Halfedge*> >
|
||||
std::optional<std::variant<Vertex*, Halfedge*> >
|
||||
place_boundary_vertex(Face*,
|
||||
const X_monotone_curve_2&,
|
||||
Arr_curve_end,
|
||||
|
|
@ -314,7 +314,7 @@ public:
|
|||
{
|
||||
// This function should never be called:
|
||||
CGAL_error();
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/*! Locate the predecessor halfedge for the given curve around a given
|
||||
|
|
@ -347,13 +347,13 @@ public:
|
|||
* \pre The curve end is incident to the boundary.
|
||||
* \return An object that contains the curve end.
|
||||
*/
|
||||
boost::variant<Vertex*, Halfedge*, Face*>
|
||||
std::variant<Vertex*, Halfedge*, Face*>
|
||||
locate_curve_end(const X_monotone_curve_2&,
|
||||
Arr_curve_end,
|
||||
Arr_parameter_space /* ps_x */,
|
||||
Arr_parameter_space /* ps_y */)
|
||||
{
|
||||
typedef boost::variant<Vertex*, Halfedge*, Face*> Result;
|
||||
typedef std::variant<Vertex*, Halfedge*, Face*> Result;
|
||||
// This function should never be called:
|
||||
CGAL_error();
|
||||
Vertex* v(nullptr);
|
||||
|
|
|
|||
|
|
@ -584,9 +584,6 @@ public:
|
|||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
// Increment the serial number of the curve cv, which will serve as its
|
||||
// unique identifier.
|
||||
unsigned int index = 0;
|
||||
|
|
@ -594,10 +591,10 @@ public:
|
|||
|
||||
if (cv.orientation() == COLLINEAR) {
|
||||
// The curve is a line segment.
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(cv.supporting_line(),
|
||||
cv.source(),
|
||||
cv.target(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(cv.supporting_line(),
|
||||
cv.source(),
|
||||
cv.target(),
|
||||
index);
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -608,8 +605,8 @@ public:
|
|||
|
||||
if (sign_rad == ZERO) {
|
||||
// Create an isolated point.
|
||||
*oi++ = Make_x_monotone_result(Point_2(circ.center().x(),
|
||||
circ.center().y()));
|
||||
*oi++ = Point_2(circ.center().x(),
|
||||
circ.center().y());
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -622,59 +619,59 @@ public:
|
|||
CGAL_assertion (n_vpts == 2);
|
||||
|
||||
// Subdivide the circle into two arcs (an upper and a lower half).
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
vpts[0], vpts[1],
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
vpts[0], vpts[1],
|
||||
cv.orientation(),
|
||||
index);
|
||||
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
vpts[1], vpts[0],
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
vpts[1], vpts[0],
|
||||
cv.orientation(),
|
||||
index);
|
||||
}
|
||||
else {
|
||||
// Act according to the number of vertical tangency points.
|
||||
if (n_vpts == 2) {
|
||||
// Subdivide the circular arc into three x-monotone arcs.
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
cv.source(), vpts[0],
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
cv.source(), vpts[0],
|
||||
cv.orientation(),
|
||||
index);
|
||||
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
vpts[0], vpts[1],
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
vpts[0], vpts[1],
|
||||
cv.orientation(),
|
||||
index);
|
||||
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
vpts[1],
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
vpts[1],
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index);
|
||||
}
|
||||
else if (n_vpts == 1) {
|
||||
// Subdivide the circular arc into two x-monotone arcs.
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
cv.source(),
|
||||
vpts[0],
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
cv.source(),
|
||||
vpts[0],
|
||||
cv.orientation(),
|
||||
index);
|
||||
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
vpts[0],
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
vpts[0],
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index);
|
||||
}
|
||||
else {
|
||||
CGAL_assertion(n_vpts == 0);
|
||||
|
||||
// The arc is already x-monotone:
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
||||
cv.source(),
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index));
|
||||
*oi++ = X_monotone_curve_2(circ,
|
||||
cv.source(),
|
||||
cv.target(),
|
||||
cv.orientation(),
|
||||
index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,17 +178,17 @@ public:
|
|||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& arc, OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
std::vector<CGAL::Object> objs;
|
||||
std::vector<Make_x_monotone_result> objs;
|
||||
CircularKernel().make_x_monotone_2_object()(arc, std::back_inserter(objs));
|
||||
for (const auto& obj : objs) {
|
||||
if (const auto* p = CGAL::object_cast<Point_2>(&obj)) {
|
||||
if (const auto* p = std::get_if<Point_2>(&obj)) {
|
||||
*oi++ = Make_x_monotone_result(*p);
|
||||
continue;
|
||||
}
|
||||
if (const auto* xcv = CGAL::object_cast<X_monotone_curve_2>(&obj)) {
|
||||
if (const auto* xcv = std::get_if<X_monotone_curve_2>(&obj)) {
|
||||
*oi++ = Make_x_monotone_result(*xcv);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
|
|
@ -51,17 +51,17 @@ namespace CGAL {
|
|||
OutputIterator res2)
|
||||
{
|
||||
typedef typename CK::Circular_arc_point_2 Point_2;
|
||||
typedef boost::variant<Arc1, Arc2> X_monotone_curve_2;
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Arc1, Arc2> X_monotone_curve_2;
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
for (auto it = res1.begin(); it != res1.end(); ++it) {
|
||||
if (const Arc1* arc = CGAL::object_cast<Arc1>(&*it)) {
|
||||
boost::variant<Arc1, Arc2> v = *arc;
|
||||
std::variant<Arc1, Arc2> v = *arc;
|
||||
*res2++ = Make_x_monotone_result(v);
|
||||
}
|
||||
else if (const Arc2* line = CGAL::object_cast<Arc2>(&*it)) {
|
||||
boost::variant<Arc1, Arc2> v = *line;
|
||||
std::variant<Arc1, Arc2> v = *line;
|
||||
*res2++ = Make_x_monotone_result(v);
|
||||
}
|
||||
else if (const Point_2* p = CGAL::object_cast<Point_2>(&*it)) {
|
||||
|
|
@ -81,27 +81,27 @@ namespace CGAL {
|
|||
Circular_arc_point_2;
|
||||
|
||||
result_type
|
||||
operator()(const boost::variant< Arc1, Arc2 > &a1,
|
||||
const boost::variant< Arc1, Arc2 > &a2,
|
||||
operator()(const std::variant< Arc1, Arc2 > &a1,
|
||||
const std::variant< Arc1, Arc2 > &a2,
|
||||
const Circular_arc_point_2 &p) const
|
||||
{
|
||||
if ( const Arc1* arc1 = boost::get<Arc1>( &a1 ) ){
|
||||
if ( const Arc1* arc2 = boost::get<Arc1>( &a2 ) ){
|
||||
if ( const Arc1* arc1 = std::get_if<Arc1>( &a1 ) ){
|
||||
if ( const Arc1* arc2 = std::get_if<Arc1>( &a2 ) ){
|
||||
return CircularKernel()
|
||||
.compare_y_to_right_2_object()(*arc1, *arc2, p);
|
||||
}
|
||||
else {
|
||||
const Arc2* arc2e = boost::get<Arc2>( &a2 );
|
||||
const Arc2* arc2e = std::get_if<Arc2>( &a2 );
|
||||
return CircularKernel()
|
||||
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
||||
}
|
||||
}
|
||||
const Arc2* arc1 = boost::get<Arc2>( &a1 );
|
||||
if ( const Arc1* arc2 = boost::get<Arc1>( &a2 ) ){
|
||||
const Arc2* arc1 = std::get_if<Arc2>( &a1 );
|
||||
if ( const Arc1* arc2 = std::get_if<Arc1>( &a2 ) ){
|
||||
return CircularKernel()
|
||||
.compare_y_to_right_2_object()(*arc1, *arc2, p);
|
||||
}
|
||||
const Arc2* arc2e = boost::get<Arc2>( &a2 );
|
||||
const Arc2* arc2e = std::get_if<Arc2>( &a2 );
|
||||
return CircularKernel()
|
||||
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
||||
}
|
||||
|
|
@ -110,7 +110,6 @@ namespace CGAL {
|
|||
|
||||
template <class CircularKernel>
|
||||
class Variant_Equal_2
|
||||
: public boost::static_visitor<bool>
|
||||
{
|
||||
public :
|
||||
|
||||
|
|
@ -136,7 +135,7 @@ namespace CGAL {
|
|||
: public CircularKernel::Equal_2
|
||||
{
|
||||
public:
|
||||
typedef boost::variant< Arc1, Arc2 > Curve_2;
|
||||
typedef std::variant< Arc1, Arc2 > Curve_2;
|
||||
typedef bool result_type;
|
||||
using CircularKernel::Equal_2::operator();
|
||||
typedef typename CircularKernel::Circular_arc_point_2
|
||||
|
|
@ -169,7 +168,7 @@ namespace CGAL {
|
|||
result_type
|
||||
operator()(const Curve_2 &a0, const Curve_2 &a1) const
|
||||
{
|
||||
return boost::apply_visitor
|
||||
return std::visit
|
||||
( Variant_Equal_2<CircularKernel>(), a0, a1 );
|
||||
}
|
||||
|
||||
|
|
@ -188,20 +187,20 @@ namespace CGAL {
|
|||
|
||||
result_type
|
||||
operator() (const Circular_arc_point_2 &p,
|
||||
const boost::variant< Arc1, Arc2 > &A1) const
|
||||
const std::variant< Arc1, Arc2 > &A1) const
|
||||
{
|
||||
if ( const Arc1* arc1 = boost::get<Arc1>( &A1 ) ){
|
||||
if ( const Arc1* arc1 = std::get_if<Arc1>( &A1 ) ){
|
||||
return CircularKernel().compare_y_at_x_2_object()(p, *arc1);
|
||||
}
|
||||
else {
|
||||
const Arc2* arc2 = boost::get<Arc2>( &A1 );
|
||||
const Arc2* arc2 = std::get_if<Arc2>( &A1 );
|
||||
return CircularKernel().compare_y_at_x_2_object()(p, *arc2);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <class CircularKernel>
|
||||
class Variant_Do_overlap_2 : public boost::static_visitor<bool>
|
||||
class Variant_Do_overlap_2
|
||||
{
|
||||
public:
|
||||
template < typename T >
|
||||
|
|
@ -229,10 +228,10 @@ namespace CGAL {
|
|||
typedef bool result_type;
|
||||
|
||||
result_type
|
||||
operator()(const boost::variant< Arc1, Arc2 > &A0,
|
||||
const boost::variant< Arc1, Arc2 > &A1) const
|
||||
operator()(const std::variant< Arc1, Arc2 > &A0,
|
||||
const std::variant< Arc1, Arc2 > &A1) const
|
||||
{
|
||||
return boost::apply_visitor
|
||||
return std::visit
|
||||
( Variant_Do_overlap_2<CircularKernel>(), A0, A1 );
|
||||
}
|
||||
};
|
||||
|
|
@ -248,23 +247,17 @@ namespace CGAL {
|
|||
|
||||
template < class OutputIterator,class Not_X_Monotone >
|
||||
OutputIterator
|
||||
operator()(const boost::variant<Arc1, Arc2, Not_X_Monotone> &A,
|
||||
operator()(const std::variant<Arc1, Arc2, Not_X_Monotone> &A,
|
||||
OutputIterator res) const
|
||||
{
|
||||
if ( const Arc1* arc1 = boost::get<Arc1>( &A ) ) {
|
||||
std::vector<CGAL::Object> container;
|
||||
CircularKernel().
|
||||
make_x_monotone_2_object()(*arc1,std::back_inserter(container));
|
||||
return object_to_object_variant<CircularKernel, Arc1, Arc2>
|
||||
(container, res);
|
||||
if ( const Arc1* arc1 = std::get_if<Arc1>( &A ) ) {
|
||||
return CircularKernel().
|
||||
make_x_monotone_2_object()(*arc1, res);
|
||||
}
|
||||
else {
|
||||
const Arc2* arc2 = boost::get<Arc2>( &A );
|
||||
std::vector<CGAL::Object> container;
|
||||
CircularKernel().
|
||||
make_x_monotone_2_object()(*arc2,std::back_inserter(container));
|
||||
return object_to_object_variant<CircularKernel, Arc1, Arc2>
|
||||
(container, res);
|
||||
const Arc2* arc2 = std::get_if<Arc2>( &A );
|
||||
return CircularKernel().
|
||||
make_x_monotone_2_object()(*arc2, res);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -278,23 +271,23 @@ namespace CGAL {
|
|||
|
||||
template < class OutputIterator >
|
||||
OutputIterator
|
||||
operator()(const boost::variant< Arc1, Arc2 > &c1,
|
||||
const boost::variant< Arc1, Arc2 > &c2,
|
||||
operator()(const std::variant< Arc1, Arc2 > &c1,
|
||||
const std::variant< Arc1, Arc2 > &c2,
|
||||
OutputIterator oi) const
|
||||
{
|
||||
if ( const Arc1* arc1 = boost::get<Arc1>( &c1 ) ){
|
||||
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
|
||||
if ( const Arc1* arc1 = std::get_if<Arc1>( &c1 ) ){
|
||||
if ( const Arc1* arc2 = std::get_if<Arc1>( &c2 ) ){
|
||||
return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
|
||||
}
|
||||
const Arc2* arc2 = boost::get<Arc2>( &c2 );
|
||||
const Arc2* arc2 = std::get_if<Arc2>( &c2 );
|
||||
return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
|
||||
}
|
||||
|
||||
const Arc2* arc1e = boost::get<Arc2>( &c1 );
|
||||
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
|
||||
const Arc2* arc1e = std::get_if<Arc2>( &c1 );
|
||||
if ( const Arc1* arc2 = std::get_if<Arc1>( &c2 ) ){
|
||||
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
|
||||
}
|
||||
const Arc2* arc2 = boost::get<Arc2>( &c2 );
|
||||
const Arc2* arc2 = std::get_if<Arc2>( &c2 );
|
||||
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
|
||||
}
|
||||
|
||||
|
|
@ -309,13 +302,13 @@ namespace CGAL {
|
|||
Circular_arc_point_2;
|
||||
typedef void result_type;
|
||||
result_type
|
||||
operator()(const boost::variant< Arc1, Arc2 > &A,
|
||||
operator()(const std::variant< Arc1, Arc2 > &A,
|
||||
const Circular_arc_point_2 &p,
|
||||
boost::variant< Arc1, Arc2 > &ca1,
|
||||
boost::variant< Arc1, Arc2 > &ca2) const
|
||||
std::variant< Arc1, Arc2 > &ca1,
|
||||
std::variant< Arc1, Arc2 > &ca2) const
|
||||
{
|
||||
// TODO : optimize by extracting the references from the variants ?
|
||||
if ( const Arc1* arc1 = boost::get<Arc1>( &A ) ){
|
||||
if ( const Arc1* arc1 = std::get_if<Arc1>( &A ) ){
|
||||
Arc1 carc1;
|
||||
Arc1 carc2;
|
||||
CircularKernel().split_2_object()(*arc1, p, carc1, carc2);
|
||||
|
|
@ -325,7 +318,7 @@ namespace CGAL {
|
|||
|
||||
}
|
||||
else{
|
||||
const Arc2* arc2 = boost::get<Arc2>( &A );
|
||||
const Arc2* arc2 = std::get_if<Arc2>( &A );
|
||||
Arc2 cline1;
|
||||
Arc2 cline2;
|
||||
CircularKernel().split_2_object()(*arc2, p, cline1, cline2);
|
||||
|
|
@ -340,8 +333,6 @@ namespace CGAL {
|
|||
|
||||
template <class CircularKernel>
|
||||
class Variant_Construct_min_vertex_2
|
||||
: public boost::static_visitor
|
||||
<const typename CircularKernel::Circular_arc_point_2&>
|
||||
{
|
||||
typedef typename CircularKernel::Circular_arc_point_2
|
||||
Circular_arc_point_2;
|
||||
|
|
@ -372,9 +363,9 @@ namespace CGAL {
|
|||
|
||||
//std::remove_reference_t<qualified_result_type>
|
||||
result_type
|
||||
operator() (const boost::variant< Arc1, Arc2 > & cv) const
|
||||
operator() (const std::variant< Arc1, Arc2 > & cv) const
|
||||
{
|
||||
return boost::apply_visitor
|
||||
return std::visit
|
||||
( Variant_Construct_min_vertex_2<CircularKernel>(), cv );
|
||||
}
|
||||
};
|
||||
|
|
@ -385,8 +376,6 @@ namespace CGAL {
|
|||
|
||||
template <class CircularKernel>
|
||||
class Variant_Construct_max_vertex_2
|
||||
: public boost::static_visitor<const typename
|
||||
CircularKernel::Circular_arc_point_2&>
|
||||
{
|
||||
typedef typename CircularKernel::Circular_arc_point_2
|
||||
Circular_arc_point_2;
|
||||
|
|
@ -422,16 +411,15 @@ namespace CGAL {
|
|||
|
||||
//std::remove_reference<qualified_result_type>
|
||||
result_type
|
||||
operator() (const boost::variant< Arc1, Arc2 > & cv) const
|
||||
operator() (const std::variant< Arc1, Arc2 > & cv) const
|
||||
{
|
||||
return boost::apply_visitor
|
||||
return std::visit
|
||||
( Variant_Construct_max_vertex_2<CircularKernel>(), cv );
|
||||
}
|
||||
};
|
||||
|
||||
template <class CircularKernel>
|
||||
class Variant_Is_vertical_2
|
||||
: public boost::static_visitor<bool>
|
||||
{
|
||||
public :
|
||||
|
||||
|
|
@ -449,9 +437,9 @@ namespace CGAL {
|
|||
public:
|
||||
typedef bool result_type;
|
||||
|
||||
bool operator() (const boost::variant< Arc1, Arc2 >& cv) const
|
||||
bool operator() (const std::variant< Arc1, Arc2 >& cv) const
|
||||
{
|
||||
return boost::apply_visitor
|
||||
return std::visit
|
||||
( Variant_Is_vertical_2<CircularKernel>(), cv );
|
||||
}
|
||||
};
|
||||
|
|
@ -459,7 +447,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
|
||||
// a empty class used to have different types between Curve_2 and X_monotone_curve_2
|
||||
// an empty class used to have different types between Curve_2 and X_monotone_curve_2
|
||||
// in Arr_circular_line_arc_traits_2.
|
||||
namespace internal_Argt_traits{
|
||||
struct Not_X_Monotone{};
|
||||
|
|
@ -499,8 +487,8 @@ namespace CGAL {
|
|||
|
||||
typedef internal_Argt_traits::Not_X_Monotone Not_X_Monotone;
|
||||
|
||||
typedef boost::variant< Arc1, Arc2, Not_X_Monotone > Curve_2;
|
||||
typedef boost::variant< Arc1, Arc2 > X_monotone_curve_2;
|
||||
typedef std::variant< Arc1, Arc2, Not_X_Monotone > Curve_2;
|
||||
typedef std::variant< Arc1, Arc2 > X_monotone_curve_2;
|
||||
|
||||
private:
|
||||
CircularKernel ck;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/math/constants/constants.hpp>
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
|
|
@ -863,8 +862,6 @@ public:
|
|||
*/
|
||||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const {
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
auto ctr_xcv = m_traits.construct_x_monotone_curve_2_object();
|
||||
|
||||
|
|
@ -878,7 +875,7 @@ public:
|
|||
auto n_vtan_ps = m_traits.vertical_tangency_points(cv, vtan_ps);
|
||||
if (n_vtan_ps == 0) {
|
||||
// In case the given curve is already x-monotone:
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, conic_id));
|
||||
*oi++ = ctr_xcv(cv, conic_id);
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -890,19 +887,15 @@ public:
|
|||
// In case the curve is a full conic, split it into two x-monotone
|
||||
// arcs, one going from ps[0] to ps[1], and the other from ps[1] to
|
||||
// ps[0].
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], vtan_ps[1],
|
||||
conic_id));
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[1], vtan_ps[0],
|
||||
conic_id));
|
||||
*oi++ = ctr_xcv(cv, vtan_ps[0], vtan_ps[1], conic_id);
|
||||
*oi++ = ctr_xcv(cv, vtan_ps[1], vtan_ps[0], conic_id);
|
||||
}
|
||||
else {
|
||||
if (n_vtan_ps == 1) {
|
||||
// Split the arc into two x-monotone sub-curves: one going from the
|
||||
// arc source to ps[0], and the other from ps[0] to the target.
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, cv.source(), vtan_ps[0],
|
||||
conic_id));
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], cv.target(),
|
||||
conic_id));
|
||||
*oi++ = ctr_xcv(cv, cv.source(), vtan_ps[0], conic_id);
|
||||
*oi++ = ctr_xcv(cv, vtan_ps[0], cv.target(), conic_id);
|
||||
}
|
||||
else {
|
||||
CGAL_assertion(n_vtan_ps == 2);
|
||||
|
|
@ -932,16 +925,16 @@ public:
|
|||
}
|
||||
|
||||
// Split the arc into three x-monotone sub-curves.
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, cv.source(),
|
||||
vtan_ps[ind_first],
|
||||
conic_id));
|
||||
*oi++ = ctr_xcv(cv, cv.source(),
|
||||
vtan_ps[ind_first],
|
||||
conic_id);
|
||||
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_first],
|
||||
vtan_ps[ind_second],
|
||||
conic_id));
|
||||
*oi++ = ctr_xcv(cv, vtan_ps[ind_first],
|
||||
vtan_ps[ind_second],
|
||||
conic_id);
|
||||
|
||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_second],
|
||||
cv.target(), conic_id));
|
||||
*oi++ = ctr_xcv(cv, vtan_ps[ind_second],
|
||||
cv.target(), conic_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1315,17 +1308,15 @@ public:
|
|||
OutputIterator intersect(const X_monotone_curve_2& xcv1,
|
||||
const X_monotone_curve_2& xcv2,
|
||||
Intersection_map& inter_map,
|
||||
OutputIterator oi) const {
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
OutputIterator oi) const
|
||||
{
|
||||
if (m_traits.has_same_supporting_conic(xcv1, xcv2)) {
|
||||
// Check for overlaps between the two arcs.
|
||||
X_monotone_curve_2 overlap;
|
||||
|
||||
if (compute_overlap(xcv1, xcv2, overlap)) {
|
||||
// There can be just a single overlap between two x-monotone arcs:
|
||||
*oi++ = Intersection_result(overlap);
|
||||
*oi++ = overlap;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -1338,22 +1329,22 @@ public:
|
|||
auto eq = alg_kernel->equal_2_object();
|
||||
if (eq(xcv1.left(), xcv2.left())) {
|
||||
Intersection_point ip(xcv1.left(), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
|
||||
if (eq(xcv1.right(), xcv2.right())) {
|
||||
Intersection_point ip(xcv1.right(), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
|
||||
if (eq(xcv1.left(), xcv2.right())) {
|
||||
Intersection_point ip(xcv1.left(), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
|
||||
if (eq(xcv1.right(), xcv2.left())) {
|
||||
Intersection_point ip(xcv1.right(), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
|
||||
return oi;
|
||||
|
|
@ -1396,7 +1387,7 @@ public:
|
|||
if (m_traits.is_between_endpoints(xcv1, (*iter).first) &&
|
||||
m_traits.is_between_endpoints(xcv2, (*iter).first))
|
||||
{
|
||||
*oi++ = Intersection_result(*iter);
|
||||
*oi++ = *iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <list>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -126,9 +126,9 @@ public:
|
|||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Point_2, Base_x_monotone_curve_2>
|
||||
typedef std::variant<Point_2, Base_x_monotone_curve_2>
|
||||
Base_make_x_monotone_result;
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
// Make the original curve x-monotone.
|
||||
|
|
@ -138,12 +138,12 @@ public:
|
|||
// Attach the data to each of the resulting x-monotone curves.
|
||||
X_monotone_curve_data xdata = Convert()(cv.data());
|
||||
for (const auto& base_obj : base_objects) {
|
||||
if (const auto* bxcv = boost::get<Base_x_monotone_curve_2>(&base_obj)) {
|
||||
if (const auto* bxcv = std::get_if<Base_x_monotone_curve_2>(&base_obj)) {
|
||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(*bxcv, xdata));
|
||||
continue;
|
||||
}
|
||||
// Current object is an isolated point: Leave it as is.
|
||||
const auto* bp = boost::get<Point_2>(&base_obj);
|
||||
const auto* bp = std::get_if<Point_2>(&base_obj);
|
||||
CGAL_assertion(bp);
|
||||
*oi++ = Make_x_monotone_result(*bp);
|
||||
}
|
||||
|
|
@ -208,9 +208,7 @@ public:
|
|||
OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
typedef boost::variant<Intersection_point, Base_x_monotone_curve_2>
|
||||
typedef std::variant<Intersection_point, Base_x_monotone_curve_2>
|
||||
Intersection_base_result;
|
||||
|
||||
// Use the base functor to obtain all intersection objects.
|
||||
|
|
@ -223,19 +221,19 @@ public:
|
|||
// Go over all intersection objects and prepare the output.
|
||||
for (const auto& item : base_objects) {
|
||||
const Base_x_monotone_curve_2* base_cv =
|
||||
boost::get<Base_x_monotone_curve_2>(&item);
|
||||
std::get_if<Base_x_monotone_curve_2>(&item);
|
||||
if (base_cv != nullptr) {
|
||||
// The current intersection object is an overlapping x-monotone
|
||||
// curve: Merge the data fields of both intersecting curves and
|
||||
// associate the result with the overlapping curve.
|
||||
X_monotone_curve_2 cv(*base_cv, Merge()(cv1.data(), cv2.data()));
|
||||
*oi++ = Intersection_result(cv);
|
||||
*oi++ = cv;
|
||||
continue;
|
||||
}
|
||||
// The current intersection object is an intersection point:
|
||||
// Copy it as is.
|
||||
const Intersection_point* ip = boost::get<Intersection_point>(&item);
|
||||
*oi++ = Intersection_result(*ip);
|
||||
const Intersection_point* ip = std::get_if<Intersection_point>(&item);
|
||||
*oi++ = *ip;
|
||||
}
|
||||
|
||||
return oi;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/Cartesian.h>
|
||||
|
|
@ -2063,7 +2063,7 @@ public:
|
|||
*/
|
||||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& c, OutputIterator oi) const {
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
// std::cout << "full: " << c.is_full() << std::endl;
|
||||
// std::cout << "vert: " << c.is_vertical() << std::endl;
|
||||
|
|
@ -2321,8 +2321,7 @@ public:
|
|||
OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
const Kernel& kernel = m_traits;
|
||||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||
|
||||
|
|
@ -2337,14 +2336,14 @@ public:
|
|||
if (equal(l1, r1)) {
|
||||
bool is_full = equal(l2, r2);
|
||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true, is_full);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
if (equal(l2, r2)) {
|
||||
CGAL_assertion(! equal(l1, r1)); // already handled above
|
||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2358,19 +2357,19 @@ public:
|
|||
// 5. l1 = r2 < r1 < l2 = l1 | One overlap (handled above)
|
||||
if (in_between(r1, r2, l2)) {
|
||||
// Case 1.
|
||||
*oi++ = Intersection_result(Intersection_point(l1_3, 1));
|
||||
*oi++ = Intersection_point(l1_3, 1);
|
||||
return oi;
|
||||
}
|
||||
if (equal(r1, l2)) {
|
||||
// Case 2.
|
||||
*oi++ = Intersection_result(Intersection_point(l1_3, 1));
|
||||
*oi++ = Intersection_result(Intersection_point(l2_3, 1));
|
||||
*oi++ = Intersection_point(l1_3, 1);
|
||||
*oi++ = Intersection_point(l2_3, 1);
|
||||
return oi;
|
||||
}
|
||||
CGAL_assertion(in_between(r1, l2, r2));
|
||||
// Case 3.
|
||||
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2383,12 +2382,12 @@ public:
|
|||
// 5. l1 < l1 = r1 = l2 < r2 | One overlap (handled above)
|
||||
if (in_between(r2, r1, l1)) {
|
||||
// Case 1.
|
||||
*oi++ = Intersection_result(Intersection_point(l2_3, 1));
|
||||
*oi++ = Intersection_point(l2_3, 1);
|
||||
return oi;
|
||||
}
|
||||
// Case 3.
|
||||
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2400,13 +2399,13 @@ public:
|
|||
if (in_between(r1, l2, r2) || equal(r1, r2)) {
|
||||
// Cases 1 & 2
|
||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
// Case 3
|
||||
CGAL_assertion(in_between(r2, l2, r1));
|
||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2418,13 +2417,13 @@ public:
|
|||
if (in_between(l1, r2, l2)) {
|
||||
// Cases 1
|
||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
// Case 3
|
||||
CGAL_assertion(in_between(l1, l2, l2));
|
||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2442,12 +2441,12 @@ public:
|
|||
if (in_between(l2, r2, l1)) {
|
||||
// Case 2
|
||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
// Case 3
|
||||
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2457,12 +2456,12 @@ public:
|
|||
// Case 4
|
||||
if (in_between(l1, r1, l2)) {
|
||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
// Case 5
|
||||
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
||||
*oi++ = Intersection_result(xc);
|
||||
*oi++ = xc;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2560,8 +2559,6 @@ public:
|
|||
typedef typename Kernel::Equal_3 Equal_3;
|
||||
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
const Kernel& kernel = m_traits;
|
||||
|
||||
|
|
@ -2584,9 +2581,9 @@ public:
|
|||
(res && (xc1.is_directed_right() != xc2.is_directed_right())))
|
||||
{
|
||||
if (xc1.left().is_min_boundary() && xc2.left().is_min_boundary())
|
||||
*oi++ = Intersection_result(Intersection_point(xc1.left(), 1));
|
||||
*oi++ = Intersection_point(xc1.left(), 1);
|
||||
if (xc1.right().is_max_boundary() && xc2.right().is_max_boundary())
|
||||
*oi++ = Intersection_result(Intersection_point(xc1.right(), 1));
|
||||
*oi++ = Intersection_point(xc1.right(), 1);
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -2594,11 +2591,11 @@ public:
|
|||
* the other arc is completely overlapping.
|
||||
*/
|
||||
if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) {
|
||||
*oi++ = Intersection_result(xc2);
|
||||
*oi++ = xc2;
|
||||
return oi;
|
||||
}
|
||||
if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) {
|
||||
*oi++ = Intersection_result(xc1);
|
||||
*oi++ = xc1;
|
||||
return oi;
|
||||
}
|
||||
/*! Find an endpoint that does not coincide with a pole, and project
|
||||
|
|
@ -2646,12 +2643,12 @@ public:
|
|||
// Observe that xc1 and xc2 may share two endpoints.
|
||||
Point_2 ed = m_traits.construct_point_2_object()(v.direction());
|
||||
if (is_in_between(ed, xc1) && is_in_between(ed, xc2))
|
||||
*oi++ = Intersection_result(Intersection_point(ed, 1));
|
||||
*oi++ = Intersection_point(ed, 1);
|
||||
|
||||
Vector_3 vo(kernel.construct_opposite_vector_3_object()(v));
|
||||
Point_2 edo = m_traits.construct_point_2_object()(vo.direction());
|
||||
if (is_in_between(edo, xc1) && is_in_between(edo, xc2))
|
||||
*oi++ = Intersection_result(Intersection_point(edo, 1));
|
||||
*oi++ = Intersection_point(edo, 1);
|
||||
|
||||
return oi;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ public:
|
|||
* intersection or a plane in case plane1 and plane2 coincide.
|
||||
*/
|
||||
template <typname Kernel>
|
||||
boost::variant<typename Kernel::Line_3, Arr_plane_3<Kernel> >
|
||||
std::variant<typename Kernel::Line_3, Arr_plane_3<Kernel> >
|
||||
intersect(const Arr_plane_3<Kernel> & plane1,
|
||||
const Arr_plane_3<Kernel> & plane2)
|
||||
{
|
||||
|
|
@ -209,7 +209,7 @@ intersect(const Arr_plane_3<Kernel> & plane1,
|
|||
typedef typename Kernel::Direction_3 Direction_3;
|
||||
typedef typename Kernel::Line_3 Line_3;
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef boost::variant<Line_3, Arr_plane_3<Kernel> > Intersection_result;
|
||||
typedef std::variant<Line_3, Arr_plane_3<Kernel> > Intersection_result;
|
||||
|
||||
// We know that the plane goes through the origin
|
||||
const FT& a1 = plane1.a();
|
||||
|
|
|
|||
|
|
@ -1264,22 +1264,22 @@ private:
|
|||
Control_points aux_vec;
|
||||
|
||||
auto res1 = f_intersect(skew1a, skew2a);
|
||||
const Point_2* p1 = boost::get<Point_2>(&*res1);
|
||||
const Point_2* p1 = std::get_if<Point_2>(&*res1);
|
||||
if (! p1) CGAL_error();
|
||||
aux_vec.push_back(*p1);
|
||||
|
||||
auto res2 = f_intersect(skew1a, skew2b);
|
||||
const Point_2* p2 = boost::get<Point_2>(&*res2);
|
||||
const Point_2* p2 = std::get_if<Point_2>(&*res2);
|
||||
if (! p2) CGAL_error();
|
||||
aux_vec.push_back(*p2);
|
||||
|
||||
auto res3 = f_intersect(skew1b, skew2a);
|
||||
const Point_2* p3 = boost::get<Point_2>(&*res3);
|
||||
const Point_2* p3 = std::get_if<Point_2>(&*res3);
|
||||
if (! p3) CGAL_error();
|
||||
aux_vec.push_back(*p3);
|
||||
|
||||
auto res4 = f_intersect (skew1b, skew2b);
|
||||
const Point_2* p4 = boost::get<Point_2>(&*res4);
|
||||
const Point_2* p4 = std::get_if<Point_2>(&*res4);
|
||||
if (! p4) CGAL_error();
|
||||
aux_vec.push_back(*p4);
|
||||
|
||||
|
|
|
|||
|
|
@ -318,13 +318,11 @@ public:
|
|||
Bezier_cache& cache,
|
||||
OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Intersection_point, Self> Intersection_result;
|
||||
|
||||
// In case we have two x-monotone subcurves of the same Bezier curve,
|
||||
// check if they have a common left endpoint.
|
||||
if (_curve.is_same(cv._curve)) {
|
||||
if (left().is_same(cv.left()) || left().is_same(cv.right()))
|
||||
*oi++ = Intersection_result(Intersection_point(left(), 0));
|
||||
*oi++ = Intersection_point(left(), 0);
|
||||
}
|
||||
|
||||
// Compute the intersections of the two sucurves. Note that for caching
|
||||
|
|
@ -341,7 +339,7 @@ public:
|
|||
|
||||
// In case of overlap, just report the overlapping subcurve.
|
||||
if (do_ovlp) {
|
||||
*oi++ = Intersection_result(ovlp_cv);
|
||||
*oi++ = ovlp_cv;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -349,14 +347,14 @@ public:
|
|||
// xy-lexicorgraphical order, and insert them to the output iterator.
|
||||
std::sort(ipts.begin(), ipts.end(), Less_intersection_point(cache));
|
||||
for (auto ip_it = ipts.begin(); ip_it != ipts.end(); ++ip_it) {
|
||||
*oi++ = Intersection_result(*ip_it);
|
||||
*oi++ = *ip_it;
|
||||
}
|
||||
|
||||
// In case we have two x-monotone subcurves of the same Bezier curve,
|
||||
// check if they have a common right endpoint.
|
||||
if (_curve.is_same(cv._curve)) {
|
||||
if (right().is_same(cv.left()) || right().is_same(cv.right())) {
|
||||
*oi++ = Intersection_result(Intersection_point(right(), 0));
|
||||
*oi++ = Intersection_point(right(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -995,9 +995,6 @@ public:
|
|||
OutputIterator intersect(const Self& cv, OutputIterator oi,
|
||||
Intersection_map* inter_map = nullptr) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, Self> Intersection_result;
|
||||
|
||||
// First check whether the two arcs have the same supporting curve.
|
||||
if (has_same_supporting_curve(cv)) {
|
||||
// Check for overlaps between the two arcs.
|
||||
|
|
@ -1005,7 +1002,7 @@ public:
|
|||
|
||||
if (_compute_overlap(cv, overlap)) {
|
||||
// There can be just a single overlap between two x-monotone arcs:
|
||||
*oi++ = Intersection_result(overlap);
|
||||
*oi++ = overlap;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -1016,11 +1013,11 @@ public:
|
|||
// intersection points we report.
|
||||
Multiplicity mult = 0;
|
||||
if (left().equals(cv.left()) || left().equals(cv.right())) {
|
||||
*oi++ = Intersection_result(std::make_pair(left(), mult));
|
||||
*oi++ = std::make_pair(left(), mult);
|
||||
}
|
||||
|
||||
if (right().equals(cv.right()) || right().equals(cv.left())) {
|
||||
*oi++ = Intersection_result(std::make_pair(right(), mult));
|
||||
*oi++ = std::make_pair(right(), mult);
|
||||
}
|
||||
|
||||
return oi;
|
||||
|
|
@ -1072,7 +1069,7 @@ public:
|
|||
if (this->_is_between_endpoints (iter->first) &&
|
||||
cv._is_between_endpoints (iter->first))
|
||||
{
|
||||
*oi++ = Intersection_result(*iter);
|
||||
*oi++ = *iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public:
|
|||
template <typename OutputIterator>
|
||||
OutputIterator operator()(const Curve_2& line, OutputIterator oi) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2> Make_x_monotone_result;
|
||||
typedef std::variant<Point_2, X_monotone_curve_2> Make_x_monotone_result;
|
||||
*oi++ = Make_x_monotone_result(line);
|
||||
return oi;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/intersections.h>
|
||||
|
|
@ -1249,7 +1249,7 @@ public:
|
|||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||
{
|
||||
// Wrap the segment with a variant.
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
*oi++ = Make_x_monotone_result(cv);
|
||||
return oi;
|
||||
|
|
@ -1326,8 +1326,6 @@ public:
|
|||
OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
CGAL_precondition(! cv1.is_degenerate());
|
||||
CGAL_precondition(! cv2.is_degenerate());
|
||||
|
|
@ -1340,7 +1338,7 @@ public:
|
|||
if (! res) return oi;
|
||||
|
||||
// Check whether we have a single intersection point.
|
||||
const Point_2* ip = boost::get<Point_2>(&*res);
|
||||
const Point_2* ip = std::get_if<Point_2>(&*res);
|
||||
if (ip != nullptr) {
|
||||
// Check whether the intersection point ip lies on both segments.
|
||||
const bool ip_on_cv1 = cv1.is_vertical() ?
|
||||
|
|
@ -1354,7 +1352,7 @@ public:
|
|||
// Create a pair representing the point with its multiplicity,
|
||||
// which is always 1 for line segments.
|
||||
Intersection_point ip_mult(*ip, 1);
|
||||
*oi++ = Intersection_result(ip_mult);
|
||||
*oi++ = ip_mult;
|
||||
}
|
||||
}
|
||||
return oi;
|
||||
|
|
@ -1398,14 +1396,14 @@ public:
|
|||
|
||||
if (cmp_res == SMALLER) {
|
||||
// We have discovered a true overlapping subcurve:
|
||||
*oi++ = Intersection_result(ovlp);
|
||||
*oi++ = ovlp;
|
||||
}
|
||||
else if (cmp_res == EQUAL) {
|
||||
// The two objects have the same supporting line, but they just share
|
||||
// a common endpoint. Thus we have an intersection point, but we leave
|
||||
// the multiplicity of this point undefined.
|
||||
Intersection_point ip_mult(ovlp.left(), 0);
|
||||
*oi++ = Intersection_result(ip_mult);
|
||||
*oi++ = ip_mult;
|
||||
}
|
||||
|
||||
return oi;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
* functors required by the concept it models.
|
||||
*/
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -131,7 +131,7 @@ public:
|
|||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||
{
|
||||
// Wrap the segment with a variant.
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
*oi++ = Make_x_monotone_result(cv);
|
||||
return oi;
|
||||
|
|
@ -224,8 +224,6 @@ public:
|
|||
OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
const Kernel& kernel = m_traits;
|
||||
auto res = kernel.intersect_2_object()(cv1, cv2);
|
||||
|
|
@ -234,19 +232,19 @@ public:
|
|||
if (! res) return oi;
|
||||
|
||||
// Check if the intersection is a point:
|
||||
const Point_2* p_p = boost::get<Point_2>(&*res);
|
||||
const Point_2* p_p = std::get_if<Point_2>(&*res);
|
||||
if (p_p != nullptr) {
|
||||
// Create a pair representing the point with its multiplicity,
|
||||
// which is always 1 for line segments for all practical purposes.
|
||||
// If the two segments intersect at their endpoints, then the
|
||||
// multiplicity is undefined, but we deliberately ignore it for
|
||||
// efficiency reasons.
|
||||
*oi++ = Intersection_result(Intersection_point(*p_p, 1));
|
||||
*oi++ = Intersection_point(*p_p, 1);
|
||||
return oi;
|
||||
}
|
||||
|
||||
// The intersection is a segment.
|
||||
const X_monotone_curve_2* cv_p = boost::get<X_monotone_curve_2>(&*res);
|
||||
const X_monotone_curve_2* cv_p = std::get_if<X_monotone_curve_2>(&*res);
|
||||
CGAL_assertion(cv_p != nullptr);
|
||||
|
||||
Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1);
|
||||
|
|
@ -257,11 +255,11 @@ public:
|
|||
// in the overlap segment
|
||||
if (m_traits.compare_endpoints_xy_2_object()(*cv_p) != cmp1) {
|
||||
auto ctr_opposite = kernel.construct_opposite_segment_2_object();
|
||||
*oi++ = Intersection_result(ctr_opposite(*cv_p));
|
||||
*oi++ = ctr_opposite(*cv_p);
|
||||
return oi;
|
||||
}
|
||||
}
|
||||
*oi++ = Intersection_result(*cv_p);
|
||||
*oi++ = *cv_p;
|
||||
return oi;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <boost/optional/optional.hpp>
|
||||
#include <optional>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
|
@ -231,7 +231,7 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
|||
xcvs_vec[i] = Ovl_x_monotone_curve_2(eit2->curve(), invalid_he1, he2);
|
||||
}
|
||||
|
||||
// Obtain a extended traits-class object and define the sweep-line visitor.
|
||||
// Obtain an extended traits-class object and define the sweep-line visitor.
|
||||
const typename Arr_res::Traits_adaptor_2* traits_adaptor =
|
||||
arr.traits_adaptor();
|
||||
|
||||
|
|
@ -284,8 +284,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
|||
if (vit1->is_isolated()) {
|
||||
typename Arr_a::Vertex_const_handle v1 = vit1;
|
||||
pts_vec[i++] =
|
||||
Ovl_point_2(vit1->point(), boost::make_optional(Cell_handle_red(v1)),
|
||||
boost::optional<Cell_handle_blue>());
|
||||
Ovl_point_2(vit1->point(), std::make_optional(Cell_handle_red(v1)),
|
||||
std::optional<Cell_handle_blue>());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -294,8 +294,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
|||
if (vit2->is_isolated()) {
|
||||
typename Arr_b::Vertex_const_handle v2 = vit2;
|
||||
pts_vec[i++] =
|
||||
Ovl_point_2(vit2->point(), boost::optional<Cell_handle_red>(),
|
||||
boost::make_optional(Cell_handle_blue(v2)));
|
||||
Ovl_point_2(vit2->point(), std::optional<Cell_handle_red>(),
|
||||
std::make_optional(Cell_handle_blue(v2)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/*! Obtain a Equal_2 function object. */
|
||||
/*! Obtain an `Equal_2` function object. */
|
||||
Equal_2 equal_2_object() const
|
||||
{ return (Equal_2(m_base_traits->equal_2_object())); }
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
#include <CGAL/Arr_point_location_result.h>
|
||||
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ Arr_trapezoid_ric_point_location<Arrangement_2>::locate(const Point_2& p) const
|
|||
case TD::POINT:
|
||||
{
|
||||
//p is interior so it should fall on Td_active_vertex
|
||||
Td_active_vertex& v (boost::get<Td_active_vertex>(tr));
|
||||
Td_active_vertex& v (std::get<Td_active_vertex>(tr));
|
||||
CGAL_TRAP_PRINT_DEBUG("POINT");
|
||||
CGAL_assertion(!v.vertex()->is_at_open_boundary());
|
||||
return make_result(v.vertex());
|
||||
|
|
@ -84,7 +84,7 @@ Arr_trapezoid_ric_point_location<Arrangement_2>::locate(const Point_2& p) const
|
|||
|
||||
case TD::CURVE:
|
||||
{
|
||||
Td_active_edge& e (boost::get<Td_active_edge>(tr));
|
||||
Td_active_edge& e (std::get<Td_active_edge>(tr));
|
||||
Halfedge_const_handle h = e.halfedge();
|
||||
CGAL_TRAP_PRINT_DEBUG("CURVE");
|
||||
if ( m_traits->is_in_x_range_2_object()(h->curve(),p) &&
|
||||
|
|
@ -100,7 +100,7 @@ Arr_trapezoid_ric_point_location<Arrangement_2>::locate(const Point_2& p) const
|
|||
|
||||
case TD::TRAPEZOID:
|
||||
{
|
||||
Td_active_trapezoid t (boost::get<Td_active_trapezoid>(tr));
|
||||
Td_active_trapezoid t (std::get<Td_active_trapezoid>(tr));
|
||||
Halfedge_const_handle h = t.top();
|
||||
CGAL_TRAP_PRINT_DEBUG("TRAPEZOID");
|
||||
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p))
|
||||
|
|
@ -160,7 +160,7 @@ Arr_trapezoid_ric_point_location<Arrangement>::
|
|||
_get_unbounded_face(const Td_map_item& item,const Point_2& p,
|
||||
Arr_not_all_sides_oblivious_tag) const
|
||||
{
|
||||
Td_active_trapezoid tr (boost::get<Td_active_trapezoid>(item));
|
||||
Td_active_trapezoid tr (std::get<Td_active_trapezoid>(item));
|
||||
// Halfedge_const_handle h = tr.top();
|
||||
if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) {
|
||||
//if one of top or bottom edges is defined
|
||||
|
|
@ -184,13 +184,13 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p,
|
|||
Td_map_item& left_v_item = td.locate(tr.left(),td_lt);
|
||||
CGAL_assertion(td_lt == TD::POINT);
|
||||
Halfedge_const_handle he;
|
||||
if (boost::get<Td_active_vertex>(&left_v_item) != nullptr) {
|
||||
Td_active_vertex v(boost::get<Td_active_vertex>(left_v_item));
|
||||
if (std::get_if<Td_active_vertex>(&left_v_item) != nullptr) {
|
||||
Td_active_vertex v(std::get<Td_active_vertex>(left_v_item));
|
||||
he = v.cw_he();
|
||||
}
|
||||
else {
|
||||
Td_active_fictitious_vertex
|
||||
v(boost::get<Td_active_fictitious_vertex>(left_v_item));
|
||||
v(std::get<Td_active_fictitious_vertex>(left_v_item));
|
||||
he = v.cw_he();
|
||||
}
|
||||
//cw_he() holds the "smallest" curve clockwise starting from 12 o'clock
|
||||
|
|
@ -216,13 +216,13 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p,
|
|||
Td_map_item& right_v_item = td.locate(tr.right(),td_lt);
|
||||
CGAL_assertion(td_lt == TD::POINT);
|
||||
Halfedge_const_handle he;
|
||||
if (boost::get<Td_active_vertex>(&right_v_item)!= nullptr) {
|
||||
Td_active_vertex v(boost::get<Td_active_vertex>(right_v_item));
|
||||
if (std::get_if<Td_active_vertex>(&right_v_item)!= nullptr) {
|
||||
Td_active_vertex v(std::get<Td_active_vertex>(right_v_item));
|
||||
he = v.cw_he();
|
||||
}
|
||||
else {
|
||||
Td_active_fictitious_vertex
|
||||
v(boost::get<Td_active_fictitious_vertex>(right_v_item));
|
||||
v(std::get<Td_active_fictitious_vertex>(right_v_item));
|
||||
he = v.cw_he();
|
||||
}
|
||||
//its cw_he() holds the "smallest" curve clockwise starting from
|
||||
|
|
@ -270,13 +270,13 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const
|
|||
case TD::POINT:
|
||||
{
|
||||
//p fell on Td_active_vertex
|
||||
Td_active_vertex& v (boost::get<Td_active_vertex>(item));
|
||||
Td_active_vertex& v (std::get<Td_active_vertex>(item));
|
||||
return (make_result(v.vertex()));
|
||||
}
|
||||
break;
|
||||
case TD::CURVE:
|
||||
{
|
||||
Td_active_edge& e (boost::get<Td_active_edge>(item));
|
||||
Td_active_edge& e (std::get<Td_active_edge>(item));
|
||||
Halfedge_const_handle h = e.halfedge();
|
||||
|
||||
if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) ||
|
||||
|
|
@ -289,7 +289,7 @@ _vertical_ray_shoot(const Point_2& p, bool shoot_up) const
|
|||
break;
|
||||
case TD::TRAPEZOID:
|
||||
{
|
||||
Td_active_trapezoid trpz (boost::get<Td_active_trapezoid>(item));
|
||||
Td_active_trapezoid trpz (std::get<Td_active_trapezoid>(item));
|
||||
Halfedge_const_handle h = (shoot_up) ? trpz.top() : trpz.bottom();
|
||||
|
||||
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p))
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
|
@ -92,9 +92,9 @@ public:
|
|||
// type flag + on boundaries flags,
|
||||
// left-bottom neighbor trapezoid, left-top neighbor trapezoid,
|
||||
// right-bottom neighbor trapezoid, right-top neighbor trapezoid
|
||||
typedef Td_ninetuple<boost::variant<Vertex_const_handle,Point>,
|
||||
boost::variant<Vertex_const_handle,unsigned char>,
|
||||
boost::variant<Halfedge_const_handle,
|
||||
typedef Td_ninetuple<std::variant<Vertex_const_handle,Point>,
|
||||
std::variant<Vertex_const_handle,unsigned char>,
|
||||
std::variant<Halfedge_const_handle,
|
||||
std::shared_ptr<X_monotone_curve_2> >,
|
||||
Halfedge_const_handle,
|
||||
unsigned char,
|
||||
|
|
@ -239,7 +239,7 @@ public:
|
|||
|
||||
Curve_end v_ce(left()->curve_end());
|
||||
ptr()->e2 = (std::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(v_ce.cv()));
|
||||
//CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2>>( &(ptr()->e2)) != nullptr);
|
||||
//CGAL_assertion(std::get<std::shared_ptr<X_monotone_curve_2>>( &(ptr()->e2)) != nullptr);
|
||||
|
||||
ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END;
|
||||
|
||||
|
|
@ -443,8 +443,8 @@ public:
|
|||
CGAL_TD_INLINE Vertex_const_handle left_unsafe() const
|
||||
{
|
||||
CGAL_precondition(is_active());
|
||||
CGAL_assertion(boost::get<Vertex_const_handle>(&(ptr()->e0)) != nullptr);
|
||||
return boost::get<Vertex_const_handle>(ptr()->e0);
|
||||
CGAL_assertion(std::get<Vertex_const_handle>(&(ptr()->e0)) != nullptr);
|
||||
return std::get<Vertex_const_handle>(ptr()->e0);
|
||||
}
|
||||
|
||||
/*! Access trapezoid left.
|
||||
|
|
@ -466,8 +466,8 @@ public:
|
|||
CGAL_TD_INLINE Vertex_const_handle right_unsafe() const
|
||||
{
|
||||
CGAL_precondition(is_active());
|
||||
CGAL_assertion(boost::get<Vertex_const_handle>(&(ptr()->e1)) != nullptr);
|
||||
return boost::get<Vertex_const_handle>(ptr()->e1);
|
||||
CGAL_assertion(std::get<Vertex_const_handle>(&(ptr()->e1)) != nullptr);
|
||||
return std::get<Vertex_const_handle>(ptr()->e1);
|
||||
}
|
||||
|
||||
/*! Access trapezoid right.
|
||||
|
|
@ -489,8 +489,8 @@ public:
|
|||
CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const
|
||||
{
|
||||
CGAL_precondition(is_active());
|
||||
CGAL_assertion(boost::get<Halfedge_const_handle>(&(ptr()->e2)) != nullptr);
|
||||
return boost::get<Halfedge_const_handle>(ptr()->e2);
|
||||
CGAL_assertion(std::get<Halfedge_const_handle>(&(ptr()->e2)) != nullptr);
|
||||
return std::get<Halfedge_const_handle>(ptr()->e2);
|
||||
}
|
||||
|
||||
/*! Access trapezoid bottom.
|
||||
|
|
@ -526,8 +526,8 @@ public:
|
|||
CGAL_precondition(type() == TD_VERTEX);
|
||||
CGAL_precondition(!is_on_boundaries());
|
||||
|
||||
CGAL_assertion(boost::get<Point>( &(ptr()->e0)) != nullptr);
|
||||
return boost::get<Point>( ptr()->e0 );
|
||||
CGAL_assertion(std::get<Point>( &(ptr()->e0)) != nullptr);
|
||||
return std::get<Point>( ptr()->e0 );
|
||||
}
|
||||
|
||||
CGAL_TD_INLINE std::pair<X_monotone_curve_2*,Arr_curve_end> curve_end_pair_for_boundary_rem_vtx() const
|
||||
|
|
@ -536,13 +536,13 @@ public:
|
|||
CGAL_precondition(type() == TD_VERTEX);
|
||||
CGAL_precondition(is_on_boundaries());
|
||||
|
||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(std::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(cv_ptr != nullptr);
|
||||
|
||||
Arr_curve_end ce =
|
||||
(boost::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
(std::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
ARR_MIN_END : ARR_MAX_END;
|
||||
|
||||
return std::make_pair(cv_ptr, ce);
|
||||
|
|
@ -554,13 +554,13 @@ public:
|
|||
CGAL_precondition(type() == TD_VERTEX);
|
||||
CGAL_precondition(is_on_boundaries());
|
||||
|
||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(std::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(cv_ptr != nullptr);
|
||||
|
||||
Arr_curve_end ce =
|
||||
(boost::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
(std::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
ARR_MIN_END : ARR_MAX_END;
|
||||
|
||||
return Curve_end(*cv_ptr, ce);
|
||||
|
|
@ -571,13 +571,13 @@ public:
|
|||
CGAL_precondition(!is_active());
|
||||
CGAL_precondition(type() == TD_VERTEX);
|
||||
|
||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||
CGAL_assertion(std::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(cv_ptr != nullptr);
|
||||
|
||||
Arr_curve_end ce =
|
||||
(boost::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
(std::get<unsigned char>(ptr()->e1) == CGAL_TD_CV_MIN_END) ?
|
||||
ARR_MIN_END : ARR_MAX_END;
|
||||
|
||||
return Curve_end(*cv_ptr, ce);
|
||||
|
|
@ -587,8 +587,8 @@ public:
|
|||
{
|
||||
CGAL_precondition(!is_active() && type() == TD_EDGE);
|
||||
|
||||
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(std::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
|
||||
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||
CGAL_assertion(cv_ptr != nullptr);
|
||||
return *cv_ptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
|
@ -145,13 +145,13 @@ public:
|
|||
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
||||
|
||||
/*! Initialize the trapezoid's neighbors. */
|
||||
inline void init_neighbors(boost::optional<Td_map_item&> next)
|
||||
inline void init_neighbors(std::optional<std::reference_wrapper<Td_map_item>> next)
|
||||
{
|
||||
set_next((next) ? *next : Td_map_item(0));
|
||||
set_next((next) ? next->get() : Td_map_item(0));
|
||||
}
|
||||
/*! \copydoc init_neighbors
|
||||
* \deprecated please use #init_neighbors */
|
||||
CGAL_DEPRECATED inline void init_neighbours(boost::optional<Td_map_item&> next)
|
||||
CGAL_DEPRECATED inline void init_neighbours(std::optional<std::reference_wrapper<Td_map_item>> next)
|
||||
{ init_neighbors(next); }
|
||||
|
||||
/*! Set the DAG node. */
|
||||
|
|
@ -199,10 +199,10 @@ public:
|
|||
/*! Constructor given Vertex & Halfedge handles. */
|
||||
Td_active_edge (Halfedge_const_handle he ,
|
||||
Dag_node* node = 0,
|
||||
boost::optional<Td_map_item&> next = boost::none)
|
||||
std::optional<std::reference_wrapper<Td_map_item>> next = std::nullopt)
|
||||
{
|
||||
|
||||
PTR = new Data(he, (next) ? *next : Td_map_item(0), node);
|
||||
PTR = new Data(he, (next) ? next->get() : Td_map_item(0), node);
|
||||
//m_dag_node = node;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <CGAL/tuple.h>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
|
|
@ -163,18 +163,18 @@ private:
|
|||
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
||||
|
||||
/*! Initialize the trapezoid's neighbors. */
|
||||
inline void init_neighbors(boost::optional<Td_map_item&> lb, boost::optional<Td_map_item&> lt,
|
||||
boost::optional<Td_map_item&> rb, boost::optional<Td_map_item&> rt)
|
||||
inline void init_neighbors(std::optional<std::reference_wrapper<Td_map_item>> lb, std::optional<std::reference_wrapper<Td_map_item>> lt,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> rb, std::optional<std::reference_wrapper<Td_map_item>> rt)
|
||||
{
|
||||
set_lb((lb) ? *lb : Td_map_item(0));
|
||||
set_lt((lt) ? *lt : Td_map_item(0));
|
||||
set_rb((rb) ? *rb : Td_map_item(0));
|
||||
set_rt((rt) ? *rt : Td_map_item(0));
|
||||
set_lb((lb) ? lb->get() : Td_map_item(0));
|
||||
set_lt((lt) ? lt->get() : Td_map_item(0));
|
||||
set_rb((rb) ? rb->get() : Td_map_item(0));
|
||||
set_rt((rt) ? rt->get() : Td_map_item(0));
|
||||
}
|
||||
/*! \copydoc init_neighbors
|
||||
* \deprecated please use #init_neighbors */
|
||||
CGAL_DEPRECATED inline void init_neighbours(boost::optional<Td_map_item&> lb, boost::optional<Td_map_item&> lt,
|
||||
boost::optional<Td_map_item&> rb, boost::optional<Td_map_item&> rt)
|
||||
CGAL_DEPRECATED inline void init_neighbours(std::optional<std::reference_wrapper<Td_map_item>> lb, std::optional<std::reference_wrapper<Td_map_item>> lt,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> rb, std::optional<std::reference_wrapper<Td_map_item>> rt)
|
||||
{ init_neighbors(lb, lt, rb, rt); }
|
||||
|
||||
/*! Set the DAG node. */
|
||||
|
|
@ -267,14 +267,14 @@ private:
|
|||
/*! Constructor given Vertex & Halfedge handles. */
|
||||
Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r,
|
||||
Halfedge_const_handle b, Halfedge_const_handle t,
|
||||
boost::optional<Td_map_item&> lb = boost::none,
|
||||
boost::optional<Td_map_item&> lt = boost::none,
|
||||
boost::optional<Td_map_item&> rb = boost::none,
|
||||
boost::optional<Td_map_item&> rt = boost::none,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> lb = std::nullopt,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> lt = std::nullopt,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> rb = std::nullopt,
|
||||
std::optional<std::reference_wrapper<Td_map_item>> rt = std::nullopt,
|
||||
Dag_node* node = 0)
|
||||
{
|
||||
PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0),
|
||||
(rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node);
|
||||
PTR = new Data (l, r, b, t, (lb) ? lb->get() : Td_map_item(0), (lt) ? lt->get() : Td_map_item(0),
|
||||
(rb) ? rb->get() : Td_map_item(0), (rt) ? rt->get() : Td_map_item(0), node);
|
||||
//m_dag_node = node;
|
||||
}
|
||||
|
||||
|
|
@ -459,14 +459,14 @@ private:
|
|||
|
||||
Td_map_item item (*this);
|
||||
|
||||
if (ptr()->rb.which() != 0)
|
||||
if (ptr()->rb.index() != 0)
|
||||
{
|
||||
Self tr(boost::get<Self>(rb()));
|
||||
Self tr(std::get<Self>(rb()));
|
||||
tr.set_lb(item);
|
||||
}
|
||||
if (ptr()->rt.which() != 0)
|
||||
if (ptr()->rt.index() != 0)
|
||||
{
|
||||
Self tr(boost::get<Self>(rt()));
|
||||
Self tr(std::get<Self>(rt()));
|
||||
tr.set_lt(item);
|
||||
}
|
||||
CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <list>
|
||||
#include <functional>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ protected:
|
|||
|
||||
public:
|
||||
|
||||
class clear_neighbors_visitor : public boost::static_visitor< void >
|
||||
class clear_neighbors_visitor
|
||||
{
|
||||
public:
|
||||
void operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -142,7 +142,7 @@ protected:
|
|||
//d'tor
|
||||
~Node()
|
||||
{
|
||||
boost::apply_visitor(clear_neighbors_visitor(), m_data);
|
||||
std::visit(clear_neighbors_visitor(), m_data);
|
||||
}
|
||||
|
||||
bool is_inner_node() const //MICHAL: a node with only left child (like removed node) will be considered as a leaf
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public:
|
|||
Td_inactive_fictitious_vertex;
|
||||
|
||||
//! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid)
|
||||
typedef boost::variant< Td_nothing,
|
||||
typedef std::variant< Td_nothing,
|
||||
Td_active_trapezoid, Td_inactive_trapezoid,
|
||||
Td_active_edge, Td_inactive_edge,
|
||||
Td_active_vertex, Td_active_fictitious_vertex,
|
||||
|
|
@ -895,8 +895,8 @@ public:
|
|||
CGAL_precondition(is_active(left_item) && is_active(right_item));
|
||||
CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item));
|
||||
|
||||
Td_active_trapezoid left (boost::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid right(boost::get<Td_active_trapezoid>(right_item));
|
||||
Td_active_trapezoid left (std::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid right(std::get<Td_active_trapezoid>(right_item));
|
||||
|
||||
if (left.is_on_bottom_boundary())
|
||||
return (right.is_on_bottom_boundary());
|
||||
|
|
@ -915,8 +915,8 @@ public:
|
|||
CGAL_precondition(is_active(left_item) && is_active(right_item));
|
||||
CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(right_item));
|
||||
|
||||
Td_active_trapezoid left (boost::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid right(boost::get<Td_active_trapezoid>(right_item));
|
||||
Td_active_trapezoid left (std::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid right(std::get<Td_active_trapezoid>(right_item));
|
||||
|
||||
if (left.is_on_top_boundary())
|
||||
return (right.is_on_top_boundary());
|
||||
|
|
@ -957,13 +957,13 @@ public:
|
|||
//returns true if the trapezoid is a curve
|
||||
bool is_empty_item(const Td_map_item& tr) const
|
||||
{
|
||||
return (tr.which() == 0);
|
||||
return (tr.index() == 0);
|
||||
}
|
||||
|
||||
//returns true if the trapezoid is a point or a curve
|
||||
bool is_trapezoid(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_TRAPEZOID:
|
||||
case TD_INACTIVE_TRAPEZOID:
|
||||
|
|
@ -976,7 +976,7 @@ public:
|
|||
//returns true if the map item is a vertex
|
||||
bool is_td_vertex(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_VERTEX:
|
||||
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
||||
|
|
@ -991,7 +991,7 @@ public:
|
|||
//returns true if the map item is an edge
|
||||
bool is_td_edge(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_EDGE:
|
||||
case TD_INACTIVE_EDGE:
|
||||
|
|
@ -1004,7 +1004,7 @@ public:
|
|||
//returns true if the map item is an edge
|
||||
bool is_td_trapezoid(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_TRAPEZOID:
|
||||
case TD_INACTIVE_TRAPEZOID:
|
||||
|
|
@ -1017,7 +1017,7 @@ public:
|
|||
//returns true if the trapezoid is a curve
|
||||
bool is_fictitious_vertex(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
||||
case TD_INACTIVE_FICTITIOUS_VERTEX:
|
||||
|
|
@ -1030,7 +1030,7 @@ public:
|
|||
//returns true if the trapezoid is a curve
|
||||
bool is_active(const Td_map_item& tr) const
|
||||
{
|
||||
switch (tr.which())
|
||||
switch (tr.index())
|
||||
{
|
||||
case TD_ACTIVE_TRAPEZOID:
|
||||
case TD_ACTIVE_EDGE:
|
||||
|
|
@ -1049,7 +1049,7 @@ public:
|
|||
CGAL_precondition(is_active(item));
|
||||
//MICHAL: assumes item is of active edge item - also fails in case of a vertical asymptote
|
||||
//MICHAL: check when this is used exactly
|
||||
Td_active_edge& e (boost::get<Td_active_edge>(item));
|
||||
Td_active_edge& e (std::get<Td_active_edge>(item));
|
||||
Halfedge_const_handle he = e.halfedge();
|
||||
return (this->compare_curve_end_x_2_object()
|
||||
(Curve_end(he,ARR_MIN_END), Curve_end(he,ARR_MAX_END))== EQUAL);
|
||||
|
|
@ -1061,7 +1061,7 @@ public:
|
|||
{
|
||||
CGAL_precondition( is_active(item) );
|
||||
CGAL_precondition( is_td_trapezoid(item) );
|
||||
Td_active_trapezoid tr (boost::get<Td_active_trapezoid>(item));
|
||||
Td_active_trapezoid tr (std::get<Td_active_trapezoid>(item));
|
||||
|
||||
return
|
||||
( tr.is_on_left_boundary() ||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
#include <CGAL/Arr_point_location/Td_predicates.h>
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/variant.hpp>
|
||||
#include <optional>
|
||||
#include <variant>
|
||||
#include <memory>
|
||||
|
||||
#include <cstdlib>
|
||||
|
|
@ -93,16 +93,16 @@ struct Non_recursive_td_map_item_destructor
|
|||
|
||||
void operator()(Td_active_trapezoid& item)
|
||||
{
|
||||
boost::apply_visitor(m_child_visitor, item.lb());
|
||||
boost::apply_visitor(m_child_visitor, item.lt());
|
||||
boost::apply_visitor(m_child_visitor, item.rb());
|
||||
boost::apply_visitor(m_child_visitor, item.rt());
|
||||
std::visit(m_child_visitor, item.lb());
|
||||
std::visit(m_child_visitor, item.lt());
|
||||
std::visit(m_child_visitor, item.rb());
|
||||
std::visit(m_child_visitor, item.rt());
|
||||
item.clear_neighbors();
|
||||
}
|
||||
|
||||
void operator()(Td_active_edge& item)
|
||||
{
|
||||
boost::apply_visitor(m_child_visitor, item.next());
|
||||
std::visit(m_child_visitor, item.next());
|
||||
item.set_next(Td_map_item(0));
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ struct Non_recursive_td_map_item_destructor
|
|||
{
|
||||
Td_map_item item = queue.back();
|
||||
queue.pop_back();
|
||||
boost::apply_visitor(item_visitor, item);
|
||||
std::visit(item_visitor, item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ struct Non_recursive_td_map_item_destructor
|
|||
{
|
||||
Td_map_item item = queue.back();
|
||||
queue.pop_back();
|
||||
boost::apply_visitor(item_visitor, item);
|
||||
std::visit(item_visitor, item);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -272,7 +272,7 @@ public:
|
|||
Base_map_item_iterator() : traits(0), m_cur_item(Td_map_item(0)){ }
|
||||
|
||||
Base_map_item_iterator(const Traits* traits_,
|
||||
boost::optional<Td_map_item&> curr = boost::none)
|
||||
std::optional<Td_map_item> curr = std::nullopt)
|
||||
:traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { }
|
||||
|
||||
Base_map_item_iterator(const Base_map_item_iterator &it)
|
||||
|
|
@ -332,12 +332,12 @@ public:
|
|||
public:
|
||||
//constructors
|
||||
In_face_iterator(const Traits* traits_, Halfedge_const_handle sep,
|
||||
boost::optional<Td_map_item&> curr = boost::none)
|
||||
std::optional<std::reference_wrapper<Td_map_item>> curr = std::nullopt)
|
||||
:Base_map_item_iterator(traits_,curr), m_sep(sep->curve())
|
||||
{ }
|
||||
|
||||
In_face_iterator(const Traits* traits_, const X_monotone_curve_2& sep,
|
||||
boost::optional<Td_map_item&> curr = boost::none)
|
||||
std::optional<std::reference_wrapper<Td_map_item>> curr = std::nullopt)
|
||||
:Base_map_item_iterator(traits_,curr), m_sep(sep)
|
||||
{ }
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ public:
|
|||
if (traits->is_td_trapezoid(m_cur_item))
|
||||
{
|
||||
//if the map item is a trapezoid
|
||||
Td_active_trapezoid tr (boost::get<Td_active_trapezoid>(m_cur_item));
|
||||
Td_active_trapezoid tr (std::get<Td_active_trapezoid>(m_cur_item));
|
||||
|
||||
#ifndef CGAL_TD_DEBUG
|
||||
CGAL_warning_code(Dag_node* tt = tr.dag_node();)
|
||||
|
|
@ -436,7 +436,7 @@ public:
|
|||
{
|
||||
//if the map item is an edge
|
||||
|
||||
Td_active_edge e (boost::get<Td_active_edge>(m_cur_item));
|
||||
Td_active_edge e (std::get<Td_active_edge>(m_cur_item));
|
||||
CGAL_assertion_code(Dag_node* tt = e.dag_node();)
|
||||
CGAL_assertion(tt != nullptr);
|
||||
CGAL_assertion(tt->is_inner_node());
|
||||
|
|
@ -453,7 +453,7 @@ public:
|
|||
while(traits->is_td_vertex(m_cur_item))
|
||||
{
|
||||
Dag_node* node =
|
||||
boost::apply_visitor(dag_node_visitor(),m_cur_item);
|
||||
std::visit(dag_node_visitor(),m_cur_item);
|
||||
m_cur_item = node->left_child().get_data();
|
||||
}
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ public:
|
|||
CGAL_precondition (!traits->is_empty_item(m_cur_item));
|
||||
CGAL_precondition (traits->is_active(m_cur_item) &&
|
||||
traits->is_td_trapezoid(m_cur_item));
|
||||
return boost::get<Td_active_trapezoid>(m_cur_item);
|
||||
return std::get<Td_active_trapezoid>(m_cur_item);
|
||||
}
|
||||
|
||||
Td_active_edge& e()
|
||||
|
|
@ -489,13 +489,13 @@ public:
|
|||
CGAL_precondition (!traits->is_empty_item(m_cur_item));
|
||||
CGAL_precondition (traits->is_active(m_cur_item) &&
|
||||
traits->is_td_edge(m_cur_item));
|
||||
return boost::get<Td_active_edge>(m_cur_item);
|
||||
return std::get<Td_active_edge>(m_cur_item);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*! Visitors for accessing td map items methods */
|
||||
class rb_visitor : public boost::static_visitor<Td_map_item>
|
||||
class rb_visitor
|
||||
{
|
||||
public:
|
||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -511,7 +511,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_rb_visitor : public boost::static_visitor<void>
|
||||
class set_rb_visitor
|
||||
{
|
||||
public:
|
||||
set_rb_visitor (const Td_map_item& rb) : m_rb(rb) {}
|
||||
|
|
@ -532,7 +532,7 @@ public:
|
|||
const Td_map_item& m_rb;
|
||||
};
|
||||
|
||||
class rt_visitor : public boost::static_visitor<Td_map_item>
|
||||
class rt_visitor
|
||||
{
|
||||
public:
|
||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -548,7 +548,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_rt_visitor : public boost::static_visitor<void>
|
||||
class set_rt_visitor
|
||||
{
|
||||
public:
|
||||
set_rt_visitor (const Td_map_item& rt) : m_rt(rt) {}
|
||||
|
|
@ -568,7 +568,7 @@ public:
|
|||
const Td_map_item& m_rt;
|
||||
};
|
||||
|
||||
class lb_visitor : public boost::static_visitor<Td_map_item>
|
||||
class lb_visitor
|
||||
{
|
||||
public:
|
||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -584,7 +584,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_lb_visitor : public boost::static_visitor<void>
|
||||
class set_lb_visitor
|
||||
{
|
||||
public:
|
||||
set_lb_visitor (const Td_map_item& lb) : m_lb(lb) {}
|
||||
|
|
@ -604,7 +604,7 @@ public:
|
|||
const Td_map_item& m_lb;
|
||||
};
|
||||
|
||||
class set_lt_visitor : public boost::static_visitor<void>
|
||||
class set_lt_visitor
|
||||
{
|
||||
public:
|
||||
set_lt_visitor (const Td_map_item& lt) : m_lt(lt) {}
|
||||
|
|
@ -624,7 +624,7 @@ public:
|
|||
const Td_map_item& m_lt;
|
||||
};
|
||||
|
||||
class bottom_he_visitor : public boost::static_visitor<Halfedge_const_handle>
|
||||
class bottom_he_visitor
|
||||
{
|
||||
public:
|
||||
Halfedge_const_handle operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -640,7 +640,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_bottom_he_visitor : public boost::static_visitor< void >
|
||||
class set_bottom_he_visitor
|
||||
{
|
||||
public:
|
||||
set_bottom_he_visitor (Halfedge_const_handle he) : m_bottom_he(he) {}
|
||||
|
|
@ -659,7 +659,7 @@ public:
|
|||
Halfedge_const_handle m_bottom_he;
|
||||
};
|
||||
|
||||
class top_he_visitor : public boost::static_visitor<Halfedge_const_handle>
|
||||
class top_he_visitor
|
||||
{
|
||||
public:
|
||||
Halfedge_const_handle operator()(Td_active_trapezoid& t) const
|
||||
|
|
@ -675,7 +675,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_top_he_visitor : public boost::static_visitor<void>
|
||||
class set_top_he_visitor
|
||||
{
|
||||
public:
|
||||
set_top_he_visitor (Halfedge_const_handle he) : m_top_he(he) {}
|
||||
|
|
@ -694,7 +694,7 @@ public:
|
|||
Halfedge_const_handle m_top_he;
|
||||
};
|
||||
|
||||
class cw_he_visitor : public boost::static_visitor< Halfedge_const_handle >
|
||||
class cw_he_visitor
|
||||
{
|
||||
public:
|
||||
Halfedge_const_handle operator()(Td_active_vertex& t) const
|
||||
|
|
@ -716,7 +716,8 @@ public:
|
|||
|
||||
/*! A visitor to set the cw halfedge of a vertex node.
|
||||
*/
|
||||
class set_cw_he_visitor : public boost::static_visitor<void> {
|
||||
class set_cw_he_visitor
|
||||
{
|
||||
public:
|
||||
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
|
||||
|
||||
|
|
@ -734,7 +735,8 @@ public:
|
|||
|
||||
/*! A visitor to reset the cw halfedge of a vertex node.
|
||||
*/
|
||||
class reset_cw_he_visitor : public boost::static_visitor<void> {
|
||||
class reset_cw_he_visitor
|
||||
{
|
||||
public:
|
||||
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
|
||||
|
||||
|
|
@ -744,7 +746,7 @@ public:
|
|||
void operator()(T& /*t*/) const { CGAL_assertion(false); }
|
||||
};
|
||||
|
||||
class dag_node_visitor : public boost::static_visitor<Dag_node*>
|
||||
class dag_node_visitor
|
||||
{
|
||||
public:
|
||||
Dag_node* operator()(Td_nothing& /* t */) const
|
||||
|
|
@ -765,7 +767,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class set_dag_node_visitor : public boost::static_visitor<void>
|
||||
class set_dag_node_visitor
|
||||
{
|
||||
public:
|
||||
set_dag_node_visitor(Dag_node* node):m_node(node) {}
|
||||
|
|
@ -789,30 +791,29 @@ public:
|
|||
Dag_node* m_node;
|
||||
};
|
||||
|
||||
class curve_end_for_fict_vertex_visitor :
|
||||
public boost::static_visitor<boost::optional<Curve_end> >
|
||||
class curve_end_for_fict_vertex_visitor
|
||||
{
|
||||
public:
|
||||
boost::optional<Curve_end> operator()(Td_active_fictitious_vertex& t) const
|
||||
std::optional<Curve_end> operator()(Td_active_fictitious_vertex& t) const
|
||||
{
|
||||
return t.curve_end();
|
||||
}
|
||||
|
||||
boost::optional<Curve_end>
|
||||
std::optional<Curve_end>
|
||||
operator()(Td_inactive_fictitious_vertex& t) const
|
||||
{
|
||||
return t.curve_end();
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
boost::optional<Curve_end> operator()(T& /* t */) const
|
||||
std::optional<Curve_end> operator()(T& /* t */) const
|
||||
{
|
||||
CGAL_assertion(false);
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
};
|
||||
|
||||
class point_for_vertex_visitor : public boost::static_visitor< Point >
|
||||
class point_for_vertex_visitor
|
||||
{
|
||||
public:
|
||||
Point operator()(Td_active_vertex& t) const
|
||||
|
|
@ -833,30 +834,28 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class curve_end_for_active_vertex_visitor :
|
||||
public boost::static_visitor<boost::optional<Curve_end> >
|
||||
class curve_end_for_active_vertex_visitor
|
||||
{
|
||||
public:
|
||||
boost::optional<Curve_end> operator()(Td_active_vertex& t) const
|
||||
std::optional<Curve_end> operator()(Td_active_vertex& t) const
|
||||
{
|
||||
return t.curve_end();
|
||||
}
|
||||
|
||||
boost::optional<Curve_end> operator()(Td_active_fictitious_vertex& t) const
|
||||
std::optional<Curve_end> operator()(Td_active_fictitious_vertex& t) const
|
||||
{
|
||||
return t.curve_end();
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
boost::optional<Curve_end> operator()(T& /* t */) const
|
||||
std::optional<Curve_end> operator()(T& /* t */) const
|
||||
{
|
||||
CGAL_assertion(false);
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
};
|
||||
|
||||
class vertex_for_active_vertex_visitor :
|
||||
public boost::static_visitor<Vertex_const_handle>
|
||||
class vertex_for_active_vertex_visitor
|
||||
{
|
||||
public:
|
||||
Vertex_const_handle operator()(Td_active_vertex& t) const
|
||||
|
|
@ -877,27 +876,26 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class cv_for_edge_visitor :
|
||||
public boost::static_visitor<boost::optional<const X_monotone_curve_2&> >
|
||||
class cv_for_edge_visitor
|
||||
{
|
||||
public:
|
||||
boost::optional<const X_monotone_curve_2&>
|
||||
std::optional<std::reference_wrapper<const X_monotone_curve_2>>
|
||||
operator()(Td_active_edge& t) const
|
||||
{
|
||||
return t.halfedge()->curve();
|
||||
}
|
||||
|
||||
boost::optional<const X_monotone_curve_2&>
|
||||
std::optional<std::reference_wrapper<const X_monotone_curve_2>>
|
||||
operator()(Td_inactive_edge& t) const
|
||||
{
|
||||
return t.curve();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
boost::optional<const X_monotone_curve_2&> operator()(T& /* t */) const
|
||||
std::optional<std::reference_wrapper<const X_monotone_curve_2>> operator()(T& /* t */) const
|
||||
{
|
||||
CGAL_assertion(false);
|
||||
return boost::none;
|
||||
return std::nullopt;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -998,11 +996,11 @@ protected:
|
|||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||
if (is_fict_vtx) {
|
||||
return (compare(t,
|
||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
||||
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||
vtx_item))) == SMALLER);
|
||||
}
|
||||
else {
|
||||
return (compare(t, boost::apply_visitor(point_for_vertex_visitor(),
|
||||
return (compare(t, std::visit(point_for_vertex_visitor(),
|
||||
vtx_item)) == SMALLER);
|
||||
}
|
||||
}
|
||||
|
|
@ -1039,12 +1037,12 @@ protected:
|
|||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||
if (is_fict_vtx) {
|
||||
return (compare(t,
|
||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
||||
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||
vtx_item))) == LARGER);
|
||||
}
|
||||
else {
|
||||
return (compare(t,
|
||||
boost::apply_visitor(point_for_vertex_visitor(),
|
||||
std::visit(point_for_vertex_visitor(),
|
||||
vtx_item)) == LARGER);
|
||||
}
|
||||
}
|
||||
|
|
@ -1058,12 +1056,12 @@ protected:
|
|||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||
if (is_fict_vtx) {
|
||||
return equal(t,
|
||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
||||
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||
vtx_item)));
|
||||
}
|
||||
else {
|
||||
return equal(t,
|
||||
boost::apply_visitor(point_for_vertex_visitor(),
|
||||
std::visit(point_for_vertex_visitor(),
|
||||
vtx_item));
|
||||
}
|
||||
}
|
||||
|
|
@ -1090,24 +1088,24 @@ protected:
|
|||
//if ( traits->is_fictitious_vertex(item) )
|
||||
//{
|
||||
// CGAL_precondition(traits->equal_curve_end_2_object()
|
||||
// (Curve_end(cv,ARR_MIN_END), *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item))));
|
||||
// (Curve_end(cv,ARR_MIN_END), *(std::visit(curve_end_for_fict_vertex_visitor(),item))));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// CGAL_precondition(traits->equal_curve_end_2_object()
|
||||
// (Curve_end(cv,ARR_MIN_END), boost::apply_visitor(point_for_vertex_visitor(), item)));
|
||||
// (Curve_end(cv,ARR_MIN_END), std::visit(point_for_vertex_visitor(), item)));
|
||||
//}
|
||||
//find the node of the curve's leftmost trapezoid
|
||||
Dag_node cv_leftmost_node(left_cv_end_node.right_child());
|
||||
if (traits->is_fictitious_vertex(item) )
|
||||
{
|
||||
Curve_end ce( *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
||||
Curve_end ce( *(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||
item)));
|
||||
search_using_dag_with_cv(cv_leftmost_node, traits, ce, &cv, cres);
|
||||
}
|
||||
else
|
||||
{
|
||||
Point p( boost::apply_visitor(point_for_vertex_visitor(), item));
|
||||
Point p( std::visit(point_for_vertex_visitor(), item));
|
||||
search_using_dag_with_cv(cv_leftmost_node, traits, p, &cv, cres);
|
||||
}
|
||||
return cv_leftmost_node;
|
||||
|
|
@ -1159,8 +1157,8 @@ protected:
|
|||
if (traits->is_empty_item(left_item) || traits->is_empty_item(right_item))
|
||||
return false;
|
||||
|
||||
Td_active_trapezoid& left (boost::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid& right (boost::get<Td_active_trapezoid>(right_item));
|
||||
Td_active_trapezoid& left (std::get<Td_active_trapezoid>(left_item));
|
||||
Td_active_trapezoid& right (std::get<Td_active_trapezoid>(right_item));
|
||||
|
||||
if (traits->is_trapezoids_top_equal(left,right) &&
|
||||
traits->is_trapezoids_bottom_equal(left,right) &&
|
||||
|
|
@ -1966,7 +1964,7 @@ public:
|
|||
for (typename std::list<Td_map_item>::iterator it =
|
||||
representatives.begin(); it != representatives.end(); ++it)
|
||||
{
|
||||
Td_active_edge e(boost::get<Td_active_edge>(*it));
|
||||
Td_active_edge e(std::get<Td_active_edge>(*it));
|
||||
container.push_back(e.halfedge()); //it represents an active trapezoid
|
||||
}
|
||||
}
|
||||
|
|
@ -2152,7 +2150,7 @@ private:
|
|||
// traits may be initialized later
|
||||
m_dag_root = new Dag_node(Td_active_trapezoid());
|
||||
//(*m_dag_root)->set_dag_node(m_dag_root);
|
||||
boost::apply_visitor(set_dag_node_visitor(m_dag_root),
|
||||
std::visit(set_dag_node_visitor(m_dag_root),
|
||||
m_dag_root->get_data());
|
||||
|
||||
m_number_of_curves = 0;
|
||||
|
|
@ -2200,11 +2198,11 @@ private:
|
|||
//{
|
||||
// if ( traits->is_fictitious_vertex(item) )
|
||||
// {
|
||||
// res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item)));
|
||||
// res = traits->equal_curve_end_2_object()(ce, *(std::visit(curve_end_for_fict_vertex_visitor(),item)));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item));
|
||||
// res = traits->equal_curve_end_2_object()(ce, std::visit(point_for_vertex_visitor(), item));
|
||||
// }
|
||||
//}
|
||||
if (traits->is_td_trapezoid(item))
|
||||
|
|
@ -2218,11 +2216,11 @@ private:
|
|||
//{
|
||||
// if ( traits->is_fictitious_vertex(item) )
|
||||
// {
|
||||
// res = traits->equal_curve_end_2_object()(ce, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item)));
|
||||
// res = traits->equal_curve_end_2_object()(ce, *(std::visit(curve_end_for_fict_vertex_visitor(),item)));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// res = traits->equal_curve_end_2_object()(ce, boost::apply_visitor(point_for_vertex_visitor(), item));
|
||||
// res = traits->equal_curve_end_2_object()(ce, std::visit(point_for_vertex_visitor(), item));
|
||||
// }
|
||||
//}
|
||||
if (traits->is_td_trapezoid(item))
|
||||
|
|
@ -2234,7 +2232,7 @@ private:
|
|||
lt=POINT;
|
||||
else
|
||||
{
|
||||
Td_active_trapezoid tr (boost::get<Td_active_trapezoid>(item));
|
||||
Td_active_trapezoid tr (std::get<Td_active_trapezoid>(item));
|
||||
lt = tr.is_on_boundaries()? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||
}
|
||||
}
|
||||
|
|
@ -2343,12 +2341,12 @@ private:
|
|||
// if the map item represents a fictitious vertex
|
||||
if (traits->is_fictitious_vertex(item))
|
||||
{
|
||||
const Curve_end left_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),item)));
|
||||
const Curve_end left_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),item)));
|
||||
print_ce_data(left_ce.cv(), left_ce.ce(), out);
|
||||
}
|
||||
else // if the map item represents a vertex
|
||||
{
|
||||
Point p = boost::apply_visitor(point_for_vertex_visitor(),item);
|
||||
Point p = std::visit(point_for_vertex_visitor(),item);
|
||||
print_point_data(p, out);
|
||||
}
|
||||
out << " (void *)left_child: " << (void*)(&(curr.left_child()))
|
||||
|
|
@ -2363,7 +2361,7 @@ private:
|
|||
{
|
||||
// bool is_active = traits->is_active(item);
|
||||
// if the map item represents an edge
|
||||
const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), item));
|
||||
const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), item));
|
||||
|
||||
// so top() is a real Halfedge with a curve() if curr is active
|
||||
// or curr holds the curve if curr is not active
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ split_trapezoid_by_vertex(Dag_node& split_node,
|
|||
Dag_node left_node, right_node;
|
||||
|
||||
if (traits->is_td_trapezoid(curr_item)) {
|
||||
Td_active_trapezoid& tr(boost::get<Td_active_trapezoid>(curr_item));
|
||||
Td_active_trapezoid& tr(std::get<Td_active_trapezoid>(curr_item));
|
||||
|
||||
CGAL_warning(traits->is_in_closure(tr, traits->vtx_to_ce(v)));
|
||||
|
||||
|
|
@ -63,9 +63,9 @@ split_trapezoid_by_vertex(Dag_node& split_node,
|
|||
(v, tr.right(), tr.bottom(), tr.top()));
|
||||
|
||||
Td_active_trapezoid&
|
||||
left_tr(boost::get<Td_active_trapezoid>(left_node.get_data()));
|
||||
left_tr(std::get<Td_active_trapezoid>(left_node.get_data()));
|
||||
Td_active_trapezoid&
|
||||
right_tr(boost::get<Td_active_trapezoid>(right_node.get_data()));
|
||||
right_tr(std::get<Td_active_trapezoid>(right_node.get_data()));
|
||||
|
||||
CGAL_warning(traits->is_trapezoids_top_equal(left_tr,right_tr));
|
||||
CGAL_warning(traits->is_trapezoids_bottom_equal(left_tr,right_tr));
|
||||
|
|
@ -77,25 +77,25 @@ split_trapezoid_by_vertex(Dag_node& split_node,
|
|||
right_tr.init_neighbors(left_node.get_data(), left_node.get_data(),
|
||||
tr.rb(), tr.rt());
|
||||
if (!traits->is_empty_item(tr.lb())) {
|
||||
Td_active_trapezoid& lb(boost::get<Td_active_trapezoid>(tr.lb()));
|
||||
Td_active_trapezoid& lb(std::get<Td_active_trapezoid>(tr.lb()));
|
||||
lb.set_rb(left_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(tr.lt())) {
|
||||
Td_active_trapezoid& lt(boost::get<Td_active_trapezoid>(tr.lt()));
|
||||
Td_active_trapezoid& lt(std::get<Td_active_trapezoid>(tr.lt()));
|
||||
lt.set_rt(left_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(tr.rb())) {
|
||||
Td_active_trapezoid& rb(boost::get<Td_active_trapezoid>(tr.rb()));
|
||||
Td_active_trapezoid& rb(std::get<Td_active_trapezoid>(tr.rb()));
|
||||
rb.set_lb(right_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(tr.rt())) {
|
||||
Td_active_trapezoid& rt(boost::get<Td_active_trapezoid>(tr.rt()));
|
||||
Td_active_trapezoid& rt(std::get<Td_active_trapezoid>(tr.rt()));
|
||||
rt.set_lt(right_node.get_data());
|
||||
}
|
||||
}
|
||||
else {
|
||||
// the curr_item is an edge
|
||||
Td_active_edge& e(boost::get<Td_active_edge>(curr_item));
|
||||
Td_active_edge& e(std::get<Td_active_edge>(curr_item));
|
||||
|
||||
CGAL_warning(traits->is_in_closure(e, traits->vtx_to_ce(v)));
|
||||
|
||||
|
|
@ -103,13 +103,13 @@ split_trapezoid_by_vertex(Dag_node& split_node,
|
|||
|
||||
right_node.set_data(Td_active_edge(e.halfedge()));
|
||||
|
||||
Td_active_edge& left_e(boost::get<Td_active_edge>(left_node.get_data()));
|
||||
Td_active_edge& right_e(boost::get<Td_active_edge>(right_node.get_data()));
|
||||
Td_active_edge& left_e(std::get<Td_active_edge>(left_node.get_data()));
|
||||
Td_active_edge& right_e(std::get<Td_active_edge>(right_node.get_data()));
|
||||
|
||||
//CGAL_warning(left_e.is_on_left_boundary() == e.is_on_left_boundary());
|
||||
//CGAL_warning(right_e.is_on_right_boundary() == e.is_on_right_boundary());
|
||||
|
||||
left_e.init_neighbors(boost::none);
|
||||
left_e.init_neighbors(std::nullopt);
|
||||
//left_e.init_neighbors(e.lb(),e.lt(),Td_map_item(),right_node.get_data());
|
||||
right_e.init_neighbors(e.next());
|
||||
//right_e.init_neighbors(left_node.get_data(),left_node.get_data(),e.rb(),e.rt());
|
||||
|
|
@ -132,10 +132,10 @@ split_trapezoid_by_vertex(Dag_node& split_node,
|
|||
const Dag_node* left_ptr = &split_node.left_child();
|
||||
const Dag_node* right_ptr = &split_node.right_child();
|
||||
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)left_ptr),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)left_ptr),
|
||||
left_ptr->get_data());
|
||||
//(*left_ptr)->set_dag_node((Dag_node*)left_ptr);
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)right_ptr),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)right_ptr),
|
||||
right_ptr->get_data());
|
||||
//(*right_ptr)->set_dag_node((Dag_node*)right_ptr);
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ deactivate_trapezoid(Dag_node& trpz_node, Dag_node* active_node) const
|
|||
CGAL_precondition(traits->is_active(trpz_node.get_data()));
|
||||
CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data()));
|
||||
if (Td_active_trapezoid* trap =
|
||||
boost::get<Td_active_trapezoid>(&trpz_node.get_data()))
|
||||
std::get_if<Td_active_trapezoid>(&trpz_node.get_data()))
|
||||
trap->non_recursive_clear_neighbors();
|
||||
trpz_node.set_data(Td_inactive_trapezoid());
|
||||
if (active_node) trpz_node.set_left_child(*active_node);
|
||||
|
|
@ -233,11 +233,11 @@ deactivate_vertex(Dag_node& vtx_node) const
|
|||
CGAL_precondition(traits->is_td_vertex(vtx_node.get_data()));
|
||||
if (traits->is_fictitious_vertex(vtx_node.get_data())) {
|
||||
Td_active_fictitious_vertex&
|
||||
v(boost::get<Td_active_fictitious_vertex>(vtx_node.get_data()));
|
||||
v(std::get<Td_active_fictitious_vertex>(vtx_node.get_data()));
|
||||
vtx_node.set_data(Td_inactive_fictitious_vertex(v.vertex(), &vtx_node));
|
||||
}
|
||||
else {
|
||||
Td_active_vertex& v(boost::get<Td_active_vertex>(vtx_node.get_data()));
|
||||
Td_active_vertex& v(std::get<Td_active_vertex>(vtx_node.get_data()));
|
||||
vtx_node.set_data(Td_inactive_vertex(v.vertex(), &vtx_node));
|
||||
}
|
||||
}
|
||||
|
|
@ -274,7 +274,7 @@ split_trapezoid_by_halfedge(Dag_node& split_node,
|
|||
CGAL_precondition(traits->is_td_trapezoid(split_node.get_data()));
|
||||
|
||||
Td_map_item curr_item(split_node.get_data());
|
||||
Td_active_trapezoid& split_tr = boost::get<Td_active_trapezoid>(curr_item);
|
||||
Td_active_trapezoid& split_tr = std::get<Td_active_trapezoid>(curr_item);
|
||||
|
||||
// sets left and right according to td_edge's source and target positions
|
||||
// sets bottom and top to Halfedge itself
|
||||
|
|
@ -303,37 +303,37 @@ split_trapezoid_by_halfedge(Dag_node& split_node,
|
|||
// CGAL_TD_ON_BOTTOM_BOUNDARY )));
|
||||
|
||||
Td_active_trapezoid& bottom =
|
||||
boost::get<Td_active_trapezoid>(bottom_node.get_data());
|
||||
std::get<Td_active_trapezoid>(bottom_node.get_data());
|
||||
Td_active_trapezoid& top =
|
||||
boost::get<Td_active_trapezoid>(top_node.get_data());
|
||||
std::get<Td_active_trapezoid>(top_node.get_data());
|
||||
|
||||
top.init_neighbors(prev_top_tr, split_tr.lt(), boost::none , split_tr.rt());
|
||||
top.init_neighbors(prev_top_tr, split_tr.lt(), std::nullopt , split_tr.rt());
|
||||
bottom.init_neighbors(split_tr.lb(), prev_bottom_tr, split_tr.rb(),
|
||||
boost::none);
|
||||
std::nullopt);
|
||||
|
||||
if (!traits->is_empty_item(prev_bottom_tr)) {
|
||||
Td_active_trapezoid&
|
||||
prev_btm(boost::get<Td_active_trapezoid>(prev_bottom_tr));
|
||||
prev_btm(std::get<Td_active_trapezoid>(prev_bottom_tr));
|
||||
prev_btm.set_rt(bottom_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(prev_top_tr)) {
|
||||
Td_active_trapezoid& prev_top(boost::get<Td_active_trapezoid>(prev_top_tr));
|
||||
Td_active_trapezoid& prev_top(std::get<Td_active_trapezoid>(prev_top_tr));
|
||||
prev_top.set_rb(top_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(split_tr.lb())) {
|
||||
Td_active_trapezoid& lb(boost::get<Td_active_trapezoid>(split_tr.lb()));
|
||||
Td_active_trapezoid& lb(std::get<Td_active_trapezoid>(split_tr.lb()));
|
||||
lb.set_rb(bottom_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(split_tr.lt())) {
|
||||
Td_active_trapezoid& lt(boost::get<Td_active_trapezoid>(split_tr.lt()));
|
||||
Td_active_trapezoid& lt(std::get<Td_active_trapezoid>(split_tr.lt()));
|
||||
lt.set_rt(top_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(split_tr.rb())) {
|
||||
Td_active_trapezoid& rb(boost::get<Td_active_trapezoid>(split_tr.rb()));
|
||||
Td_active_trapezoid& rb(std::get<Td_active_trapezoid>(split_tr.rb()));
|
||||
rb.set_lb(bottom_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(split_tr.rt())) {
|
||||
Td_active_trapezoid& rt(boost::get<Td_active_trapezoid>(split_tr.rt()));
|
||||
Td_active_trapezoid& rt(std::get<Td_active_trapezoid>(split_tr.rt()));
|
||||
rt.set_lt(top_node.get_data());
|
||||
}
|
||||
split_node.replace(sep,bottom_node,top_node); //nodes depth are updated here
|
||||
|
|
@ -348,14 +348,14 @@ split_trapezoid_by_halfedge(Dag_node& split_node,
|
|||
const Dag_node* bottomPtr = &split_node.left_child();
|
||||
const Dag_node* topPtr = &split_node.right_child();
|
||||
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)bottomPtr),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)bottomPtr),
|
||||
bottomPtr->get_data());
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)topPtr),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)topPtr),
|
||||
topPtr->get_data());
|
||||
|
||||
// Td_active_edge& new_e = boost::get<Td_active_edge>(split_node.get_data());
|
||||
// Td_active_edge& new_e = std::get<Td_active_edge>(split_node.get_data());
|
||||
if (!traits->is_empty_item(prev_e)) {
|
||||
Td_active_edge& e( boost::get<Td_active_edge>(prev_e));
|
||||
Td_active_edge& e( std::get<Td_active_edge>(prev_e));
|
||||
e.set_next(split_node.get_data());
|
||||
}
|
||||
//update these trapezoids pointers.
|
||||
|
|
@ -404,14 +404,14 @@ update_vtx_with_new_edge(Halfedge_const_handle he,
|
|||
|
||||
//set cw to hold the halfedge whose source is p,
|
||||
// which is clockwise "smallest" starting from top (12 o'clock)
|
||||
Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item));
|
||||
Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item));
|
||||
if (traits->compare_cw_around_point_2_object()(he->curve(),
|
||||
is_edge_to_right(he,p),
|
||||
cw_he->curve(),
|
||||
is_edge_to_right(cw_he,p),
|
||||
p) == SMALLER)
|
||||
{
|
||||
boost::apply_visitor(set_cw_he_visitor(he),vtx_item);//v_tr->set_top(he);
|
||||
std::visit(set_cw_he_visitor(he),vtx_item);//v_tr->set_top(he);
|
||||
}
|
||||
|
||||
return vtx_item;
|
||||
|
|
@ -430,7 +430,7 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he,
|
|||
{
|
||||
CGAL_precondition(lt==TRAPEZOID || lt==UNBOUNDED_TRAPEZOID);
|
||||
|
||||
Dag_node* node = boost::apply_visitor(dag_node_visitor(), item);
|
||||
Dag_node* node = std::visit(dag_node_visitor(), item);
|
||||
|
||||
CGAL_assertion(node != nullptr);
|
||||
CGAL_assertion(he != m_empty_he_handle);
|
||||
|
|
@ -458,13 +458,13 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he,
|
|||
// CGAL_precondition(traits->is_td_vertex(vtx_item));
|
||||
// CGAL_precondition(traits->is_active(vtx_item));
|
||||
//
|
||||
// Halfedge_const_handle cw_he (boost::apply_visitor(cw_he_visitor(), vtx_item));
|
||||
// Halfedge_const_handle cw_he (std::visit(cw_he_visitor(), vtx_item));
|
||||
//
|
||||
// //make sure the cw_he is added in same direction as before
|
||||
// // such that vtx_item is the source (done inside the set methods)
|
||||
// if (cw_he == old_he || cw_he->twin() == old_he)
|
||||
// {
|
||||
// boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item);
|
||||
// std::visit(set_cw_he_visitor(new_he), vtx_item);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
|
@ -479,12 +479,12 @@ update_vtx_cw_he_after_merge(const X_monotone_curve_2& old_cv,
|
|||
CGAL_precondition(traits->is_td_vertex(vtx_item));
|
||||
CGAL_precondition(traits->is_active(vtx_item));
|
||||
|
||||
Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item));
|
||||
Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item));
|
||||
|
||||
//make sure the cw_he is added in same direction as before
|
||||
// such that v_tr is the source (done inside the set methods)
|
||||
if (traits->equal_2_object()(cw_he->curve(), old_cv))
|
||||
boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item);
|
||||
std::visit(set_cw_he_visitor(new_he), vtx_item);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -499,12 +499,12 @@ update_vtx_cw_he_after_remove(Halfedge_const_handle old_he,
|
|||
CGAL_precondition(traits->is_td_vertex(vtx_item));
|
||||
CGAL_precondition(traits->is_active(vtx_item));
|
||||
|
||||
Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(), vtx_item));
|
||||
Halfedge_const_handle cw_he(std::visit(cw_he_visitor(), vtx_item));
|
||||
if ((old_he == cw_he) || (old_he->twin() == cw_he)) {
|
||||
Halfedge_const_handle new_he = cw_he->twin()->next();
|
||||
if (new_he != cw_he)
|
||||
boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item);
|
||||
else boost::apply_visitor(reset_cw_he_visitor(), vtx_item); // dangling edge removed
|
||||
std::visit(set_cw_he_visitor(new_he), vtx_item);
|
||||
else std::visit(reset_cw_he_visitor(), vtx_item); // dangling edge removed
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -520,20 +520,20 @@ update_vtx_cw_he_after_remove(Halfedge_const_handle old_he,
|
|||
// CGAL_precondition(traits->is_td_vertex(vtx_item));
|
||||
// CGAL_precondition(traits->is_active(vtx_item));
|
||||
//
|
||||
// Halfedge_const_handle top_he (boost::apply_visitor(top_he_visitor(), vtx_item));
|
||||
// Halfedge_const_handle bottom_he (boost::apply_visitor(bottom_he_visitor(), vtx_item));
|
||||
// Halfedge_const_handle top_he (std::visit(top_he_visitor(), vtx_item));
|
||||
// Halfedge_const_handle bottom_he (std::visit(bottom_he_visitor(), vtx_item));
|
||||
//
|
||||
// //make sure the top & bottom are added in same direction as before
|
||||
// // such that sep is the source (done inside the set methods)
|
||||
// if ((top_he == he1) || (top_he == he1->twin()) ||
|
||||
// (top_he == he2) || (top_he == he2->twin()) )
|
||||
// {
|
||||
// boost::apply_visitor(set_top_he_visitor(new_he), vtx_item); //v_tr.set_top(new_he);
|
||||
// std::visit(set_top_he_visitor(new_he), vtx_item); //v_tr.set_top(new_he);
|
||||
// }
|
||||
// if ((bottom_he == he1) || (bottom_he == he1->twin()) ||
|
||||
// (bottom_he == he2) || (bottom_he == he2->twin()) )
|
||||
// {
|
||||
// boost::apply_visitor(set_bottom_he_visitor(new_he), vtx_item); //v_tr.set_bottom(new_he);
|
||||
// std::visit(set_bottom_he_visitor(new_he), vtx_item); //v_tr.set_bottom(new_he);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
|
@ -561,22 +561,22 @@ update_map_items_after_merge(In_face_iterator& it,
|
|||
CGAL_assertion(traits->is_active(curr_item));
|
||||
|
||||
if (traits->is_td_edge(curr_item)) {
|
||||
Td_active_edge& e(boost::get<Td_active_edge>(curr_item));
|
||||
Td_active_edge& e(std::get<Td_active_edge>(curr_item));
|
||||
if (e.halfedge() == old_he || e.halfedge() == old_he->twin())
|
||||
e.set_halfedge(new_he);
|
||||
}
|
||||
else if (traits->is_td_trapezoid(curr_item)) {
|
||||
Td_active_trapezoid& tr(boost::get<Td_active_trapezoid>(curr_item));
|
||||
Td_active_trapezoid& tr(std::get<Td_active_trapezoid>(curr_item));
|
||||
if (tr.bottom() == old_he || tr.bottom() == old_he->twin())
|
||||
tr.set_bottom(new_he);
|
||||
if (tr.top() == old_he || tr.top() == old_he->twin()) tr.set_top(new_he);
|
||||
}
|
||||
else {
|
||||
//if is_td_vertex
|
||||
Halfedge_const_handle cw_he(boost::apply_visitor(cw_he_visitor(),
|
||||
Halfedge_const_handle cw_he(std::visit(cw_he_visitor(),
|
||||
curr_item));
|
||||
if (cw_he == old_he || cw_he == old_he->twin())
|
||||
boost::apply_visitor(set_cw_he_visitor(new_he), curr_item);
|
||||
std::visit(set_cw_he_visitor(new_he), curr_item);
|
||||
}
|
||||
|
||||
last_item = *it;
|
||||
|
|
@ -615,20 +615,20 @@ search_using_dag(Dag_node& curr_node,
|
|||
if (traits->is_td_vertex(curr_item)) {
|
||||
// the curr_item represents a vertex
|
||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
||||
//if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) )
|
||||
//if ((is_fict_vtx && is_end_point_left_low(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(p, std::visit(point_for_vertex_visitor(), curr_item))) )
|
||||
if (is_end_point_left_low(p, curr_node)) {
|
||||
curr_node = curr_node.left_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(), curr_item))) )
|
||||
//else if ((is_fict_vtx && is_end_point_right_top(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(p, std::visit(point_for_vertex_visitor(), curr_item))) )
|
||||
else if (is_end_point_right_top(p, curr_node)) {
|
||||
curr_node = curr_node.right_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) )
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item), p)) )
|
||||
else if (are_equal_end_points(p, curr_node)) {
|
||||
if (he == m_empty_he_handle) {
|
||||
// he is the empty handle
|
||||
|
|
@ -663,13 +663,13 @@ search_using_dag(Dag_node& curr_node,
|
|||
are_equal_end_points(p,curr_node));
|
||||
|
||||
//(is_fict_vtx &&
|
||||
// (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||
// (is_end_point_left_low(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||
// (!is_fict_vtx &&
|
||||
// (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p))));
|
||||
// (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p))));
|
||||
|
||||
return Locate_type();
|
||||
}
|
||||
|
|
@ -678,7 +678,7 @@ search_using_dag(Dag_node& curr_node,
|
|||
// curr_item represents an edge,
|
||||
// so top() is a real Halfedge with a curve() if curr_item is active
|
||||
// or curr_item holds the curve if it is not active
|
||||
const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item));
|
||||
const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), curr_item));
|
||||
|
||||
Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv);
|
||||
if (cres == SMALLER) {
|
||||
|
|
@ -753,7 +753,7 @@ search_using_dag(Dag_node& curr_node,
|
|||
else {
|
||||
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||
if (traits->is_active(curr_item)) {
|
||||
Td_active_trapezoid& tr = boost::get<Td_active_trapezoid>(curr_item);
|
||||
Td_active_trapezoid& tr = std::get<Td_active_trapezoid>(curr_item);
|
||||
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||
}
|
||||
curr_node = curr_node.left_child();
|
||||
|
|
@ -810,30 +810,30 @@ search_using_dag(Dag_node& curr_node,
|
|||
// bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
||||
// if (is_fict_vtx)
|
||||
// {
|
||||
// Curve_end vtx_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)));
|
||||
// Curve_end vtx_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)));
|
||||
// print_ce_data(vtx_ce.cv(), vtx_ce.ce(), out);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// print_point_data(boost::apply_visitor(point_for_vertex_visitor(),curr_item), out);
|
||||
// print_point_data(std::visit(point_for_vertex_visitor(),curr_item), out);
|
||||
// }
|
||||
//
|
||||
// if ((is_fict_vtx && is_end_point_left_low(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) )
|
||||
// if ((is_fict_vtx && is_end_point_left_low(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(p, std::visit(point_for_vertex_visitor(),curr_item))) )
|
||||
// {
|
||||
// out << " Going left " << std::endl;
|
||||
// curr_node = curr_node.left_child();
|
||||
// continue;
|
||||
// }
|
||||
// else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(p, boost::apply_visitor(point_for_vertex_visitor(),curr_item))) )
|
||||
// else if ((is_fict_vtx && is_end_point_right_top(p, *(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)))) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(p, std::visit(point_for_vertex_visitor(),curr_item))) )
|
||||
// {
|
||||
// out << " Going right " << std::endl;
|
||||
// curr_node = curr_node.right_child();
|
||||
// continue;
|
||||
// }
|
||||
// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(),curr_item), p)) )
|
||||
// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(),curr_item), p)) )
|
||||
// {
|
||||
// out << " Equal to query " << std::endl;
|
||||
// if (he == m_empty_he_handle) //if he is the empty handle
|
||||
|
|
@ -876,7 +876,7 @@ search_using_dag(Dag_node& curr_node,
|
|||
// // if curr_item represents an edge,
|
||||
// // so top() is a real Halfedge with a curve() if curr_item is active
|
||||
// // or curr_item holds the curve if it is not active
|
||||
// const X_monotone_curve_2& he_cv = *(boost::apply_visitor(cv_for_edge_visitor(), curr_item));
|
||||
// const X_monotone_curve_2& he_cv = *(std::visit(cv_for_edge_visitor(), curr_item));
|
||||
//
|
||||
// out << " EDGE : " ;
|
||||
// if (traits->is_active(curr_item))
|
||||
|
|
@ -951,7 +951,7 @@ search_using_dag(Dag_node& curr_node,
|
|||
// if (traits->is_active(curr_item))
|
||||
// {
|
||||
// out << " (active) ";
|
||||
// Td_active_trapezoid tr = boost::get<Td_active_trapezoid>(curr_item);
|
||||
// Td_active_trapezoid tr = std::get<Td_active_trapezoid>(curr_item);
|
||||
// if (tr.is_on_boundaries())
|
||||
// out << " UNBOUNDED! ";
|
||||
// else
|
||||
|
|
@ -1023,20 +1023,20 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
if (traits->is_td_vertex(curr_item)) {
|
||||
// the curr_item represents a vertex
|
||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
if (is_end_point_left_low(ce, curr_node)) {
|
||||
curr_node = curr_node.left_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
//else if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
else if (is_end_point_right_top(ce, curr_node)) {
|
||||
curr_node = curr_node.right_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), ce)) ||
|
||||
// (!is_fict_vtx && traits->equal_curve_end_2_object()(std::visit(point_for_vertex_visitor(), curr_item), ce)) )
|
||||
else if (are_equal_end_points(ce, curr_node)) {
|
||||
if (!p_cv) {
|
||||
// p_cv was not given
|
||||
|
|
@ -1070,13 +1070,13 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
is_end_point_right_top(ce, curr_node) ||
|
||||
are_equal_end_points(ce, curr_node));
|
||||
//(is_fict_vtx &&
|
||||
// (is_end_point_left_low(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) ||
|
||||
// (is_end_point_left_low(ce,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(ce,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) ||
|
||||
// (!is_fict_vtx &&
|
||||
// (is_end_point_left_low(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_curve_end_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),ce))));
|
||||
// (is_end_point_left_low(ce,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(ce,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_curve_end_2_object()(std::visit(point_for_vertex_visitor(), curr_item),ce))));
|
||||
return Locate_type();
|
||||
}
|
||||
}
|
||||
|
|
@ -1086,7 +1086,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
// or curr_item holds the curve if it is not active
|
||||
|
||||
const X_monotone_curve_2& he_cv =
|
||||
*(boost::apply_visitor(cv_for_edge_visitor(), curr_item));
|
||||
*(std::visit(cv_for_edge_visitor(), curr_item));
|
||||
Comparison_result cres =
|
||||
traits->compare_curve_end_y_at_x_2_object()(ce, he_cv);
|
||||
if (cres == SMALLER) {
|
||||
|
|
@ -1174,7 +1174,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
else {
|
||||
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||
if (traits->is_active(curr_item)) {
|
||||
Td_active_trapezoid& tr = boost::get<Td_active_trapezoid>(curr_item);
|
||||
Td_active_trapezoid& tr = std::get<Td_active_trapezoid>(curr_item);
|
||||
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||
}
|
||||
curr_node = curr_node.left_child();
|
||||
|
|
@ -1213,20 +1213,20 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
if (traits->is_td_vertex(curr_item)) {
|
||||
// the curr_item represents a vertex
|
||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) )
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), p)) )
|
||||
if (is_end_point_left_low(p, curr_node)) {
|
||||
curr_node = curr_node.left_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) )
|
||||
//else if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), p)) )
|
||||
else if (is_end_point_right_top(p, curr_node)) {
|
||||
curr_node = curr_node.right_child();
|
||||
continue;
|
||||
}
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item), p)) )
|
||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), p)) ||
|
||||
// (!is_fict_vtx && traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item), p)) )
|
||||
else if (are_equal_end_points(p, curr_node)) {
|
||||
if (!p_cv) {
|
||||
// p_cv was not given
|
||||
|
|
@ -1260,13 +1260,13 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
is_end_point_right_top(p, curr_node) ||
|
||||
are_equal_end_points(p, curr_node));
|
||||
//CGAL_assertion((is_fict_vtx &&
|
||||
// (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||
// (is_end_point_left_low(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// is_end_point_right_top(p,*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
||||
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||
// (!is_fict_vtx &&
|
||||
// (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p))));
|
||||
// (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||
// traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p))));
|
||||
return Locate_type();
|
||||
}
|
||||
}
|
||||
|
|
@ -1275,7 +1275,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
// so top() is a real Halfedge with a curve() if curr_item is active
|
||||
// or curr_item holds the curve if it is not active
|
||||
const X_monotone_curve_2& he_cv =
|
||||
*(boost::apply_visitor(cv_for_edge_visitor(), curr_item));
|
||||
*(std::visit(cv_for_edge_visitor(), curr_item));
|
||||
Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv);
|
||||
if (cres == SMALLER) {
|
||||
curr_node = curr_node.left_child();
|
||||
|
|
@ -1351,7 +1351,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
|||
else {
|
||||
// is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||
if (traits->is_active(curr_item)) {
|
||||
Td_active_trapezoid& tr = boost::get<Td_active_trapezoid>(curr_item);
|
||||
Td_active_trapezoid& tr = std::get<Td_active_trapezoid>(curr_item);
|
||||
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||
}
|
||||
curr_node = curr_node.left_child();
|
||||
|
|
@ -1377,7 +1377,7 @@ container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const
|
|||
CGAL_assertion(traits->is_active(item));
|
||||
CGAL_assertion(traits->is_td_trapezoid(item));
|
||||
Dag_node& tr_node( ar.find(d)->second);
|
||||
Td_active_trapezoid& tr(boost::get<Td_active_trapezoid>(tr_node.get_data()));
|
||||
Td_active_trapezoid& tr(std::get<Td_active_trapezoid>(tr_node.get_data()));
|
||||
Vertex_const_handle v = tr.right();
|
||||
|
||||
Curve_end ce(traits->vtx_to_ce(v));
|
||||
|
|
@ -1397,15 +1397,15 @@ container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const
|
|||
}
|
||||
|
||||
num_of_new_nodes++;
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.left_child())), curr_node.left_child().get_data());
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)&(curr_node.right_child())), curr_node.right_child().get_data());
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)&curr_node),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)&(curr_node.left_child())), curr_node.left_child().get_data());
|
||||
std::visit(set_dag_node_visitor((Dag_node*)&(curr_node.right_child())), curr_node.right_child().get_data());
|
||||
std::visit(set_dag_node_visitor((Dag_node*)&curr_node),
|
||||
curr_node.get_data());
|
||||
//curr_node.left_child()->set_dag_node(&curr_node.left_child());
|
||||
//curr_node.right_child()->set_dag_node(&curr_node.right_child());
|
||||
//curr_node->set_dag_node(&curr_node);// fake temporary node
|
||||
deactivate_vertex(curr_node); //curr_node->remove(); // mark as deleted
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)nullptr),
|
||||
std::visit(set_dag_node_visitor((Dag_node*)nullptr),
|
||||
curr_node.get_data());//curr_node->set_dag_node(0);
|
||||
|
||||
return curr_node;
|
||||
|
|
@ -1423,7 +1423,7 @@ is_last_edge(Halfedge_const_handle /* he */ , Td_map_item& vtx_item)
|
|||
CGAL_precondition(traits->is_active(vtx_item));
|
||||
|
||||
Vertex_const_handle
|
||||
v(boost::apply_visitor(vertex_for_active_vertex_visitor(), vtx_item));
|
||||
v(std::visit(vertex_for_active_vertex_visitor(), vtx_item));
|
||||
|
||||
typename Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator
|
||||
first, second;
|
||||
|
|
@ -1518,13 +1518,13 @@ Trapezoidal_decomposition_2<Td_traits>::insert(Halfedge_const_handle he)
|
|||
|
||||
// locate and insert end points of the input halfedge to the Td_map_item
|
||||
// Dag if needed
|
||||
Dag_node p1_node(*(boost::apply_visitor(dag_node_visitor(), p1_item)));
|
||||
//Dag_node p2_node(*(boost::apply_visitor(dag_node_visitor(), p2_item)));// Not in use
|
||||
Dag_node p1_node(*(std::visit(dag_node_visitor(), p1_item)));
|
||||
//Dag_node p2_node(*(std::visit(dag_node_visitor(), p2_item)));// Not in use
|
||||
|
||||
// create the Td_map_item iterator for traveling along the Trapezoids that
|
||||
// intersect the input Halfedge, using left-low to right-high order
|
||||
In_face_iterator it = follow_curve(p1_node,he,LARGER);
|
||||
boost::optional<Td_active_trapezoid> curr_trp = boost::none;
|
||||
std::optional<Td_active_trapezoid> curr_trp = std::nullopt;
|
||||
Td_map_item prev = p1_item;
|
||||
Td_map_item prev_bottom_tr = Td_map_item(0); //active_tr
|
||||
Td_map_item prev_top_tr = Td_map_item(0); //active_tr
|
||||
|
|
@ -1539,7 +1539,7 @@ Trapezoidal_decomposition_2<Td_traits>::insert(Halfedge_const_handle he)
|
|||
|
||||
while(!!it) { //this means as long as the iterator is valid
|
||||
curr_trp = it.trp();
|
||||
CGAL_assertion(curr_trp != boost::none);
|
||||
CGAL_assertion(curr_trp != std::nullopt);
|
||||
prev_bottom_tr = (*curr_trp).lb();
|
||||
prev_top_tr = (*curr_trp).lt();
|
||||
|
||||
|
|
@ -1568,7 +1568,7 @@ Trapezoidal_decomposition_2<Td_traits>::insert(Halfedge_const_handle he)
|
|||
traits->is_active(new_btm_item));
|
||||
if (merge_if_possible(prev_bottom_tr, new_btm_item)) {
|
||||
Dag_node* left_child_node =
|
||||
boost::apply_visitor(dag_node_visitor(),prev_bottom_tr);
|
||||
std::visit(dag_node_visitor(),prev_bottom_tr);
|
||||
node->set_left_child(*left_child_node);
|
||||
old_bottom_tr = prev_bottom_tr;
|
||||
m_number_of_dag_nodes--; //update number of nodes in the DAG after merge
|
||||
|
|
@ -1581,7 +1581,7 @@ Trapezoidal_decomposition_2<Td_traits>::insert(Halfedge_const_handle he)
|
|||
CGAL_assertion(traits->is_td_trapezoid(new_top_item) &&
|
||||
traits->is_active(new_top_item));
|
||||
if (merge_if_possible(prev_top_tr, new_top_item)) {
|
||||
Dag_node* right_child_node = boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* right_child_node = std::visit(dag_node_visitor(),
|
||||
prev_top_tr);
|
||||
node->set_right_child(*right_child_node);
|
||||
old_top_tr = prev_top_tr;
|
||||
|
|
@ -1654,12 +1654,12 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
|
||||
if (lt1 != POINT || lt2 != POINT) return;
|
||||
|
||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != nullptr);
|
||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != nullptr);
|
||||
CGAL_warning(std::visit(dag_node_visitor(), p1_item) != nullptr);
|
||||
CGAL_warning(std::visit(dag_node_visitor(), p2_item) != nullptr);
|
||||
|
||||
//retrieve the Dag_nodes of the two point-degenerate trapezoid
|
||||
Dag_node& p1_node = *(boost::apply_visitor(dag_node_visitor(), p1_item));
|
||||
Dag_node& p2_node = *(boost::apply_visitor(dag_node_visitor(), p2_item));
|
||||
Dag_node& p1_node = *(std::visit(dag_node_visitor(), p1_item));
|
||||
Dag_node& p2_node = *(std::visit(dag_node_visitor(), p2_item));
|
||||
|
||||
//calculate the immediate lower, central and upper neighborhood of
|
||||
// the curve in the data structure
|
||||
|
|
@ -1725,7 +1725,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
//copy trapezoid data from btm and top trapezoids
|
||||
Dag_node& new_node = (new_array.find(sz))->second;
|
||||
++sz;
|
||||
Td_active_trapezoid& tr(boost::get<Td_active_trapezoid>(new_node.get_data()));
|
||||
Td_active_trapezoid& tr(std::get<Td_active_trapezoid>(new_node.get_data()));
|
||||
tr.set_dag_node(&new_node);
|
||||
tr.set_lb(btm_it_tr.lb());
|
||||
tr.set_lt(top_it_tr.lt());
|
||||
|
|
@ -1741,13 +1741,13 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
}
|
||||
if (!traits->is_empty_item(tr.lb())) {
|
||||
Td_map_item lb_item = tr.lb();
|
||||
Td_active_trapezoid& lb_tr(boost::get<Td_active_trapezoid>(lb_item));
|
||||
Td_active_trapezoid& lb_tr(std::get<Td_active_trapezoid>(lb_item));
|
||||
lb_tr.set_rb(new_node.get_data());
|
||||
}
|
||||
if (!traits->is_empty_item(tr.lt()))
|
||||
{
|
||||
Td_map_item lt_item = tr.lt();
|
||||
Td_active_trapezoid& lt_tr(boost::get<Td_active_trapezoid>(lt_item));
|
||||
Td_active_trapezoid& lt_tr(std::get<Td_active_trapezoid>(lt_item));
|
||||
lt_tr.set_rt(new_node.get_data());
|
||||
}
|
||||
|
||||
|
|
@ -1769,23 +1769,23 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
if (!btm_it ||
|
||||
(inc_btm && !traits->is_trpz_bottom_equal(old_tr_item, *curr_it)))
|
||||
{
|
||||
Td_map_item rb(boost::apply_visitor(rb_visitor(), old_tr_item));
|
||||
Td_map_item rb(std::visit(rb_visitor(), old_tr_item));
|
||||
if (!traits->is_empty_item(rb)) {
|
||||
boost::apply_visitor(set_lb_visitor(last_new_tr_item), rb);
|
||||
std::visit(set_lb_visitor(last_new_tr_item), rb);
|
||||
//rb->set_lb(last_new_tr);
|
||||
boost::apply_visitor(set_rb_visitor(rb), last_new_tr_item);
|
||||
std::visit(set_rb_visitor(rb), last_new_tr_item);
|
||||
//last_new_tr->set_rb(rb);
|
||||
}
|
||||
}
|
||||
if (!top_it ||
|
||||
(!inc_btm && !traits->is_trpz_top_equal(old_tr_item,*curr_it)))
|
||||
{
|
||||
Td_map_item rt(boost::apply_visitor(rt_visitor(), old_tr_item));
|
||||
Td_map_item rt(std::visit(rt_visitor(), old_tr_item));
|
||||
if (!traits->is_empty_item(rt))
|
||||
{
|
||||
boost::apply_visitor(set_lt_visitor(last_new_tr_item), rt);
|
||||
std::visit(set_lt_visitor(last_new_tr_item), rt);
|
||||
//rt->set_lt(last_new_tr);
|
||||
boost::apply_visitor(set_rt_visitor(rt), last_new_tr_item);
|
||||
std::visit(set_rt_visitor(rt), last_new_tr_item);
|
||||
//last_new_tr->set_rt(rt);
|
||||
}
|
||||
}
|
||||
|
|
@ -1793,7 +1793,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
//set the no longer relevant trapezoids as removed and add the new nodes
|
||||
// as their replacement
|
||||
|
||||
Dag_node* last_tr_node(boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* last_tr_node(std::visit(dag_node_visitor(),
|
||||
last_tr_item));
|
||||
|
||||
if (prev_inc_btm != inc_btm) {
|
||||
|
|
@ -1827,7 +1827,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
|
||||
// update the dag node pointer in the trapezoid
|
||||
const Dag_node* real = &last_tr_node->left_child();
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real);
|
||||
std::visit(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real);
|
||||
}
|
||||
while(!end_reached);
|
||||
|
||||
|
|
@ -1853,18 +1853,18 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
m_number_of_dag_nodes += num_of_new_nodes; //new node (tmp) was added
|
||||
|
||||
const Dag_node* real = &tr.dag_node()->left_child();
|
||||
boost::apply_visitor(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real);
|
||||
std::visit(set_dag_node_visitor((Dag_node*)real),real->get_data()); //(*real)->set_dag_node((Dag_node*)real);
|
||||
|
||||
if (!traits->is_empty_item(rb)) {
|
||||
boost::apply_visitor(set_rb_visitor(rb),last_new_tr_item);
|
||||
std::visit(set_rb_visitor(rb),last_new_tr_item);
|
||||
//last_new_tr->set_rb(rb);
|
||||
boost::apply_visitor(set_lb_visitor(last_new_tr_item),rb);
|
||||
std::visit(set_lb_visitor(last_new_tr_item),rb);
|
||||
//rb->set_lb(last_new_tr);
|
||||
}
|
||||
if (!traits->is_empty_item(rt)) {
|
||||
boost::apply_visitor(set_rt_visitor(rt),last_new_tr_item);
|
||||
std::visit(set_rt_visitor(rt),last_new_tr_item);
|
||||
//last_new_tr->set_rt(rt);
|
||||
boost::apply_visitor(set_lt_visitor(last_new_tr_item),rt);
|
||||
std::visit(set_lt_visitor(last_new_tr_item),rt);
|
||||
//rt->set_lt(last_new_tr);
|
||||
}
|
||||
|
||||
|
|
@ -1876,7 +1876,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
//Base_trapezoid_iterator last_mid = mid_it;
|
||||
Dag_node* e_node = nullptr;
|
||||
while (!!++mid_it) {
|
||||
e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it);
|
||||
e_node = std::visit(dag_node_visitor(),*last_edge_fragment_it);
|
||||
deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove();
|
||||
last_edge_fragment_it = mid_it;
|
||||
}
|
||||
|
|
@ -1885,7 +1885,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
|
|||
//4. remove adjacency at right end point
|
||||
|
||||
//remove the final trapezoid representing the removed halfedge
|
||||
e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it);
|
||||
e_node = std::visit(dag_node_visitor(),*last_edge_fragment_it);
|
||||
deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove();
|
||||
|
||||
//-----------------------------------
|
||||
|
|
@ -1945,7 +1945,7 @@ vertical_ray_shoot(const Point & p,Locate_type & lt,
|
|||
p
|
||||
x------x
|
||||
*/
|
||||
Td_active_trapezoid& tr(boost::get<Td_active_trapezoid>(item));
|
||||
Td_active_trapezoid& tr(std::get<Td_active_trapezoid>(item));
|
||||
|
||||
if ((up_direction && !tr.is_on_right_boundary() &&
|
||||
(traits->compare_curve_end_x_2_object()
|
||||
|
|
@ -2637,9 +2637,9 @@ merge_edge(Halfedge_const_handle he1,
|
|||
Td_map_item mrgp_item = locate(ce, lt);
|
||||
|
||||
//varifying that all trapezoids are not nullptr and are of type POINT
|
||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), leftp_item) != nullptr);
|
||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), rightp_item)!= nullptr);
|
||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), mrgp_item) != nullptr);
|
||||
CGAL_warning(std::visit(dag_node_visitor(), leftp_item) != nullptr);
|
||||
CGAL_warning(std::visit(dag_node_visitor(), rightp_item)!= nullptr);
|
||||
CGAL_warning(std::visit(dag_node_visitor(), mrgp_item) != nullptr);
|
||||
|
||||
//define the left curve and the right curve, according
|
||||
// to the common point (that is merged)
|
||||
|
|
@ -2679,8 +2679,8 @@ merge_edge(Halfedge_const_handle he1,
|
|||
#endif
|
||||
|
||||
//get the nodes of leftmost point and merge point
|
||||
Dag_node& leftp_node = *(boost::apply_visitor(dag_node_visitor(), leftp_item));
|
||||
Dag_node& mrgp_node = *(boost::apply_visitor(dag_node_visitor(), mrgp_item));
|
||||
Dag_node& leftp_node = *(std::visit(dag_node_visitor(), leftp_item));
|
||||
Dag_node& mrgp_node = *(std::visit(dag_node_visitor(), mrgp_item));
|
||||
|
||||
//set iterators for below left curve, on left curve & above left curve
|
||||
In_face_iterator
|
||||
|
|
@ -2760,15 +2760,15 @@ merge_edge(Halfedge_const_handle he1,
|
|||
merge_if_possible(below_cv_left, below_cv_right);
|
||||
|
||||
// mark older trapezoids as inactive - nodes depth are updated here
|
||||
Dag_node* above_cv_right_node(boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* above_cv_right_node(std::visit(dag_node_visitor(),
|
||||
above_cv_right));
|
||||
Dag_node* above_cv_left_node(boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* above_cv_left_node(std::visit(dag_node_visitor(),
|
||||
above_cv_left));
|
||||
deactivate_trapezoid( *above_cv_right_node, above_cv_left_node);
|
||||
//above_cv_right->remove(above_cv_left->dag_node());
|
||||
Dag_node* below_cv_right_node(boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* below_cv_right_node(std::visit(dag_node_visitor(),
|
||||
below_cv_right));
|
||||
Dag_node* below_cv_left_node(boost::apply_visitor(dag_node_visitor(),
|
||||
Dag_node* below_cv_left_node(std::visit(dag_node_visitor(),
|
||||
below_cv_left));
|
||||
deactivate_trapezoid( *below_cv_right_node, below_cv_left_node);
|
||||
//below_cv_right->remove(below_cv_left->dag_node());
|
||||
|
|
@ -2788,7 +2788,7 @@ merge_edge(Halfedge_const_handle he1,
|
|||
CGAL_assertion(traits->is_td_edge(on_cv_left) &&
|
||||
traits->is_active(on_cv_left));
|
||||
|
||||
Td_active_edge& e_left(boost::get<Td_active_edge>(on_cv_left));
|
||||
Td_active_edge& e_left(std::get<Td_active_edge>(on_cv_left));
|
||||
e_left.set_next(on_cv_right);
|
||||
|
||||
CGAL_assertion(traits->is_td_edge(on_cv_right) &&
|
||||
|
|
@ -2830,17 +2830,17 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
|||
if (!minus_inf && !plus_inf) {
|
||||
Td_map_item min_node_item(min_node.get_data());
|
||||
if (traits->is_fictitious_vertex(min_node_item)) {
|
||||
const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item)));
|
||||
const Curve_end min_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),min_node_item)));
|
||||
|
||||
Td_map_item max_node_item(max_node.get_data());
|
||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
||||
const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
|
||||
//min-fict, max-fict
|
||||
if (!is_end_point_left_low(min_ce, max_ce)) return 0;
|
||||
}
|
||||
else {
|
||||
const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),
|
||||
const Point& max_p(std::visit(point_for_vertex_visitor(),
|
||||
max_node_item));
|
||||
|
||||
//min-fict, max-pt
|
||||
|
|
@ -2849,18 +2849,18 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
|||
}
|
||||
}
|
||||
else {
|
||||
const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(),
|
||||
const Point& min_p(std::visit(point_for_vertex_visitor(),
|
||||
min_node_item));
|
||||
|
||||
Td_map_item max_node_item(max_node.get_data());
|
||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
||||
const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
|
||||
//min-pt, max-fict
|
||||
if (!is_end_point_left_low(min_p, max_ce)) return 0;
|
||||
}
|
||||
else {
|
||||
const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),
|
||||
const Point& max_p(std::visit(point_for_vertex_visitor(),
|
||||
max_node_item));
|
||||
|
||||
//min-pt, max-pt
|
||||
|
|
@ -2893,19 +2893,19 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
|||
if (!minus_inf) {
|
||||
Td_map_item min_node_item(min_node.get_data());
|
||||
if (traits->is_fictitious_vertex(min_node_item)) {
|
||||
const Curve_end min_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),min_node_item)));
|
||||
const Curve_end min_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),min_node_item)));
|
||||
//if smaller than the point represented by min_node
|
||||
//if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_ce) ))
|
||||
//if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), min_ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), min_ce) ))
|
||||
if (is_end_point_right_top(min_ce, node)) {
|
||||
new_min_node = min_node;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Point& min_p(boost::apply_visitor(point_for_vertex_visitor(),min_node_item));
|
||||
const Point& min_p(std::visit(point_for_vertex_visitor(),min_node_item));
|
||||
//if smaller than the point represented by min_node
|
||||
//if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), min_p)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(boost::apply_visitor(point_for_vertex_visitor(), curr_item), min_p) ))
|
||||
//if ((is_fict_vtx && is_end_point_left_low(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), min_p)) ||
|
||||
// (!is_fict_vtx && is_end_point_left_low(std::visit(point_for_vertex_visitor(), curr_item), min_p) ))
|
||||
if (is_end_point_right_top(min_p, node)) {
|
||||
new_min_node = min_node;
|
||||
}
|
||||
|
|
@ -2917,21 +2917,21 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
|||
if (!plus_inf) {
|
||||
Td_map_item max_node_item(max_node.get_data());
|
||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
||||
const Curve_end max_ce(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
const Curve_end max_ce(*(std::visit(curve_end_for_fict_vertex_visitor(),max_node_item)));
|
||||
//if larger than the point represented by max_node
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_ce) ))
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), max_ce)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), max_ce) ))
|
||||
if (is_end_point_left_low(max_ce, node))
|
||||
{
|
||||
new_max_node = max_node;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const Point& max_p(boost::apply_visitor(point_for_vertex_visitor(),
|
||||
const Point& max_p(std::visit(point_for_vertex_visitor(),
|
||||
max_node_item));
|
||||
//if smaller than the point represented by min_node
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item)), max_p)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(boost::apply_visitor(point_for_vertex_visitor(), curr_item), max_p) ))
|
||||
//if ((is_fict_vtx && is_end_point_right_top(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)), max_p)) ||
|
||||
// (!is_fict_vtx && is_end_point_right_top(std::visit(point_for_vertex_visitor(), curr_item), max_p) ))
|
||||
if (is_end_point_left_low(max_p, node)) {
|
||||
new_max_node = max_node;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,41 +15,10 @@
|
|||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
// The macro CGAL_ARR_POINT_LOCATION_VERSION controls which version of the
|
||||
// point location is used. Currently two values are supported:
|
||||
// 1. Point location with CGAL::Object
|
||||
// 2. Point location with boost::optional<boost::variant<...> >
|
||||
// The default value is 2.
|
||||
|
||||
#if !defined(CGAL_ARR_POINT_LOCATION_VERSION)
|
||||
#define CGAL_ARR_POINT_LOCATION_VERSION 2
|
||||
#endif
|
||||
|
||||
#include <CGAL/Object.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#ifdef CGAL_CFG_BOOST_VARIANT_SWAP_BUG
|
||||
#if CGAL_ARR_POINT_LOCATION_VERSION > 1
|
||||
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
|
||||
// workaround for this bug:
|
||||
// https://svn.boost.org/trac/boost/ticket/2839
|
||||
namespace boost{ namespace detail { namespace variant {
|
||||
|
||||
template <class CI, class F, class MI, class V, class D, class C>
|
||||
inline void move_swap(
|
||||
::CGAL::I_Filtered_const_iterator<CI, F, MI, V, D, C>& lhs,
|
||||
::CGAL::I_Filtered_const_iterator<CI, F, MI, V, D, C>& rhs)
|
||||
{
|
||||
::CGAL::I_Filtered_const_iterator<CI, F, MI, V, D, C> tmp( boost::detail::variant::move(lhs) );
|
||||
lhs = boost::detail::variant::move(rhs);
|
||||
rhs = boost::detail::variant::move(tmp);
|
||||
}
|
||||
} } }
|
||||
#endif
|
||||
#endif
|
||||
#include <optional>
|
||||
#include <variant>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -61,46 +30,27 @@ struct Arr_point_location_result {
|
|||
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
|
||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||
|
||||
#if CGAL_ARR_POINT_LOCATION_VERSION < 2
|
||||
typedef CGAL::Object Type;
|
||||
#else
|
||||
typedef typename boost::variant<Vertex_const_handle,
|
||||
typedef typename std::variant<Vertex_const_handle,
|
||||
Halfedge_const_handle,
|
||||
Face_const_handle> Type;
|
||||
#endif
|
||||
typedef Type type;
|
||||
|
||||
// This function returns either make_object() or a result_type constructor
|
||||
// to generate return values. The Object version takes a dummy template
|
||||
// argument, which is needed for the return of the other option, e.g.,
|
||||
// boost::optional<boost::variant> >.
|
||||
// This function returns a result_type constructor
|
||||
// to generate return values.
|
||||
// In theory a one parameter variant could be returned, but this _could_
|
||||
// lead to conversion overhead, and so we rather go for the real type.
|
||||
// Overloads for empty returns are also provided.
|
||||
#if CGAL_ARR_POINT_LOCATION_VERSION < 2
|
||||
template <typename T>
|
||||
static
|
||||
inline Type make_result(T t) { return CGAL::make_object(t); }
|
||||
|
||||
static
|
||||
inline CGAL::Object empty_optional_result() { return CGAL::Object(); }
|
||||
|
||||
template <typename T>
|
||||
static
|
||||
inline const T* assign(const Type* obj) { return CGAL::object_cast<T>(obj); }
|
||||
#else
|
||||
template <typename T>
|
||||
static
|
||||
inline Type make_result(T t) { return Type(t); }
|
||||
|
||||
static
|
||||
inline boost::optional<Type> empty_optional_result()
|
||||
{ return boost::optional<Type>(); }
|
||||
inline std::optional<Type> empty_optional_result()
|
||||
{ return std::optional<Type>(); }
|
||||
|
||||
template <typename T>
|
||||
static
|
||||
inline const T* assign(const Type* obj) { return boost::get<T>(obj); }
|
||||
#endif // CGAL_ARR_POINT_LOCATION_VERSION < 2
|
||||
inline const T* assign(const Type* obj) { return std::get_if<T>(obj); }
|
||||
|
||||
//this one is only to remove warnings in functions
|
||||
static
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include <iterator>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/tags.h>
|
||||
|
|
@ -185,9 +185,9 @@ public:
|
|||
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
||||
Arr_all_sides_oblivious_tag) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_subcurve_2>
|
||||
typedef std::variant<Point_2, X_monotone_subcurve_2>
|
||||
Make_x_monotone_subresult;
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
// If the polycurve is empty, return.
|
||||
|
|
@ -212,7 +212,7 @@ public:
|
|||
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
||||
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
||||
auto it = x_seg_objects.begin();
|
||||
const auto* x_seg_p = boost::get<X_monotone_subcurve_2>(&(*it));
|
||||
const auto* x_seg_p = std::get_if<X_monotone_subcurve_2>(&(*it));
|
||||
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||
CGAL_assertion(x_seg_p != nullptr);
|
||||
#endif
|
||||
|
|
@ -260,7 +260,7 @@ public:
|
|||
#endif
|
||||
|
||||
for (++it; it != x_seg_objects.end(); ++it) {
|
||||
const auto* x_seg_p = boost::get<X_monotone_subcurve_2>(&(*it));
|
||||
const auto* x_seg_p = std::get_if<X_monotone_subcurve_2>(&(*it));
|
||||
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||
CGAL_assertion(x_seg_p != nullptr);
|
||||
#endif
|
||||
|
|
@ -318,9 +318,9 @@ public:
|
|||
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
||||
Arr_not_all_sides_oblivious_tag) const
|
||||
{
|
||||
typedef boost::variant<Point_2, X_monotone_subcurve_2>
|
||||
typedef std::variant<Point_2, X_monotone_subcurve_2>
|
||||
Make_x_monotone_subresult;
|
||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
||||
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||
Make_x_monotone_result;
|
||||
|
||||
// If the polycurve is empty, return.
|
||||
|
|
@ -350,7 +350,7 @@ public:
|
|||
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
||||
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
||||
auto it = x_seg_objects.begin();
|
||||
const auto* x_seg_p = boost::get<X_monotone_subcurve_2>(&(*it));
|
||||
const auto* x_seg_p = std::get_if<X_monotone_subcurve_2>(&(*it));
|
||||
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||
CGAL_assertion(x_seg_p != nullptr);
|
||||
#endif
|
||||
|
|
@ -398,7 +398,7 @@ public:
|
|||
#endif
|
||||
|
||||
for (++it; it != x_seg_objects.end(); ++it) {
|
||||
const auto* x_seg_p = boost::get<X_monotone_subcurve_2>(&(*it));
|
||||
const auto* x_seg_p = std::get_if<X_monotone_subcurve_2>(&(*it));
|
||||
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||
CGAL_assertion(x_seg_p != nullptr);
|
||||
#endif
|
||||
|
|
@ -696,10 +696,9 @@ public:
|
|||
OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_subcurve_2>
|
||||
typedef std::variant<Intersection_point, X_monotone_subcurve_2>
|
||||
Intersection_base_result;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
|
||||
|
||||
const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
|
||||
auto cmp_y_at_x = m_poly_traits.compare_y_at_x_2_object();
|
||||
|
|
@ -744,7 +743,7 @@ public:
|
|||
// cv1's right endpoint equals cv2's left endpoint
|
||||
// Thus we can return this single(!) intersection point
|
||||
Intersection_point p(max_vertex(cv1[i1]), 0);
|
||||
*oi++ = Intersection_result(p);
|
||||
*oi++ = p;
|
||||
return oi;
|
||||
}
|
||||
dir1 == SMALLER ?
|
||||
|
|
@ -767,7 +766,7 @@ public:
|
|||
// cv2's right endpoint equals cv1's left endpoint
|
||||
// Thus we can return this single(!) intersection point
|
||||
Intersection_point p(max_vertex(cv2[i2]), 0);
|
||||
*oi++ = Intersection_result(p);
|
||||
*oi++ = p;
|
||||
return oi;
|
||||
}
|
||||
|
||||
|
|
@ -824,7 +823,7 @@ public:
|
|||
intersect(cv1[i1], cv2[i2], std::back_inserter(xections));
|
||||
for (const auto& xection : xections) {
|
||||
const X_monotone_subcurve_2* subcv_p =
|
||||
boost::get<X_monotone_subcurve_2>(&xection);
|
||||
std::get_if<X_monotone_subcurve_2>(&xection);
|
||||
if (subcv_p != nullptr) {
|
||||
ocv.push_back(*subcv_p);
|
||||
oi = output_ocv (ocv, invert_ocv, oi);
|
||||
|
|
@ -832,8 +831,8 @@ public:
|
|||
}
|
||||
|
||||
const Intersection_point* p_p =
|
||||
boost::get<Intersection_point>(&xection);
|
||||
if (p_p != nullptr) *oi++ = Intersection_result(*p_p);
|
||||
std::get_if<Intersection_point>(&xection);
|
||||
if (p_p != nullptr) *oi++ = *p_p;
|
||||
}
|
||||
}
|
||||
else if (right_coincides && left_coincides) {
|
||||
|
|
@ -846,7 +845,7 @@ public:
|
|||
|
||||
for (const auto& item : sub_xections) {
|
||||
const X_monotone_subcurve_2* x_seg =
|
||||
boost::get<X_monotone_subcurve_2>(&item);
|
||||
std::get_if<X_monotone_subcurve_2>(&item);
|
||||
if (x_seg != nullptr) {
|
||||
X_monotone_subcurve_2 seg = *x_seg;
|
||||
// We maintain the variant that if the input curves have opposite
|
||||
|
|
@ -863,7 +862,7 @@ public:
|
|||
}
|
||||
|
||||
const Intersection_point* p_ptr =
|
||||
boost::get<Intersection_point>(&item);
|
||||
std::get_if<Intersection_point>(&item);
|
||||
if (p_ptr != nullptr) {
|
||||
// Any point that is not equal to the max_vertex of the
|
||||
// subcurve should be inserted into oi.
|
||||
|
|
@ -871,7 +870,7 @@ public:
|
|||
// will be taken care of as the min_vertex of in the next
|
||||
// iteration.
|
||||
if (! equal(p_ptr->first, max_vertex(cv1[i1])))
|
||||
*oi++ = Intersection_result(*p_ptr);
|
||||
*oi++ = *p_ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -896,11 +895,11 @@ public:
|
|||
// it multiplicity 0.
|
||||
if (left_res == SMALLER) {
|
||||
Intersection_point p(min_vertex(cv2[i2]), 0);
|
||||
*oi++ = Intersection_result(p);
|
||||
*oi++ = p;
|
||||
}
|
||||
else {
|
||||
Intersection_point p(min_vertex(cv1[i1]), 0);
|
||||
*oi++ = Intersection_result(p);
|
||||
*oi++ = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -941,7 +940,7 @@ public:
|
|||
(i1 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||
return_point(max_vertex(cv1[i1+1]), 0) :
|
||||
return_point(max_vertex(cv1[0]), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
else if (right_res == LARGER) {
|
||||
ip = (dir2 == SMALLER) ?
|
||||
|
|
@ -949,7 +948,7 @@ public:
|
|||
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||
return_point(max_vertex(cv2[i2+1]), 0) :
|
||||
return_point(max_vertex(cv2[0]), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
else if (((i1 > 0) && (dir1 == SMALLER)) ||
|
||||
((i1 < n1) && (dir1 != SMALLER)) ||
|
||||
|
|
@ -961,7 +960,7 @@ public:
|
|||
(i1 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||
return_point(max_vertex(cv1[i1+1]), 0) :
|
||||
return_point(max_vertex(cv1[0]), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
else {
|
||||
CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) ||
|
||||
|
|
@ -976,7 +975,7 @@ public:
|
|||
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||
return_point(max_vertex(cv2[i2+1]), 0) :
|
||||
return_point(max_vertex(cv2[0]), 0);
|
||||
*oi++ = Intersection_result(ip);
|
||||
*oi++ = ip;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -989,15 +988,12 @@ public:
|
|||
inline OutputIterator output_ocv
|
||||
(std::vector<X_monotone_subcurve_2>& ocv, bool invert_ocv, OutputIterator oi) const
|
||||
{
|
||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
||||
Intersection_result;
|
||||
X_monotone_curve_2 curve;
|
||||
if (invert_ocv)
|
||||
std::reverse (ocv.begin(), ocv.end());
|
||||
for (X_monotone_subcurve_2& sc : ocv)
|
||||
curve.push_back (sc);
|
||||
*(oi ++) = Intersection_result(curve);
|
||||
*(oi ++) = curve;
|
||||
|
||||
ocv.clear();
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue