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)`,
|
`return_type operator()(const Query& q, const Primitive::Datum& d)`,
|
||||||
|
|
||||||
which computes the intersection between `q` and `d`. The type of the returned object
|
which computes the intersection between `q` and `d`. The type of the returned object
|
||||||
must be a `boost::optional` of a `boost::variant` of the possible intersection types.
|
must be a `std::optional` of a `std::variant` of the possible intersection types.
|
||||||
*/
|
*/
|
||||||
typedef unspecified_type Intersect_3;
|
typedef unspecified_type Intersect_3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,15 @@ public:
|
||||||
/*!
|
/*!
|
||||||
A functor object to compute the distance between the source of a ray and its
|
A functor object to compute the distance between the source of a ray and its
|
||||||
closest intersection point between the ray and a primitive or a bounding box.
|
closest intersection point between the ray and a primitive or a bounding box.
|
||||||
An empty `boost::optional` is returned, if there is no intersection.
|
An empty `std::optional` is returned, if there is no intersection.
|
||||||
When there is an intersection, an object of type `FT` is returned such that
|
When there is an intersection, an object of type `FT` is returned such that
|
||||||
if `i1` and `i2` are two intersection points, then `i1` is closer to the source
|
if `i1` and `i2` are two intersection points, then `i1` is closer to the source
|
||||||
of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2`
|
of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2`
|
||||||
respectively.
|
respectively.
|
||||||
|
|
||||||
Provides the operators:
|
Provides the operators:
|
||||||
`boost::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
|
`std::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
|
||||||
`boost::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
|
`std::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
|
||||||
operator()(const Ray_3& r, const Primitive& primitive)`.
|
operator()(const Ray_3& r, const Primitive& primitive)`.
|
||||||
|
|
||||||
A common algorithm to compute the intersection between a bounding box and a ray is <A
|
A common algorithm to compute the intersection between a bounding box and a ray is <A
|
||||||
|
|
|
||||||
|
|
@ -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:
|
A functor object to compute the intersection of a query and a primitive. Provides the operator:
|
||||||
`boost::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
|
`std::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
|
||||||
|
|
||||||
\cgalHeading{Note on Backward Compatibility}
|
\cgalHeading{Note on Backward Compatibility}
|
||||||
Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional<Object_and_primitive_id>`.
|
Before the release 4.3 of \cgal, the return type of this function used to be `std::optional<Object_and_primitive_id>`.
|
||||||
*/
|
*/
|
||||||
typedef unspecified_type Intersection;
|
typedef unspecified_type Intersection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ typedef CGAL::Polyhedron_3<K> Polyhedron;
|
||||||
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
|
||||||
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
||||||
typedef CGAL::AABB_tree<Traits> Tree;
|
typedef CGAL::AABB_tree<Traits> Tree;
|
||||||
typedef boost::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection;
|
typedef std::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection;
|
||||||
typedef boost::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
|
typedef std::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
|
||||||
typedef Tree::Primitive_id Primitive_id;
|
typedef Tree::Primitive_id Primitive_id;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|
@ -57,7 +57,7 @@ int main()
|
||||||
if(intersection)
|
if(intersection)
|
||||||
{
|
{
|
||||||
// gets intersection object
|
// gets intersection object
|
||||||
const Point* p = boost::get<Point>(&(intersection->first));
|
const Point* p = std::get_if<Point>(&(intersection->first));
|
||||||
if(p)
|
if(p)
|
||||||
std::cout << "intersection object is a point " << *p << std::endl;
|
std::cout << "intersection object is a point " << *p << std::endl;
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ int main()
|
||||||
if(plane_intersection)
|
if(plane_intersection)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(boost::get<Segment>(&(plane_intersection->first)))
|
if(std::get_if<Segment>(&(plane_intersection->first)))
|
||||||
std::cout << "intersection object is a segment" << std::endl;
|
std::cout << "intersection object is a segment" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ typedef boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
|
||||||
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh> Primitive;
|
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh> Primitive;
|
||||||
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
typedef CGAL::AABB_traits<K, Primitive> Traits;
|
||||||
typedef CGAL::AABB_tree<Traits> Tree;
|
typedef CGAL::AABB_tree<Traits> Tree;
|
||||||
typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
|
typedef std::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
|
||||||
|
|
||||||
struct Skip
|
struct Skip
|
||||||
{
|
{
|
||||||
|
|
@ -70,8 +70,8 @@ int main(int argc, char* argv[])
|
||||||
Ray_intersection intersection = tree.first_intersection(ray, skip);
|
Ray_intersection intersection = tree.first_intersection(ray, skip);
|
||||||
if(intersection)
|
if(intersection)
|
||||||
{
|
{
|
||||||
if(boost::get<Point>(&(intersection->first))){
|
if(std::get_if<Point>(&(intersection->first))){
|
||||||
const Point* p = boost::get<Point>(&(intersection->first) );
|
const Point* p = std::get_if<Point>(&(intersection->first) );
|
||||||
std::cout << *p << std::endl;
|
std::cout << *p << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
|
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
|
||||||
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
/// \file AABB_traits.h
|
/// \file AABB_traits.h
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ template <class T>
|
||||||
struct Remove_optional { typedef T type; };
|
struct Remove_optional { typedef T type; };
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct Remove_optional< ::boost::optional<T> > { typedef T type; };
|
struct Remove_optional< ::std::optional<T> > { typedef T type; };
|
||||||
|
|
||||||
//helper controlling whether extra data should be stored in the AABB_tree traits class
|
//helper controlling whether extra data should be stored in the AABB_tree traits class
|
||||||
template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value>
|
template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value>
|
||||||
|
|
@ -85,7 +85,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
|
||||||
typedef typename CGAL::Bbox_3 Bounding_box;
|
typedef typename CGAL::Bbox_3 Bounding_box;
|
||||||
|
|
||||||
struct Intersection_distance {
|
struct Intersection_distance {
|
||||||
boost::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
|
std::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
|
||||||
FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903
|
FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903
|
||||||
FT t_far = DBL_MAX;
|
FT t_far = DBL_MAX;
|
||||||
|
|
||||||
|
|
@ -101,7 +101,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
|
||||||
for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) {
|
for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) {
|
||||||
if(*direction_iter == 0) {
|
if(*direction_iter == 0) {
|
||||||
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
|
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
|
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
|
||||||
|
|
@ -118,7 +118,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
|
||||||
// t_far = t2;
|
// t_far = t2;
|
||||||
|
|
||||||
if(t_near > t_far || t_far < FT(0.))
|
if(t_near > t_far || t_far < FT(0.))
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ public:
|
||||||
|
|
||||||
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
|
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
|
||||||
/// the result type of `GeomTraits::Intersect_3::operator()`. If it is
|
/// the result type of `GeomTraits::Intersect_3::operator()`. If it is
|
||||||
/// `boost::optional<T>` then it is `T`, and the result type otherwise.
|
/// `std::optional<T>` then it is `T`, and the result type otherwise.
|
||||||
template<typename Query>
|
template<typename Query>
|
||||||
struct Intersection_and_primitive_id {
|
struct Intersection_and_primitive_id {
|
||||||
typedef decltype(
|
typedef decltype(
|
||||||
|
|
@ -364,12 +364,12 @@ public:
|
||||||
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
||||||
:m_traits(traits) {}
|
:m_traits(traits) {}
|
||||||
template<typename Query>
|
template<typename Query>
|
||||||
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename Intersection_and_primitive_id<Query>::Type >
|
||||||
operator()(const Query& query, const typename AT::Primitive& primitive) const {
|
operator()(const Query& query, const typename AT::Primitive& primitive) const {
|
||||||
auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits));
|
auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits));
|
||||||
if (!inter_res)
|
if (!inter_res)
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
|
return std::make_optional( std::make_pair(*inter_res, primitive.id()) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include <CGAL/AABB_tree/internal/AABB_search_tree.h>
|
#include <CGAL/AABB_tree/internal/AABB_search_tree.h>
|
||||||
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
||||||
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
|
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
#ifdef CGAL_HAS_THREADS
|
#ifdef CGAL_HAS_THREADS
|
||||||
#include <CGAL/mutex.h>
|
#include <CGAL/mutex.h>
|
||||||
|
|
@ -270,7 +270,7 @@ public:
|
||||||
/// \tparam Query must be a type for which `Do_intersect` operators are
|
/// \tparam Query must be a type for which `Do_intersect` operators are
|
||||||
/// defined in the traits class `AABBTraits`.
|
/// defined in the traits class `AABBTraits`.
|
||||||
template <typename Query>
|
template <typename Query>
|
||||||
boost::optional<Primitive_id> any_intersected_primitive(const Query& query) const;
|
std::optional<Primitive_id> any_intersected_primitive(const Query& query) const;
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/// \name Intersections
|
/// \name Intersections
|
||||||
|
|
@ -293,7 +293,7 @@ public:
|
||||||
/// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are
|
/// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are
|
||||||
/// defined in the traits class `AABBTraits`.
|
/// defined in the traits class `AABBTraits`.
|
||||||
template <typename Query>
|
template <typename Query>
|
||||||
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename Intersection_and_primitive_id<Query>::Type >
|
||||||
any_intersection(const Query& query) const;
|
any_intersection(const Query& query) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -317,12 +317,12 @@ public:
|
||||||
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
||||||
/// call this member function.
|
/// call this member function.
|
||||||
template<typename Ray, typename SkipFunctor>
|
template<typename Ray, typename SkipFunctor>
|
||||||
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
std::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
||||||
first_intersection(const Ray& query, const SkipFunctor& skip) const;
|
first_intersection(const Ray& query, const SkipFunctor& skip) const;
|
||||||
|
|
||||||
/// \cond
|
/// \cond
|
||||||
template<typename Ray>
|
template<typename Ray>
|
||||||
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
std::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
||||||
first_intersection(const Ray& query) const
|
first_intersection(const Ray& query) const
|
||||||
{
|
{
|
||||||
return first_intersection(query, [](Primitive_id){ return false; });
|
return first_intersection(query, [](Primitive_id){ return false; });
|
||||||
|
|
@ -342,12 +342,12 @@ public:
|
||||||
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
|
||||||
/// call this member function.
|
/// call this member function.
|
||||||
template<typename Ray, typename SkipFunctor>
|
template<typename Ray, typename SkipFunctor>
|
||||||
boost::optional<Primitive_id>
|
std::optional<Primitive_id>
|
||||||
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
|
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
|
||||||
|
|
||||||
/// \cond
|
/// \cond
|
||||||
template<typename Ray>
|
template<typename Ray>
|
||||||
boost::optional<Primitive_id>
|
std::optional<Primitive_id>
|
||||||
first_intersected_primitive(const Ray& query) const
|
first_intersected_primitive(const Ray& query) const
|
||||||
{
|
{
|
||||||
return first_intersected_primitive(query, [](Primitive_id){ return false; });
|
return first_intersected_primitive(query, [](Primitive_id){ return false; });
|
||||||
|
|
@ -963,7 +963,7 @@ public:
|
||||||
|
|
||||||
template <typename Tr>
|
template <typename Tr>
|
||||||
template <typename Query>
|
template <typename Query>
|
||||||
boost::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
|
||||||
AABB_tree<Tr>::any_intersection(const Query& query) const
|
AABB_tree<Tr>::any_intersection(const Query& query) const
|
||||||
{
|
{
|
||||||
using namespace CGAL::internal::AABB_tree;
|
using namespace CGAL::internal::AABB_tree;
|
||||||
|
|
@ -975,7 +975,7 @@ public:
|
||||||
|
|
||||||
template <typename Tr>
|
template <typename Tr>
|
||||||
template <typename Query>
|
template <typename Query>
|
||||||
boost::optional<typename AABB_tree<Tr>::Primitive_id>
|
std::optional<typename AABB_tree<Tr>::Primitive_id>
|
||||||
AABB_tree<Tr>::any_intersected_primitive(const Query& query) const
|
AABB_tree<Tr>::any_intersected_primitive(const Query& query) const
|
||||||
{
|
{
|
||||||
using namespace CGAL::internal::AABB_tree;
|
using namespace CGAL::internal::AABB_tree;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,7 @@
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
#include <boost/variant/apply_visitor.hpp>
|
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4996)
|
# pragma warning(disable: 4996)
|
||||||
|
|
@ -43,7 +42,7 @@ class AABB_ray_intersection {
|
||||||
public:
|
public:
|
||||||
AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {}
|
AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {}
|
||||||
|
|
||||||
boost::optional< Ray_intersection_and_primitive_id >
|
std::optional< Ray_intersection_and_primitive_id >
|
||||||
ray_intersection(const Ray& query, SkipFunctor skip) const {
|
ray_intersection(const Ray& query, SkipFunctor skip) const {
|
||||||
// We hit the root, now continue on the children. Keep track of
|
// We hit the root, now continue on the children. Keep track of
|
||||||
// nb_primitives through a variable in each Node on the stack. In
|
// nb_primitives through a variable in each Node on the stack. In
|
||||||
|
|
@ -63,7 +62,7 @@ public:
|
||||||
|
|
||||||
Heap_type pq;
|
Heap_type pq;
|
||||||
// pq.reserve(tree_.size() / 2);
|
// pq.reserve(tree_.size() / 2);
|
||||||
boost::optional< Ray_intersection_and_primitive_id >
|
std::optional< Ray_intersection_and_primitive_id >
|
||||||
intersection, /* the temporary for calculating the result */
|
intersection, /* the temporary for calculating the result */
|
||||||
p; /* the current best intersection */
|
p; /* the current best intersection */
|
||||||
|
|
||||||
|
|
@ -84,7 +83,7 @@ public:
|
||||||
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
|
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
|
||||||
intersection = intersection_obj(query, current.node->left_data());
|
intersection = intersection_obj(query, current.node->left_data());
|
||||||
if(intersection) {
|
if(intersection) {
|
||||||
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
|
FT ray_distance = std::visit(param_visitor, intersection->first);
|
||||||
if(ray_distance < t) {
|
if(ray_distance < t) {
|
||||||
t = ray_distance;
|
t = ray_distance;
|
||||||
p = intersection;
|
p = intersection;
|
||||||
|
|
@ -96,7 +95,7 @@ public:
|
||||||
if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) {
|
if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) {
|
||||||
intersection = intersection_obj(query, current.node->right_data());
|
intersection = intersection_obj(query, current.node->right_data());
|
||||||
if(intersection) {
|
if(intersection) {
|
||||||
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
|
FT ray_distance = std::visit(param_visitor, intersection->first);
|
||||||
if(ray_distance < t) {
|
if(ray_distance < t) {
|
||||||
t = ray_distance;
|
t = ray_distance;
|
||||||
p = intersection;
|
p = intersection;
|
||||||
|
|
@ -111,7 +110,7 @@ public:
|
||||||
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
|
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
|
||||||
intersection = intersection_obj(query, current.node->left_data());
|
intersection = intersection_obj(query, current.node->left_data());
|
||||||
if(intersection) {
|
if(intersection) {
|
||||||
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
|
FT ray_distance = std::visit(param_visitor, intersection->first);
|
||||||
if(ray_distance < t) {
|
if(ray_distance < t) {
|
||||||
t = ray_distance;
|
t = ray_distance;
|
||||||
p = intersection;
|
p = intersection;
|
||||||
|
|
@ -121,7 +120,7 @@ public:
|
||||||
|
|
||||||
// right child
|
// right child
|
||||||
const Node* child = &(current.node->right_child());
|
const Node* child = &(current.node->right_child());
|
||||||
boost::optional< FT > dist = intersection_distance_obj(query, child->bbox());
|
std::optional< FT > dist = intersection_distance_obj(query, child->bbox());
|
||||||
if(dist)
|
if(dist)
|
||||||
pq.push(Node_ptr_with_ft(child, *dist, 2));
|
pq.push(Node_ptr_with_ft(child, *dist, 2));
|
||||||
|
|
||||||
|
|
@ -130,7 +129,7 @@ public:
|
||||||
default: // Children both inner nodes
|
default: // Children both inner nodes
|
||||||
{
|
{
|
||||||
const Node* child = &(current.node->left_child());
|
const Node* child = &(current.node->left_child());
|
||||||
boost::optional<FT> dist = intersection_distance_obj(query, child->bbox());
|
std::optional<FT> dist = intersection_distance_obj(query, child->bbox());
|
||||||
if(dist)
|
if(dist)
|
||||||
pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2));
|
pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2));
|
||||||
|
|
||||||
|
|
@ -198,7 +197,7 @@ private:
|
||||||
|
|
||||||
template<typename AABBTraits>
|
template<typename AABBTraits>
|
||||||
template<typename Ray, typename SkipFunctor>
|
template<typename Ray, typename SkipFunctor>
|
||||||
boost::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
|
std::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
|
||||||
AABB_tree<AABBTraits>::first_intersection(const Ray& query,
|
AABB_tree<AABBTraits>::first_intersection(const Ray& query,
|
||||||
const SkipFunctor& skip) const {
|
const SkipFunctor& skip) const {
|
||||||
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
|
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
|
||||||
|
|
@ -219,22 +218,22 @@ AABB_tree<AABBTraits>::first_intersection(const Ray& query,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename AABBTraits>
|
template<typename AABBTraits>
|
||||||
template<typename Ray, typename SkipFunctor>
|
template<typename Ray, typename SkipFunctor>
|
||||||
boost::optional<typename AABB_tree<AABBTraits>::Primitive_id>
|
std::optional<typename AABB_tree<AABBTraits>::Primitive_id>
|
||||||
AABB_tree<AABBTraits>::first_intersected_primitive(const Ray& query,
|
AABB_tree<AABBTraits>::first_intersected_primitive(const Ray& query,
|
||||||
const SkipFunctor& skip) const
|
const SkipFunctor& skip) const
|
||||||
{
|
{
|
||||||
boost::optional<
|
std::optional<
|
||||||
typename AABB_tree<AABBTraits>::
|
typename AABB_tree<AABBTraits>::
|
||||||
template Intersection_and_primitive_id<Ray>::Type > res =
|
template Intersection_and_primitive_id<Ray>::Type > res =
|
||||||
first_intersection(query, skip);
|
first_intersection(query, skip);
|
||||||
if ( (bool) res )
|
if ( (bool) res )
|
||||||
return boost::make_optional( res->second );
|
return std::make_optional( res->second );
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/AABB_tree/internal/AABB_node.h>
|
#include <CGAL/AABB_tree/internal/AABB_node.h>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ class First_intersection_traits
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef
|
typedef
|
||||||
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
||||||
Result;
|
Result;
|
||||||
public:
|
public:
|
||||||
First_intersection_traits(const AABBTraits& traits)
|
First_intersection_traits(const AABBTraits& traits)
|
||||||
|
|
@ -124,7 +124,7 @@ public:
|
||||||
|
|
||||||
void intersection(const Query& query, const Primitive& primitive)
|
void intersection(const Query& query, const Primitive& primitive)
|
||||||
{
|
{
|
||||||
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
|
||||||
intersection = m_traits.intersection_object()(query, primitive);
|
intersection = m_traits.intersection_object()(query, primitive);
|
||||||
|
|
||||||
if(intersection)
|
if(intersection)
|
||||||
|
|
@ -211,7 +211,7 @@ public:
|
||||||
{
|
{
|
||||||
if( m_traits.do_intersect_object()(query, primitive) )
|
if( m_traits.do_intersect_object()(query, primitive) )
|
||||||
{
|
{
|
||||||
m_result = boost::optional<typename Primitive::Id>(primitive.id());
|
m_result = std::optional<typename Primitive::Id>(primitive.id());
|
||||||
m_is_found = true;
|
m_is_found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -221,12 +221,12 @@ public:
|
||||||
return m_traits.do_intersect_object()(query, node.bbox());
|
return m_traits.do_intersect_object()(query, node.bbox());
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<typename Primitive::Id> result() const { return m_result; }
|
std::optional<typename Primitive::Id> result() const { return m_result; }
|
||||||
bool is_intersection_found() const { return m_is_found; }
|
bool is_intersection_found() const { return m_is_found; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_is_found;
|
bool m_is_found;
|
||||||
boost::optional<typename Primitive::Id> m_result;
|
std::optional<typename Primitive::Id> m_result;
|
||||||
const AABBTraits& m_traits;
|
const AABBTraits& m_traits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,20 +95,23 @@ void test_all_intersection_query_types(Tree& tree)
|
||||||
tree.all_intersected_primitives(segment,std::back_inserter(primitives));
|
tree.all_intersected_primitives(segment,std::back_inserter(primitives));
|
||||||
|
|
||||||
// any_intersection
|
// any_intersection
|
||||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
|
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
|
||||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
|
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
|
||||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
|
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
|
||||||
|
CGAL_USE(r);
|
||||||
|
CGAL_USE(l);
|
||||||
|
CGAL_USE(s);
|
||||||
|
|
||||||
// any_intersected_primitive
|
// any_intersected_primitive
|
||||||
boost::optional<typename Primitive::Id> optional_primitive;
|
std::optional<typename Primitive::Id> optional_primitive;
|
||||||
optional_primitive = tree.any_intersected_primitive(ray);
|
optional_primitive = tree.any_intersected_primitive(ray);
|
||||||
optional_primitive = tree.any_intersected_primitive(line);
|
optional_primitive = tree.any_intersected_primitive(line);
|
||||||
optional_primitive = tree.any_intersected_primitive(segment);
|
optional_primitive = tree.any_intersected_primitive(segment);
|
||||||
|
|
||||||
// all_intersections
|
// all_intersections
|
||||||
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
|
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
|
||||||
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
|
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
|
||||||
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
|
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
|
||||||
tree.all_intersections(ray,std::back_inserter(intersections_r));
|
tree.all_intersections(ray,std::back_inserter(intersections_r));
|
||||||
tree.all_intersections(line,std::back_inserter(intersections_l));
|
tree.all_intersections(line,std::back_inserter(intersections_l));
|
||||||
tree.all_intersections(segment,std::back_inserter(intersections_s));
|
tree.all_intersections(segment,std::back_inserter(intersections_s));
|
||||||
|
|
@ -322,7 +325,7 @@ class Naive_implementations
|
||||||
typedef typename Traits::Point_3 Point;
|
typedef typename Traits::Point_3 Point;
|
||||||
typedef typename Traits::Point_and_primitive_id Point_and_primitive_id;
|
typedef typename Traits::Point_and_primitive_id Point_and_primitive_id;
|
||||||
|
|
||||||
typedef boost::optional<Object_and_primitive_id> Intersection_result;
|
typedef std::optional<Object_and_primitive_id> Intersection_result;
|
||||||
|
|
||||||
const Traits& m_traits;
|
const Traits& m_traits;
|
||||||
public:
|
public:
|
||||||
|
|
@ -380,7 +383,7 @@ public:
|
||||||
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
|
||||||
for ( ; it != Pr_generator().end(p) ; ++it )
|
for ( ; it != Pr_generator().end(p) ; ++it )
|
||||||
{
|
{
|
||||||
boost::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
|
||||||
intersection = m_traits.intersection_object()(query, Pr(it,p));
|
intersection = m_traits.intersection_object()(query, Pr(it,p));
|
||||||
if ( intersection )
|
if ( intersection )
|
||||||
*out++ = *intersection;
|
*out++ = *intersection;
|
||||||
|
|
@ -653,7 +656,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
// any_intersected_primitive test (do not count time here)
|
// any_intersected_primitive test (do not count time here)
|
||||||
typedef boost::optional<typename Primitive::Id> Any_primitive;
|
typedef std::optional<typename Primitive::Id> Any_primitive;
|
||||||
Any_primitive primitive = tree.any_intersected_primitive(query);
|
Any_primitive primitive = tree.any_intersected_primitive(query);
|
||||||
|
|
||||||
// Check: verify we do get the result by naive method
|
// Check: verify we do get the result by naive method
|
||||||
|
|
@ -723,7 +726,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Any intersection test (do not count time here)
|
// Any intersection test (do not count time here)
|
||||||
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
|
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
|
||||||
intersection = tree.any_intersection(query);
|
intersection = tree.any_intersection(query);
|
||||||
|
|
||||||
// Check: verify we do get the result by naive method
|
// Check: verify we do get the result by naive method
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo
|
||||||
v.reserve(elements);
|
v.reserve(elements);
|
||||||
for(; b != e; ++b) {
|
for(; b != e; ++b) {
|
||||||
tree.all_intersections(*b, std::back_inserter(v));
|
tree.all_intersections(*b, std::back_inserter(v));
|
||||||
boost::optional<Obj_type> o = tree.any_intersection(*b);
|
std::optional<Obj_type> o = tree.any_intersection(*b);
|
||||||
if(o)
|
if(o)
|
||||||
++counter;
|
++counter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ int test()
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<Object_and_primitive_id> any;
|
std::optional<Object_and_primitive_id> any;
|
||||||
any = tree.any_intersection(pq);
|
any = tree.any_intersection(pq);
|
||||||
if(!any)
|
if(!any)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ FT point_on_ray_dist(const Ray& ray, const Point& point) {
|
||||||
|
|
||||||
std::size_t accum = 0;
|
std::size_t accum = 0;
|
||||||
|
|
||||||
boost::optional<
|
std::optional<
|
||||||
Tree::Intersection_and_primitive_id<Ray>::Type
|
Tree::Intersection_and_primitive_id<Ray>::Type
|
||||||
>
|
>
|
||||||
min_intersection(const Tree& tree, const Ray& ray) {
|
min_intersection(const Tree& tree, const Ray& ray) {
|
||||||
|
|
@ -45,12 +45,12 @@ min_intersection(const Tree& tree, const Ray& ray) {
|
||||||
tree.all_intersections(ray, std::back_inserter(all_intersections));
|
tree.all_intersections(ray, std::back_inserter(all_intersections));
|
||||||
accum += all_intersections.size();
|
accum += all_intersections.size();
|
||||||
Tree::FT min_distance = DBL_MAX;
|
Tree::FT min_distance = DBL_MAX;
|
||||||
boost::optional<
|
std::optional<
|
||||||
Tree::Intersection_and_primitive_id<Ray>::Type
|
Tree::Intersection_and_primitive_id<Ray>::Type
|
||||||
> mini = boost::none;
|
> mini = std::nullopt;
|
||||||
|
|
||||||
for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) {
|
for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) {
|
||||||
if(Point* point = boost::get<Point>(&(it2->first))) {
|
if(Point* point = std::get_if<Point>(&(it2->first))) {
|
||||||
Vector i_ray(*point, ray.source());
|
Vector i_ray(*point, ray.source());
|
||||||
Tree::FT new_distance = i_ray.squared_length();
|
Tree::FT new_distance = i_ray.squared_length();
|
||||||
if(new_distance < min_distance) {
|
if(new_distance < min_distance) {
|
||||||
|
|
@ -124,7 +124,7 @@ int main()
|
||||||
rays.reserve(NB_RAYS);
|
rays.reserve(NB_RAYS);
|
||||||
std::transform(v1.begin(), v1.end(), v2.begin(),
|
std::transform(v1.begin(), v1.end(), v2.begin(),
|
||||||
std::back_inserter(rays), boost::value_factory<Ray>());
|
std::back_inserter(rays), boost::value_factory<Ray>());
|
||||||
std::vector< boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2;
|
std::vector< std::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2;
|
||||||
primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS);
|
primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ int main()
|
||||||
}
|
}
|
||||||
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
|
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
|
||||||
assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch
|
assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch
|
||||||
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none);
|
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), std::nullopt);
|
||||||
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
|
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
|
||||||
std::cout << "Primitive method had to sort " << accum/NB_RAYS
|
std::cout << "Primitive method had to sort " << accum/NB_RAYS
|
||||||
<< " intersections on average." << std::endl;
|
<< " intersections on average." << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
|
||||||
\cgalConcept
|
\cgalConcept
|
||||||
|
|
||||||
A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain).
|
A model of `EuclideanRing` represents a Euclidean ring (or Euclidean domain).
|
||||||
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
|
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
|
||||||
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
|
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
|
||||||
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.
|
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/config.h>
|
#include <CGAL/config.h>
|
||||||
|
|
@ -359,7 +359,7 @@ public:
|
||||||
Unary_compose(const Unary_compose& other) = default;
|
Unary_compose(const Unary_compose& other) = default;
|
||||||
Unary_compose& operator=(const Unary_compose& other) = default;
|
Unary_compose& operator=(const Unary_compose& other) = default;
|
||||||
|
|
||||||
Unary_compose() : _inner(::boost::none),_outer(::boost::none) {}
|
Unary_compose() : _inner(::std::nullopt),_outer(::std::nullopt) {}
|
||||||
|
|
||||||
typedef typename InnerFunctor::argument_type argument_type;
|
typedef typename InnerFunctor::argument_type argument_type;
|
||||||
typedef typename OuterFunctor::result_type result_type;
|
typedef typename OuterFunctor::result_type result_type;
|
||||||
|
|
@ -368,11 +368,11 @@ public:
|
||||||
result_type operator() (const argument_type& arg) const {
|
result_type operator() (const argument_type& arg) const {
|
||||||
CGAL_assertion(bool(_inner));
|
CGAL_assertion(bool(_inner));
|
||||||
CGAL_assertion(bool(_outer));
|
CGAL_assertion(bool(_outer));
|
||||||
return _outer.get()(_inner.get()(arg));
|
return _outer.value()(_inner.value()(arg));
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
::boost::optional<InnerFunctor> _inner;
|
::std::optional<InnerFunctor> _inner;
|
||||||
::boost::optional<OuterFunctor> _outer;
|
::std::optional<OuterFunctor> _outer;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename InnerFunctor,typename OuterFunctor>
|
template<typename InnerFunctor,typename OuterFunctor>
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ public:
|
||||||
long old_precision = get_precision( BFI() );
|
long old_precision = get_precision( BFI() );
|
||||||
set_precision( BFI(), 53 );
|
set_precision( BFI(), 53 );
|
||||||
std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this)));
|
std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this)));
|
||||||
this->ptr()->interval_option = boost::optional< std::pair<double, double> >(interval);
|
this->ptr()->interval_option = std::optional< std::pair<double, double> >(interval);
|
||||||
set_precision( BFI(), old_precision );
|
set_precision( BFI(), old_precision );
|
||||||
return *(this->ptr()->interval_option);
|
return *(this->ptr()->interval_option);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,10 +86,10 @@ private:
|
||||||
CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1>
|
CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1>
|
||||||
::Other::Type BFI_polynomial;
|
::Other::Type BFI_polynomial;
|
||||||
|
|
||||||
mutable boost::optional
|
mutable std::optional
|
||||||
< BFI_polynomial > f_bfi_;
|
< BFI_polynomial > f_bfi_;
|
||||||
|
|
||||||
mutable boost::optional<BFI> low_bfi_, f_low_bfi_,
|
mutable std::optional<BFI> low_bfi_, f_low_bfi_,
|
||||||
high_bfi_, f_high_bfi_;
|
high_bfi_, f_high_bfi_;
|
||||||
|
|
||||||
mutable long N;
|
mutable long N;
|
||||||
|
|
@ -113,8 +113,8 @@ private:
|
||||||
low_bfi_ = CGAL::convert_to_bfi(this->low());
|
low_bfi_ = CGAL::convert_to_bfi(this->low());
|
||||||
|
|
||||||
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
||||||
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get());
|
f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
|
||||||
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get());
|
f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bfi = CGAL::convert_to_bfi(m);
|
m_bfi = CGAL::convert_to_bfi(m);
|
||||||
f_m_bfi = f_bfi_.get().evaluate(m_bfi);
|
f_m_bfi = f_bfi_.value().evaluate(m_bfi);
|
||||||
|
|
||||||
if(CGAL::zero_in(f_m_bfi)) {
|
if(CGAL::zero_in(f_m_bfi)) {
|
||||||
|
|
||||||
|
|
@ -229,21 +229,21 @@ protected:
|
||||||
|
|
||||||
bool poly_changed = (P!=this->polynomial());
|
bool poly_changed = (P!=this->polynomial());
|
||||||
if(poly_changed) {
|
if(poly_changed) {
|
||||||
f_bfi_ = boost::none;
|
f_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
if(poly_changed || LOW != this->low()) {
|
if(poly_changed || LOW != this->low()) {
|
||||||
f_low_bfi_ = low_bfi_ = boost::none;
|
f_low_bfi_ = low_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
if(poly_changed || HIGH != this->high()) {
|
if(poly_changed || HIGH != this->high()) {
|
||||||
f_high_bfi_ = high_bfi_ = boost::none;
|
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
Base::set_implicit_rep(P,LOW,HIGH,dummy_bool);
|
Base::set_implicit_rep(P,LOW,HIGH,dummy_bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_explicit_rep(const Field& m) const {
|
virtual void set_explicit_rep(const Field& m) const {
|
||||||
f_bfi_ = boost::none;
|
f_bfi_ = std::nullopt;
|
||||||
f_low_bfi_ = low_bfi_ = boost::none;
|
f_low_bfi_ = low_bfi_ = std::nullopt;
|
||||||
f_high_bfi_ = high_bfi_ = boost::none;
|
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||||
Base::set_explicit_rep(m);
|
Base::set_explicit_rep(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,13 +256,13 @@ public:
|
||||||
if(this->is_rational()) return;
|
if(this->is_rational()) return;
|
||||||
|
|
||||||
if(old_low_!=this->low_) {
|
if(old_low_!=this->low_) {
|
||||||
f_low_bfi_ = low_bfi_ = boost::none;
|
f_low_bfi_ = low_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
if(old_high_!=this->high_) {
|
if(old_high_!=this->high_) {
|
||||||
f_high_bfi_ = high_bfi_ = boost::none;
|
f_high_bfi_ = high_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
if(old_pol != this->polynomial()) {
|
if(old_pol != this->polynomial()) {
|
||||||
f_bfi_ = boost::none;
|
f_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -329,25 +329,25 @@ private:
|
||||||
low_bfi_ = CGAL::convert_to_bfi(this->low());
|
low_bfi_ = CGAL::convert_to_bfi(this->low());
|
||||||
}
|
}
|
||||||
if(! f_low_bfi_) {
|
if(! f_low_bfi_) {
|
||||||
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get());
|
f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
|
||||||
}
|
}
|
||||||
if(! high_bfi_) {
|
if(! high_bfi_) {
|
||||||
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
high_bfi_ = CGAL::convert_to_bfi(this->high());
|
||||||
}
|
}
|
||||||
if(! f_high_bfi_) {
|
if(! f_high_bfi_) {
|
||||||
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get());
|
f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
|
||||||
}
|
}
|
||||||
Integer i;
|
Integer i;
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
if(CGAL::zero_in(f_low_bfi_.get() - f_high_bfi_.get())) {
|
if(CGAL::zero_in(f_low_bfi_.value() - f_high_bfi_.value())) {
|
||||||
_set_prec(2*prec_);
|
_set_prec(2*prec_);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BFI denom = f_low_bfi_.get()-f_high_bfi_.get();
|
BFI denom = f_low_bfi_.value()-f_high_bfi_.value();
|
||||||
|
|
||||||
BFI z = f_low_bfi_.get() / denom;
|
BFI z = f_low_bfi_.value() / denom;
|
||||||
|
|
||||||
std::pair<Integer, Integer> int_pair = _to_integer_interval(z,N);
|
std::pair<Integer, Integer> int_pair = _to_integer_interval(z,N);
|
||||||
Integer i_low = int_pair.first;
|
Integer i_low = int_pair.first;
|
||||||
|
|
@ -458,7 +458,7 @@ protected:
|
||||||
f_bfi_ = _convert_polynomial_to_bfi(this->polynomial());
|
f_bfi_ = _convert_polynomial_to_bfi(this->polynomial());
|
||||||
}
|
}
|
||||||
|
|
||||||
BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m));
|
BFI eval = f_bfi_.value().evaluate(convert_to_bfi(m));
|
||||||
|
|
||||||
CGAL::Sign s = CGAL::sign(CGAL::lower(eval));
|
CGAL::Sign s = CGAL::sign(CGAL::lower(eval));
|
||||||
|
|
||||||
|
|
@ -490,7 +490,7 @@ public:
|
||||||
Poly f_old = this->polynomial();
|
Poly f_old = this->polynomial();
|
||||||
Base::simplify();
|
Base::simplify();
|
||||||
if(f_old != this->polynomial()) {
|
if(f_old != this->polynomial()) {
|
||||||
f_bfi_ = boost::none;
|
f_bfi_ = std::nullopt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Polynomial_type_generator.h>
|
#include <CGAL/Polynomial_type_generator.h>
|
||||||
#include <CGAL/Polynomial_traits_d.h>
|
#include <CGAL/Polynomial_traits_d.h>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ private:
|
||||||
|
|
||||||
typedef Algebraic_real_rep <Coefficient,Rational> Self;
|
typedef Algebraic_real_rep <Coefficient,Rational> Self;
|
||||||
public:
|
public:
|
||||||
typedef boost::optional< std::pair<double, double> > Interval_option;
|
typedef std::optional< std::pair<double, double> > Interval_option;
|
||||||
|
|
||||||
mutable Poly polynomial_; //!< square free polynomial
|
mutable Poly polynomial_; //!< square free polynomial
|
||||||
mutable Rational low_; //!< lower endpoint of interval
|
mutable Rational low_; //!< lower endpoint of interval
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
#include <CGAL/tss.h>
|
#include <CGAL/tss.h>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AUXILIARY CLASSES AND FUNCTIONS
|
* AUXILIARY CLASSES AND FUNCTIONS
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ private:
|
||||||
size_type index_of_content_root;
|
size_type index_of_content_root;
|
||||||
size_type mult_of_prim_lcoeff_root;
|
size_type mult_of_prim_lcoeff_root;
|
||||||
size_type index_of_prim_lcoeff_root;
|
size_type index_of_prim_lcoeff_root;
|
||||||
boost::optional<Status_line_1> stack;
|
std::optional<Status_line_1> stack;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Functor to get the X_coordinate of an Event_coordinate
|
// Functor to get the X_coordinate of an Event_coordinate
|
||||||
|
|
@ -210,14 +210,14 @@ private:
|
||||||
|
|
||||||
|
|
||||||
//! The object holding the information about events, as an optional
|
//! The object holding the information about events, as an optional
|
||||||
mutable boost::optional<std::vector<Event_coordinate_1> >
|
mutable std::optional<std::vector<Event_coordinate_1> >
|
||||||
event_coordinates;
|
event_coordinates;
|
||||||
|
|
||||||
//! The algebraic kernel to use
|
//! The algebraic kernel to use
|
||||||
Algebraic_kernel_with_analysis_2* _m_kernel;
|
Algebraic_kernel_with_analysis_2* _m_kernel;
|
||||||
|
|
||||||
//! The polynomial defining the curve
|
//! The polynomial defining the curve
|
||||||
boost::optional<Polynomial_2> f;
|
std::optional<Polynomial_2> f;
|
||||||
|
|
||||||
//! How degenerate situations are handled
|
//! How degenerate situations are handled
|
||||||
CGAL::Degeneracy_strategy degeneracy_strategy;
|
CGAL::Degeneracy_strategy degeneracy_strategy;
|
||||||
|
|
@ -230,24 +230,24 @@ private:
|
||||||
* \c f/cont(f). The corresponding curve is equal to the curve of \c f,
|
* \c f/cont(f). The corresponding curve is equal to the curve of \c f,
|
||||||
* only without vertical line components.
|
* only without vertical line components.
|
||||||
*/
|
*/
|
||||||
mutable boost::optional<Polynomial_2> f_primitive;
|
mutable std::optional<Polynomial_2> f_primitive;
|
||||||
|
|
||||||
//! the polynomial containing all roots of the resultant of the primitive
|
//! the polynomial containing all roots of the resultant of the primitive
|
||||||
//! part of f and its y-derivative
|
//! part of f and its y-derivative
|
||||||
mutable boost::optional<Polynomial_1>
|
mutable std::optional<Polynomial_1>
|
||||||
resultant_of_primitive_and_derivative_y;
|
resultant_of_primitive_and_derivative_y;
|
||||||
|
|
||||||
//! the polynomial containing all roots of the resultant of the primitive
|
//! the polynomial containing all roots of the resultant of the primitive
|
||||||
//! part of f and its x-derivative
|
//! part of f and its x-derivative
|
||||||
mutable boost::optional<Polynomial_1>
|
mutable std::optional<Polynomial_1>
|
||||||
resultant_of_primitive_and_derivative_x;
|
resultant_of_primitive_and_derivative_x;
|
||||||
|
|
||||||
//! The Sturm-Habicht polynomials of f
|
//! The Sturm-Habicht polynomials of f
|
||||||
mutable boost::optional<std::vector<Polynomial_2> >
|
mutable std::optional<std::vector<Polynomial_2> >
|
||||||
sturm_habicht_of_primitive;
|
sturm_habicht_of_primitive;
|
||||||
|
|
||||||
//! The content of f
|
//! The content of f
|
||||||
mutable boost::optional<Polynomial_1> content;
|
mutable std::optional<Polynomial_1> content;
|
||||||
|
|
||||||
//! The non-working shear factors, as far as known
|
//! The non-working shear factors, as far as known
|
||||||
mutable std::set<Integer> bad_shears;
|
mutable std::set<Integer> bad_shears;
|
||||||
|
|
@ -256,10 +256,10 @@ private:
|
||||||
mutable std::map<Integer,Handle> sheared_curves;
|
mutable std::map<Integer,Handle> sheared_curves;
|
||||||
|
|
||||||
//! Has the curve vertical line components
|
//! Has the curve vertical line components
|
||||||
mutable boost::optional<bool> has_vertical_component;
|
mutable std::optional<bool> has_vertical_component;
|
||||||
|
|
||||||
//! The intermediate values
|
//! The intermediate values
|
||||||
mutable boost::optional<std::vector<boost::optional<Bound> > >
|
mutable std::optional<std::vector<std::optional<Bound> > >
|
||||||
intermediate_values;
|
intermediate_values;
|
||||||
|
|
||||||
//! stores Y_values at rational coordinate
|
//! stores Y_values at rational coordinate
|
||||||
|
|
@ -272,7 +272,7 @@ private:
|
||||||
* are asymptotic to y=beta,
|
* are asymptotic to y=beta,
|
||||||
* or go to +/- infty also in y-direction
|
* or go to +/- infty also in y-direction
|
||||||
*/
|
*/
|
||||||
mutable boost::optional<std::vector<CGAL::Object> >
|
mutable std::optional<std::vector<CGAL::Object> >
|
||||||
horizontal_asymptotes_left, horizontal_asymptotes_right;
|
horizontal_asymptotes_left, horizontal_asymptotes_right;
|
||||||
|
|
||||||
//! friends
|
//! friends
|
||||||
|
|
@ -546,7 +546,7 @@ private:
|
||||||
|
|
||||||
if(! this->ptr()->intermediate_values) {
|
if(! this->ptr()->intermediate_values) {
|
||||||
this->ptr()->intermediate_values
|
this->ptr()->intermediate_values
|
||||||
= std::vector<boost::optional<Bound> >
|
= std::vector<std::optional<Bound> >
|
||||||
(number_of_status_lines_with_event()+1);
|
(number_of_status_lines_with_event()+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -583,7 +583,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void set_f(Polynomial_2 f) {
|
void set_f(Polynomial_2 f) {
|
||||||
CGAL_precondition(! has_defining_polynomial());
|
CGAL_precondition(! has_defining_polynomial());
|
||||||
if((! this->ptr()->f) || f!=this->ptr()->f.get()) {
|
if((! this->ptr()->f) || f!=this->ptr()->f.value()) {
|
||||||
this->copy_on_write();
|
this->copy_on_write();
|
||||||
this->ptr()->f=f;
|
this->ptr()->f=f;
|
||||||
}
|
}
|
||||||
|
|
@ -630,7 +630,7 @@ public:
|
||||||
event_coordinates();
|
event_coordinates();
|
||||||
CGAL_assertion(this->ptr()->has_vertical_component);
|
CGAL_assertion(this->ptr()->has_vertical_component);
|
||||||
}
|
}
|
||||||
return this->ptr()->has_vertical_component.get();
|
return this->ptr()->has_vertical_component.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -638,7 +638,7 @@ public:
|
||||||
//! Returns the defining polynomial
|
//! Returns the defining polynomial
|
||||||
Polynomial_2 polynomial_2() const {
|
Polynomial_2 polynomial_2() const {
|
||||||
CGAL_precondition(bool(this->ptr()->f));
|
CGAL_precondition(bool(this->ptr()->f));
|
||||||
return this->ptr()->f.get();
|
return this->ptr()->f.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -713,8 +713,8 @@ public:
|
||||||
= event_line;
|
= event_line;
|
||||||
event_coordinates()[i].stack = event_line;
|
event_coordinates()[i].stack = event_line;
|
||||||
}
|
}
|
||||||
CGAL_postcondition(event_coordinates()[i].stack.get().is_event());
|
CGAL_postcondition(event_coordinates()[i].stack.value().is_event());
|
||||||
return event_coordinates()[i].stack.get();
|
return event_coordinates()[i].stack.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -1348,7 +1348,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return intermediate_values()[i].get();
|
return intermediate_values()[i].value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1369,7 +1369,7 @@ public:
|
||||||
if(! this->ptr()->content) {
|
if(! this->ptr()->content) {
|
||||||
compute_content_and_primitive_part();
|
compute_content_and_primitive_part();
|
||||||
}
|
}
|
||||||
return this->ptr()->content.get();
|
return this->ptr()->content.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -1388,7 +1388,7 @@ public:
|
||||||
if(! this->ptr()->f_primitive) {
|
if(! this->ptr()->f_primitive) {
|
||||||
compute_content_and_primitive_part();
|
compute_content_and_primitive_part();
|
||||||
}
|
}
|
||||||
return this->ptr()->f_primitive.get();
|
return this->ptr()->f_primitive.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Algebraic_kernel_with_analysis_2* kernel() const {
|
Algebraic_kernel_with_analysis_2* kernel() const {
|
||||||
|
|
@ -1436,7 +1436,7 @@ private:
|
||||||
if(! this->ptr()->sturm_habicht_of_primitive) {
|
if(! this->ptr()->sturm_habicht_of_primitive) {
|
||||||
compute_sturm_habicht_of_primitive();
|
compute_sturm_habicht_of_primitive();
|
||||||
}
|
}
|
||||||
return this->ptr()->sturm_habicht_of_primitive.get();
|
return this->ptr()->sturm_habicht_of_primitive.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -1557,7 +1557,7 @@ private:
|
||||||
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
|
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
|
||||||
this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0];
|
this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0];
|
||||||
if(this->ptr()->resultant_of_primitive_and_derivative_y.
|
if(this->ptr()->resultant_of_primitive_and_derivative_y.
|
||||||
get().is_zero()) {
|
value().is_zero()) {
|
||||||
throw internal::Zero_resultant_exception<Polynomial_2>
|
throw internal::Zero_resultant_exception<Polynomial_2>
|
||||||
(polynomial_2());
|
(polynomial_2());
|
||||||
}
|
}
|
||||||
|
|
@ -1581,7 +1581,7 @@ private:
|
||||||
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
|
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
|
||||||
compute_resultant_of_primitive_and_derivative_y();
|
compute_resultant_of_primitive_and_derivative_y();
|
||||||
}
|
}
|
||||||
return this->ptr()->resultant_of_primitive_and_derivative_y.get();
|
return this->ptr()->resultant_of_primitive_and_derivative_y.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -1592,7 +1592,7 @@ private:
|
||||||
if(! this->ptr()->resultant_of_primitive_and_derivative_x) {
|
if(! this->ptr()->resultant_of_primitive_and_derivative_x) {
|
||||||
compute_resultant_of_primitive_and_derivative_x();
|
compute_resultant_of_primitive_and_derivative_x();
|
||||||
}
|
}
|
||||||
return this->ptr()->resultant_of_primitive_and_derivative_x.get();
|
return this->ptr()->resultant_of_primitive_and_derivative_x.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -1713,20 +1713,20 @@ private:
|
||||||
if(! this->ptr()->event_coordinates) {
|
if(! this->ptr()->event_coordinates) {
|
||||||
compute_event_coordinates();
|
compute_event_coordinates();
|
||||||
}
|
}
|
||||||
return this->ptr()->event_coordinates.get();
|
return this->ptr()->event_coordinates.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Returns the intermediate values for intervals between events
|
// Returns the intermediate values for intervals between events
|
||||||
std::vector<boost::optional<Bound> >& intermediate_values() const
|
std::vector<std::optional<Bound> >& intermediate_values() const
|
||||||
{
|
{
|
||||||
if(! this->ptr()->intermediate_values) {
|
if(! this->ptr()->intermediate_values) {
|
||||||
// This is created during event_coordiantes()
|
// This is created during event_coordiantes()
|
||||||
event_coordinates();
|
event_coordinates();
|
||||||
CGAL_assertion(bool(this->ptr()->intermediate_values));
|
CGAL_assertion(bool(this->ptr()->intermediate_values));
|
||||||
}
|
}
|
||||||
return this->ptr()->intermediate_values.get();
|
return this->ptr()->intermediate_values.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1915,7 +1915,7 @@ private:
|
||||||
static_cast<size_type>(content_roots.size()));
|
static_cast<size_type>(content_roots.size()));
|
||||||
|
|
||||||
this->ptr()->intermediate_values
|
this->ptr()->intermediate_values
|
||||||
= std::vector<boost::optional<Bound> >
|
= std::vector<std::optional<Bound> >
|
||||||
(event_coordinate_vector.size()+1);
|
(event_coordinate_vector.size()+1);
|
||||||
this->ptr()->event_coordinates = event_coordinate_vector;
|
this->ptr()->event_coordinates = event_coordinate_vector;
|
||||||
|
|
||||||
|
|
@ -2110,7 +2110,7 @@ public:
|
||||||
compute_horizontal_asymptotes();
|
compute_horizontal_asymptotes();
|
||||||
}
|
}
|
||||||
std::vector<Asymptote_y>& asym_info
|
std::vector<Asymptote_y>& asym_info
|
||||||
= this->ptr()->horizontal_asymptotes_left.get();
|
= this->ptr()->horizontal_asymptotes_left.value();
|
||||||
CGAL_precondition(arcno>=0 &&
|
CGAL_precondition(arcno>=0 &&
|
||||||
arcno<static_cast<size_type>(asym_info.size()));
|
arcno<static_cast<size_type>(asym_info.size()));
|
||||||
return asym_info[arcno];
|
return asym_info[arcno];
|
||||||
|
|
@ -2120,7 +2120,7 @@ public:
|
||||||
compute_horizontal_asymptotes();
|
compute_horizontal_asymptotes();
|
||||||
}
|
}
|
||||||
std::vector<Asymptote_y>& asym_info
|
std::vector<Asymptote_y>& asym_info
|
||||||
= this->ptr()->horizontal_asymptotes_right.get();
|
= this->ptr()->horizontal_asymptotes_right.value();
|
||||||
CGAL_precondition(arcno>=0 &&
|
CGAL_precondition(arcno>=0 &&
|
||||||
arcno<static_cast<size_type>(asym_info.size()));
|
arcno<static_cast<size_type>(asym_info.size()));
|
||||||
return asym_info[arcno];
|
return asym_info[arcno];
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
#include <CGAL/Handle_with_policy.h>
|
#include <CGAL/Handle_with_policy.h>
|
||||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||||
|
|
@ -136,9 +136,9 @@ public:
|
||||||
|
|
||||||
typedef std::vector<Slice_element> Slice_info;
|
typedef std::vector<Slice_element> Slice_info;
|
||||||
|
|
||||||
typedef boost::optional<Slice_info> Lazy_slice_info;
|
typedef std::optional<Slice_info> Lazy_slice_info;
|
||||||
|
|
||||||
typedef boost::optional<Bound> Lazy_bound;
|
typedef std::optional<Bound> Lazy_bound;
|
||||||
|
|
||||||
typedef CGAL::internal::Event_indices<size_type> Event_indices;
|
typedef CGAL::internal::Event_indices<size_type> Event_indices;
|
||||||
|
|
||||||
|
|
@ -151,11 +151,11 @@ public:
|
||||||
typedef std::vector<std::vector<Intersection_info> >
|
typedef std::vector<std::vector<Intersection_info> >
|
||||||
Intersection_info_container;
|
Intersection_info_container;
|
||||||
|
|
||||||
typedef boost::optional<Intersection_info_container>
|
typedef std::optional<Intersection_info_container>
|
||||||
Lazy_intersection_info_container;
|
Lazy_intersection_info_container;
|
||||||
|
|
||||||
// For lazy evaluation of Status_line_CPA_1s.
|
// For lazy evaluation of Status_line_CPA_1s.
|
||||||
typedef boost::optional<Status_line_CPA_1> Lazy_status_line_CPA_1;
|
typedef std::optional<Status_line_CPA_1> Lazy_status_line_CPA_1;
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
@ -191,31 +191,31 @@ private:
|
||||||
Polynomial_2 g;
|
Polynomial_2 g;
|
||||||
|
|
||||||
|
|
||||||
mutable boost::optional<std::vector<Polynomial_2> > subresultants;
|
mutable std::optional<std::vector<Polynomial_2> > subresultants;
|
||||||
|
|
||||||
mutable boost::optional<std::vector<Polynomial_1> >
|
mutable std::optional<std::vector<Polynomial_1> >
|
||||||
principal_subresultants;
|
principal_subresultants;
|
||||||
mutable boost::optional<std::vector<Polynomial_1> >
|
mutable std::optional<std::vector<Polynomial_1> >
|
||||||
coprincipal_subresultants;
|
coprincipal_subresultants;
|
||||||
|
|
||||||
mutable boost::optional<Polynomial_1> resultant;
|
mutable std::optional<Polynomial_1> resultant;
|
||||||
|
|
||||||
mutable boost::optional<std::vector<Algebraic_real_1> > resultant_roots;
|
mutable std::optional<std::vector<Algebraic_real_1> > resultant_roots;
|
||||||
mutable boost::optional<std::vector<Algebraic_real_1> >
|
mutable std::optional<std::vector<Algebraic_real_1> >
|
||||||
event_x_coordinates;
|
event_x_coordinates;
|
||||||
mutable boost::optional<std::vector<size_type> >
|
mutable std::optional<std::vector<size_type> >
|
||||||
multiplicities_of_resultant_roots;
|
multiplicities_of_resultant_roots;
|
||||||
|
|
||||||
mutable boost::optional<std::vector<Bound> > stripe_values;
|
mutable std::optional<std::vector<Bound> > stripe_values;
|
||||||
|
|
||||||
mutable std::vector< Lazy_status_line_CPA_1 > event_slices;
|
mutable std::vector< Lazy_status_line_CPA_1 > event_slices;
|
||||||
|
|
||||||
mutable boost::optional<std::vector< Lazy_bound > > intermediate_values;
|
mutable std::optional<std::vector< Lazy_bound > > intermediate_values;
|
||||||
|
|
||||||
mutable boost::optional< std::vector< Lazy_status_line_CPA_1 > >
|
mutable std::optional< std::vector< Lazy_status_line_CPA_1 > >
|
||||||
intermediate_slices;
|
intermediate_slices;
|
||||||
|
|
||||||
mutable boost::optional<std::vector<Event_indices> > event_indices;
|
mutable std::optional<std::vector<Event_indices> > event_indices;
|
||||||
|
|
||||||
mutable Lazy_intersection_info_container intersection_info_container;
|
mutable Lazy_intersection_info_container intersection_info_container;
|
||||||
|
|
||||||
|
|
@ -530,7 +530,7 @@ private:
|
||||||
/*
|
/*
|
||||||
* \brief Computes the intermediate x-coordinates and their status lines
|
* \brief Computes the intermediate x-coordinates and their status lines
|
||||||
*
|
*
|
||||||
* In fact, it only fills the data fields with boost::none instances,
|
* In fact, it only fills the data fields with std::nullopt instances,
|
||||||
* according to the lazy philosophy of the whole class.
|
* according to the lazy philosophy of the whole class.
|
||||||
*/
|
*/
|
||||||
void compute_intermediate_values_and_slices() const;
|
void compute_intermediate_values_and_slices() const;
|
||||||
|
|
@ -547,7 +547,7 @@ public:
|
||||||
compute_resultant();
|
compute_resultant();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->resultant));
|
CGAL_assertion(bool(this->ptr()->resultant));
|
||||||
return this->ptr()->resultant.get();
|
return this->ptr()->resultant.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Algebraic_real_1>& resultant_roots() const {
|
std::vector<Algebraic_real_1>& resultant_roots() const {
|
||||||
|
|
@ -555,7 +555,7 @@ public:
|
||||||
compute_resultant_roots_with_multiplicities();
|
compute_resultant_roots_with_multiplicities();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->resultant_roots));
|
CGAL_assertion(bool(this->ptr()->resultant_roots));
|
||||||
return this->ptr()->resultant_roots.get();
|
return this->ptr()->resultant_roots.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Algebraic_real_1& resultant_roots(size_type i) const {
|
Algebraic_real_1& resultant_roots(size_type i) const {
|
||||||
|
|
@ -569,7 +569,7 @@ public:
|
||||||
compute_resultant_roots_with_multiplicities();
|
compute_resultant_roots_with_multiplicities();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots));
|
CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots));
|
||||||
return this->ptr()->multiplicities_of_resultant_roots.get();
|
return this->ptr()->multiplicities_of_resultant_roots.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type multiplicities_of_resultant_roots(size_type i) const {
|
size_type multiplicities_of_resultant_roots(size_type i) const {
|
||||||
|
|
@ -586,10 +586,10 @@ public:
|
||||||
(kernel(),
|
(kernel(),
|
||||||
resultant_roots().begin(),
|
resultant_roots().begin(),
|
||||||
resultant_roots().end(),
|
resultant_roots().end(),
|
||||||
std::back_inserter(this->ptr()->stripe_values.get()));
|
std::back_inserter(this->ptr()->stripe_values.value()));
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->stripe_values));
|
CGAL_assertion(bool(this->ptr()->stripe_values));
|
||||||
return this->ptr()->stripe_values.get();
|
return this->ptr()->stripe_values.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Algebraic_real_1>& event_x_coordinates() const {
|
std::vector<Algebraic_real_1>& event_x_coordinates() const {
|
||||||
|
|
@ -597,7 +597,7 @@ public:
|
||||||
compute_event_x_coordinates_with_event_indices();
|
compute_event_x_coordinates_with_event_indices();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->event_x_coordinates));
|
CGAL_assertion(bool(this->ptr()->event_x_coordinates));
|
||||||
return this->ptr()->event_x_coordinates.get();
|
return this->ptr()->event_x_coordinates.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Event_indices>& event_indices() const {
|
std::vector<Event_indices>& event_indices() const {
|
||||||
|
|
@ -605,7 +605,7 @@ public:
|
||||||
compute_event_x_coordinates_with_event_indices();
|
compute_event_x_coordinates_with_event_indices();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->event_indices));
|
CGAL_assertion(bool(this->ptr()->event_indices));
|
||||||
return this->ptr()->event_indices.get();
|
return this->ptr()->event_indices.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -613,7 +613,7 @@ public:
|
||||||
/*
|
/*
|
||||||
* \brief returns the indices of the <tt>i</tt>th event value
|
* \brief returns the indices of the <tt>i</tt>th event value
|
||||||
*
|
*
|
||||||
* Returns a Event_indices <tt>(fg,ffy,ggy)</tt> such that
|
* Returns an `Event_indices` <tt>(fg,ffy,ggy)</tt> such that
|
||||||
* the <tt>i</tt>th event root is the <tt>fg</tt>th root of the
|
* the <tt>i</tt>th event root is the <tt>fg</tt>th root of the
|
||||||
* resultant of \c f and \c g, the <tt>ffy</tt>th root of the
|
* resultant of \c f and \c g, the <tt>ffy</tt>th root of the
|
||||||
* discriminant of \c f, and the <tt>ggy</tt>th root of the
|
* discriminant of \c f, and the <tt>ggy</tt>th root of the
|
||||||
|
|
@ -633,7 +633,7 @@ private:
|
||||||
compute_intermediate_values_and_slices();
|
compute_intermediate_values_and_slices();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->intermediate_values));
|
CGAL_assertion(bool(this->ptr()->intermediate_values));
|
||||||
return this->ptr()->intermediate_values.get();
|
return this->ptr()->intermediate_values.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Lazy_status_line_CPA_1>& intermediate_slices() const {
|
std::vector<Lazy_status_line_CPA_1>& intermediate_slices() const {
|
||||||
|
|
@ -641,7 +641,7 @@ private:
|
||||||
compute_intermediate_values_and_slices();
|
compute_intermediate_values_and_slices();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->intermediate_slices));
|
CGAL_assertion(bool(this->ptr()->intermediate_slices));
|
||||||
return this->ptr()->intermediate_slices.get();
|
return this->ptr()->intermediate_slices.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -652,7 +652,7 @@ private:
|
||||||
compute_subresultants();
|
compute_subresultants();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->subresultants));
|
CGAL_assertion(bool(this->ptr()->subresultants));
|
||||||
return this->ptr()->subresultants.get();
|
return this->ptr()->subresultants.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Polynomial_2& subresultants(size_type i) const {
|
Polynomial_2& subresultants(size_type i) const {
|
||||||
|
|
@ -666,7 +666,7 @@ private:
|
||||||
compute_subresultants();
|
compute_subresultants();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->principal_subresultants));
|
CGAL_assertion(bool(this->ptr()->principal_subresultants));
|
||||||
return this->ptr()->principal_subresultants.get();
|
return this->ptr()->principal_subresultants.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Polynomial_1& principal_subresultants(size_type i) const {
|
Polynomial_1& principal_subresultants(size_type i) const {
|
||||||
|
|
@ -681,7 +681,7 @@ private:
|
||||||
compute_subresultants();
|
compute_subresultants();
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->coprincipal_subresultants));
|
CGAL_assertion(bool(this->ptr()->coprincipal_subresultants));
|
||||||
return this->ptr()->coprincipal_subresultants.get();
|
return this->ptr()->coprincipal_subresultants.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
Polynomial_1& coprincipal_subresultants(size_type i) const {
|
Polynomial_1& coprincipal_subresultants(size_type i) const {
|
||||||
|
|
@ -1030,7 +1030,7 @@ public:
|
||||||
this->ptr()->event_slices[i] = create_event_slice(i);
|
this->ptr()->event_slices[i] = create_event_slice(i);
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(this->ptr()->event_slices[i]));
|
CGAL_assertion(bool(this->ptr()->event_slices[i]));
|
||||||
return this->ptr()->event_slices[i].get();
|
return this->ptr()->event_slices[i].value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1045,7 +1045,7 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return intermediate_slices()[i].get();
|
return intermediate_slices()[i].value();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns bound representative value at the <tt>i</tt>th interval
|
//! Returns bound representative value at the <tt>i</tt>th interval
|
||||||
|
|
@ -1074,7 +1074,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CGAL_assertion(bool(intermediate_values()[i]));
|
CGAL_assertion(bool(intermediate_values()[i]));
|
||||||
return intermediate_values()[i].get();
|
return intermediate_values()[i].value();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1312,11 +1312,11 @@ void Curve_pair_analysis_2<AlgebraicKernelWithAnalysis_2>::compute_resultant()
|
||||||
compute_subresultants();
|
compute_subresultants();
|
||||||
|
|
||||||
this->ptr()->resultant
|
this->ptr()->resultant
|
||||||
= this->ptr()->principal_subresultants.get()[0];
|
= this->ptr()->principal_subresultants.value()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(this->ptr()->resultant.get().is_zero()) {
|
if(this->ptr()->resultant.value().is_zero()) {
|
||||||
throw CGAL::internal::Zero_resultant_exception<Polynomial_2>
|
throw CGAL::internal::Zero_resultant_exception<Polynomial_2>
|
||||||
(this->ptr()->f,
|
(this->ptr()->f,
|
||||||
this->ptr()->g);
|
this->ptr()->g);
|
||||||
|
|
@ -1345,8 +1345,8 @@ compute_resultant_roots_with_multiplicities() const {
|
||||||
solve_1(resultant(), std::back_inserter(res_pairs));
|
solve_1(resultant(), std::back_inserter(res_pairs));
|
||||||
|
|
||||||
for(int i=0; i < static_cast<int>(res_pairs.size()); i++ ) {
|
for(int i=0; i < static_cast<int>(res_pairs.size()); i++ ) {
|
||||||
this->ptr()->resultant_roots.get().push_back(res_pairs[i].first);
|
this->ptr()->resultant_roots.value().push_back(res_pairs[i].first);
|
||||||
this->ptr()->multiplicities_of_resultant_roots.get()
|
this->ptr()->multiplicities_of_resultant_roots.value()
|
||||||
.push_back(res_pairs[i].second);
|
.push_back(res_pairs[i].second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1357,13 +1357,13 @@ compute_resultant_roots_with_multiplicities() const {
|
||||||
#if CGAL_ACK_DEBUG_FLAG
|
#if CGAL_ACK_DEBUG_FLAG
|
||||||
for(size_type i = 0;
|
for(size_type i = 0;
|
||||||
i<static_cast<size_type>
|
i<static_cast<size_type>
|
||||||
(this->ptr()->resultant_roots.get().size());
|
(this->ptr()->resultant_roots.value().size());
|
||||||
i++) {
|
i++) {
|
||||||
CGAL_ACK_DEBUG_PRINT
|
CGAL_ACK_DEBUG_PRINT
|
||||||
<< "Root at "
|
<< "Root at "
|
||||||
<< CGAL::to_double(this->ptr()->resultant_roots.get()[i])
|
<< CGAL::to_double(this->ptr()->resultant_roots.value()[i])
|
||||||
<< " with multiplicity "
|
<< " with multiplicity "
|
||||||
<< this->ptr()->multiplicities_of_resultant_roots.get()[i]
|
<< this->ptr()->multiplicities_of_resultant_roots.value()[i]
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1401,18 +1401,18 @@ compute_event_x_coordinates_with_event_indices() const {
|
||||||
one_curve_events.end(),
|
one_curve_events.end(),
|
||||||
resultant_roots().begin(),
|
resultant_roots().begin(),
|
||||||
resultant_roots().end(),
|
resultant_roots().end(),
|
||||||
std::back_inserter(this->ptr()->event_x_coordinates.get()),
|
std::back_inserter(this->ptr()->event_x_coordinates.value()),
|
||||||
std::back_inserter(events_type),
|
std::back_inserter(events_type),
|
||||||
compare);
|
compare);
|
||||||
std::vector<Algebraic_real_1>& events
|
std::vector<Algebraic_real_1>& events
|
||||||
= this->ptr()->event_x_coordinates.get();
|
= this->ptr()->event_x_coordinates.value();
|
||||||
|
|
||||||
typename std::vector<CGAL::internal::Three_valued>::iterator one_curve_it
|
typename std::vector<CGAL::internal::Three_valued>::iterator one_curve_it
|
||||||
=one_curve_events_type.begin();
|
=one_curve_events_type.begin();
|
||||||
size_type inter_count=0, f_count=0,g_count=0;
|
size_type inter_count=0, f_count=0,g_count=0;
|
||||||
this->ptr()->event_indices = std::vector<Event_indices>();
|
this->ptr()->event_indices = std::vector<Event_indices>();
|
||||||
std::vector<Event_indices>& event_indices
|
std::vector<Event_indices>& event_indices
|
||||||
= this->ptr()->event_indices.get();
|
= this->ptr()->event_indices.value();
|
||||||
for(size_type i=0;i<static_cast<size_type>(events.size());i++) {
|
for(size_type i=0;i<static_cast<size_type>(events.size());i++) {
|
||||||
/*
|
/*
|
||||||
#if CGAL_ACK_DEBUG_FLAG
|
#if CGAL_ACK_DEBUG_FLAG
|
||||||
|
|
@ -1519,8 +1519,8 @@ compute_intermediate_values_and_slices() const {
|
||||||
std::size_t size = event_x_coordinates().size()+1;
|
std::size_t size = event_x_coordinates().size()+1;
|
||||||
this->ptr()->intermediate_values=std::vector<Lazy_bound>();
|
this->ptr()->intermediate_values=std::vector<Lazy_bound>();
|
||||||
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
|
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
|
||||||
this->ptr()->intermediate_values.get().resize(size);
|
this->ptr()->intermediate_values.value().resize(size);
|
||||||
this->ptr()->intermediate_slices.get().resize(size);
|
this->ptr()->intermediate_slices.value().resize(size);
|
||||||
#if CGAL_ACK_DEBUG_FLAG
|
#if CGAL_ACK_DEBUG_FLAG
|
||||||
CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
|
CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1539,25 +1539,25 @@ compute_subresultants() const {
|
||||||
if(CGAL::degree(f,1)<CGAL::degree(g,1)) {
|
if(CGAL::degree(f,1)<CGAL::degree(g,1)) {
|
||||||
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
|
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
|
||||||
CGAL::internal::bezout_polynomial_subresultants
|
CGAL::internal::bezout_polynomial_subresultants
|
||||||
(g,f,std::back_inserter(this->ptr()->subresultants.get()));
|
(g,f,std::back_inserter(this->ptr()->subresultants.value()));
|
||||||
#else
|
#else
|
||||||
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
||||||
::Polynomial_subresultants()
|
::Polynomial_subresultants()
|
||||||
(g,f,std::back_inserter(this->ptr()->subresultants.get()));
|
(g,f,std::back_inserter(this->ptr()->subresultants.value()));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
|
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
|
||||||
CGAL::internal::bezout_polynomial_subresultants
|
CGAL::internal::bezout_polynomial_subresultants
|
||||||
(f,g,std::back_inserter(this->ptr()->subresultants.get()));
|
(f,g,std::back_inserter(this->ptr()->subresultants.value()));
|
||||||
#else
|
#else
|
||||||
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
typename CGAL::Polynomial_traits_d<Polynomial_2>
|
||||||
::Polynomial_subresultants()
|
::Polynomial_subresultants()
|
||||||
(f,g,std::back_inserter(this->ptr()->subresultants.get()));
|
(f,g,std::back_inserter(this->ptr()->subresultants.value()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Polynomial_2>& subresultants
|
std::vector<Polynomial_2>& subresultants
|
||||||
= this->ptr()->subresultants.get();
|
= this->ptr()->subresultants.value();
|
||||||
|
|
||||||
size_type n = static_cast<size_type>(subresultants.size());
|
size_type n = static_cast<size_type>(subresultants.size());
|
||||||
|
|
||||||
|
|
@ -1584,11 +1584,11 @@ compute_subresultants() const {
|
||||||
// This must be corrected, if f and g have same degree:
|
// This must be corrected, if f and g have same degree:
|
||||||
if(CGAL::degree(f,1) == CGAL::degree(g,1)) {
|
if(CGAL::degree(f,1) == CGAL::degree(g,1)) {
|
||||||
if(n>=1) {
|
if(n>=1) {
|
||||||
this->ptr()->principal_subresultants.get()[n-1]
|
this->ptr()->principal_subresultants.value()[n-1]
|
||||||
= Polynomial_1(CGAL::leading_coefficient(g));
|
= Polynomial_1(CGAL::leading_coefficient(g));
|
||||||
}
|
}
|
||||||
if(n>=2) {
|
if(n>=2) {
|
||||||
this->ptr()->coprincipal_subresultants.get()[n-2]
|
this->ptr()->coprincipal_subresultants.value()[n-2]
|
||||||
= Polynomial_1(g[CGAL::degree(g,1)-1]);
|
= Polynomial_1(g[CGAL::degree(g,1)-1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public:
|
||||||
//Arc_pair _m_num_arcs;
|
//Arc_pair _m_num_arcs;
|
||||||
|
|
||||||
//! sequence of arcs crossing this status line (valid only event lines)
|
//! sequence of arcs crossing this status line (valid only event lines)
|
||||||
mutable boost::optional<Arc_container> _m_arcs;
|
mutable std::optional<Arc_container> _m_arcs;
|
||||||
|
|
||||||
//! number of arcs intersecting this status line
|
//! number of arcs intersecting this status line
|
||||||
mutable int _m_total_arcs;
|
mutable int _m_total_arcs;
|
||||||
|
|
@ -160,10 +160,10 @@ public:
|
||||||
std::vector< int > multiplicities_;*/
|
std::vector< int > multiplicities_;*/
|
||||||
|
|
||||||
// stores algebraic real over the vertical line
|
// stores algebraic real over the vertical line
|
||||||
mutable std::vector<boost::optional< Algebraic_real_2 > >_m_xy_coords;
|
mutable std::vector<std::optional< Algebraic_real_2 > >_m_xy_coords;
|
||||||
|
|
||||||
// stores the isolator instance
|
// stores the isolator instance
|
||||||
mutable boost::optional<Bitstream_descartes> isolator;
|
mutable std::optional<Bitstream_descartes> isolator;
|
||||||
|
|
||||||
// befriending the handle
|
// befriending the handle
|
||||||
friend class Status_line_CA_1<Curve_analysis_2, Self>;
|
friend class Status_line_CA_1<Curve_analysis_2, Self>;
|
||||||
|
|
@ -555,7 +555,7 @@ public:
|
||||||
//! Returns the isolator instance
|
//! Returns the isolator instance
|
||||||
Bitstream_descartes& isolator() const {
|
Bitstream_descartes& isolator() const {
|
||||||
CGAL_assertion(bool(this->ptr()->isolator));
|
CGAL_assertion(bool(this->ptr()->isolator));
|
||||||
return this->ptr()->isolator.get();
|
return this->ptr()->isolator.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns whether an isolator has been given for that status line
|
//! Returns whether an isolator has been given for that status line
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public:
|
||||||
|
|
||||||
// represents x-coordinate of event of rational value over interval
|
// represents x-coordinate of event of rational value over interval
|
||||||
// computed only by demand
|
// computed only by demand
|
||||||
mutable boost::optional<Algebraic_real_1> _m_x;
|
mutable std::optional<Algebraic_real_1> _m_x;
|
||||||
|
|
||||||
// for each event point stores a pair of arcnos of the 1st and 2nd curve
|
// for each event point stores a pair of arcnos of the 1st and 2nd curve
|
||||||
// or -1 if respective curve is not involved
|
// or -1 if respective curve is not involved
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,10 @@ public:
|
||||||
mutable int _m_arcno;
|
mutable int _m_arcno;
|
||||||
|
|
||||||
// y-coordinate
|
// y-coordinate
|
||||||
mutable boost::optional< Algebraic_real_1 > _m_y;
|
mutable std::optional< Algebraic_real_1 > _m_y;
|
||||||
|
|
||||||
//! A bounding box for the given point
|
//! A bounding box for the given point
|
||||||
mutable boost::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair;
|
mutable std::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* \brief y-coordinate of this point
|
* \brief y-coordinate of this point
|
||||||
*
|
*
|
||||||
* Note: In general, this method results in a extremely large polynomial
|
* Note: In general, this method results in an extremely large polynomial
|
||||||
* for the y-coordinate. It is recommended to use it carefully,
|
* for the y-coordinate. It is recommended to use it carefully,
|
||||||
* and using get_approximation_y() instead whenever approximations suffice.
|
* and using get_approximation_y() instead whenever approximations suffice.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
|
||||||
|
|
||||||
//members
|
//members
|
||||||
//the members can be updated when calling method exact()
|
//the members can be updated when calling method exact()
|
||||||
mutable boost::optional<NT_exact> exact_;
|
mutable std::optional<NT_exact> exact_;
|
||||||
mutable NT_approx approx_;
|
mutable NT_approx approx_;
|
||||||
|
|
||||||
//private functions
|
//private functions
|
||||||
|
|
@ -235,7 +235,7 @@ public:
|
||||||
|
|
||||||
const NT_exact& exact() const
|
const NT_exact& exact() const
|
||||||
{
|
{
|
||||||
if (exact_ == boost::none) {
|
if (exact_ == std::nullopt) {
|
||||||
update_exact();
|
update_exact();
|
||||||
approx_=to_interval(*exact_);
|
approx_=to_interval(*exact_);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/type_traits.hpp>
|
#include <boost/type_traits.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
|
||||||
|
|
||||||
//members
|
//members
|
||||||
//the members can be updated when calling method exact()
|
//the members can be updated when calling method exact()
|
||||||
mutable boost::optional<NT_exact> exact_;
|
mutable std::optional<NT_exact> exact_;
|
||||||
mutable NT_approx approx_;
|
mutable NT_approx approx_;
|
||||||
|
|
||||||
//private functions
|
//private functions
|
||||||
|
|
@ -229,7 +229,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const NT_exact& exact() const {
|
const NT_exact& exact() const {
|
||||||
if (exact_ == boost::none){
|
if (exact_ == std::nullopt){
|
||||||
update_exact();
|
update_exact();
|
||||||
approx_=to_interval(*exact_);
|
approx_=to_interval(*exact_);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -608,24 +608,22 @@ Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
|
||||||
/*!
|
/*!
|
||||||
Returns the
|
Returns the
|
||||||
dual corresponding to the face handle `f`. The returned object can
|
dual corresponding to the face handle `f`. The returned object can
|
||||||
be assignable to one of the following: `Site_2`, `Gt::Line_2`.
|
be assigned to one of the following: `Site_2`, `Gt::Line_2`.
|
||||||
*/
|
*/
|
||||||
Gt::Object_2 dual(Face_handle f) const;
|
Gt::Object_2 dual(Face_handle f) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the
|
Returns the
|
||||||
dual of the face to which `it` points to. The returned object can
|
dual of the face to which `it` points to. The returned object can
|
||||||
be assignable to one of the following: `Site_2`, `Gt::Line_2`.
|
be assigned to one of the following: `Site_2`, `Gt::Line_2`.
|
||||||
*/
|
*/
|
||||||
Gt::Object_2 dual(All_faces_iterator it) const;
|
Gt::Object_2 dual(All_faces_iterator it) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns
|
Returns
|
||||||
the dual of the face to which `it` points to. The returned
|
the dual of the face to which `it` points to.
|
||||||
object can be assignable to one of the following: `Site_2`,
|
|
||||||
`Gt::Line_2`.
|
|
||||||
*/
|
*/
|
||||||
Gt::Object_2 dual(Finite_faces_iterator it) const;
|
Site dual(Finite_faces_iterator it) const;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@ namespace CGAL {
|
||||||
The class `Apollonius_graph_vertex_base_2` provides a model for the
|
The class `Apollonius_graph_vertex_base_2` provides a model for the
|
||||||
`ApolloniusGraphVertexBase_2` concept which is the vertex base
|
`ApolloniusGraphVertexBase_2` concept which is the vertex base
|
||||||
required by the `ApolloniusGraphDataStructure_2` concept. The
|
required by the `ApolloniusGraphDataStructure_2` concept. The
|
||||||
class `Apollonius_graph_vertex_base_2` has two template arguments, the first being the
|
class `Apollonius_graph_vertex_base_2` has three template arguments.
|
||||||
geometric traits of the Apollonius graph and should be a model of the
|
|
||||||
concept `ApolloniusGraphTraits_2`. The second is a Boolean which
|
\tparam Gt is the geometric traits of the Apollonius graph and must be a model of the
|
||||||
|
concept `ApolloniusGraphTraits_2`.
|
||||||
|
|
||||||
|
\tparam StoreHidden is a Boolean which
|
||||||
controls whether hidden sites are actually stored. Such a
|
controls whether hidden sites are actually stored. Such a
|
||||||
control is important if the user is not interested in hidden sites
|
control is important if the user is not interested in hidden sites
|
||||||
and/or if only insertions are made, in which case no hidden
|
and/or if only insertions are made, in which case no hidden
|
||||||
|
|
@ -17,13 +20,17 @@ site can become visible. If `StoreHidden` is set to
|
||||||
`true`, hidden sites are stored, otherwise they are
|
`true`, hidden sites are stored, otherwise they are
|
||||||
discarded. By default `StoreHidden` is set to `true`.
|
discarded. By default `StoreHidden` is set to `true`.
|
||||||
|
|
||||||
|
\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`
|
\cgalModels `ApolloniusGraphVertexBase_2`
|
||||||
|
|
||||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||||
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
|
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
|
||||||
*/
|
*/
|
||||||
template< typename Gt, typename StoreHidden >
|
template< typename Gt, typename StoreHidden, typename Vb >
|
||||||
class Apollonius_graph_vertex_base_2 {
|
class Apollonius_graph_vertex_base_2 : public Vb {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// \name Creation
|
/// \name Creation
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ char * Option_parser::s_strategy_opts[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class MyId>
|
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)
|
const std::vector<std::string> & values)
|
||||||
{
|
{
|
||||||
typedef std::vector<MyId> Vector_id;
|
typedef std::vector<MyId> Vector_id;
|
||||||
|
|
@ -28,11 +28,11 @@ void Option_parser::my_validate(boost::any & v,
|
||||||
if (v.empty()) {
|
if (v.empty()) {
|
||||||
Vector_id vec;
|
Vector_id vec;
|
||||||
vec.push_back(MyId(i));
|
vec.push_back(MyId(i));
|
||||||
v = boost::any(vec);
|
v = std::any(vec);
|
||||||
} else {
|
} else {
|
||||||
Vector_id vec = boost::any_cast<Vector_id>(v);
|
Vector_id vec = std::any_cast<Vector_id>(v);
|
||||||
vec.push_back(MyId(i));
|
vec.push_back(MyId(i));
|
||||||
v = boost::any(vec);
|
v = std::any(vec);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -41,14 +41,14 @@ void Option_parser::my_validate(boost::any & v,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overload the 'validate' function for the user-defined class */
|
/* 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::Vector_type_id * target_type, int)
|
||||||
{
|
{
|
||||||
Option_parser::my_validate<Option_parser::Type_id>(v, values);
|
Option_parser::my_validate<Option_parser::Type_id>(v, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Overload the 'validate' function for the user-defined class */
|
/* 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::Vector_strategy_id * target_type, int)
|
||||||
{
|
{
|
||||||
Option_parser::my_validate<Option_parser::Strategy_id>(v, values);
|
Option_parser::my_validate<Option_parser::Strategy_id>(v, values);
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ public:
|
||||||
unsigned int get_height() const { return m_win_height; }
|
unsigned int get_height() const { return m_win_height; }
|
||||||
|
|
||||||
template <class MyId>
|
template <class MyId>
|
||||||
static void my_validate(boost::any & v,
|
static void my_validate(std::any & v,
|
||||||
const std::vector<std::string> & values);
|
const std::vector<std::string> & values);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ static inline bool hasValidChars(const std::string& expression, int dimension)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Polynomial_d>
|
template <typename Polynomial_d>
|
||||||
boost::optional<Polynomial_d>
|
std::optional<Polynomial_d>
|
||||||
AlgebraicCurveParser<Polynomial_d>::operator()(const std::string& expression)
|
AlgebraicCurveParser<Polynomial_d>::operator()(const std::string& expression)
|
||||||
{
|
{
|
||||||
using Traits = CGAL::Polynomial_traits_d<Polynomial_d>;
|
using Traits = CGAL::Polynomial_traits_d<Polynomial_d>;
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
template <typename Polynomial_d>
|
template <typename Polynomial_d>
|
||||||
struct AlgebraicCurveParser
|
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
|
#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) {
|
const CGAL::Bbox_2& allowable_range) {
|
||||||
using Traits = demo_types::DemoTypes::Alg_seg_traits;
|
using Traits = demo_types::DemoTypes::Alg_seg_traits;
|
||||||
CGAL::Bbox_2 bb = {};
|
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 it = arr->edges_begin(); it != arr->edges_end(); ++it) {
|
||||||
for (auto& arc : getXyCurves(arr->traits()))
|
for (auto& arc : getXyCurves(arr->traits()))
|
||||||
|
{
|
||||||
if (arc.is_vertical() != it->curve().is_vertical())
|
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;
|
for (auto point_multiplicity :intersections) {
|
||||||
CGAL::assign(point_multiplicity, *it);
|
|
||||||
auto& point = point_multiplicity.first;
|
auto& point = point_multiplicity.first;
|
||||||
if (point.location() == CGAL::ARR_INTERIOR) {
|
if (point.location() == CGAL::ARR_INTERIOR) {
|
||||||
auto xy = point.to_double();
|
auto xy = point.to_double();
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ void EnvelopeCallback< Arr_>::updateEnvelope( bool lower )
|
||||||
{
|
{
|
||||||
if (!e->is_empty())
|
if (!e->is_empty())
|
||||||
{
|
{
|
||||||
boost::optional<Point_2> leftPoint, rightPoint;
|
std::optional<Point_2> leftPoint, rightPoint;
|
||||||
if (e->left())
|
if (e->left())
|
||||||
leftPoint = e->left()->point();
|
leftPoint = e->left()->point();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ void GraphicsViewCurveInput<Arr_>::generate(CGAL::Object o) {
|
||||||
template <typename Arr_>
|
template <typename Arr_>
|
||||||
void GraphicsViewCurveInput<Arr_>::
|
void GraphicsViewCurveInput<Arr_>::
|
||||||
curveInputDoneEvent(const std::vector<Point_2>& clickedPoints, CurveType type) {
|
curveInputDoneEvent(const std::vector<Point_2>& clickedPoints, CurveType type) {
|
||||||
boost::optional<Curve_2> cv =
|
std::optional<Curve_2> cv =
|
||||||
this->curveGenerator.generate(clickedPoints, type);
|
this->curveGenerator.generate(clickedPoints, type);
|
||||||
if (cv) {
|
if (cv) {
|
||||||
Insert_curve<Arrangement>{}(this->arrangement, *cv);
|
Insert_curve<Arrangement>{}(this->arrangement, *cv);
|
||||||
|
|
@ -135,9 +135,9 @@ curveInputDoneEvent(const std::vector<Point_2>& clickedPoints, CurveType type) {
|
||||||
template <typename ArrTraits_>
|
template <typename ArrTraits_>
|
||||||
auto CurveGeneratorBase<ArrTraits_>::
|
auto CurveGeneratorBase<ArrTraits_>::
|
||||||
generate(const std::vector<Point_2>& clickedPoints, CurveType type)
|
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) {
|
switch (type) {
|
||||||
case CurveType::Segment:
|
case CurveType::Segment:
|
||||||
res = generateSegment(clickedPoints);
|
res = generateSegment(clickedPoints);
|
||||||
|
|
@ -180,7 +180,7 @@ void CurveGeneratorBase<ArrTraits_>::setTraits(const ArrTraits* traits_)
|
||||||
template <typename Kernel_>
|
template <typename Kernel_>
|
||||||
auto CurveGenerator<CGAL::Arr_segment_traits_2<Kernel_>>::
|
auto CurveGenerator<CGAL::Arr_segment_traits_2<Kernel_>>::
|
||||||
generateSegment(const std::vector<Point_2>& clickedPoints)
|
generateSegment(const std::vector<Point_2>& clickedPoints)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
Curve_2 res{clickedPoints[0], clickedPoints[1]};
|
Curve_2 res{clickedPoints[0], clickedPoints[1]};
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -190,7 +190,7 @@ generateSegment(const std::vector<Point_2>& clickedPoints)
|
||||||
template <typename SegmentTraits>
|
template <typename SegmentTraits>
|
||||||
auto CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
|
auto CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
|
||||||
generatePolyline(const std::vector<Point_2>& clickedPoints)
|
generatePolyline(const std::vector<Point_2>& clickedPoints)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
if (clickedPoints.size() < 2) return {};
|
if (clickedPoints.size() < 2) return {};
|
||||||
|
|
||||||
|
|
@ -202,7 +202,7 @@ auto CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
|
||||||
// Curve Generator Linear Traits
|
// Curve Generator Linear Traits
|
||||||
template <typename Kernel_>
|
template <typename Kernel_>
|
||||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<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]));
|
Curve_2 res = Curve_2(Segment_2(points[0], points[1]));
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -211,7 +211,7 @@ generateSegment(const std::vector<Point_2>& points) -> boost::optional<Curve_2>
|
||||||
//
|
//
|
||||||
template <typename Kernel_>
|
template <typename Kernel_>
|
||||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<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]));
|
Curve_2 res = Curve_2(Ray_2(points[0], points[1]));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -219,7 +219,7 @@ generateRay(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||||
//
|
//
|
||||||
template <typename Kernel_>
|
template <typename Kernel_>
|
||||||
auto CurveGenerator<CGAL::Arr_linear_traits_2<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]));
|
Curve_2 res = Curve_2(Line_2(points[0], points[1]));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -228,7 +228,7 @@ generateLine(const std::vector<Point_2>& points) -> boost::optional<Curve_2> {
|
||||||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||||
generateSegment(const std::vector<Point_2>& points)
|
generateSegment(const std::vector<Point_2>& points)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
auto ctr_cv = this->traits->construct_curve_2_object();
|
auto ctr_cv = this->traits->construct_curve_2_object();
|
||||||
Curve_2 res = ctr_cv(Rat_segment_2(points[0], points[1]));
|
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>
|
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, 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 =
|
auto sq_rad =
|
||||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
||||||
(points[0].y() - points[1].y()) * (points[0].y() - points[1].y());
|
(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>
|
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||||
generateEllipse(const std::vector<Point_2>& points)
|
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 x1 = (CGAL::min)(points[0].x(), points[1].x());
|
||||||
auto y1 = (CGAL::min)(points[0].y(), points[1].y());
|
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>
|
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||||
generateThreePointCircularArc(const std::vector<Point_2>& points)
|
generateThreePointCircularArc(const std::vector<Point_2>& points)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
auto& qp1 = points[0];
|
auto& qp1 = points[0];
|
||||||
auto& qp2 = points[1];
|
auto& qp2 = points[1];
|
||||||
|
|
@ -305,7 +305,7 @@ generateThreePointCircularArc(const std::vector<Point_2>& points)
|
||||||
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
auto CurveGenerator<Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||||
generateFivePointConicArc(const std::vector<Point_2>& points)
|
generateFivePointConicArc(const std::vector<Point_2>& points)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
auto& qp0 = points[0];
|
auto& qp0 = points[0];
|
||||||
auto& qp1 = points[1];
|
auto& qp1 = points[1];
|
||||||
|
|
@ -333,7 +333,7 @@ generateFivePointConicArc(const std::vector<Point_2>& points)
|
||||||
// CurveGenerator Algebraic Traits
|
// CurveGenerator Algebraic Traits
|
||||||
template <typename Coefficient_>
|
template <typename Coefficient_>
|
||||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<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;
|
RationalTraits ratTraits;
|
||||||
|
|
||||||
Rational dx = points[1].x() - points[0].x();
|
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_>
|
template <typename Coefficient_>
|
||||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<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 =
|
auto sq_rad =
|
||||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) +
|
||||||
(points[0].y() - points[1].y()) * (points[0].y() - points[1].y());
|
(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_>
|
template <typename Coefficient_>
|
||||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||||
generateEllipse(const std::vector<Point_2>& points)
|
generateEllipse(const std::vector<Point_2>& points)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
auto rx =
|
auto rx =
|
||||||
(points[0].x() - points[1].x()) * (points[0].x() - points[1].x()) / 4.;
|
(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_>
|
template <typename Coefficient_>
|
||||||
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
auto CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>>::
|
||||||
generateEllipse_(const Point_2& center, Rational rxRat, Rational ryRat)
|
generateEllipse_(const Point_2& center, Rational rxRat, Rational ryRat)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
RationalTraits ratTraits;
|
RationalTraits ratTraits;
|
||||||
|
|
||||||
|
|
@ -428,7 +428,7 @@ template <typename RatKernel, typename AlgKernel, typename NtTraits,
|
||||||
auto CurveGenerator
|
auto CurveGenerator
|
||||||
<Arr_Bezier_curve_traits_2<RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
<Arr_Bezier_curve_traits_2<RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
||||||
generateBezier(const std::vector<Point_2>& clickedPoints)
|
generateBezier(const std::vector<Point_2>& clickedPoints)
|
||||||
-> boost::optional<Curve_2>
|
-> std::optional<Curve_2>
|
||||||
{
|
{
|
||||||
if (clickedPoints.size() < 2) return {};
|
if (clickedPoints.size() < 2) return {};
|
||||||
return Curve_2{clickedPoints.begin(), clickedPoints.end()};
|
return Curve_2{clickedPoints.begin(), clickedPoints.end()};
|
||||||
|
|
|
||||||
|
|
@ -42,34 +42,34 @@ public:
|
||||||
|
|
||||||
void setTraits(const ArrTraits* traits_);
|
void setTraits(const ArrTraits* traits_);
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generate(const std::vector<Point_2>& clickedPoints, CurveType type);
|
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 {}; }
|
generateSegment(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateRay(const std::vector<Point_2>&) { return {}; }
|
generateRay(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateLine(const std::vector<Point_2>&) { return {}; }
|
generateLine(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generatePolyline(const std::vector<Point_2>&) { return {}; }
|
generatePolyline(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateCircle(const std::vector<Point_2>&) { return {}; }
|
generateCircle(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateEllipse(const std::vector<Point_2>&) { return {}; }
|
generateEllipse(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateThreePointCircularArc(const std::vector<Point_2>&) { return {}; }
|
generateThreePointCircularArc(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateFivePointConicArc(const std::vector<Point_2>&) { return {}; }
|
generateFivePointConicArc(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
virtual boost::optional<Curve_2>
|
virtual std::optional<Curve_2>
|
||||||
generateBezier(const std::vector<Point_2>&) { return {}; }
|
generateBezier(const std::vector<Point_2>&) { return {}; }
|
||||||
|
|
||||||
const ArrTraits* traits;
|
const ArrTraits* traits;
|
||||||
|
|
@ -91,7 +91,7 @@ struct CurveGenerator<CGAL::Arr_segment_traits_2<Kernel_>> :
|
||||||
using Super = CurveGeneratorBase<ArrTraits>;
|
using Super = CurveGeneratorBase<ArrTraits>;
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generateSegment(const std::vector<Point_2>&) override;
|
generateSegment(const std::vector<Point_2>&) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ struct CurveGenerator<CGAL::Arr_polyline_traits_2<SegmentTraits>> :
|
||||||
using Super = CurveGeneratorBase<ArrTraits>;
|
using Super = CurveGeneratorBase<ArrTraits>;
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generatePolyline(const std::vector<Point_2>&) override;
|
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 Super = CurveGeneratorBase<ArrTraits>;
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generateSegment(const std::vector<Point_2>&) override;
|
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;
|
generateEllipse(const std::vector<Point_2>&) override;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generateThreePointCircularArc(const std::vector<Point_2>&) override;
|
generateThreePointCircularArc(const std::vector<Point_2>&) override;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generateFivePointConicArc(const std::vector<Point_2>&) override;
|
generateFivePointConicArc(const std::vector<Point_2>&) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -154,10 +154,10 @@ struct CurveGenerator<CGAL::Arr_linear_traits_2<Kernel_>> :
|
||||||
using Super = CurveGeneratorBase<ArrTraits>;
|
using Super = CurveGeneratorBase<ArrTraits>;
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
|
|
||||||
boost::optional<Curve_2>
|
std::optional<Curve_2>
|
||||||
generateSegment(const std::vector<Point_2>&) override;
|
generateSegment(const std::vector<Point_2>&) override;
|
||||||
boost::optional<Curve_2> generateRay(const std::vector<Point_2>&) override;
|
std::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> generateLine(const std::vector<Point_2>&) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Coefficient_>
|
template <typename Coefficient_>
|
||||||
|
|
@ -176,13 +176,13 @@ struct CurveGenerator<CGAL::Arr_algebraic_segment_traits_2<Coefficient_>> :
|
||||||
using Super = CurveGeneratorBase<ArrTraits>;
|
using Super = CurveGeneratorBase<ArrTraits>;
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
|
|
||||||
boost::optional<Curve_2> generateLine(const std::vector<Point_2>&) override;
|
std::optional<Curve_2> generateLine(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;
|
generateEllipse(const std::vector<Point_2>&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::optional<Curve_2> generateEllipse_(const Point_2&, Rational, Rational);
|
std::optional<Curve_2> generateEllipse_(const Point_2&, Rational, Rational);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <
|
template <
|
||||||
|
|
@ -199,7 +199,7 @@ struct CurveGenerator<
|
||||||
using Point_2 = typename Super::Point_2;
|
using Point_2 = typename Super::Point_2;
|
||||||
using Curve_2 = typename ArrTraits::Curve_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>
|
template <typename ArrTraits>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include "ArrangementTypesUtils.h"
|
#include "ArrangementTypesUtils.h"
|
||||||
#include "PointSnapper.h"
|
#include "PointSnapper.h"
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
template <typename Arr_>
|
template <typename Arr_>
|
||||||
class PointSnapper : public PointSnapperBase
|
class PointSnapper : public PointSnapperBase
|
||||||
|
|
@ -26,7 +26,7 @@ class PointSnapper : public PointSnapperBase
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PointSnapper(QGraphicsScene*, GridGraphicsItem*, Arrangement*);
|
PointSnapper(QGraphicsScene*, GridGraphicsItem*, Arrangement*);
|
||||||
boost::optional<Point_2> snapToArrangement(const QPointF& qpt) override;
|
std::optional<Point_2> snapToArrangement(const QPointF& qpt) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Arrangement* arr;
|
Arrangement* arr;
|
||||||
|
|
@ -170,7 +170,7 @@ PointSnapper<Arr_>::PointSnapper(
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Arrangement>
|
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)
|
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||||
{
|
{
|
||||||
using Point_2 = PointSnapperBase::Point_2;
|
using Point_2 = PointSnapperBase::Point_2;
|
||||||
|
|
@ -215,7 +215,7 @@ struct SnapToArrangement
|
||||||
{
|
{
|
||||||
using Point_2 = PointSnapperBase::Point_2;
|
using Point_2 = PointSnapperBase::Point_2;
|
||||||
template <typename Arrangement>
|
template <typename Arrangement>
|
||||||
boost::optional<Point_2>
|
std::optional<Point_2>
|
||||||
operator()(const QPointF& qpt, const QTransform&, Arrangement*)
|
operator()(const QPointF& qpt, const QTransform&, Arrangement*)
|
||||||
{
|
{
|
||||||
return Point_2{qpt.x(), qpt.y()};
|
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;
|
using Point_2 = PointSnapperBase::Point_2;
|
||||||
template <typename Arrangement>
|
template <typename Arrangement>
|
||||||
boost::optional<Point_2> operator()(
|
std::optional<Point_2> operator()(
|
||||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||||
{
|
{
|
||||||
return snapToArrangement(qpt, worldTransform, arr);
|
return snapToArrangement(qpt, worldTransform, arr);
|
||||||
|
|
@ -237,7 +237,7 @@ struct SnapToArrangement<CGAL::Arr_segment_traits_2<Kernel>>
|
||||||
{
|
{
|
||||||
using Point_2 = PointSnapperBase::Point_2;
|
using Point_2 = PointSnapperBase::Point_2;
|
||||||
template <typename Arrangement>
|
template <typename Arrangement>
|
||||||
boost::optional<Point_2> operator()(
|
std::optional<Point_2> operator()(
|
||||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||||
{
|
{
|
||||||
return snapToArrangement(qpt, worldTransform, arr);
|
return snapToArrangement(qpt, worldTransform, arr);
|
||||||
|
|
@ -248,7 +248,7 @@ struct SnapToArrangement<CGAL::Arr_polyline_traits_2<Kernel>>
|
||||||
{
|
{
|
||||||
using Point_2 = PointSnapperBase::Point_2;
|
using Point_2 = PointSnapperBase::Point_2;
|
||||||
template <typename Arrangement>
|
template <typename Arrangement>
|
||||||
boost::optional<Point_2> operator()(
|
std::optional<Point_2> operator()(
|
||||||
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
const QPointF& qpt, const QTransform& worldTransform, Arrangement* arr)
|
||||||
{
|
{
|
||||||
return snapToArrangement(qpt, worldTransform, arr);
|
return snapToArrangement(qpt, worldTransform, arr);
|
||||||
|
|
@ -257,7 +257,7 @@ struct SnapToArrangement<CGAL::Arr_polyline_traits_2<Kernel>>
|
||||||
|
|
||||||
template <typename Arr_>
|
template <typename Arr_>
|
||||||
auto PointSnapper<Arr_>::snapToArrangement(const QPointF& qpt)
|
auto PointSnapper<Arr_>::snapToArrangement(const QPointF& qpt)
|
||||||
-> boost::optional<Point_2>
|
-> std::optional<Point_2>
|
||||||
{
|
{
|
||||||
using Traits = typename Arrangement::Geometry_traits_2;
|
using Traits = typename Arrangement::Geometry_traits_2;
|
||||||
auto view = getView();
|
auto view = getView();
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
PointSnapperBase(QGraphicsScene* scene, GridGraphicsItem* grid);
|
PointSnapperBase(QGraphicsScene* scene, GridGraphicsItem* grid);
|
||||||
Point_2 snapToGrid(const QPointF& qpt);
|
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;
|
GridGraphicsItem* gridGraphicsItem;
|
||||||
bool snapToGridEnabled;
|
bool snapToGridEnabled;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include "IntersectCurves.h"
|
#include "IntersectCurves.h"
|
||||||
#include "ArrangementTypes.h"
|
#include "ArrangementTypes.h"
|
||||||
|
#include <boost/function_output_iterator.hpp>
|
||||||
|
|
||||||
|
|
||||||
template <typename Traits_>
|
template <typename Traits_>
|
||||||
Intersect_curves<Traits_>::Intersect_curves(const Traits* 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_>
|
template <typename Traits_>
|
||||||
void Intersect_curves<Traits_>::operator()(
|
void Intersect_curves<Traits_>::operator()(
|
||||||
const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2,
|
const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2,
|
||||||
std::vector<CGAL::Object>& output)
|
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)
|
ARRANGEMENT_DEMO_SPECIALIZE_TRAITS(Intersect_curves)
|
||||||
|
|
|
||||||
|
|
@ -391,8 +391,8 @@ Construct_x_monotone_subcurve_2<ArrTraits>::Construct_x_monotone_subcurve_2(
|
||||||
//
|
//
|
||||||
template <typename ArrTraits>
|
template <typename ArrTraits>
|
||||||
auto Construct_x_monotone_subcurve_2<ArrTraits>::operator()(
|
auto Construct_x_monotone_subcurve_2<ArrTraits>::operator()(
|
||||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||||
{
|
{
|
||||||
Point_2 pMin, pMax;
|
Point_2 pMin, pMax;
|
||||||
bool unbounded_min = false;
|
bool unbounded_min = false;
|
||||||
|
|
@ -442,8 +442,8 @@ template <typename RatKernel, typename AlgKernel, typename NtTraits>
|
||||||
auto Construct_x_monotone_subcurve_2
|
auto Construct_x_monotone_subcurve_2
|
||||||
<CGAL::Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
<CGAL::Arr_conic_traits_2<RatKernel, AlgKernel, NtTraits>>::
|
||||||
operator()(const X_monotone_curve_2& curve,
|
operator()(const X_monotone_curve_2& curve,
|
||||||
const boost::optional<Point_2>& pLeft,
|
const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||||
{
|
{
|
||||||
// TODO: handle when pLeft or pRight is null
|
// 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<
|
auto Construct_x_monotone_subcurve_2<CGAL::Arr_Bezier_curve_traits_2<
|
||||||
RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
RatKernel, AlgKernel, NtTraits, BoundingTraits>>::
|
||||||
operator()(
|
operator()(
|
||||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||||
{
|
{
|
||||||
auto pMin = this->construct_min_vertex_2(curve);
|
auto pMin = this->construct_min_vertex_2(curve);
|
||||||
auto pMax = this->construct_max_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<
|
auto Construct_x_monotone_subcurve_2<
|
||||||
CGAL::Arr_rational_function_traits_2<AlgebraicKernel_d_1>>::
|
CGAL::Arr_rational_function_traits_2<AlgebraicKernel_d_1>>::
|
||||||
operator()(
|
operator()(
|
||||||
const X_monotone_curve_2& curve, const boost::optional<Point_2>& pLeft,
|
const X_monotone_curve_2& curve, const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight) -> X_monotone_curve_2
|
const std::optional<Point_2>& pRight) -> X_monotone_curve_2
|
||||||
{
|
{
|
||||||
Point_2 pMin, pMax;
|
Point_2 pMin, pMax;
|
||||||
bool unbounded_min = false;
|
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));
|
Point_2 p2c1(x, CoordinateType(clipRect.ymax() + 1));
|
||||||
|
|
||||||
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
||||||
CGAL::Object o;
|
std::vector<IntersectionResult> pairs;
|
||||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
|
||||||
|
|
||||||
this->intersectCurves(curve, verticalLine, oi);
|
this->intersectCurves(curve, verticalLine,
|
||||||
|
CGAL::dispatch_or_drop_output<IntersectionResult>(std::back_inserter(pairs)));
|
||||||
|
|
||||||
IntersectionResult pair;
|
IntersectionResult pair;
|
||||||
if (CGAL::assign(pair, o)) {
|
if (!pairs.empty()) {
|
||||||
Point_2 pt = pair.first;
|
Point_2 pt = pairs[0].first;
|
||||||
res = pt.y();
|
res = pt.y();
|
||||||
}
|
}
|
||||||
return res;
|
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
|
Point_2 p2c1(x, CoordinateType(10000000)); // upper bounding box
|
||||||
|
|
||||||
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
const X_monotone_curve_2 verticalLine = ctr_xcv(p1c1, p2c1);
|
||||||
CGAL::Object o;
|
std::vector<IntersectionResult> pairs;
|
||||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
|
||||||
|
|
||||||
this->intersectCurves(curve, verticalLine, oi);
|
this->intersectCurves(curve, verticalLine,
|
||||||
|
CGAL::dispatch_or_drop_output<IntersectionResult>(std::back_inserter(pairs)));
|
||||||
|
|
||||||
IntersectionResult pair;
|
if (!pairs.empty()) {
|
||||||
if (CGAL::assign(pair, o)) {
|
Point_2 pt = pairs[0].first;
|
||||||
Point_2 pt = pair.first;
|
|
||||||
res = pt.y();
|
res = pt.y();
|
||||||
}
|
}
|
||||||
return res;
|
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));
|
Point_2 p2c1(x, Coordinate_type(clip_rect.ymax() + 1));
|
||||||
|
|
||||||
const X_monotone_curve_2 vertical_line = ctr_xcv(p1c1, p2c1);
|
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);
|
Coordinate_type res(0);
|
||||||
IntersectionResult pair;
|
if (!pairs.empty()) {
|
||||||
if (CGAL::assign(pair, o)) {
|
Point_2 pt = pairs[0].first;
|
||||||
Point_2 pt = pair.first;
|
|
||||||
res = pt.y();
|
res = pt.y();
|
||||||
}
|
}
|
||||||
return res;
|
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)
|
operator()(const X_monotone_curve_2& curve, const CoordinateType& x)
|
||||||
-> CoordinateType
|
-> CoordinateType
|
||||||
{
|
{
|
||||||
CGAL::Object o;
|
|
||||||
CGAL::Oneset_iterator<CGAL::Object> oi(o);
|
|
||||||
Intersect_2 intersect = traits->intersect_2_object();
|
Intersect_2 intersect = traits->intersect_2_object();
|
||||||
X_monotone_curve_2 c2 = this->makeVerticalLine(x);
|
X_monotone_curve_2 c2 = this->makeVerticalLine(x);
|
||||||
intersect(curve, c2, oi);
|
typedef std::pair<Point_2, Multiplicity> PtM;
|
||||||
std::pair<Point_2, Multiplicity> res;
|
|
||||||
if (CGAL::assign(res, o)) {
|
std::vector<PtM> res;
|
||||||
|
intersect(curve, c2, CGAL::dispatch_or_drop_output<PtM>(std::back_inserter(res)));
|
||||||
|
if (!res.empty()) {
|
||||||
// TODO: handle failure case
|
// TODO: handle failure case
|
||||||
const Point_2& p = res.first;
|
const Point_2& p = res[0].first;
|
||||||
CoordinateType coord = p.y();
|
CoordinateType coord = p.y();
|
||||||
return coord;
|
return coord;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -479,8 +479,8 @@ public:
|
||||||
* projection.
|
* projection.
|
||||||
*/
|
*/
|
||||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||||
const boost::optional<Point_2>& pLeft,
|
const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight);
|
const std::optional<Point_2>& pRight);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const ArrTraits* traits;
|
const ArrTraits* traits;
|
||||||
|
|
@ -524,8 +524,8 @@ public:
|
||||||
/* Return the subcurve of curve bracketed by pLeft and pRight.
|
/* Return the subcurve of curve bracketed by pLeft and pRight.
|
||||||
*/
|
*/
|
||||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||||
const boost::optional<Point_2>& pLeft,
|
const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight );
|
const std::optional<Point_2>& pRight );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Traits& m_traits;
|
const Traits& m_traits;
|
||||||
|
|
@ -558,8 +558,8 @@ public:
|
||||||
Return the subcurve of curve bracketed by pLeft and pRight.
|
Return the subcurve of curve bracketed by pLeft and pRight.
|
||||||
*/
|
*/
|
||||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||||
const boost::optional<Point_2>& pLeft,
|
const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight);
|
const std::optional<Point_2>& pRight);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const ArrTraits* traits;
|
const ArrTraits* traits;
|
||||||
|
|
@ -600,8 +600,8 @@ public:
|
||||||
* projection.
|
* projection.
|
||||||
*/
|
*/
|
||||||
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
X_monotone_curve_2 operator()(const X_monotone_curve_2& curve,
|
||||||
const boost::optional<Point_2>& pLeft,
|
const std::optional<Point_2>& pLeft,
|
||||||
const boost::optional<Point_2>& pRight);
|
const std::optional<Point_2>& pRight);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const Traits* traits;
|
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
|
`Face_const_handle`\endlink. Depending on whether the query point is
|
||||||
located inside a face, lies on an edge, or coincides with a vertex,
|
located inside a face, lies on an edge, or coincides with a vertex,
|
||||||
the appropriate handle can be obtained with <em>value retrieval</em>
|
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
|
Note that the handles returned by the \link
|
||||||
ArrangementPointLocation_2::locate() `locate()`\endlink functions are
|
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
|
function template `print_point_location()`, which inserts the
|
||||||
result of the query into the standard output-stream. It is listed
|
result of the query into the standard output-stream. It is listed
|
||||||
below, and defined in the header file `point_location_utils.h`.
|
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
|
resulting object into a handle to an arrangement feature. The
|
||||||
point-location object `pl` is assumed to be already attached
|
point-location object `pl` is assumed to be already attached
|
||||||
to an arrangement.
|
to an arrangement.
|
||||||
|
|
@ -1383,13 +1383,13 @@ void print_point_location
|
||||||
const Face_const_handle* f;
|
const Face_const_handle* f;
|
||||||
|
|
||||||
std::cout << "The point (" << q << ") is located ";
|
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 "
|
std::cout << "inside "
|
||||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||||
<< " face.\n";
|
<< " 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;
|
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")
|
std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||||
<< " vertex: " << (*v)->point() << std::endl;
|
<< " vertex: " << (*v)->point() << std::endl;
|
||||||
else CGAL_error_msg("Invalid object.");
|
else CGAL_error_msg("Invalid object.");
|
||||||
|
|
@ -1603,12 +1603,12 @@ void shoot_vertical_ray(const RayShoot& vrs,
|
||||||
const Face_const_handle* f;
|
const Face_const_handle* f;
|
||||||
|
|
||||||
std::cout << "Shooting up from (" << q << ") : ";
|
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")
|
std::cout << "hit " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||||
<< " vertex: " << (*v)->point() << std::endl;
|
<< " 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;
|
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());
|
CGAL_assertion((*f)->is_unbounded());
|
||||||
std::cout << "hit nothing.\n";
|
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>`.
|
`std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
|
||||||
</UL>
|
</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_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template<typename Traits, typename Dcel,
|
template<typename Traits, typename Dcel,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ of both types
|
||||||
`CGAL::Line_arc_2<CircularKernel>` or
|
`CGAL::Line_arc_2<CircularKernel>` or
|
||||||
`CGAL::Circular_arc_2<CircularKernel>`.
|
`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`
|
\cgalModels `ArrangementTraits_2`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ insertions of curves and not deletions of them.
|
||||||
\sa `ArrangementPointLocation_2`
|
\sa `ArrangementPointLocation_2`
|
||||||
\sa `ArrangementVerticalRayShoot_2`
|
\sa `ArrangementVerticalRayShoot_2`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template< typename Arrangement, typename Generator >
|
template< typename Arrangement, typename Generator >
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ time-consuming process when applied to dense arrangements.
|
||||||
\sa `ArrangementPointLocation_2`
|
\sa `ArrangementPointLocation_2`
|
||||||
\sa `ArrangementVerticalRayShoot_2`
|
\sa `ArrangementVerticalRayShoot_2`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template< typename Arrangement >
|
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 {
|
namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -37,16 +14,13 @@ or vertical ray-shoot query.
|
||||||
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||||
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
*/
|
*/
|
||||||
template <class Arrangement>
|
template <class Arrangement>
|
||||||
struct Arr_point_location_result
|
struct Arr_point_location_result
|
||||||
{
|
{
|
||||||
/*! The type of the arrangement feature that is the result of a
|
/*! The type of the arrangement feature that is the result of a
|
||||||
* point-location query or a vertical ray-shoot query, namely,
|
* point-location query or a vertical ray-shoot query, namely,
|
||||||
* `boost::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>`
|
* `std::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`.
|
|
||||||
*/
|
*/
|
||||||
typedef unspecified_type Type;
|
typedef unspecified_type Type;
|
||||||
}; /* end Arr_point_location_result */
|
}; /* end Arr_point_location_result */
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ This strategy supports arbitrary subdivisions, including unbounded ones.
|
||||||
\sa `ArrangementPointLocation_2`
|
\sa `ArrangementPointLocation_2`
|
||||||
\sa `ArrangementVerticalRayShoot_2`
|
\sa `ArrangementVerticalRayShoot_2`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template< typename Arrangement >
|
template< typename Arrangement >
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ namespace CGAL {
|
||||||
* \sa `ArrangementPointLocation_2`
|
* \sa `ArrangementPointLocation_2`
|
||||||
* \sa `ArrangementVerticalRayShoot_2`
|
* \sa `ArrangementVerticalRayShoot_2`
|
||||||
* \sa `CGAL::Arr_point_location_result<Arrangement>`
|
* \sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
* \sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename Arrangement_>
|
template <typename Arrangement_>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ of issued queries is not large.
|
||||||
\sa `ArrangementPointLocation_2`
|
\sa `ArrangementPointLocation_2`
|
||||||
\sa `ArrangementVerticalRayShoot_2`
|
\sa `ArrangementVerticalRayShoot_2`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template< typename Arrangement >
|
template< typename Arrangement >
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public:
|
||||||
/*! computes the intersections of `xc1` and `xc2` and writes them <I>in an
|
/*! 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
|
* ascending lexicographic \f$xy\f$-order</I> into a range beginning at
|
||||||
* `oi`. The type `OutputIterator` must dereference a polymorphic object of
|
* `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
|
* `pair<ArrTraits::Point_2, ArrTraits::Multiplicity>` or
|
||||||
* `ArrTraits::X_monotone_curve_2`. An object of the former type represents an
|
* `ArrTraits::X_monotone_curve_2`. An object of the former type represents an
|
||||||
* intersection point with its multiplicity (in case the multiplicity is
|
* 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
|
/*! 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
|
* isolated points, and inserts the results into a range beginning at the given
|
||||||
* output iterator `oi`. The type `OutputIterator` dereferences a
|
* 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
|
* `ArrTraits::X_monotone_curve_2` object. The operator returns a past-the-end
|
||||||
* iterator for the output sequence.
|
* 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
|
arrangement face, but in degenerate situations it may lie on an edge or
|
||||||
coincide with an arrangement vertex.
|
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_naive_point_location<Arrangement>`
|
||||||
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||||
\cgalHasModel `CGAL::Arr_trapezoid_ric_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_trapezoid_ric_point_location<Arrangement>`
|
||||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\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
|
arrangement feature on its way. In this case the unbounded face is
|
||||||
returned.
|
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_naive_point_location<Arrangement>`
|
||||||
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
\cgalHasModel `CGAL::Arr_walk_along_line_point_location<Arrangement>`
|
||||||
\cgalHasModel `CGAL::Arr_trapezoid_ric_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_trapezoid_ric_point_location<Arrangement>`
|
||||||
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
|
||||||
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
\sa `CGAL::Arr_point_location_result<Arrangement>`
|
||||||
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ArrangementVerticalRayShoot_2 {
|
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_unb_planar_topology_traits_2<GeometryTraits_2,Dcel>`
|
||||||
- `CGAL::Arr_spherical_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}
|
\cgalCRPSection{Functions}
|
||||||
|
|
||||||
- `CGAL::is_valid()`
|
- `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::X_monotone_curve_2 X_monotone_curve;
|
||||||
typedef Traits::Point_2 Point;
|
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() {
|
int main() {
|
||||||
Traits traits;
|
Traits traits;
|
||||||
|
|
@ -52,7 +52,7 @@ int main() {
|
||||||
// but not in this case).
|
// but not in this case).
|
||||||
std::vector<X_monotone_curve> segs;
|
std::vector<X_monotone_curve> segs;
|
||||||
for(size_t i = 0; i < pre_segs.size(); ++i) {
|
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);
|
assert(curr_p);
|
||||||
segs.push_back(*curr_p);
|
segs.push_back(*curr_p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#include <CGAL/Arr_circular_line_arc_traits_2.h>
|
#include <CGAL/Arr_circular_line_arc_traits_2.h>
|
||||||
#include <CGAL/Arrangement_2.h>
|
#include <CGAL/Arrangement_2.h>
|
||||||
#include <CGAL/Arr_naive_point_location.h>
|
#include <CGAL/Arr_naive_point_location.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/Random.h>
|
#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::Circular_arc_2 Circular_arc_2;
|
||||||
typedef Circular_k::Line_arc_2 Line_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 std::vector< Arc_2> ArcContainer;
|
||||||
|
|
||||||
typedef CGAL::Arr_circular_line_arc_traits_2<Circular_k> Traits;
|
typedef CGAL::Arr_circular_line_arc_traits_2<Circular_k> Traits;
|
||||||
|
|
@ -52,7 +52,7 @@ int main() {
|
||||||
} while((x1 == x2) && (y1 == y2));
|
} while((x1 == x2) && (y1 == y2));
|
||||||
|
|
||||||
std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
|
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));
|
Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||||
ac.push_back( v);
|
ac.push_back( v);
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ int main() {
|
||||||
y1 = theRandom.get_int(random_min,random_max);
|
y1 = theRandom.get_int(random_min,random_max);
|
||||||
}
|
}
|
||||||
while(x1==0 && y1==0);
|
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);
|
Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||||
ac.push_back(v);
|
ac.push_back(v);
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +72,8 @@ int main() {
|
||||||
Point_location _pl(arr);
|
Point_location _pl(arr);
|
||||||
for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) {
|
for (ArcContainer::const_iterator it = ac.begin(); it != ac.end(); ++it) {
|
||||||
//insert(arr,_pl,*it);
|
//insert(arr,_pl,*it);
|
||||||
insert(arr, *it, _pl);
|
//DONOTCOMMIT
|
||||||
|
//~ insert(arr, *it, _pl);
|
||||||
};
|
};
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ int main() {
|
||||||
Point_location pl(arr);
|
Point_location pl(arr);
|
||||||
const Point q{_7_halves, 7};
|
const Point q{_7_halves, 7};
|
||||||
Point_location::result_type obj = pl.locate(q);
|
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;
|
// Split the edge e to two edges e1 and e2;
|
||||||
auto e1 = arr.split_edge(arr.non_const_handle(*e), q);
|
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.
|
// the boundary of the face that contains it.
|
||||||
Point q(4, 1);
|
Point q(4, 1);
|
||||||
auto obj = pl.locate(q);
|
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: ";
|
std::cout << "The query point (" << q << ") is located in: ";
|
||||||
print_face<Arrangement>(*f);
|
print_face<Arrangement>(*f);
|
||||||
|
|
|
||||||
|
|
@ -4,33 +4,6 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Print the result of a point-location query.
|
// 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_>
|
template <typename Arrangement_>
|
||||||
void print_point_location
|
void print_point_location
|
||||||
(const typename Arrangement_::Point_2& q,
|
(const typename Arrangement_::Point_2& q,
|
||||||
|
|
@ -46,18 +19,17 @@ void print_point_location
|
||||||
const Face_const_handle* f;
|
const Face_const_handle* f;
|
||||||
|
|
||||||
std::cout << "The point (" << q << ") is located ";
|
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 "
|
std::cout << "inside "
|
||||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||||
<< " face." << std::endl;
|
<< " 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;
|
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")
|
std::cout << "on " << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||||
<< " vertex: " << (*v)->point() << std::endl;
|
<< " vertex: " << (*v)->point() << std::endl;
|
||||||
else CGAL_error_msg("Invalid object.");
|
else CGAL_error_msg("Invalid object.");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Perform a point-location query and print the result.
|
// 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 ";
|
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")
|
std::cout << (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||||
<< " vertex: " << (*v)->point() << std::endl;
|
<< " 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;
|
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());
|
assert((*f)->is_unbounded());
|
||||||
std::cout << "nothing." << std::endl;
|
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 Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve;
|
||||||
typedef CGAL::Arrangement_2<Polycurve_bezier_traits> Arrangement_2;
|
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() {
|
int main() {
|
||||||
Polycurve_bezier_traits pc_traits;
|
Polycurve_bezier_traits pc_traits;
|
||||||
|
|
@ -58,7 +58,7 @@ int main() {
|
||||||
// convert it into x-monotone bezier curve.
|
// convert it into x-monotone bezier curve.
|
||||||
std::vector<Make_x_monotone_result> obj_vector;
|
std::vector<Make_x_monotone_result> obj_vector;
|
||||||
bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(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);
|
x_curves.push_back(*x_seg_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,15 +99,15 @@ protected:
|
||||||
for (auto it = results.begin(); it != results.end(); ++it) {
|
for (auto it = results.begin(); it != results.end(); ++it) {
|
||||||
std::cout << "The point (" << it->first << ") is located ";
|
std::cout << "The point (" << it->first << ") is located ";
|
||||||
if (const Face_const_handle* f =
|
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 "
|
std::cout << "inside "
|
||||||
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
|
||||||
<< " face.\n";
|
<< " face.\n";
|
||||||
else if (const Halfedge_const_handle* e =
|
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;
|
std::cout << "on an edge: " << (*e)->curve() << std::endl;
|
||||||
else if (const Vertex_const_handle* v =
|
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 "
|
std::cout << "on "
|
||||||
<< (((*v)->is_isolated()) ? "an isolated" : "a")
|
<< (((*v)->is_isolated()) ? "an isolated" : "a")
|
||||||
<< " vertex: " << (*v)->point() << std::endl;
|
<< " vertex: " << (*v)->point() << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
#include "arr_linear.h"
|
#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;
|
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<Vert_decomp_type, Vert_decomp_type> Vert_decomp_pair;
|
||||||
typedef std::pair<Vertex_const_handle, Vert_decomp_pair> Vert_decomp_entry;
|
typedef std::pair<Vertex_const_handle, Vert_decomp_pair> Vert_decomp_entry;
|
||||||
typedef std::list<Vert_decomp_entry> Vert_decomp_list;
|
typedef std::list<Vert_decomp_entry> Vert_decomp_list;
|
||||||
|
|
@ -41,10 +41,10 @@ int main() {
|
||||||
std::cout << " feature below: ";
|
std::cout << " feature below: ";
|
||||||
if (! curr.first) std::cout << "EMPTY";
|
if (! curr.first) std::cout << "EMPTY";
|
||||||
else {
|
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() << ')';
|
if (vh) std::cout << '(' << (*vh)->point() << ')';
|
||||||
else {
|
else {
|
||||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.first));
|
auto* hh = std::get_if<Halfedge_const_handle>(&*(curr.first));
|
||||||
if (! (*hh)->is_fictitious())
|
if (! (*hh)->is_fictitious())
|
||||||
std::cout << '[' << (*hh)->curve() << ']';
|
std::cout << '[' << (*hh)->curve() << ']';
|
||||||
else std::cout << "NONE";
|
else std::cout << "NONE";
|
||||||
|
|
@ -54,10 +54,10 @@ int main() {
|
||||||
std::cout << " feature above: ";
|
std::cout << " feature above: ";
|
||||||
if (! curr.second) std::cout << "EMPTY\n";
|
if (! curr.second) std::cout << "EMPTY\n";
|
||||||
else {
|
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";
|
if (vh) std::cout << '(' << (*vh)->point() << ")\n";
|
||||||
else {
|
else {
|
||||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second));
|
auto* hh = std::get_if<Halfedge_const_handle>(&*(curr.second));
|
||||||
if (! (*hh)->is_fictitious())
|
if (! (*hh)->is_fictitious())
|
||||||
std::cout << '[' << (*hh)->curve() << "]\n";
|
std::cout << '[' << (*hh)->curve() << "]\n";
|
||||||
else std::cout << "NONE\n";
|
else std::cout << "NONE\n";
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,7 @@ public:
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator() (const Curve_2& B, OutputIterator oi) const
|
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;
|
Make_x_monotone_result;
|
||||||
typedef typename Bounding_traits::Vertical_tangency_point
|
typedef typename Bounding_traits::Vertical_tangency_point
|
||||||
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);
|
auto obj = p_arr->topology_traits()->locate_curve_end(cv, ind, ps_x, ps_y);
|
||||||
|
|
||||||
// Return a handle to the DCEL feature.
|
// 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)));
|
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)));
|
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)));
|
if (v_p) return (Pl_result::make_result(p_arr->_const_handle_for(*v_p)));
|
||||||
|
|
||||||
// We should never reach here:
|
// We should never reach here:
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h>
|
#include <CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_impl.h>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
#include <boost/none.hpp>
|
#include <boost/none.hpp>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -267,11 +267,11 @@ public:
|
||||||
template <typename OutputIterator> OutputIterator
|
template <typename OutputIterator> OutputIterator
|
||||||
x_monotone_segment(Curve_2 cv,
|
x_monotone_segment(Curve_2 cv,
|
||||||
Point_2 p,
|
Point_2 p,
|
||||||
boost::optional<Point_2> start,
|
std::optional<Point_2> start,
|
||||||
boost::optional<Point_2> end,
|
std::optional<Point_2> end,
|
||||||
OutputIterator out) const
|
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;
|
Make_x_monotone_result;
|
||||||
//CGAL_assertion(is_one_one(cv,p));
|
//CGAL_assertion(is_one_one(cv,p));
|
||||||
|
|
||||||
|
|
@ -286,46 +286,46 @@ public:
|
||||||
this->_ckva()->make_x_monotone_2_object()(cv, std::back_inserter(arcs));
|
this->_ckva()->make_x_monotone_2_object()(cv, std::back_inserter(arcs));
|
||||||
auto it = arcs.begin();
|
auto it = arcs.begin();
|
||||||
auto helper = it;
|
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()) {
|
while (it != arcs.end()) {
|
||||||
if ( on_arc(p, *it_seg_p) ) break;
|
if ( on_arc(p, *it_seg_p) ) break;
|
||||||
it++;
|
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 left_on_arc = start && on_arc(start.value(), *it_seg_p);
|
||||||
bool right_on_arc = end && on_arc(end.get(), *it_seg_p);
|
bool right_on_arc = end && on_arc(end.value(), *it_seg_p);
|
||||||
|
|
||||||
if ( left_on_arc && right_on_arc ) {
|
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 (left_on_arc && (!right_on_arc)) {
|
||||||
if (!it_seg_p->is_finite(CGAL::ARR_MAX_END) ||
|
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) &&
|
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);
|
segs.push_back(*it_seg_p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
X_monotone_curve_2 split1,split2;
|
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);
|
segs.push_back(split2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((!left_on_arc) && right_on_arc) {
|
if ((!left_on_arc) && right_on_arc) {
|
||||||
if (!it_seg_p->is_finite(CGAL::ARR_MIN_END) ||
|
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) &&
|
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);
|
segs.push_back(*it_seg_p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
X_monotone_curve_2 split1,split2;
|
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);
|
segs.push_back(split1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -348,14 +348,14 @@ public:
|
||||||
}
|
}
|
||||||
CGAL_assertion(it != arcs.begin());
|
CGAL_assertion(it != arcs.begin());
|
||||||
it--;
|
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)) {
|
while (! on_arc(point_it, *it_seg_p)) {
|
||||||
CGAL_assertion(it != arcs.begin());
|
CGAL_assertion(it != arcs.begin());
|
||||||
it--;
|
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)) {
|
if (start && on_arc(start.value(),*it_seg_p)) {
|
||||||
segs.push_front(it_seg_p->trim(start.get(), right(*it_seg_p)));
|
segs.push_front(it_seg_p->trim(start.value(), right(*it_seg_p)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -365,7 +365,7 @@ public:
|
||||||
}
|
}
|
||||||
if (! right_on_arc) {
|
if (! right_on_arc) {
|
||||||
it = helper; // reset
|
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;
|
Point_2 point_it;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (it_seg_p->is_finite(CGAL::ARR_MAX_END) &&
|
if (it_seg_p->is_finite(CGAL::ARR_MAX_END) &&
|
||||||
|
|
@ -378,14 +378,14 @@ public:
|
||||||
}
|
}
|
||||||
it++;
|
it++;
|
||||||
CGAL_assertion(it != arcs.end());
|
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)) {
|
while(! on_arc(point_it, *it_seg_p)) {
|
||||||
it++;
|
it++;
|
||||||
CGAL_assertion(it != arcs.end());
|
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)) {
|
if(end && on_arc(end.value(),*it_seg_p)) {
|
||||||
segs.push_back(it_seg_p->trim(left(*it_seg_p),end.get()));
|
segs.push_back(it_seg_p->trim(left(*it_seg_p),end.value()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -407,19 +407,19 @@ public:
|
||||||
Site_of_point site_of_p,
|
Site_of_point site_of_p,
|
||||||
OutputIterator out) const {
|
OutputIterator out) const {
|
||||||
if(site_of_p==POINT_IN_INTERIOR) {
|
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) {
|
} else if(site_of_p==MIN_ENDPOINT) {
|
||||||
return x_monotone_segment(cv,
|
return x_monotone_segment(cv,
|
||||||
p,
|
p,
|
||||||
boost::optional<Point_2>(p),
|
std::optional<Point_2>(p),
|
||||||
boost::none,
|
std::nullopt,
|
||||||
out);
|
out);
|
||||||
}
|
}
|
||||||
CGAL_assertion(site_of_p==MAX_ENDPOINT);
|
CGAL_assertion(site_of_p==MAX_ENDPOINT);
|
||||||
return x_monotone_segment(cv,
|
return x_monotone_segment(cv,
|
||||||
p,
|
p,
|
||||||
boost::none,
|
std::nullopt,
|
||||||
boost::optional<Point_2>(p),
|
std::optional<Point_2>(p),
|
||||||
out);
|
out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -468,15 +468,15 @@ public:
|
||||||
return x_monotone_segment
|
return x_monotone_segment
|
||||||
(cv,
|
(cv,
|
||||||
end_left,
|
end_left,
|
||||||
boost::optional<Point_2>(end_left),
|
std::optional<Point_2>(end_left),
|
||||||
boost::optional<Point_2>(end_right),
|
std::optional<Point_2>(end_right),
|
||||||
out);
|
out);
|
||||||
} else {
|
} else {
|
||||||
return x_monotone_segment
|
return x_monotone_segment
|
||||||
(cv,
|
(cv,
|
||||||
end_right,
|
end_right,
|
||||||
boost::optional<Point_2>(end_left),
|
std::optional<Point_2>(end_left),
|
||||||
boost::optional<Point_2>(end_right),
|
std::optional<Point_2>(end_right),
|
||||||
out);
|
out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Ss2 = Surface_sweep_2;
|
||||||
* \param oi Output: An output iterator for the query results.
|
* \param oi Output: An output iterator for the query results.
|
||||||
* \pre The value-type of PointsIterator is Arrangement::Point_2,
|
* \pre The value-type of PointsIterator is Arrangement::Point_2,
|
||||||
* and the value-type of OutputIterator is is pair<Point_2, Result>,
|
* 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,
|
* Halfedge_const_handle,
|
||||||
* Face_const_handle> >.
|
* Face_const_handle> >.
|
||||||
* It represents the arrangement feature containing the point.
|
* 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();
|
const Gt2* geom_traits = arr.geometry_traits();
|
||||||
|
|
||||||
/* We would like to avoid copy construction of the geometry traits class.
|
/* 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
|
#ifndef CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_H
|
||||||
#define 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>
|
#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.
|
* \pre The curve has a boundary condition in either x or y.
|
||||||
* \return An object that wraps the curve end.
|
* \return An object that wraps the curve end.
|
||||||
*/
|
*/
|
||||||
boost::optional<boost::variant<Vertex*, Halfedge*> >
|
std::optional<std::variant<Vertex*, Halfedge*> >
|
||||||
place_boundary_vertex(Face*,
|
place_boundary_vertex(Face*,
|
||||||
const X_monotone_curve_2&,
|
const X_monotone_curve_2&,
|
||||||
Arr_curve_end,
|
Arr_curve_end,
|
||||||
|
|
@ -314,7 +314,7 @@ public:
|
||||||
{
|
{
|
||||||
// This function should never be called:
|
// This function should never be called:
|
||||||
CGAL_error();
|
CGAL_error();
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Locate the predecessor halfedge for the given curve around a given
|
/*! 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.
|
* \pre The curve end is incident to the boundary.
|
||||||
* \return An object that contains the curve end.
|
* \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&,
|
locate_curve_end(const X_monotone_curve_2&,
|
||||||
Arr_curve_end,
|
Arr_curve_end,
|
||||||
Arr_parameter_space /* ps_x */,
|
Arr_parameter_space /* ps_x */,
|
||||||
Arr_parameter_space /* ps_y */)
|
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:
|
// This function should never be called:
|
||||||
CGAL_error();
|
CGAL_error();
|
||||||
Vertex* v(nullptr);
|
Vertex* v(nullptr);
|
||||||
|
|
|
||||||
|
|
@ -584,9 +584,6 @@ public:
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
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
|
// Increment the serial number of the curve cv, which will serve as its
|
||||||
// unique identifier.
|
// unique identifier.
|
||||||
unsigned int index = 0;
|
unsigned int index = 0;
|
||||||
|
|
@ -594,10 +591,10 @@ public:
|
||||||
|
|
||||||
if (cv.orientation() == COLLINEAR) {
|
if (cv.orientation() == COLLINEAR) {
|
||||||
// The curve is a line segment.
|
// The curve is a line segment.
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(cv.supporting_line(),
|
*oi++ = X_monotone_curve_2(cv.supporting_line(),
|
||||||
cv.source(),
|
cv.source(),
|
||||||
cv.target(),
|
cv.target(),
|
||||||
index));
|
index);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -608,8 +605,8 @@ public:
|
||||||
|
|
||||||
if (sign_rad == ZERO) {
|
if (sign_rad == ZERO) {
|
||||||
// Create an isolated point.
|
// Create an isolated point.
|
||||||
*oi++ = Make_x_monotone_result(Point_2(circ.center().x(),
|
*oi++ = Point_2(circ.center().x(),
|
||||||
circ.center().y()));
|
circ.center().y());
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -622,59 +619,59 @@ public:
|
||||||
CGAL_assertion (n_vpts == 2);
|
CGAL_assertion (n_vpts == 2);
|
||||||
|
|
||||||
// Subdivide the circle into two arcs (an upper and a lower half).
|
// Subdivide the circle into two arcs (an upper and a lower half).
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
vpts[0], vpts[1],
|
vpts[0], vpts[1],
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
vpts[1], vpts[0],
|
vpts[1], vpts[0],
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Act according to the number of vertical tangency points.
|
// Act according to the number of vertical tangency points.
|
||||||
if (n_vpts == 2) {
|
if (n_vpts == 2) {
|
||||||
// Subdivide the circular arc into three x-monotone arcs.
|
// Subdivide the circular arc into three x-monotone arcs.
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
cv.source(), vpts[0],
|
cv.source(), vpts[0],
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
vpts[0], vpts[1],
|
vpts[0], vpts[1],
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
vpts[1],
|
vpts[1],
|
||||||
cv.target(),
|
cv.target(),
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
}
|
}
|
||||||
else if (n_vpts == 1) {
|
else if (n_vpts == 1) {
|
||||||
// Subdivide the circular arc into two x-monotone arcs.
|
// Subdivide the circular arc into two x-monotone arcs.
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
cv.source(),
|
cv.source(),
|
||||||
vpts[0],
|
vpts[0],
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
vpts[0],
|
vpts[0],
|
||||||
cv.target(),
|
cv.target(),
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(n_vpts == 0);
|
CGAL_assertion(n_vpts == 0);
|
||||||
|
|
||||||
// The arc is already x-monotone:
|
// The arc is already x-monotone:
|
||||||
*oi++ = Make_x_monotone_result(X_monotone_curve_2(circ,
|
*oi++ = X_monotone_curve_2(circ,
|
||||||
cv.source(),
|
cv.source(),
|
||||||
cv.target(),
|
cv.target(),
|
||||||
cv.orientation(),
|
cv.orientation(),
|
||||||
index));
|
index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,17 +178,17 @@ public:
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& arc, OutputIterator oi) const
|
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;
|
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));
|
CircularKernel().make_x_monotone_2_object()(arc, std::back_inserter(objs));
|
||||||
for (const auto& obj : 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);
|
*oi++ = Make_x_monotone_result(*p);
|
||||||
continue;
|
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);
|
*oi++ = Make_x_monotone_result(*xcv);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Arr_tags.h>
|
#include <CGAL/Arr_tags.h>
|
||||||
|
|
@ -51,17 +51,17 @@ namespace CGAL {
|
||||||
OutputIterator res2)
|
OutputIterator res2)
|
||||||
{
|
{
|
||||||
typedef typename CK::Circular_arc_point_2 Point_2;
|
typedef typename CK::Circular_arc_point_2 Point_2;
|
||||||
typedef boost::variant<Arc1, Arc2> X_monotone_curve_2;
|
typedef std::variant<Arc1, Arc2> X_monotone_curve_2;
|
||||||
typedef boost::variant<Point_2, X_monotone_curve_2>
|
typedef std::variant<Point_2, X_monotone_curve_2>
|
||||||
Make_x_monotone_result;
|
Make_x_monotone_result;
|
||||||
|
|
||||||
for (auto it = res1.begin(); it != res1.end(); ++it) {
|
for (auto it = res1.begin(); it != res1.end(); ++it) {
|
||||||
if (const Arc1* arc = CGAL::object_cast<Arc1>(&*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);
|
*res2++ = Make_x_monotone_result(v);
|
||||||
}
|
}
|
||||||
else if (const Arc2* line = CGAL::object_cast<Arc2>(&*it)) {
|
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);
|
*res2++ = Make_x_monotone_result(v);
|
||||||
}
|
}
|
||||||
else if (const Point_2* p = CGAL::object_cast<Point_2>(&*it)) {
|
else if (const Point_2* p = CGAL::object_cast<Point_2>(&*it)) {
|
||||||
|
|
@ -81,27 +81,27 @@ namespace CGAL {
|
||||||
Circular_arc_point_2;
|
Circular_arc_point_2;
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()(const boost::variant< Arc1, Arc2 > &a1,
|
operator()(const std::variant< Arc1, Arc2 > &a1,
|
||||||
const boost::variant< Arc1, Arc2 > &a2,
|
const std::variant< Arc1, Arc2 > &a2,
|
||||||
const Circular_arc_point_2 &p) const
|
const Circular_arc_point_2 &p) const
|
||||||
{
|
{
|
||||||
if ( const Arc1* arc1 = boost::get<Arc1>( &a1 ) ){
|
if ( const Arc1* arc1 = std::get_if<Arc1>( &a1 ) ){
|
||||||
if ( const Arc1* arc2 = boost::get<Arc1>( &a2 ) ){
|
if ( const Arc1* arc2 = std::get_if<Arc1>( &a2 ) ){
|
||||||
return CircularKernel()
|
return CircularKernel()
|
||||||
.compare_y_to_right_2_object()(*arc1, *arc2, p);
|
.compare_y_to_right_2_object()(*arc1, *arc2, p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const Arc2* arc2e = boost::get<Arc2>( &a2 );
|
const Arc2* arc2e = std::get_if<Arc2>( &a2 );
|
||||||
return CircularKernel()
|
return CircularKernel()
|
||||||
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const Arc2* arc1 = boost::get<Arc2>( &a1 );
|
const Arc2* arc1 = std::get_if<Arc2>( &a1 );
|
||||||
if ( const Arc1* arc2 = boost::get<Arc1>( &a2 ) ){
|
if ( const Arc1* arc2 = std::get_if<Arc1>( &a2 ) ){
|
||||||
return CircularKernel()
|
return CircularKernel()
|
||||||
.compare_y_to_right_2_object()(*arc1, *arc2, p);
|
.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()
|
return CircularKernel()
|
||||||
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
.compare_y_to_right_2_object()(*arc1, *arc2e, p);
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +110,6 @@ namespace CGAL {
|
||||||
|
|
||||||
template <class CircularKernel>
|
template <class CircularKernel>
|
||||||
class Variant_Equal_2
|
class Variant_Equal_2
|
||||||
: public boost::static_visitor<bool>
|
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
|
@ -136,7 +135,7 @@ namespace CGAL {
|
||||||
: public CircularKernel::Equal_2
|
: public CircularKernel::Equal_2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::variant< Arc1, Arc2 > Curve_2;
|
typedef std::variant< Arc1, Arc2 > Curve_2;
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
using CircularKernel::Equal_2::operator();
|
using CircularKernel::Equal_2::operator();
|
||||||
typedef typename CircularKernel::Circular_arc_point_2
|
typedef typename CircularKernel::Circular_arc_point_2
|
||||||
|
|
@ -169,7 +168,7 @@ namespace CGAL {
|
||||||
result_type
|
result_type
|
||||||
operator()(const Curve_2 &a0, const Curve_2 &a1) const
|
operator()(const Curve_2 &a0, const Curve_2 &a1) const
|
||||||
{
|
{
|
||||||
return boost::apply_visitor
|
return std::visit
|
||||||
( Variant_Equal_2<CircularKernel>(), a0, a1 );
|
( Variant_Equal_2<CircularKernel>(), a0, a1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,20 +187,20 @@ namespace CGAL {
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator() (const Circular_arc_point_2 &p,
|
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);
|
return CircularKernel().compare_y_at_x_2_object()(p, *arc1);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
return CircularKernel().compare_y_at_x_2_object()(p, *arc2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class CircularKernel>
|
template <class CircularKernel>
|
||||||
class Variant_Do_overlap_2 : public boost::static_visitor<bool>
|
class Variant_Do_overlap_2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
template < typename T >
|
template < typename T >
|
||||||
|
|
@ -229,10 +228,10 @@ namespace CGAL {
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
|
|
||||||
result_type
|
result_type
|
||||||
operator()(const boost::variant< Arc1, Arc2 > &A0,
|
operator()(const std::variant< Arc1, Arc2 > &A0,
|
||||||
const boost::variant< Arc1, Arc2 > &A1) const
|
const std::variant< Arc1, Arc2 > &A1) const
|
||||||
{
|
{
|
||||||
return boost::apply_visitor
|
return std::visit
|
||||||
( Variant_Do_overlap_2<CircularKernel>(), A0, A1 );
|
( Variant_Do_overlap_2<CircularKernel>(), A0, A1 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -248,23 +247,17 @@ namespace CGAL {
|
||||||
|
|
||||||
template < class OutputIterator,class Not_X_Monotone >
|
template < class OutputIterator,class Not_X_Monotone >
|
||||||
OutputIterator
|
OutputIterator
|
||||||
operator()(const boost::variant<Arc1, Arc2, Not_X_Monotone> &A,
|
operator()(const std::variant<Arc1, Arc2, Not_X_Monotone> &A,
|
||||||
OutputIterator res) const
|
OutputIterator res) const
|
||||||
{
|
{
|
||||||
if ( const Arc1* arc1 = boost::get<Arc1>( &A ) ) {
|
if ( const Arc1* arc1 = std::get_if<Arc1>( &A ) ) {
|
||||||
std::vector<CGAL::Object> container;
|
return CircularKernel().
|
||||||
CircularKernel().
|
make_x_monotone_2_object()(*arc1, res);
|
||||||
make_x_monotone_2_object()(*arc1,std::back_inserter(container));
|
|
||||||
return object_to_object_variant<CircularKernel, Arc1, Arc2>
|
|
||||||
(container, res);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const Arc2* arc2 = boost::get<Arc2>( &A );
|
const Arc2* arc2 = std::get_if<Arc2>( &A );
|
||||||
std::vector<CGAL::Object> container;
|
return CircularKernel().
|
||||||
CircularKernel().
|
make_x_monotone_2_object()(*arc2, res);
|
||||||
make_x_monotone_2_object()(*arc2,std::back_inserter(container));
|
|
||||||
return object_to_object_variant<CircularKernel, Arc1, Arc2>
|
|
||||||
(container, res);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -278,23 +271,23 @@ namespace CGAL {
|
||||||
|
|
||||||
template < class OutputIterator >
|
template < class OutputIterator >
|
||||||
OutputIterator
|
OutputIterator
|
||||||
operator()(const boost::variant< Arc1, Arc2 > &c1,
|
operator()(const std::variant< Arc1, Arc2 > &c1,
|
||||||
const boost::variant< Arc1, Arc2 > &c2,
|
const std::variant< Arc1, Arc2 > &c2,
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
if ( const Arc1* arc1 = boost::get<Arc1>( &c1 ) ){
|
if ( const Arc1* arc1 = std::get_if<Arc1>( &c1 ) ){
|
||||||
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
|
if ( const Arc1* arc2 = std::get_if<Arc1>( &c2 ) ){
|
||||||
return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
|
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);
|
return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Arc2* arc1e = boost::get<Arc2>( &c1 );
|
const Arc2* arc1e = std::get_if<Arc2>( &c1 );
|
||||||
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
|
if ( const Arc1* arc2 = std::get_if<Arc1>( &c2 ) ){
|
||||||
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
|
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);
|
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -309,13 +302,13 @@ namespace CGAL {
|
||||||
Circular_arc_point_2;
|
Circular_arc_point_2;
|
||||||
typedef void result_type;
|
typedef void result_type;
|
||||||
result_type
|
result_type
|
||||||
operator()(const boost::variant< Arc1, Arc2 > &A,
|
operator()(const std::variant< Arc1, Arc2 > &A,
|
||||||
const Circular_arc_point_2 &p,
|
const Circular_arc_point_2 &p,
|
||||||
boost::variant< Arc1, Arc2 > &ca1,
|
std::variant< Arc1, Arc2 > &ca1,
|
||||||
boost::variant< Arc1, Arc2 > &ca2) const
|
std::variant< Arc1, Arc2 > &ca2) const
|
||||||
{
|
{
|
||||||
// TODO : optimize by extracting the references from the variants ?
|
// 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 carc1;
|
||||||
Arc1 carc2;
|
Arc1 carc2;
|
||||||
CircularKernel().split_2_object()(*arc1, p, carc1, carc2);
|
CircularKernel().split_2_object()(*arc1, p, carc1, carc2);
|
||||||
|
|
@ -325,7 +318,7 @@ namespace CGAL {
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const Arc2* arc2 = boost::get<Arc2>( &A );
|
const Arc2* arc2 = std::get_if<Arc2>( &A );
|
||||||
Arc2 cline1;
|
Arc2 cline1;
|
||||||
Arc2 cline2;
|
Arc2 cline2;
|
||||||
CircularKernel().split_2_object()(*arc2, p, cline1, cline2);
|
CircularKernel().split_2_object()(*arc2, p, cline1, cline2);
|
||||||
|
|
@ -340,8 +333,6 @@ namespace CGAL {
|
||||||
|
|
||||||
template <class CircularKernel>
|
template <class CircularKernel>
|
||||||
class Variant_Construct_min_vertex_2
|
class Variant_Construct_min_vertex_2
|
||||||
: public boost::static_visitor
|
|
||||||
<const typename CircularKernel::Circular_arc_point_2&>
|
|
||||||
{
|
{
|
||||||
typedef typename CircularKernel::Circular_arc_point_2
|
typedef typename CircularKernel::Circular_arc_point_2
|
||||||
Circular_arc_point_2;
|
Circular_arc_point_2;
|
||||||
|
|
@ -372,9 +363,9 @@ namespace CGAL {
|
||||||
|
|
||||||
//std::remove_reference_t<qualified_result_type>
|
//std::remove_reference_t<qualified_result_type>
|
||||||
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 );
|
( Variant_Construct_min_vertex_2<CircularKernel>(), cv );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -385,8 +376,6 @@ namespace CGAL {
|
||||||
|
|
||||||
template <class CircularKernel>
|
template <class CircularKernel>
|
||||||
class Variant_Construct_max_vertex_2
|
class Variant_Construct_max_vertex_2
|
||||||
: public boost::static_visitor<const typename
|
|
||||||
CircularKernel::Circular_arc_point_2&>
|
|
||||||
{
|
{
|
||||||
typedef typename CircularKernel::Circular_arc_point_2
|
typedef typename CircularKernel::Circular_arc_point_2
|
||||||
Circular_arc_point_2;
|
Circular_arc_point_2;
|
||||||
|
|
@ -422,16 +411,15 @@ namespace CGAL {
|
||||||
|
|
||||||
//std::remove_reference<qualified_result_type>
|
//std::remove_reference<qualified_result_type>
|
||||||
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 );
|
( Variant_Construct_max_vertex_2<CircularKernel>(), cv );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class CircularKernel>
|
template <class CircularKernel>
|
||||||
class Variant_Is_vertical_2
|
class Variant_Is_vertical_2
|
||||||
: public boost::static_visitor<bool>
|
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
|
|
@ -449,9 +437,9 @@ namespace CGAL {
|
||||||
public:
|
public:
|
||||||
typedef bool result_type;
|
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 );
|
( 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.
|
// in Arr_circular_line_arc_traits_2.
|
||||||
namespace internal_Argt_traits{
|
namespace internal_Argt_traits{
|
||||||
struct Not_X_Monotone{};
|
struct Not_X_Monotone{};
|
||||||
|
|
@ -499,8 +487,8 @@ namespace CGAL {
|
||||||
|
|
||||||
typedef internal_Argt_traits::Not_X_Monotone Not_X_Monotone;
|
typedef internal_Argt_traits::Not_X_Monotone Not_X_Monotone;
|
||||||
|
|
||||||
typedef boost::variant< Arc1, Arc2, Not_X_Monotone > Curve_2;
|
typedef std::variant< Arc1, Arc2, Not_X_Monotone > Curve_2;
|
||||||
typedef boost::variant< Arc1, Arc2 > X_monotone_curve_2;
|
typedef std::variant< Arc1, Arc2 > X_monotone_curve_2;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CircularKernel ck;
|
CircularKernel ck;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
|
||||||
#include <boost/math/constants/constants.hpp>
|
#include <boost/math/constants/constants.hpp>
|
||||||
|
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
|
|
@ -863,8 +862,6 @@ public:
|
||||||
*/
|
*/
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const {
|
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();
|
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);
|
auto n_vtan_ps = m_traits.vertical_tangency_points(cv, vtan_ps);
|
||||||
if (n_vtan_ps == 0) {
|
if (n_vtan_ps == 0) {
|
||||||
// In case the given curve is already x-monotone:
|
// 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;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -890,19 +887,15 @@ public:
|
||||||
// In case the curve is a full conic, split it into two x-monotone
|
// 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
|
// arcs, one going from ps[0] to ps[1], and the other from ps[1] to
|
||||||
// ps[0].
|
// ps[0].
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], vtan_ps[1],
|
*oi++ = ctr_xcv(cv, vtan_ps[0], vtan_ps[1], conic_id);
|
||||||
conic_id));
|
*oi++ = ctr_xcv(cv, vtan_ps[1], vtan_ps[0], conic_id);
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[1], vtan_ps[0],
|
|
||||||
conic_id));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (n_vtan_ps == 1) {
|
if (n_vtan_ps == 1) {
|
||||||
// Split the arc into two x-monotone sub-curves: one going from the
|
// 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.
|
// 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],
|
*oi++ = ctr_xcv(cv, cv.source(), vtan_ps[0], conic_id);
|
||||||
conic_id));
|
*oi++ = ctr_xcv(cv, vtan_ps[0], cv.target(), conic_id);
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[0], cv.target(),
|
|
||||||
conic_id));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion(n_vtan_ps == 2);
|
CGAL_assertion(n_vtan_ps == 2);
|
||||||
|
|
@ -932,16 +925,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split the arc into three x-monotone sub-curves.
|
// Split the arc into three x-monotone sub-curves.
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, cv.source(),
|
*oi++ = ctr_xcv(cv, cv.source(),
|
||||||
vtan_ps[ind_first],
|
vtan_ps[ind_first],
|
||||||
conic_id));
|
conic_id);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_first],
|
*oi++ = ctr_xcv(cv, vtan_ps[ind_first],
|
||||||
vtan_ps[ind_second],
|
vtan_ps[ind_second],
|
||||||
conic_id));
|
conic_id);
|
||||||
|
|
||||||
*oi++ = Make_x_monotone_result(ctr_xcv(cv, vtan_ps[ind_second],
|
*oi++ = ctr_xcv(cv, vtan_ps[ind_second],
|
||||||
cv.target(), conic_id));
|
cv.target(), conic_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1315,17 +1308,15 @@ public:
|
||||||
OutputIterator intersect(const X_monotone_curve_2& xcv1,
|
OutputIterator intersect(const X_monotone_curve_2& xcv1,
|
||||||
const X_monotone_curve_2& xcv2,
|
const X_monotone_curve_2& xcv2,
|
||||||
Intersection_map& inter_map,
|
Intersection_map& inter_map,
|
||||||
OutputIterator oi) const {
|
OutputIterator oi) const
|
||||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
{
|
||||||
Intersection_result;
|
|
||||||
|
|
||||||
if (m_traits.has_same_supporting_conic(xcv1, xcv2)) {
|
if (m_traits.has_same_supporting_conic(xcv1, xcv2)) {
|
||||||
// Check for overlaps between the two arcs.
|
// Check for overlaps between the two arcs.
|
||||||
X_monotone_curve_2 overlap;
|
X_monotone_curve_2 overlap;
|
||||||
|
|
||||||
if (compute_overlap(xcv1, xcv2, overlap)) {
|
if (compute_overlap(xcv1, xcv2, overlap)) {
|
||||||
// There can be just a single overlap between two x-monotone arcs:
|
// There can be just a single overlap between two x-monotone arcs:
|
||||||
*oi++ = Intersection_result(overlap);
|
*oi++ = overlap;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1338,22 +1329,22 @@ public:
|
||||||
auto eq = alg_kernel->equal_2_object();
|
auto eq = alg_kernel->equal_2_object();
|
||||||
if (eq(xcv1.left(), xcv2.left())) {
|
if (eq(xcv1.left(), xcv2.left())) {
|
||||||
Intersection_point ip(xcv1.left(), 0);
|
Intersection_point ip(xcv1.left(), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eq(xcv1.right(), xcv2.right())) {
|
if (eq(xcv1.right(), xcv2.right())) {
|
||||||
Intersection_point ip(xcv1.right(), 0);
|
Intersection_point ip(xcv1.right(), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eq(xcv1.left(), xcv2.right())) {
|
if (eq(xcv1.left(), xcv2.right())) {
|
||||||
Intersection_point ip(xcv1.left(), 0);
|
Intersection_point ip(xcv1.left(), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eq(xcv1.right(), xcv2.left())) {
|
if (eq(xcv1.right(), xcv2.left())) {
|
||||||
Intersection_point ip(xcv1.right(), 0);
|
Intersection_point ip(xcv1.right(), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
return oi;
|
return oi;
|
||||||
|
|
@ -1396,7 +1387,7 @@ public:
|
||||||
if (m_traits.is_between_endpoints(xcv1, (*iter).first) &&
|
if (m_traits.is_between_endpoints(xcv1, (*iter).first) &&
|
||||||
m_traits.is_between_endpoints(xcv2, (*iter).first))
|
m_traits.is_between_endpoints(xcv2, (*iter).first))
|
||||||
{
|
{
|
||||||
*oi++ = Intersection_result(*iter);
|
*oi++ = *iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <boost/mpl/has_xxx.hpp>
|
#include <boost/mpl/has_xxx.hpp>
|
||||||
|
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
|
|
@ -126,9 +126,9 @@ public:
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
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;
|
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_x_monotone_result;
|
||||||
|
|
||||||
// Make the original curve x-monotone.
|
// Make the original curve x-monotone.
|
||||||
|
|
@ -138,12 +138,12 @@ public:
|
||||||
// Attach the data to each of the resulting x-monotone curves.
|
// Attach the data to each of the resulting x-monotone curves.
|
||||||
X_monotone_curve_data xdata = Convert()(cv.data());
|
X_monotone_curve_data xdata = Convert()(cv.data());
|
||||||
for (const auto& base_obj : base_objects) {
|
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));
|
*oi++ = Make_x_monotone_result(X_monotone_curve_2(*bxcv, xdata));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Current object is an isolated point: Leave it as is.
|
// 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);
|
CGAL_assertion(bp);
|
||||||
*oi++ = Make_x_monotone_result(*bp);
|
*oi++ = Make_x_monotone_result(*bp);
|
||||||
}
|
}
|
||||||
|
|
@ -208,9 +208,7 @@ public:
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
typedef std::variant<Intersection_point, Base_x_monotone_curve_2>
|
||||||
Intersection_result;
|
|
||||||
typedef boost::variant<Intersection_point, Base_x_monotone_curve_2>
|
|
||||||
Intersection_base_result;
|
Intersection_base_result;
|
||||||
|
|
||||||
// Use the base functor to obtain all intersection objects.
|
// Use the base functor to obtain all intersection objects.
|
||||||
|
|
@ -223,19 +221,19 @@ public:
|
||||||
// Go over all intersection objects and prepare the output.
|
// Go over all intersection objects and prepare the output.
|
||||||
for (const auto& item : base_objects) {
|
for (const auto& item : base_objects) {
|
||||||
const Base_x_monotone_curve_2* base_cv =
|
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) {
|
if (base_cv != nullptr) {
|
||||||
// The current intersection object is an overlapping x-monotone
|
// The current intersection object is an overlapping x-monotone
|
||||||
// curve: Merge the data fields of both intersecting curves and
|
// curve: Merge the data fields of both intersecting curves and
|
||||||
// associate the result with the overlapping curve.
|
// associate the result with the overlapping curve.
|
||||||
X_monotone_curve_2 cv(*base_cv, Merge()(cv1.data(), cv2.data()));
|
X_monotone_curve_2 cv(*base_cv, Merge()(cv1.data(), cv2.data()));
|
||||||
*oi++ = Intersection_result(cv);
|
*oi++ = cv;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// The current intersection object is an intersection point:
|
// The current intersection object is an intersection point:
|
||||||
// Copy it as is.
|
// Copy it as is.
|
||||||
const Intersection_point* ip = boost::get<Intersection_point>(&item);
|
const Intersection_point* ip = std::get_if<Intersection_point>(&item);
|
||||||
*oi++ = Intersection_result(*ip);
|
*oi++ = *ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
return oi;
|
return oi;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/config.h>
|
#include <CGAL/config.h>
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
|
|
@ -2063,7 +2063,7 @@ public:
|
||||||
*/
|
*/
|
||||||
template <typename OutputIterator>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& c, OutputIterator oi) const {
|
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;
|
Make_x_monotone_result;
|
||||||
// std::cout << "full: " << c.is_full() << std::endl;
|
// std::cout << "full: " << c.is_full() << std::endl;
|
||||||
// std::cout << "vert: " << c.is_vertical() << std::endl;
|
// std::cout << "vert: " << c.is_vertical() << std::endl;
|
||||||
|
|
@ -2321,8 +2321,7 @@ public:
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
|
||||||
Intersection_result;
|
|
||||||
const Kernel& kernel = m_traits;
|
const Kernel& kernel = m_traits;
|
||||||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||||
|
|
||||||
|
|
@ -2337,14 +2336,14 @@ public:
|
||||||
if (equal(l1, r1)) {
|
if (equal(l1, r1)) {
|
||||||
bool is_full = equal(l2, r2);
|
bool is_full = equal(l2, r2);
|
||||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true, is_full);
|
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true, is_full);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (equal(l2, r2)) {
|
if (equal(l2, r2)) {
|
||||||
CGAL_assertion(! equal(l1, r1)); // already handled above
|
CGAL_assertion(! equal(l1, r1)); // already handled above
|
||||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2358,19 +2357,19 @@ public:
|
||||||
// 5. l1 = r2 < r1 < l2 = l1 | One overlap (handled above)
|
// 5. l1 = r2 < r1 < l2 = l1 | One overlap (handled above)
|
||||||
if (in_between(r1, r2, l2)) {
|
if (in_between(r1, r2, l2)) {
|
||||||
// Case 1.
|
// Case 1.
|
||||||
*oi++ = Intersection_result(Intersection_point(l1_3, 1));
|
*oi++ = Intersection_point(l1_3, 1);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
if (equal(r1, l2)) {
|
if (equal(r1, l2)) {
|
||||||
// Case 2.
|
// Case 2.
|
||||||
*oi++ = Intersection_result(Intersection_point(l1_3, 1));
|
*oi++ = Intersection_point(l1_3, 1);
|
||||||
*oi++ = Intersection_result(Intersection_point(l2_3, 1));
|
*oi++ = Intersection_point(l2_3, 1);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
CGAL_assertion(in_between(r1, l2, r2));
|
CGAL_assertion(in_between(r1, l2, r2));
|
||||||
// Case 3.
|
// Case 3.
|
||||||
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2383,12 +2382,12 @@ public:
|
||||||
// 5. l1 < l1 = r1 = l2 < r2 | One overlap (handled above)
|
// 5. l1 < l1 = r1 = l2 < r2 | One overlap (handled above)
|
||||||
if (in_between(r2, r1, l1)) {
|
if (in_between(r2, r1, l1)) {
|
||||||
// Case 1.
|
// Case 1.
|
||||||
*oi++ = Intersection_result(Intersection_point(l2_3, 1));
|
*oi++ = Intersection_point(l2_3, 1);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
// Case 3.
|
// Case 3.
|
||||||
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2400,13 +2399,13 @@ public:
|
||||||
if (in_between(r1, l2, r2) || equal(r1, r2)) {
|
if (in_between(r1, l2, r2) || equal(r1, r2)) {
|
||||||
// Cases 1 & 2
|
// Cases 1 & 2
|
||||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
// Case 3
|
// Case 3
|
||||||
CGAL_assertion(in_between(r2, l2, r1));
|
CGAL_assertion(in_between(r2, l2, r1));
|
||||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2418,13 +2417,13 @@ public:
|
||||||
if (in_between(l1, r2, l2)) {
|
if (in_between(l1, r2, l2)) {
|
||||||
// Cases 1
|
// Cases 1
|
||||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
// Case 3
|
// Case 3
|
||||||
CGAL_assertion(in_between(l1, l2, l2));
|
CGAL_assertion(in_between(l1, l2, l2));
|
||||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2442,12 +2441,12 @@ public:
|
||||||
if (in_between(l2, r2, l1)) {
|
if (in_between(l2, r2, l1)) {
|
||||||
// Case 2
|
// Case 2
|
||||||
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
// Case 3
|
// Case 3
|
||||||
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l2_3, r1_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2457,12 +2456,12 @@ public:
|
||||||
// Case 4
|
// Case 4
|
||||||
if (in_between(l1, r1, l2)) {
|
if (in_between(l1, r1, l2)) {
|
||||||
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l2_3, r2_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
// Case 5
|
// Case 5
|
||||||
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
X_monotone_curve_2 xc(l1_3, r2_3, normal, vertical, true);
|
||||||
*oi++ = Intersection_result(xc);
|
*oi++ = xc;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2560,8 +2559,6 @@ public:
|
||||||
typedef typename Kernel::Equal_3 Equal_3;
|
typedef typename Kernel::Equal_3 Equal_3;
|
||||||
|
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
|
||||||
Intersection_result;
|
|
||||||
|
|
||||||
const Kernel& kernel = m_traits;
|
const Kernel& kernel = m_traits;
|
||||||
|
|
||||||
|
|
@ -2584,9 +2581,9 @@ public:
|
||||||
(res && (xc1.is_directed_right() != xc2.is_directed_right())))
|
(res && (xc1.is_directed_right() != xc2.is_directed_right())))
|
||||||
{
|
{
|
||||||
if (xc1.left().is_min_boundary() && xc2.left().is_min_boundary())
|
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())
|
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;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2594,11 +2591,11 @@ public:
|
||||||
* the other arc is completely overlapping.
|
* the other arc is completely overlapping.
|
||||||
*/
|
*/
|
||||||
if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) {
|
if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) {
|
||||||
*oi++ = Intersection_result(xc2);
|
*oi++ = xc2;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) {
|
if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) {
|
||||||
*oi++ = Intersection_result(xc1);
|
*oi++ = xc1;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
/*! Find an endpoint that does not coincide with a pole, and project
|
/*! 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.
|
// Observe that xc1 and xc2 may share two endpoints.
|
||||||
Point_2 ed = m_traits.construct_point_2_object()(v.direction());
|
Point_2 ed = m_traits.construct_point_2_object()(v.direction());
|
||||||
if (is_in_between(ed, xc1) && is_in_between(ed, xc2))
|
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));
|
Vector_3 vo(kernel.construct_opposite_vector_3_object()(v));
|
||||||
Point_2 edo = m_traits.construct_point_2_object()(vo.direction());
|
Point_2 edo = m_traits.construct_point_2_object()(vo.direction());
|
||||||
if (is_in_between(edo, xc1) && is_in_between(edo, xc2))
|
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;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ public:
|
||||||
* intersection or a plane in case plane1 and plane2 coincide.
|
* intersection or a plane in case plane1 and plane2 coincide.
|
||||||
*/
|
*/
|
||||||
template <typname Kernel>
|
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,
|
intersect(const Arr_plane_3<Kernel> & plane1,
|
||||||
const Arr_plane_3<Kernel> & plane2)
|
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::Direction_3 Direction_3;
|
||||||
typedef typename Kernel::Line_3 Line_3;
|
typedef typename Kernel::Line_3 Line_3;
|
||||||
typedef typename Kernel::FT FT;
|
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
|
// We know that the plane goes through the origin
|
||||||
const FT& a1 = plane1.a();
|
const FT& a1 = plane1.a();
|
||||||
|
|
|
||||||
|
|
@ -1264,22 +1264,22 @@ private:
|
||||||
Control_points aux_vec;
|
Control_points aux_vec;
|
||||||
|
|
||||||
auto res1 = f_intersect(skew1a, skew2a);
|
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();
|
if (! p1) CGAL_error();
|
||||||
aux_vec.push_back(*p1);
|
aux_vec.push_back(*p1);
|
||||||
|
|
||||||
auto res2 = f_intersect(skew1a, skew2b);
|
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();
|
if (! p2) CGAL_error();
|
||||||
aux_vec.push_back(*p2);
|
aux_vec.push_back(*p2);
|
||||||
|
|
||||||
auto res3 = f_intersect(skew1b, skew2a);
|
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();
|
if (! p3) CGAL_error();
|
||||||
aux_vec.push_back(*p3);
|
aux_vec.push_back(*p3);
|
||||||
|
|
||||||
auto res4 = f_intersect (skew1b, skew2b);
|
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();
|
if (! p4) CGAL_error();
|
||||||
aux_vec.push_back(*p4);
|
aux_vec.push_back(*p4);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -318,13 +318,11 @@ public:
|
||||||
Bezier_cache& cache,
|
Bezier_cache& cache,
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef boost::variant<Intersection_point, Self> Intersection_result;
|
|
||||||
|
|
||||||
// In case we have two x-monotone subcurves of the same Bezier curve,
|
// In case we have two x-monotone subcurves of the same Bezier curve,
|
||||||
// check if they have a common left endpoint.
|
// check if they have a common left endpoint.
|
||||||
if (_curve.is_same(cv._curve)) {
|
if (_curve.is_same(cv._curve)) {
|
||||||
if (left().is_same(cv.left()) || left().is_same(cv.right()))
|
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
|
// 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.
|
// In case of overlap, just report the overlapping subcurve.
|
||||||
if (do_ovlp) {
|
if (do_ovlp) {
|
||||||
*oi++ = Intersection_result(ovlp_cv);
|
*oi++ = ovlp_cv;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -349,14 +347,14 @@ public:
|
||||||
// xy-lexicorgraphical order, and insert them to the output iterator.
|
// xy-lexicorgraphical order, and insert them to the output iterator.
|
||||||
std::sort(ipts.begin(), ipts.end(), Less_intersection_point(cache));
|
std::sort(ipts.begin(), ipts.end(), Less_intersection_point(cache));
|
||||||
for (auto ip_it = ipts.begin(); ip_it != ipts.end(); ++ip_it) {
|
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,
|
// In case we have two x-monotone subcurves of the same Bezier curve,
|
||||||
// check if they have a common right endpoint.
|
// check if they have a common right endpoint.
|
||||||
if (_curve.is_same(cv._curve)) {
|
if (_curve.is_same(cv._curve)) {
|
||||||
if (right().is_same(cv.left()) || right().is_same(cv.right())) {
|
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,
|
OutputIterator intersect(const Self& cv, OutputIterator oi,
|
||||||
Intersection_map* inter_map = nullptr) const
|
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.
|
// First check whether the two arcs have the same supporting curve.
|
||||||
if (has_same_supporting_curve(cv)) {
|
if (has_same_supporting_curve(cv)) {
|
||||||
// Check for overlaps between the two arcs.
|
// Check for overlaps between the two arcs.
|
||||||
|
|
@ -1005,7 +1002,7 @@ public:
|
||||||
|
|
||||||
if (_compute_overlap(cv, overlap)) {
|
if (_compute_overlap(cv, overlap)) {
|
||||||
// There can be just a single overlap between two x-monotone arcs:
|
// There can be just a single overlap between two x-monotone arcs:
|
||||||
*oi++ = Intersection_result(overlap);
|
*oi++ = overlap;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1016,11 +1013,11 @@ public:
|
||||||
// intersection points we report.
|
// intersection points we report.
|
||||||
Multiplicity mult = 0;
|
Multiplicity mult = 0;
|
||||||
if (left().equals(cv.left()) || left().equals(cv.right())) {
|
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())) {
|
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;
|
return oi;
|
||||||
|
|
@ -1072,7 +1069,7 @@ public:
|
||||||
if (this->_is_between_endpoints (iter->first) &&
|
if (this->_is_between_endpoints (iter->first) &&
|
||||||
cv._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>
|
template <typename OutputIterator>
|
||||||
OutputIterator operator()(const Curve_2& line, OutputIterator oi) const
|
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);
|
*oi++ = Make_x_monotone_result(line);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
#include <CGAL/intersections.h>
|
#include <CGAL/intersections.h>
|
||||||
|
|
@ -1249,7 +1249,7 @@ public:
|
||||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||||
{
|
{
|
||||||
// Wrap the segment with a variant.
|
// 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;
|
Make_x_monotone_result;
|
||||||
*oi++ = Make_x_monotone_result(cv);
|
*oi++ = Make_x_monotone_result(cv);
|
||||||
return oi;
|
return oi;
|
||||||
|
|
@ -1326,8 +1326,6 @@ public:
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
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(! cv1.is_degenerate());
|
||||||
CGAL_precondition(! cv2.is_degenerate());
|
CGAL_precondition(! cv2.is_degenerate());
|
||||||
|
|
@ -1340,7 +1338,7 @@ public:
|
||||||
if (! res) return oi;
|
if (! res) return oi;
|
||||||
|
|
||||||
// Check whether we have a single intersection point.
|
// 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) {
|
if (ip != nullptr) {
|
||||||
// Check whether the intersection point ip lies on both segments.
|
// Check whether the intersection point ip lies on both segments.
|
||||||
const bool ip_on_cv1 = cv1.is_vertical() ?
|
const bool ip_on_cv1 = cv1.is_vertical() ?
|
||||||
|
|
@ -1354,7 +1352,7 @@ public:
|
||||||
// Create a pair representing the point with its multiplicity,
|
// Create a pair representing the point with its multiplicity,
|
||||||
// which is always 1 for line segments.
|
// which is always 1 for line segments.
|
||||||
Intersection_point ip_mult(*ip, 1);
|
Intersection_point ip_mult(*ip, 1);
|
||||||
*oi++ = Intersection_result(ip_mult);
|
*oi++ = ip_mult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oi;
|
return oi;
|
||||||
|
|
@ -1398,14 +1396,14 @@ public:
|
||||||
|
|
||||||
if (cmp_res == SMALLER) {
|
if (cmp_res == SMALLER) {
|
||||||
// We have discovered a true overlapping subcurve:
|
// We have discovered a true overlapping subcurve:
|
||||||
*oi++ = Intersection_result(ovlp);
|
*oi++ = ovlp;
|
||||||
}
|
}
|
||||||
else if (cmp_res == EQUAL) {
|
else if (cmp_res == EQUAL) {
|
||||||
// The two objects have the same supporting line, but they just share
|
// The two objects have the same supporting line, but they just share
|
||||||
// a common endpoint. Thus we have an intersection point, but we leave
|
// a common endpoint. Thus we have an intersection point, but we leave
|
||||||
// the multiplicity of this point undefined.
|
// the multiplicity of this point undefined.
|
||||||
Intersection_point ip_mult(ovlp.left(), 0);
|
Intersection_point ip_mult(ovlp.left(), 0);
|
||||||
*oi++ = Intersection_result(ip_mult);
|
*oi++ = ip_mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
return oi;
|
return oi;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
* functors required by the concept it models.
|
* functors required by the concept it models.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
|
|
@ -131,7 +131,7 @@ public:
|
||||||
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
|
||||||
{
|
{
|
||||||
// Wrap the segment with a variant.
|
// 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;
|
Make_x_monotone_result;
|
||||||
*oi++ = Make_x_monotone_result(cv);
|
*oi++ = Make_x_monotone_result(cv);
|
||||||
return oi;
|
return oi;
|
||||||
|
|
@ -224,8 +224,6 @@ public:
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
||||||
typedef boost::variant<Intersection_point, X_monotone_curve_2>
|
|
||||||
Intersection_result;
|
|
||||||
|
|
||||||
const Kernel& kernel = m_traits;
|
const Kernel& kernel = m_traits;
|
||||||
auto res = kernel.intersect_2_object()(cv1, cv2);
|
auto res = kernel.intersect_2_object()(cv1, cv2);
|
||||||
|
|
@ -234,19 +232,19 @@ public:
|
||||||
if (! res) return oi;
|
if (! res) return oi;
|
||||||
|
|
||||||
// Check if the intersection is a point:
|
// 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) {
|
if (p_p != nullptr) {
|
||||||
// Create a pair representing the point with its multiplicity,
|
// Create a pair representing the point with its multiplicity,
|
||||||
// which is always 1 for line segments for all practical purposes.
|
// which is always 1 for line segments for all practical purposes.
|
||||||
// If the two segments intersect at their endpoints, then the
|
// If the two segments intersect at their endpoints, then the
|
||||||
// multiplicity is undefined, but we deliberately ignore it for
|
// multiplicity is undefined, but we deliberately ignore it for
|
||||||
// efficiency reasons.
|
// efficiency reasons.
|
||||||
*oi++ = Intersection_result(Intersection_point(*p_p, 1));
|
*oi++ = Intersection_point(*p_p, 1);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The intersection is a segment.
|
// 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);
|
CGAL_assertion(cv_p != nullptr);
|
||||||
|
|
||||||
Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1);
|
Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1);
|
||||||
|
|
@ -257,11 +255,11 @@ public:
|
||||||
// in the overlap segment
|
// in the overlap segment
|
||||||
if (m_traits.compare_endpoints_xy_2_object()(*cv_p) != cmp1) {
|
if (m_traits.compare_endpoints_xy_2_object()(*cv_p) != cmp1) {
|
||||||
auto ctr_opposite = kernel.construct_opposite_segment_2_object();
|
auto ctr_opposite = kernel.construct_opposite_segment_2_object();
|
||||||
*oi++ = Intersection_result(ctr_opposite(*cv_p));
|
*oi++ = ctr_opposite(*cv_p);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*oi++ = Intersection_result(*cv_p);
|
*oi++ = *cv_p;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/optional/optional.hpp>
|
#include <optional>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/or.hpp>
|
#include <boost/mpl/or.hpp>
|
||||||
#include <boost/type_traits.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);
|
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 =
|
const typename Arr_res::Traits_adaptor_2* traits_adaptor =
|
||||||
arr.traits_adaptor();
|
arr.traits_adaptor();
|
||||||
|
|
||||||
|
|
@ -284,8 +284,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
||||||
if (vit1->is_isolated()) {
|
if (vit1->is_isolated()) {
|
||||||
typename Arr_a::Vertex_const_handle v1 = vit1;
|
typename Arr_a::Vertex_const_handle v1 = vit1;
|
||||||
pts_vec[i++] =
|
pts_vec[i++] =
|
||||||
Ovl_point_2(vit1->point(), boost::make_optional(Cell_handle_red(v1)),
|
Ovl_point_2(vit1->point(), std::make_optional(Cell_handle_red(v1)),
|
||||||
boost::optional<Cell_handle_blue>());
|
std::optional<Cell_handle_blue>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -294,8 +294,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
||||||
if (vit2->is_isolated()) {
|
if (vit2->is_isolated()) {
|
||||||
typename Arr_b::Vertex_const_handle v2 = vit2;
|
typename Arr_b::Vertex_const_handle v2 = vit2;
|
||||||
pts_vec[i++] =
|
pts_vec[i++] =
|
||||||
Ovl_point_2(vit2->point(), boost::optional<Cell_handle_red>(),
|
Ovl_point_2(vit2->point(), std::optional<Cell_handle_red>(),
|
||||||
boost::make_optional(Cell_handle_blue(v2)));
|
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
|
Equal_2 equal_2_object() const
|
||||||
{ return (Equal_2(m_base_traits->equal_2_object())); }
|
{ return (Equal_2(m_base_traits->equal_2_object())); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
#include <CGAL/Arr_point_location_result.h>
|
#include <CGAL/Arr_point_location_result.h>
|
||||||
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
|
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ Arr_trapezoid_ric_point_location<Arrangement_2>::locate(const Point_2& p) const
|
||||||
case TD::POINT:
|
case TD::POINT:
|
||||||
{
|
{
|
||||||
//p is interior so it should fall on Td_active_vertex
|
//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_TRAP_PRINT_DEBUG("POINT");
|
||||||
CGAL_assertion(!v.vertex()->is_at_open_boundary());
|
CGAL_assertion(!v.vertex()->is_at_open_boundary());
|
||||||
return make_result(v.vertex());
|
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:
|
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();
|
Halfedge_const_handle h = e.halfedge();
|
||||||
CGAL_TRAP_PRINT_DEBUG("CURVE");
|
CGAL_TRAP_PRINT_DEBUG("CURVE");
|
||||||
if ( m_traits->is_in_x_range_2_object()(h->curve(),p) &&
|
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:
|
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();
|
Halfedge_const_handle h = t.top();
|
||||||
CGAL_TRAP_PRINT_DEBUG("TRAPEZOID");
|
CGAL_TRAP_PRINT_DEBUG("TRAPEZOID");
|
||||||
bool is_p_above_h = (m_traits->is_in_x_range_2_object()(h->curve(),p))
|
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,
|
_get_unbounded_face(const Td_map_item& item,const Point_2& p,
|
||||||
Arr_not_all_sides_oblivious_tag) const
|
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();
|
// Halfedge_const_handle h = tr.top();
|
||||||
if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) {
|
if (!tr.is_on_top_boundary() || !tr.is_on_bottom_boundary()) {
|
||||||
//if one of top or bottom edges is defined
|
//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);
|
Td_map_item& left_v_item = td.locate(tr.left(),td_lt);
|
||||||
CGAL_assertion(td_lt == TD::POINT);
|
CGAL_assertion(td_lt == TD::POINT);
|
||||||
Halfedge_const_handle he;
|
Halfedge_const_handle he;
|
||||||
if (boost::get<Td_active_vertex>(&left_v_item) != nullptr) {
|
if (std::get_if<Td_active_vertex>(&left_v_item) != nullptr) {
|
||||||
Td_active_vertex v(boost::get<Td_active_vertex>(left_v_item));
|
Td_active_vertex v(std::get<Td_active_vertex>(left_v_item));
|
||||||
he = v.cw_he();
|
he = v.cw_he();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Td_active_fictitious_vertex
|
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();
|
he = v.cw_he();
|
||||||
}
|
}
|
||||||
//cw_he() holds the "smallest" curve clockwise starting from 12 o'clock
|
//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);
|
Td_map_item& right_v_item = td.locate(tr.right(),td_lt);
|
||||||
CGAL_assertion(td_lt == TD::POINT);
|
CGAL_assertion(td_lt == TD::POINT);
|
||||||
Halfedge_const_handle he;
|
Halfedge_const_handle he;
|
||||||
if (boost::get<Td_active_vertex>(&right_v_item)!= nullptr) {
|
if (std::get_if<Td_active_vertex>(&right_v_item)!= nullptr) {
|
||||||
Td_active_vertex v(boost::get<Td_active_vertex>(right_v_item));
|
Td_active_vertex v(std::get<Td_active_vertex>(right_v_item));
|
||||||
he = v.cw_he();
|
he = v.cw_he();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Td_active_fictitious_vertex
|
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();
|
he = v.cw_he();
|
||||||
}
|
}
|
||||||
//its cw_he() holds the "smallest" curve clockwise starting from
|
//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:
|
case TD::POINT:
|
||||||
{
|
{
|
||||||
//p fell on Td_active_vertex
|
//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()));
|
return (make_result(v.vertex()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TD::CURVE:
|
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();
|
Halfedge_const_handle h = e.halfedge();
|
||||||
|
|
||||||
if ((shoot_up && h->direction() == ARR_LEFT_TO_RIGHT) ||
|
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;
|
break;
|
||||||
case TD::TRAPEZOID:
|
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();
|
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))
|
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 <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -92,9 +92,9 @@ public:
|
||||||
// type flag + on boundaries flags,
|
// type flag + on boundaries flags,
|
||||||
// left-bottom neighbor trapezoid, left-top neighbor trapezoid,
|
// left-bottom neighbor trapezoid, left-top neighbor trapezoid,
|
||||||
// right-bottom neighbor trapezoid, right-top neighbor trapezoid
|
// right-bottom neighbor trapezoid, right-top neighbor trapezoid
|
||||||
typedef Td_ninetuple<boost::variant<Vertex_const_handle,Point>,
|
typedef Td_ninetuple<std::variant<Vertex_const_handle,Point>,
|
||||||
boost::variant<Vertex_const_handle,unsigned char>,
|
std::variant<Vertex_const_handle,unsigned char>,
|
||||||
boost::variant<Halfedge_const_handle,
|
std::variant<Halfedge_const_handle,
|
||||||
std::shared_ptr<X_monotone_curve_2> >,
|
std::shared_ptr<X_monotone_curve_2> >,
|
||||||
Halfedge_const_handle,
|
Halfedge_const_handle,
|
||||||
unsigned char,
|
unsigned char,
|
||||||
|
|
@ -239,7 +239,7 @@ public:
|
||||||
|
|
||||||
Curve_end v_ce(left()->curve_end());
|
Curve_end v_ce(left()->curve_end());
|
||||||
ptr()->e2 = (std::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(v_ce.cv()));
|
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;
|
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_TD_INLINE Vertex_const_handle left_unsafe() const
|
||||||
{
|
{
|
||||||
CGAL_precondition(is_active());
|
CGAL_precondition(is_active());
|
||||||
CGAL_assertion(boost::get<Vertex_const_handle>(&(ptr()->e0)) != nullptr);
|
CGAL_assertion(std::get<Vertex_const_handle>(&(ptr()->e0)) != nullptr);
|
||||||
return boost::get<Vertex_const_handle>(ptr()->e0);
|
return std::get<Vertex_const_handle>(ptr()->e0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Access trapezoid left.
|
/*! Access trapezoid left.
|
||||||
|
|
@ -466,8 +466,8 @@ public:
|
||||||
CGAL_TD_INLINE Vertex_const_handle right_unsafe() const
|
CGAL_TD_INLINE Vertex_const_handle right_unsafe() const
|
||||||
{
|
{
|
||||||
CGAL_precondition(is_active());
|
CGAL_precondition(is_active());
|
||||||
CGAL_assertion(boost::get<Vertex_const_handle>(&(ptr()->e1)) != nullptr);
|
CGAL_assertion(std::get<Vertex_const_handle>(&(ptr()->e1)) != nullptr);
|
||||||
return boost::get<Vertex_const_handle>(ptr()->e1);
|
return std::get<Vertex_const_handle>(ptr()->e1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Access trapezoid right.
|
/*! Access trapezoid right.
|
||||||
|
|
@ -489,8 +489,8 @@ public:
|
||||||
CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const
|
CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const
|
||||||
{
|
{
|
||||||
CGAL_precondition(is_active());
|
CGAL_precondition(is_active());
|
||||||
CGAL_assertion(boost::get<Halfedge_const_handle>(&(ptr()->e2)) != nullptr);
|
CGAL_assertion(std::get<Halfedge_const_handle>(&(ptr()->e2)) != nullptr);
|
||||||
return boost::get<Halfedge_const_handle>(ptr()->e2);
|
return std::get<Halfedge_const_handle>(ptr()->e2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Access trapezoid bottom.
|
/*! Access trapezoid bottom.
|
||||||
|
|
@ -526,8 +526,8 @@ public:
|
||||||
CGAL_precondition(type() == TD_VERTEX);
|
CGAL_precondition(type() == TD_VERTEX);
|
||||||
CGAL_precondition(!is_on_boundaries());
|
CGAL_precondition(!is_on_boundaries());
|
||||||
|
|
||||||
CGAL_assertion(boost::get<Point>( &(ptr()->e0)) != nullptr);
|
CGAL_assertion(std::get<Point>( &(ptr()->e0)) != nullptr);
|
||||||
return boost::get<Point>( ptr()->e0 );
|
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
|
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(type() == TD_VERTEX);
|
||||||
CGAL_precondition(is_on_boundaries());
|
CGAL_precondition(is_on_boundaries());
|
||||||
|
|
||||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||||
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);
|
||||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||||
CGAL_assertion(cv_ptr != nullptr);
|
CGAL_assertion(cv_ptr != nullptr);
|
||||||
|
|
||||||
Arr_curve_end ce =
|
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;
|
ARR_MIN_END : ARR_MAX_END;
|
||||||
|
|
||||||
return std::make_pair(cv_ptr, ce);
|
return std::make_pair(cv_ptr, ce);
|
||||||
|
|
@ -554,13 +554,13 @@ public:
|
||||||
CGAL_precondition(type() == TD_VERTEX);
|
CGAL_precondition(type() == TD_VERTEX);
|
||||||
CGAL_precondition(is_on_boundaries());
|
CGAL_precondition(is_on_boundaries());
|
||||||
|
|
||||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||||
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);
|
||||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||||
CGAL_assertion(cv_ptr != nullptr);
|
CGAL_assertion(cv_ptr != nullptr);
|
||||||
|
|
||||||
Arr_curve_end ce =
|
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;
|
ARR_MIN_END : ARR_MAX_END;
|
||||||
|
|
||||||
return Curve_end(*cv_ptr, ce);
|
return Curve_end(*cv_ptr, ce);
|
||||||
|
|
@ -571,13 +571,13 @@ public:
|
||||||
CGAL_precondition(!is_active());
|
CGAL_precondition(!is_active());
|
||||||
CGAL_precondition(type() == TD_VERTEX);
|
CGAL_precondition(type() == TD_VERTEX);
|
||||||
|
|
||||||
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
CGAL_assertion(std::get<unsigned char>( &(ptr()->e1)) != nullptr);
|
||||||
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);
|
||||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||||
CGAL_assertion(cv_ptr != nullptr);
|
CGAL_assertion(cv_ptr != nullptr);
|
||||||
|
|
||||||
Arr_curve_end ce =
|
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;
|
ARR_MIN_END : ARR_MAX_END;
|
||||||
|
|
||||||
return Curve_end(*cv_ptr, ce);
|
return Curve_end(*cv_ptr, ce);
|
||||||
|
|
@ -587,8 +587,8 @@ public:
|
||||||
{
|
{
|
||||||
CGAL_precondition(!is_active() && type() == TD_EDGE);
|
CGAL_precondition(!is_active() && type() == TD_EDGE);
|
||||||
|
|
||||||
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);
|
||||||
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
X_monotone_curve_2* cv_ptr = (std::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
|
||||||
CGAL_assertion(cv_ptr != nullptr);
|
CGAL_assertion(cv_ptr != nullptr);
|
||||||
return *cv_ptr;
|
return *cv_ptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -145,13 +145,13 @@ public:
|
||||||
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
||||||
|
|
||||||
/*! Initialize the trapezoid's neighbors. */
|
/*! 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
|
/*! \copydoc init_neighbors
|
||||||
* \deprecated please use #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); }
|
{ init_neighbors(next); }
|
||||||
|
|
||||||
/*! Set the DAG node. */
|
/*! Set the DAG node. */
|
||||||
|
|
@ -199,10 +199,10 @@ public:
|
||||||
/*! Constructor given Vertex & Halfedge handles. */
|
/*! Constructor given Vertex & Halfedge handles. */
|
||||||
Td_active_edge (Halfedge_const_handle he ,
|
Td_active_edge (Halfedge_const_handle he ,
|
||||||
Dag_node* node = 0,
|
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;
|
//m_dag_node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <CGAL/tuple.h>
|
#include <CGAL/tuple.h>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
|
|
@ -163,18 +163,18 @@ private:
|
||||||
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
//Dag_node* m_dag_node; //pointer to the search structure (DAG) node
|
||||||
|
|
||||||
/*! Initialize the trapezoid's neighbors. */
|
/*! Initialize the trapezoid's neighbors. */
|
||||||
inline void init_neighbors(boost::optional<Td_map_item&> lb, boost::optional<Td_map_item&> lt,
|
inline void init_neighbors(std::optional<std::reference_wrapper<Td_map_item>> lb, std::optional<std::reference_wrapper<Td_map_item>> lt,
|
||||||
boost::optional<Td_map_item&> rb, boost::optional<Td_map_item&> rt)
|
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_lb((lb) ? lb->get() : Td_map_item(0));
|
||||||
set_lt((lt) ? *lt : Td_map_item(0));
|
set_lt((lt) ? lt->get() : Td_map_item(0));
|
||||||
set_rb((rb) ? *rb : Td_map_item(0));
|
set_rb((rb) ? rb->get() : Td_map_item(0));
|
||||||
set_rt((rt) ? *rt : Td_map_item(0));
|
set_rt((rt) ? rt->get() : Td_map_item(0));
|
||||||
}
|
}
|
||||||
/*! \copydoc init_neighbors
|
/*! \copydoc init_neighbors
|
||||||
* \deprecated please use #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,
|
CGAL_DEPRECATED inline void init_neighbours(std::optional<std::reference_wrapper<Td_map_item>> lb, std::optional<std::reference_wrapper<Td_map_item>> lt,
|
||||||
boost::optional<Td_map_item&> rb, boost::optional<Td_map_item&> rt)
|
std::optional<std::reference_wrapper<Td_map_item>> rb, std::optional<std::reference_wrapper<Td_map_item>> rt)
|
||||||
{ init_neighbors(lb, lt, rb, rt); }
|
{ init_neighbors(lb, lt, rb, rt); }
|
||||||
|
|
||||||
/*! Set the DAG node. */
|
/*! Set the DAG node. */
|
||||||
|
|
@ -267,14 +267,14 @@ private:
|
||||||
/*! Constructor given Vertex & Halfedge handles. */
|
/*! Constructor given Vertex & Halfedge handles. */
|
||||||
Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r,
|
Td_active_trapezoid (Vertex_const_handle l, Vertex_const_handle r,
|
||||||
Halfedge_const_handle b, Halfedge_const_handle t,
|
Halfedge_const_handle b, Halfedge_const_handle t,
|
||||||
boost::optional<Td_map_item&> lb = boost::none,
|
std::optional<std::reference_wrapper<Td_map_item>> lb = std::nullopt,
|
||||||
boost::optional<Td_map_item&> lt = boost::none,
|
std::optional<std::reference_wrapper<Td_map_item>> lt = std::nullopt,
|
||||||
boost::optional<Td_map_item&> rb = boost::none,
|
std::optional<std::reference_wrapper<Td_map_item>> rb = std::nullopt,
|
||||||
boost::optional<Td_map_item&> rt = boost::none,
|
std::optional<std::reference_wrapper<Td_map_item>> rt = std::nullopt,
|
||||||
Dag_node* node = 0)
|
Dag_node* node = 0)
|
||||||
{
|
{
|
||||||
PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0),
|
PTR = new Data (l, r, b, t, (lb) ? lb->get() : Td_map_item(0), (lt) ? lt->get() : Td_map_item(0),
|
||||||
(rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node);
|
(rb) ? rb->get() : Td_map_item(0), (rt) ? rt->get() : Td_map_item(0), node);
|
||||||
//m_dag_node = node;
|
//m_dag_node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -459,14 +459,14 @@ private:
|
||||||
|
|
||||||
Td_map_item item (*this);
|
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);
|
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);
|
tr.set_lt(item);
|
||||||
}
|
}
|
||||||
CGAL_assertion(is_on_right_boundary() == right.is_on_right_boundary());
|
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 <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
class clear_neighbors_visitor : public boost::static_visitor< void >
|
class clear_neighbors_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void operator()(Td_active_trapezoid& t) const
|
void operator()(Td_active_trapezoid& t) const
|
||||||
|
|
@ -142,7 +142,7 @@ protected:
|
||||||
//d'tor
|
//d'tor
|
||||||
~Node()
|
~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
|
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 <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGAL_TD_DEBUG
|
#ifdef CGAL_TD_DEBUG
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ public:
|
||||||
Td_inactive_fictitious_vertex;
|
Td_inactive_fictitious_vertex;
|
||||||
|
|
||||||
//! type of td map item (Td_halfedge, Td_vertex or Td_trapezoid)
|
//! 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_trapezoid, Td_inactive_trapezoid,
|
||||||
Td_active_edge, Td_inactive_edge,
|
Td_active_edge, Td_inactive_edge,
|
||||||
Td_active_vertex, Td_active_fictitious_vertex,
|
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_active(left_item) && is_active(right_item));
|
||||||
CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(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 left (std::get<Td_active_trapezoid>(left_item));
|
||||||
Td_active_trapezoid right(boost::get<Td_active_trapezoid>(right_item));
|
Td_active_trapezoid right(std::get<Td_active_trapezoid>(right_item));
|
||||||
|
|
||||||
if (left.is_on_bottom_boundary())
|
if (left.is_on_bottom_boundary())
|
||||||
return (right.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_active(left_item) && is_active(right_item));
|
||||||
CGAL_precondition(is_td_trapezoid(left_item) && is_td_trapezoid(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 left (std::get<Td_active_trapezoid>(left_item));
|
||||||
Td_active_trapezoid right(boost::get<Td_active_trapezoid>(right_item));
|
Td_active_trapezoid right(std::get<Td_active_trapezoid>(right_item));
|
||||||
|
|
||||||
if (left.is_on_top_boundary())
|
if (left.is_on_top_boundary())
|
||||||
return (right.is_on_top_boundary());
|
return (right.is_on_top_boundary());
|
||||||
|
|
@ -957,13 +957,13 @@ public:
|
||||||
//returns true if the trapezoid is a curve
|
//returns true if the trapezoid is a curve
|
||||||
bool is_empty_item(const Td_map_item& tr) const
|
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
|
//returns true if the trapezoid is a point or a curve
|
||||||
bool is_trapezoid(const Td_map_item& tr) const
|
bool is_trapezoid(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_TRAPEZOID:
|
case TD_ACTIVE_TRAPEZOID:
|
||||||
case TD_INACTIVE_TRAPEZOID:
|
case TD_INACTIVE_TRAPEZOID:
|
||||||
|
|
@ -976,7 +976,7 @@ public:
|
||||||
//returns true if the map item is a vertex
|
//returns true if the map item is a vertex
|
||||||
bool is_td_vertex(const Td_map_item& tr) const
|
bool is_td_vertex(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_VERTEX:
|
case TD_ACTIVE_VERTEX:
|
||||||
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
||||||
|
|
@ -991,7 +991,7 @@ public:
|
||||||
//returns true if the map item is an edge
|
//returns true if the map item is an edge
|
||||||
bool is_td_edge(const Td_map_item& tr) const
|
bool is_td_edge(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_EDGE:
|
case TD_ACTIVE_EDGE:
|
||||||
case TD_INACTIVE_EDGE:
|
case TD_INACTIVE_EDGE:
|
||||||
|
|
@ -1004,7 +1004,7 @@ public:
|
||||||
//returns true if the map item is an edge
|
//returns true if the map item is an edge
|
||||||
bool is_td_trapezoid(const Td_map_item& tr) const
|
bool is_td_trapezoid(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_TRAPEZOID:
|
case TD_ACTIVE_TRAPEZOID:
|
||||||
case TD_INACTIVE_TRAPEZOID:
|
case TD_INACTIVE_TRAPEZOID:
|
||||||
|
|
@ -1017,7 +1017,7 @@ public:
|
||||||
//returns true if the trapezoid is a curve
|
//returns true if the trapezoid is a curve
|
||||||
bool is_fictitious_vertex(const Td_map_item& tr) const
|
bool is_fictitious_vertex(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
case TD_ACTIVE_FICTITIOUS_VERTEX:
|
||||||
case TD_INACTIVE_FICTITIOUS_VERTEX:
|
case TD_INACTIVE_FICTITIOUS_VERTEX:
|
||||||
|
|
@ -1030,7 +1030,7 @@ public:
|
||||||
//returns true if the trapezoid is a curve
|
//returns true if the trapezoid is a curve
|
||||||
bool is_active(const Td_map_item& tr) const
|
bool is_active(const Td_map_item& tr) const
|
||||||
{
|
{
|
||||||
switch (tr.which())
|
switch (tr.index())
|
||||||
{
|
{
|
||||||
case TD_ACTIVE_TRAPEZOID:
|
case TD_ACTIVE_TRAPEZOID:
|
||||||
case TD_ACTIVE_EDGE:
|
case TD_ACTIVE_EDGE:
|
||||||
|
|
@ -1049,7 +1049,7 @@ public:
|
||||||
CGAL_precondition(is_active(item));
|
CGAL_precondition(is_active(item));
|
||||||
//MICHAL: assumes item is of active edge item - also fails in case of a vertical asymptote
|
//MICHAL: assumes item is of active edge item - also fails in case of a vertical asymptote
|
||||||
//MICHAL: check when this is used exactly
|
//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();
|
Halfedge_const_handle he = e.halfedge();
|
||||||
return (this->compare_curve_end_x_2_object()
|
return (this->compare_curve_end_x_2_object()
|
||||||
(Curve_end(he,ARR_MIN_END), Curve_end(he,ARR_MAX_END))== EQUAL);
|
(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_active(item) );
|
||||||
CGAL_precondition( is_td_trapezoid(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
|
return
|
||||||
( tr.is_on_left_boundary() ||
|
( tr.is_on_left_boundary() ||
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
#include <CGAL/Arr_point_location/Td_predicates.h>
|
#include <CGAL/Arr_point_location/Td_predicates.h>
|
||||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h>
|
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
@ -93,16 +93,16 @@ struct Non_recursive_td_map_item_destructor
|
||||||
|
|
||||||
void operator()(Td_active_trapezoid& item)
|
void operator()(Td_active_trapezoid& item)
|
||||||
{
|
{
|
||||||
boost::apply_visitor(m_child_visitor, item.lb());
|
std::visit(m_child_visitor, item.lb());
|
||||||
boost::apply_visitor(m_child_visitor, item.lt());
|
std::visit(m_child_visitor, item.lt());
|
||||||
boost::apply_visitor(m_child_visitor, item.rb());
|
std::visit(m_child_visitor, item.rb());
|
||||||
boost::apply_visitor(m_child_visitor, item.rt());
|
std::visit(m_child_visitor, item.rt());
|
||||||
item.clear_neighbors();
|
item.clear_neighbors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(Td_active_edge& item)
|
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));
|
item.set_next(Td_map_item(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ struct Non_recursive_td_map_item_destructor
|
||||||
{
|
{
|
||||||
Td_map_item item = queue.back();
|
Td_map_item item = queue.back();
|
||||||
queue.pop_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();
|
Td_map_item item = queue.back();
|
||||||
queue.pop_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() : traits(0), m_cur_item(Td_map_item(0)){ }
|
||||||
|
|
||||||
Base_map_item_iterator(const Traits* traits_,
|
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) ) { }
|
:traits(traits_), m_cur_item((curr) ? *curr : Td_map_item(0) ) { }
|
||||||
|
|
||||||
Base_map_item_iterator(const Base_map_item_iterator &it)
|
Base_map_item_iterator(const Base_map_item_iterator &it)
|
||||||
|
|
@ -332,12 +332,12 @@ public:
|
||||||
public:
|
public:
|
||||||
//constructors
|
//constructors
|
||||||
In_face_iterator(const Traits* traits_, Halfedge_const_handle sep,
|
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())
|
:Base_map_item_iterator(traits_,curr), m_sep(sep->curve())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
In_face_iterator(const Traits* traits_, const X_monotone_curve_2& sep,
|
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)
|
:Base_map_item_iterator(traits_,curr), m_sep(sep)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
@ -384,7 +384,7 @@ public:
|
||||||
if (traits->is_td_trapezoid(m_cur_item))
|
if (traits->is_td_trapezoid(m_cur_item))
|
||||||
{
|
{
|
||||||
//if the map item is a trapezoid
|
//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
|
#ifndef CGAL_TD_DEBUG
|
||||||
CGAL_warning_code(Dag_node* tt = tr.dag_node();)
|
CGAL_warning_code(Dag_node* tt = tr.dag_node();)
|
||||||
|
|
@ -436,7 +436,7 @@ public:
|
||||||
{
|
{
|
||||||
//if the map item is an edge
|
//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_code(Dag_node* tt = e.dag_node();)
|
||||||
CGAL_assertion(tt != nullptr);
|
CGAL_assertion(tt != nullptr);
|
||||||
CGAL_assertion(tt->is_inner_node());
|
CGAL_assertion(tt->is_inner_node());
|
||||||
|
|
@ -453,7 +453,7 @@ public:
|
||||||
while(traits->is_td_vertex(m_cur_item))
|
while(traits->is_td_vertex(m_cur_item))
|
||||||
{
|
{
|
||||||
Dag_node* node =
|
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();
|
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_empty_item(m_cur_item));
|
||||||
CGAL_precondition (traits->is_active(m_cur_item) &&
|
CGAL_precondition (traits->is_active(m_cur_item) &&
|
||||||
traits->is_td_trapezoid(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()
|
Td_active_edge& e()
|
||||||
|
|
@ -489,13 +489,13 @@ public:
|
||||||
CGAL_precondition (!traits->is_empty_item(m_cur_item));
|
CGAL_precondition (!traits->is_empty_item(m_cur_item));
|
||||||
CGAL_precondition (traits->is_active(m_cur_item) &&
|
CGAL_precondition (traits->is_active(m_cur_item) &&
|
||||||
traits->is_td_edge(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 */
|
/*! Visitors for accessing td map items methods */
|
||||||
class rb_visitor : public boost::static_visitor<Td_map_item>
|
class rb_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
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:
|
public:
|
||||||
set_rb_visitor (const Td_map_item& rb) : m_rb(rb) {}
|
set_rb_visitor (const Td_map_item& rb) : m_rb(rb) {}
|
||||||
|
|
@ -532,7 +532,7 @@ public:
|
||||||
const Td_map_item& m_rb;
|
const Td_map_item& m_rb;
|
||||||
};
|
};
|
||||||
|
|
||||||
class rt_visitor : public boost::static_visitor<Td_map_item>
|
class rt_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
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:
|
public:
|
||||||
set_rt_visitor (const Td_map_item& rt) : m_rt(rt) {}
|
set_rt_visitor (const Td_map_item& rt) : m_rt(rt) {}
|
||||||
|
|
@ -568,7 +568,7 @@ public:
|
||||||
const Td_map_item& m_rt;
|
const Td_map_item& m_rt;
|
||||||
};
|
};
|
||||||
|
|
||||||
class lb_visitor : public boost::static_visitor<Td_map_item>
|
class lb_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Td_map_item operator()(Td_active_trapezoid& t) const
|
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:
|
public:
|
||||||
set_lb_visitor (const Td_map_item& lb) : m_lb(lb) {}
|
set_lb_visitor (const Td_map_item& lb) : m_lb(lb) {}
|
||||||
|
|
@ -604,7 +604,7 @@ public:
|
||||||
const Td_map_item& m_lb;
|
const Td_map_item& m_lb;
|
||||||
};
|
};
|
||||||
|
|
||||||
class set_lt_visitor : public boost::static_visitor<void>
|
class set_lt_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
set_lt_visitor (const Td_map_item& lt) : m_lt(lt) {}
|
set_lt_visitor (const Td_map_item& lt) : m_lt(lt) {}
|
||||||
|
|
@ -624,7 +624,7 @@ public:
|
||||||
const Td_map_item& m_lt;
|
const Td_map_item& m_lt;
|
||||||
};
|
};
|
||||||
|
|
||||||
class bottom_he_visitor : public boost::static_visitor<Halfedge_const_handle>
|
class bottom_he_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Halfedge_const_handle operator()(Td_active_trapezoid& t) const
|
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:
|
public:
|
||||||
set_bottom_he_visitor (Halfedge_const_handle he) : m_bottom_he(he) {}
|
set_bottom_he_visitor (Halfedge_const_handle he) : m_bottom_he(he) {}
|
||||||
|
|
@ -659,7 +659,7 @@ public:
|
||||||
Halfedge_const_handle m_bottom_he;
|
Halfedge_const_handle m_bottom_he;
|
||||||
};
|
};
|
||||||
|
|
||||||
class top_he_visitor : public boost::static_visitor<Halfedge_const_handle>
|
class top_he_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Halfedge_const_handle operator()(Td_active_trapezoid& t) const
|
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:
|
public:
|
||||||
set_top_he_visitor (Halfedge_const_handle he) : m_top_he(he) {}
|
set_top_he_visitor (Halfedge_const_handle he) : m_top_he(he) {}
|
||||||
|
|
@ -694,7 +694,7 @@ public:
|
||||||
Halfedge_const_handle m_top_he;
|
Halfedge_const_handle m_top_he;
|
||||||
};
|
};
|
||||||
|
|
||||||
class cw_he_visitor : public boost::static_visitor< Halfedge_const_handle >
|
class cw_he_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Halfedge_const_handle operator()(Td_active_vertex& t) const
|
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.
|
/*! 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:
|
public:
|
||||||
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
|
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.
|
/*! 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:
|
public:
|
||||||
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
|
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
|
||||||
|
|
||||||
|
|
@ -744,7 +746,7 @@ public:
|
||||||
void operator()(T& /*t*/) const { CGAL_assertion(false); }
|
void operator()(T& /*t*/) const { CGAL_assertion(false); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class dag_node_visitor : public boost::static_visitor<Dag_node*>
|
class dag_node_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Dag_node* operator()(Td_nothing& /* t */) const
|
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:
|
public:
|
||||||
set_dag_node_visitor(Dag_node* node):m_node(node) {}
|
set_dag_node_visitor(Dag_node* node):m_node(node) {}
|
||||||
|
|
@ -789,30 +791,29 @@ public:
|
||||||
Dag_node* m_node;
|
Dag_node* m_node;
|
||||||
};
|
};
|
||||||
|
|
||||||
class curve_end_for_fict_vertex_visitor :
|
class curve_end_for_fict_vertex_visitor
|
||||||
public boost::static_visitor<boost::optional<Curve_end> >
|
|
||||||
{
|
{
|
||||||
public:
|
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();
|
return t.curve_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<Curve_end>
|
std::optional<Curve_end>
|
||||||
operator()(Td_inactive_fictitious_vertex& t) const
|
operator()(Td_inactive_fictitious_vertex& t) const
|
||||||
{
|
{
|
||||||
return t.curve_end();
|
return t.curve_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
boost::optional<Curve_end> operator()(T& /* t */) const
|
std::optional<Curve_end> operator()(T& /* t */) const
|
||||||
{
|
{
|
||||||
CGAL_assertion(false);
|
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:
|
public:
|
||||||
Point operator()(Td_active_vertex& t) const
|
Point operator()(Td_active_vertex& t) const
|
||||||
|
|
@ -833,30 +834,28 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class curve_end_for_active_vertex_visitor :
|
class curve_end_for_active_vertex_visitor
|
||||||
public boost::static_visitor<boost::optional<Curve_end> >
|
|
||||||
{
|
{
|
||||||
public:
|
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();
|
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();
|
return t.curve_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
boost::optional<Curve_end> operator()(T& /* t */) const
|
std::optional<Curve_end> operator()(T& /* t */) const
|
||||||
{
|
{
|
||||||
CGAL_assertion(false);
|
CGAL_assertion(false);
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class vertex_for_active_vertex_visitor :
|
class vertex_for_active_vertex_visitor
|
||||||
public boost::static_visitor<Vertex_const_handle>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Vertex_const_handle operator()(Td_active_vertex& t) const
|
Vertex_const_handle operator()(Td_active_vertex& t) const
|
||||||
|
|
@ -877,27 +876,26 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class cv_for_edge_visitor :
|
class cv_for_edge_visitor
|
||||||
public boost::static_visitor<boost::optional<const X_monotone_curve_2&> >
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
boost::optional<const X_monotone_curve_2&>
|
std::optional<std::reference_wrapper<const X_monotone_curve_2>>
|
||||||
operator()(Td_active_edge& t) const
|
operator()(Td_active_edge& t) const
|
||||||
{
|
{
|
||||||
return t.halfedge()->curve();
|
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
|
operator()(Td_inactive_edge& t) const
|
||||||
{
|
{
|
||||||
return t.curve();
|
return t.curve();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
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);
|
CGAL_assertion(false);
|
||||||
return boost::none;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -998,11 +996,11 @@ protected:
|
||||||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||||
if (is_fict_vtx) {
|
if (is_fict_vtx) {
|
||||||
return (compare(t,
|
return (compare(t,
|
||||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||||
vtx_item))) == SMALLER);
|
vtx_item))) == SMALLER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (compare(t, boost::apply_visitor(point_for_vertex_visitor(),
|
return (compare(t, std::visit(point_for_vertex_visitor(),
|
||||||
vtx_item)) == SMALLER);
|
vtx_item)) == SMALLER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1039,12 +1037,12 @@ protected:
|
||||||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||||
if (is_fict_vtx) {
|
if (is_fict_vtx) {
|
||||||
return (compare(t,
|
return (compare(t,
|
||||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||||
vtx_item))) == LARGER);
|
vtx_item))) == LARGER);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (compare(t,
|
return (compare(t,
|
||||||
boost::apply_visitor(point_for_vertex_visitor(),
|
std::visit(point_for_vertex_visitor(),
|
||||||
vtx_item)) == LARGER);
|
vtx_item)) == LARGER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1058,12 +1056,12 @@ protected:
|
||||||
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
bool is_fict_vtx = traits->is_fictitious_vertex(vtx_item);
|
||||||
if (is_fict_vtx) {
|
if (is_fict_vtx) {
|
||||||
return equal(t,
|
return equal(t,
|
||||||
*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),
|
*(std::visit(curve_end_for_fict_vertex_visitor(),
|
||||||
vtx_item)));
|
vtx_item)));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return equal(t,
|
return equal(t,
|
||||||
boost::apply_visitor(point_for_vertex_visitor(),
|
std::visit(point_for_vertex_visitor(),
|
||||||
vtx_item));
|
vtx_item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1090,24 +1088,24 @@ protected:
|
||||||
//if ( traits->is_fictitious_vertex(item) )
|
//if ( traits->is_fictitious_vertex(item) )
|
||||||
//{
|
//{
|
||||||
// CGAL_precondition(traits->equal_curve_end_2_object()
|
// 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
|
//else
|
||||||
//{
|
//{
|
||||||
// CGAL_precondition(traits->equal_curve_end_2_object()
|
// 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
|
//find the node of the curve's leftmost trapezoid
|
||||||
Dag_node cv_leftmost_node(left_cv_end_node.right_child());
|
Dag_node cv_leftmost_node(left_cv_end_node.right_child());
|
||||||
if (traits->is_fictitious_vertex(item) )
|
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)));
|
item)));
|
||||||
search_using_dag_with_cv(cv_leftmost_node, traits, ce, &cv, cres);
|
search_using_dag_with_cv(cv_leftmost_node, traits, ce, &cv, cres);
|
||||||
}
|
}
|
||||||
else
|
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);
|
search_using_dag_with_cv(cv_leftmost_node, traits, p, &cv, cres);
|
||||||
}
|
}
|
||||||
return cv_leftmost_node;
|
return cv_leftmost_node;
|
||||||
|
|
@ -1159,8 +1157,8 @@ protected:
|
||||||
if (traits->is_empty_item(left_item) || traits->is_empty_item(right_item))
|
if (traits->is_empty_item(left_item) || traits->is_empty_item(right_item))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Td_active_trapezoid& left (boost::get<Td_active_trapezoid>(left_item));
|
Td_active_trapezoid& left (std::get<Td_active_trapezoid>(left_item));
|
||||||
Td_active_trapezoid& right (boost::get<Td_active_trapezoid>(right_item));
|
Td_active_trapezoid& right (std::get<Td_active_trapezoid>(right_item));
|
||||||
|
|
||||||
if (traits->is_trapezoids_top_equal(left,right) &&
|
if (traits->is_trapezoids_top_equal(left,right) &&
|
||||||
traits->is_trapezoids_bottom_equal(left,right) &&
|
traits->is_trapezoids_bottom_equal(left,right) &&
|
||||||
|
|
@ -1966,7 +1964,7 @@ public:
|
||||||
for (typename std::list<Td_map_item>::iterator it =
|
for (typename std::list<Td_map_item>::iterator it =
|
||||||
representatives.begin(); it != representatives.end(); ++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
|
container.push_back(e.halfedge()); //it represents an active trapezoid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2152,7 +2150,7 @@ private:
|
||||||
// traits may be initialized later
|
// traits may be initialized later
|
||||||
m_dag_root = new Dag_node(Td_active_trapezoid());
|
m_dag_root = new Dag_node(Td_active_trapezoid());
|
||||||
//(*m_dag_root)->set_dag_node(m_dag_root);
|
//(*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_dag_root->get_data());
|
||||||
|
|
||||||
m_number_of_curves = 0;
|
m_number_of_curves = 0;
|
||||||
|
|
@ -2200,11 +2198,11 @@ private:
|
||||||
//{
|
//{
|
||||||
// if ( traits->is_fictitious_vertex(item) )
|
// 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
|
// 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))
|
if (traits->is_td_trapezoid(item))
|
||||||
|
|
@ -2218,11 +2216,11 @@ private:
|
||||||
//{
|
//{
|
||||||
// if ( traits->is_fictitious_vertex(item) )
|
// 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
|
// 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))
|
if (traits->is_td_trapezoid(item))
|
||||||
|
|
@ -2234,7 +2232,7 @@ private:
|
||||||
lt=POINT;
|
lt=POINT;
|
||||||
else
|
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;
|
lt = tr.is_on_boundaries()? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2343,12 +2341,12 @@ private:
|
||||||
// if the map item represents a fictitious vertex
|
// if the map item represents a fictitious vertex
|
||||||
if (traits->is_fictitious_vertex(item))
|
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);
|
print_ce_data(left_ce.cv(), left_ce.ce(), out);
|
||||||
}
|
}
|
||||||
else // if the map item represents a vertex
|
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);
|
print_point_data(p, out);
|
||||||
}
|
}
|
||||||
out << " (void *)left_child: " << (void*)(&(curr.left_child()))
|
out << " (void *)left_child: " << (void*)(&(curr.left_child()))
|
||||||
|
|
@ -2363,7 +2361,7 @@ private:
|
||||||
{
|
{
|
||||||
// bool is_active = traits->is_active(item);
|
// bool is_active = traits->is_active(item);
|
||||||
// if the map item represents an edge
|
// 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
|
// so top() is a real Halfedge with a curve() if curr is active
|
||||||
// or curr holds the curve if curr is not 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;
|
Dag_node left_node, right_node;
|
||||||
|
|
||||||
if (traits->is_td_trapezoid(curr_item)) {
|
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)));
|
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()));
|
(v, tr.right(), tr.bottom(), tr.top()));
|
||||||
|
|
||||||
Td_active_trapezoid&
|
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&
|
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_top_equal(left_tr,right_tr));
|
||||||
CGAL_warning(traits->is_trapezoids_bottom_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(),
|
right_tr.init_neighbors(left_node.get_data(), left_node.get_data(),
|
||||||
tr.rb(), tr.rt());
|
tr.rb(), tr.rt());
|
||||||
if (!traits->is_empty_item(tr.lb())) {
|
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());
|
lb.set_rb(left_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(tr.lt())) {
|
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());
|
lt.set_rt(left_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(tr.rb())) {
|
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());
|
rb.set_lb(right_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(tr.rt())) {
|
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());
|
rt.set_lt(right_node.get_data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// the curr_item is an edge
|
// 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)));
|
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()));
|
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& left_e(std::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& 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(left_e.is_on_left_boundary() == e.is_on_left_boundary());
|
||||||
//CGAL_warning(right_e.is_on_right_boundary() == e.is_on_right_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());
|
//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(e.next());
|
||||||
//right_e.init_neighbors(left_node.get_data(),left_node.get_data(),e.rb(),e.rt());
|
//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* left_ptr = &split_node.left_child();
|
||||||
const Dag_node* right_ptr = &split_node.right_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->get_data());
|
||||||
//(*left_ptr)->set_dag_node((Dag_node*)left_ptr);
|
//(*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->get_data());
|
||||||
//(*right_ptr)->set_dag_node((Dag_node*)right_ptr);
|
//(*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_active(trpz_node.get_data()));
|
||||||
CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data()));
|
CGAL_precondition(traits->is_td_trapezoid(trpz_node.get_data()));
|
||||||
if (Td_active_trapezoid* trap =
|
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();
|
trap->non_recursive_clear_neighbors();
|
||||||
trpz_node.set_data(Td_inactive_trapezoid());
|
trpz_node.set_data(Td_inactive_trapezoid());
|
||||||
if (active_node) trpz_node.set_left_child(*active_node);
|
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()));
|
CGAL_precondition(traits->is_td_vertex(vtx_node.get_data()));
|
||||||
if (traits->is_fictitious_vertex(vtx_node.get_data())) {
|
if (traits->is_fictitious_vertex(vtx_node.get_data())) {
|
||||||
Td_active_fictitious_vertex&
|
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));
|
vtx_node.set_data(Td_inactive_fictitious_vertex(v.vertex(), &vtx_node));
|
||||||
}
|
}
|
||||||
else {
|
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));
|
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()));
|
CGAL_precondition(traits->is_td_trapezoid(split_node.get_data()));
|
||||||
|
|
||||||
Td_map_item curr_item(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 left and right according to td_edge's source and target positions
|
||||||
// sets bottom and top to Halfedge itself
|
// sets bottom and top to Halfedge itself
|
||||||
|
|
@ -303,37 +303,37 @@ split_trapezoid_by_halfedge(Dag_node& split_node,
|
||||||
// CGAL_TD_ON_BOTTOM_BOUNDARY )));
|
// CGAL_TD_ON_BOTTOM_BOUNDARY )));
|
||||||
|
|
||||||
Td_active_trapezoid& bottom =
|
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 =
|
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(),
|
bottom.init_neighbors(split_tr.lb(), prev_bottom_tr, split_tr.rb(),
|
||||||
boost::none);
|
std::nullopt);
|
||||||
|
|
||||||
if (!traits->is_empty_item(prev_bottom_tr)) {
|
if (!traits->is_empty_item(prev_bottom_tr)) {
|
||||||
Td_active_trapezoid&
|
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());
|
prev_btm.set_rt(bottom_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(prev_top_tr)) {
|
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());
|
prev_top.set_rb(top_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(split_tr.lb())) {
|
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());
|
lb.set_rb(bottom_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(split_tr.lt())) {
|
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());
|
lt.set_rt(top_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(split_tr.rb())) {
|
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());
|
rb.set_lb(bottom_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(split_tr.rt())) {
|
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());
|
rt.set_lt(top_node.get_data());
|
||||||
}
|
}
|
||||||
split_node.replace(sep,bottom_node,top_node); //nodes depth are updated here
|
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* bottomPtr = &split_node.left_child();
|
||||||
const Dag_node* topPtr = &split_node.right_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());
|
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());
|
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)) {
|
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());
|
e.set_next(split_node.get_data());
|
||||||
}
|
}
|
||||||
//update these trapezoids pointers.
|
//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,
|
//set cw to hold the halfedge whose source is p,
|
||||||
// which is clockwise "smallest" starting from top (12 o'clock)
|
// 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(),
|
if (traits->compare_cw_around_point_2_object()(he->curve(),
|
||||||
is_edge_to_right(he,p),
|
is_edge_to_right(he,p),
|
||||||
cw_he->curve(),
|
cw_he->curve(),
|
||||||
is_edge_to_right(cw_he,p),
|
is_edge_to_right(cw_he,p),
|
||||||
p) == SMALLER)
|
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;
|
return vtx_item;
|
||||||
|
|
@ -430,7 +430,7 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he,
|
||||||
{
|
{
|
||||||
CGAL_precondition(lt==TRAPEZOID || lt==UNBOUNDED_TRAPEZOID);
|
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(node != nullptr);
|
||||||
CGAL_assertion(he != m_empty_he_handle);
|
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_td_vertex(vtx_item));
|
||||||
// CGAL_precondition(traits->is_active(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
|
// //make sure the cw_he is added in same direction as before
|
||||||
// // such that vtx_item is the source (done inside the set methods)
|
// // such that vtx_item is the source (done inside the set methods)
|
||||||
// if (cw_he == old_he || cw_he->twin() == old_he)
|
// 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_td_vertex(vtx_item));
|
||||||
CGAL_precondition(traits->is_active(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
|
//make sure the cw_he is added in same direction as before
|
||||||
// such that v_tr is the source (done inside the set methods)
|
// such that v_tr is the source (done inside the set methods)
|
||||||
if (traits->equal_2_object()(cw_he->curve(), old_cv))
|
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_td_vertex(vtx_item));
|
||||||
CGAL_precondition(traits->is_active(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)) {
|
if ((old_he == cw_he) || (old_he->twin() == cw_he)) {
|
||||||
Halfedge_const_handle new_he = cw_he->twin()->next();
|
Halfedge_const_handle new_he = cw_he->twin()->next();
|
||||||
if (new_he != cw_he)
|
if (new_he != cw_he)
|
||||||
boost::apply_visitor(set_cw_he_visitor(new_he), vtx_item);
|
std::visit(set_cw_he_visitor(new_he), vtx_item);
|
||||||
else boost::apply_visitor(reset_cw_he_visitor(), vtx_item); // dangling edge removed
|
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_td_vertex(vtx_item));
|
||||||
// CGAL_precondition(traits->is_active(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 top_he (std::visit(top_he_visitor(), vtx_item));
|
||||||
// Halfedge_const_handle bottom_he (boost::apply_visitor(bottom_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
|
// //make sure the top & bottom are added in same direction as before
|
||||||
// // such that sep is the source (done inside the set methods)
|
// // such that sep is the source (done inside the set methods)
|
||||||
// if ((top_he == he1) || (top_he == he1->twin()) ||
|
// if ((top_he == he1) || (top_he == he1->twin()) ||
|
||||||
// (top_he == he2) || (top_he == he2->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()) ||
|
// if ((bottom_he == he1) || (bottom_he == he1->twin()) ||
|
||||||
// (bottom_he == he2) || (bottom_he == he2->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));
|
CGAL_assertion(traits->is_active(curr_item));
|
||||||
|
|
||||||
if (traits->is_td_edge(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())
|
if (e.halfedge() == old_he || e.halfedge() == old_he->twin())
|
||||||
e.set_halfedge(new_he);
|
e.set_halfedge(new_he);
|
||||||
}
|
}
|
||||||
else if (traits->is_td_trapezoid(curr_item)) {
|
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())
|
if (tr.bottom() == old_he || tr.bottom() == old_he->twin())
|
||||||
tr.set_bottom(new_he);
|
tr.set_bottom(new_he);
|
||||||
if (tr.top() == old_he || tr.top() == old_he->twin()) tr.set_top(new_he);
|
if (tr.top() == old_he || tr.top() == old_he->twin()) tr.set_top(new_he);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//if is_td_vertex
|
//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));
|
curr_item));
|
||||||
if (cw_he == old_he || cw_he == old_he->twin())
|
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;
|
last_item = *it;
|
||||||
|
|
@ -615,20 +615,20 @@ search_using_dag(Dag_node& curr_node,
|
||||||
if (traits->is_td_vertex(curr_item)) {
|
if (traits->is_td_vertex(curr_item)) {
|
||||||
// the curr_item represents a vertex
|
// the curr_item represents a vertex
|
||||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
//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)))) ||
|
//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, boost::apply_visitor(point_for_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)) {
|
if (is_end_point_left_low(p, curr_node)) {
|
||||||
curr_node = curr_node.left_child();
|
curr_node = curr_node.left_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_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, boost::apply_visitor(point_for_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)) {
|
else if (is_end_point_right_top(p, curr_node)) {
|
||||||
curr_node = curr_node.right_child();
|
curr_node = curr_node.right_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_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()(boost::apply_visitor(point_for_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)) {
|
else if (are_equal_end_points(p, curr_node)) {
|
||||||
if (he == m_empty_he_handle) {
|
if (he == m_empty_he_handle) {
|
||||||
// he is the empty handle
|
// he is the empty handle
|
||||||
|
|
@ -663,13 +663,13 @@ search_using_dag(Dag_node& curr_node,
|
||||||
are_equal_end_points(p,curr_node));
|
are_equal_end_points(p,curr_node));
|
||||||
|
|
||||||
//(is_fict_vtx &&
|
//(is_fict_vtx &&
|
||||||
// (is_end_point_left_low(p,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
// (is_end_point_left_low(p,*(std::visit(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))) ||
|
// is_end_point_right_top(p,*(std::visit(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))) ||
|
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||||
// (!is_fict_vtx &&
|
// (!is_fict_vtx &&
|
||||||
// (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
// (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||||
// is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
// is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||||
// traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p))));
|
// traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p))));
|
||||||
|
|
||||||
return Locate_type();
|
return Locate_type();
|
||||||
}
|
}
|
||||||
|
|
@ -678,7 +678,7 @@ search_using_dag(Dag_node& curr_node,
|
||||||
// curr_item represents an edge,
|
// curr_item represents an edge,
|
||||||
// so top() is a real Halfedge with a curve() if curr_item is active
|
// 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
|
// 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);
|
Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv);
|
||||||
if (cres == SMALLER) {
|
if (cres == SMALLER) {
|
||||||
|
|
@ -753,7 +753,7 @@ search_using_dag(Dag_node& curr_node,
|
||||||
else {
|
else {
|
||||||
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||||
if (traits->is_active(curr_item)) {
|
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;
|
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||||
}
|
}
|
||||||
curr_node = curr_node.left_child();
|
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);
|
// bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
||||||
// if (is_fict_vtx)
|
// 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);
|
// print_ce_data(vtx_ce.cv(), vtx_ce.ce(), out);
|
||||||
// }
|
// }
|
||||||
// else
|
// 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)))) ||
|
// 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, boost::apply_visitor(point_for_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;
|
// out << " Going left " << std::endl;
|
||||||
// curr_node = curr_node.left_child();
|
// curr_node = curr_node.left_child();
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// else if ((is_fict_vtx && is_end_point_right_top(p, *(boost::apply_visitor(curve_end_for_fict_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, boost::apply_visitor(point_for_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;
|
// out << " Going right " << std::endl;
|
||||||
// curr_node = curr_node.right_child();
|
// curr_node = curr_node.right_child();
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_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()(boost::apply_visitor(point_for_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;
|
// out << " Equal to query " << std::endl;
|
||||||
// if (he == m_empty_he_handle) //if he is the empty handle
|
// 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,
|
// // if curr_item represents an edge,
|
||||||
// // so top() is a real Halfedge with a curve() if curr_item is active
|
// // 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
|
// // 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 : " ;
|
// out << " EDGE : " ;
|
||||||
// if (traits->is_active(curr_item))
|
// if (traits->is_active(curr_item))
|
||||||
|
|
@ -951,7 +951,7 @@ search_using_dag(Dag_node& curr_node,
|
||||||
// if (traits->is_active(curr_item))
|
// if (traits->is_active(curr_item))
|
||||||
// {
|
// {
|
||||||
// out << " (active) ";
|
// 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())
|
// if (tr.is_on_boundaries())
|
||||||
// out << " UNBOUNDED! ";
|
// out << " UNBOUNDED! ";
|
||||||
// else
|
// else
|
||||||
|
|
@ -1023,20 +1023,20 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
||||||
if (traits->is_td_vertex(curr_item)) {
|
if (traits->is_td_vertex(curr_item)) {
|
||||||
// the curr_item represents a vertex
|
// the curr_item represents a vertex
|
||||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
//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)) ||
|
//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(boost::apply_visitor(point_for_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)) {
|
if (is_end_point_left_low(ce, curr_node)) {
|
||||||
curr_node = curr_node.left_child();
|
curr_node = curr_node.left_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_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(boost::apply_visitor(point_for_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)) {
|
else if (is_end_point_right_top(ce, curr_node)) {
|
||||||
curr_node = curr_node.right_child();
|
curr_node = curr_node.right_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_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()(boost::apply_visitor(point_for_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)) {
|
else if (are_equal_end_points(ce, curr_node)) {
|
||||||
if (!p_cv) {
|
if (!p_cv) {
|
||||||
// p_cv was not given
|
// 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) ||
|
is_end_point_right_top(ce, curr_node) ||
|
||||||
are_equal_end_points(ce, curr_node));
|
are_equal_end_points(ce, curr_node));
|
||||||
//(is_fict_vtx &&
|
//(is_fict_vtx &&
|
||||||
// (is_end_point_left_low(ce,*(boost::apply_visitor(curve_end_for_fict_vertex_visitor(),curr_item))) ||
|
// (is_end_point_left_low(ce,*(std::visit(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))) ||
|
// is_end_point_right_top(ce,*(std::visit(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))) ||
|
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),ce))) ||
|
||||||
// (!is_fict_vtx &&
|
// (!is_fict_vtx &&
|
||||||
// (is_end_point_left_low(ce,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
// (is_end_point_left_low(ce,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||||
// is_end_point_right_top(ce,boost::apply_visitor(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()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),ce))));
|
// traits->equal_curve_end_2_object()(std::visit(point_for_vertex_visitor(), curr_item),ce))));
|
||||||
return Locate_type();
|
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
|
// or curr_item holds the curve if it is not active
|
||||||
|
|
||||||
const X_monotone_curve_2& he_cv =
|
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 =
|
Comparison_result cres =
|
||||||
traits->compare_curve_end_y_at_x_2_object()(ce, he_cv);
|
traits->compare_curve_end_y_at_x_2_object()(ce, he_cv);
|
||||||
if (cres == SMALLER) {
|
if (cres == SMALLER) {
|
||||||
|
|
@ -1174,7 +1174,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
||||||
else {
|
else {
|
||||||
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
// if is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||||
if (traits->is_active(curr_item)) {
|
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;
|
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||||
}
|
}
|
||||||
curr_node = curr_node.left_child();
|
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)) {
|
if (traits->is_td_vertex(curr_item)) {
|
||||||
// the curr_item represents a vertex
|
// the curr_item represents a vertex
|
||||||
//bool is_fict_vtx = traits->is_fictitious_vertex(curr_item);
|
//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)) ||
|
//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(boost::apply_visitor(point_for_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)) {
|
if (is_end_point_left_low(p, curr_node)) {
|
||||||
curr_node = curr_node.left_child();
|
curr_node = curr_node.left_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && is_end_point_left_low(*(boost::apply_visitor(curve_end_for_fict_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(boost::apply_visitor(point_for_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)) {
|
else if (is_end_point_right_top(p, curr_node)) {
|
||||||
curr_node = curr_node.right_child();
|
curr_node = curr_node.right_child();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if ((is_fict_vtx && traits->equal_curve_end_2_object()(*(boost::apply_visitor(curve_end_for_fict_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()(boost::apply_visitor(point_for_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)) {
|
else if (are_equal_end_points(p, curr_node)) {
|
||||||
if (!p_cv) {
|
if (!p_cv) {
|
||||||
// p_cv was not given
|
// 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) ||
|
is_end_point_right_top(p, curr_node) ||
|
||||||
are_equal_end_points(p, curr_node));
|
are_equal_end_points(p, curr_node));
|
||||||
//CGAL_assertion((is_fict_vtx &&
|
//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_left_low(p,*(std::visit(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))) ||
|
// is_end_point_right_top(p,*(std::visit(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))) ||
|
// traits->equal_curve_end_2_object()(*(std::visit(curve_end_for_fict_vertex_visitor(),curr_item)),p))) ||
|
||||||
// (!is_fict_vtx &&
|
// (!is_fict_vtx &&
|
||||||
// (is_end_point_left_low(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
// (is_end_point_left_low(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||||
// is_end_point_right_top(p,boost::apply_visitor(point_for_vertex_visitor(), curr_item)) ||
|
// is_end_point_right_top(p,std::visit(point_for_vertex_visitor(), curr_item)) ||
|
||||||
// traits->equal_2_object()(boost::apply_visitor(point_for_vertex_visitor(), curr_item),p))));
|
// traits->equal_2_object()(std::visit(point_for_vertex_visitor(), curr_item),p))));
|
||||||
return Locate_type();
|
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
|
// 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
|
// or curr_item holds the curve if it is not active
|
||||||
const X_monotone_curve_2& he_cv =
|
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);
|
Comparison_result cres = traits->compare_y_at_x_2_object()(p, he_cv);
|
||||||
if (cres == SMALLER) {
|
if (cres == SMALLER) {
|
||||||
curr_node = curr_node.left_child();
|
curr_node = curr_node.left_child();
|
||||||
|
|
@ -1351,7 +1351,7 @@ search_using_dag_with_cv(Dag_node& curr_node,
|
||||||
else {
|
else {
|
||||||
// is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
// is_degenerate() == 0, meaning: curr_item is a real trapezoid
|
||||||
if (traits->is_active(curr_item)) {
|
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;
|
return tr.is_on_boundaries() ? UNBOUNDED_TRAPEZOID : TRAPEZOID;
|
||||||
}
|
}
|
||||||
curr_node = curr_node.left_child();
|
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_active(item));
|
||||||
CGAL_assertion(traits->is_td_trapezoid(item));
|
CGAL_assertion(traits->is_td_trapezoid(item));
|
||||||
Dag_node& tr_node( ar.find(d)->second);
|
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();
|
Vertex_const_handle v = tr.right();
|
||||||
|
|
||||||
Curve_end ce(traits->vtx_to_ce(v));
|
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++;
|
num_of_new_nodes++;
|
||||||
boost::apply_visitor(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.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());
|
std::visit(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),
|
||||||
curr_node.get_data());
|
curr_node.get_data());
|
||||||
//curr_node.left_child()->set_dag_node(&curr_node.left_child());
|
//curr_node.left_child()->set_dag_node(&curr_node.left_child());
|
||||||
//curr_node.right_child()->set_dag_node(&curr_node.right_child());
|
//curr_node.right_child()->set_dag_node(&curr_node.right_child());
|
||||||
//curr_node->set_dag_node(&curr_node);// fake temporary node
|
//curr_node->set_dag_node(&curr_node);// fake temporary node
|
||||||
deactivate_vertex(curr_node); //curr_node->remove(); // mark as deleted
|
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);
|
curr_node.get_data());//curr_node->set_dag_node(0);
|
||||||
|
|
||||||
return curr_node;
|
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));
|
CGAL_precondition(traits->is_active(vtx_item));
|
||||||
|
|
||||||
Vertex_const_handle
|
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
|
typename Arrangement_on_surface_2::Halfedge_around_vertex_const_circulator
|
||||||
first, second;
|
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
|
// locate and insert end points of the input halfedge to the Td_map_item
|
||||||
// Dag if needed
|
// Dag if needed
|
||||||
Dag_node p1_node(*(boost::apply_visitor(dag_node_visitor(), p1_item)));
|
Dag_node p1_node(*(std::visit(dag_node_visitor(), p1_item)));
|
||||||
//Dag_node p2_node(*(boost::apply_visitor(dag_node_visitor(), p2_item)));// Not in use
|
//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
|
// create the Td_map_item iterator for traveling along the Trapezoids that
|
||||||
// intersect the input Halfedge, using left-low to right-high order
|
// intersect the input Halfedge, using left-low to right-high order
|
||||||
In_face_iterator it = follow_curve(p1_node,he,LARGER);
|
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 = p1_item;
|
||||||
Td_map_item prev_bottom_tr = Td_map_item(0); //active_tr
|
Td_map_item prev_bottom_tr = Td_map_item(0); //active_tr
|
||||||
Td_map_item prev_top_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
|
while(!!it) { //this means as long as the iterator is valid
|
||||||
curr_trp = it.trp();
|
curr_trp = it.trp();
|
||||||
CGAL_assertion(curr_trp != boost::none);
|
CGAL_assertion(curr_trp != std::nullopt);
|
||||||
prev_bottom_tr = (*curr_trp).lb();
|
prev_bottom_tr = (*curr_trp).lb();
|
||||||
prev_top_tr = (*curr_trp).lt();
|
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));
|
traits->is_active(new_btm_item));
|
||||||
if (merge_if_possible(prev_bottom_tr, new_btm_item)) {
|
if (merge_if_possible(prev_bottom_tr, new_btm_item)) {
|
||||||
Dag_node* left_child_node =
|
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);
|
node->set_left_child(*left_child_node);
|
||||||
old_bottom_tr = prev_bottom_tr;
|
old_bottom_tr = prev_bottom_tr;
|
||||||
m_number_of_dag_nodes--; //update number of nodes in the DAG after merge
|
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) &&
|
CGAL_assertion(traits->is_td_trapezoid(new_top_item) &&
|
||||||
traits->is_active(new_top_item));
|
traits->is_active(new_top_item));
|
||||||
if (merge_if_possible(prev_top_tr, 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);
|
prev_top_tr);
|
||||||
node->set_right_child(*right_child_node);
|
node->set_right_child(*right_child_node);
|
||||||
old_top_tr = prev_top_tr;
|
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;
|
if (lt1 != POINT || lt2 != POINT) return;
|
||||||
|
|
||||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != nullptr);
|
CGAL_warning(std::visit(dag_node_visitor(), p1_item) != nullptr);
|
||||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != nullptr);
|
CGAL_warning(std::visit(dag_node_visitor(), p2_item) != nullptr);
|
||||||
|
|
||||||
//retrieve the Dag_nodes of the two point-degenerate trapezoid
|
//retrieve the Dag_nodes of the two point-degenerate trapezoid
|
||||||
Dag_node& p1_node = *(boost::apply_visitor(dag_node_visitor(), p1_item));
|
Dag_node& p1_node = *(std::visit(dag_node_visitor(), p1_item));
|
||||||
Dag_node& p2_node = *(boost::apply_visitor(dag_node_visitor(), p2_item));
|
Dag_node& p2_node = *(std::visit(dag_node_visitor(), p2_item));
|
||||||
|
|
||||||
//calculate the immediate lower, central and upper neighborhood of
|
//calculate the immediate lower, central and upper neighborhood of
|
||||||
// the curve in the data structure
|
// 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
|
//copy trapezoid data from btm and top trapezoids
|
||||||
Dag_node& new_node = (new_array.find(sz))->second;
|
Dag_node& new_node = (new_array.find(sz))->second;
|
||||||
++sz;
|
++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_dag_node(&new_node);
|
||||||
tr.set_lb(btm_it_tr.lb());
|
tr.set_lb(btm_it_tr.lb());
|
||||||
tr.set_lt(top_it_tr.lt());
|
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())) {
|
if (!traits->is_empty_item(tr.lb())) {
|
||||||
Td_map_item lb_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());
|
lb_tr.set_rb(new_node.get_data());
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(tr.lt()))
|
if (!traits->is_empty_item(tr.lt()))
|
||||||
{
|
{
|
||||||
Td_map_item lt_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());
|
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 ||
|
if (!btm_it ||
|
||||||
(inc_btm && !traits->is_trpz_bottom_equal(old_tr_item, *curr_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)) {
|
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);
|
//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);
|
//last_new_tr->set_rb(rb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!top_it ||
|
if (!top_it ||
|
||||||
(!inc_btm && !traits->is_trpz_top_equal(old_tr_item,*curr_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))
|
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);
|
//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);
|
//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
|
//set the no longer relevant trapezoids as removed and add the new nodes
|
||||||
// as their replacement
|
// 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));
|
last_tr_item));
|
||||||
|
|
||||||
if (prev_inc_btm != inc_btm) {
|
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
|
// update the dag node pointer in the trapezoid
|
||||||
const Dag_node* real = &last_tr_node->left_child();
|
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);
|
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
|
m_number_of_dag_nodes += num_of_new_nodes; //new node (tmp) was added
|
||||||
|
|
||||||
const Dag_node* real = &tr.dag_node()->left_child();
|
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)) {
|
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);
|
//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);
|
//rb->set_lb(last_new_tr);
|
||||||
}
|
}
|
||||||
if (!traits->is_empty_item(rt)) {
|
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);
|
//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);
|
//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;
|
//Base_trapezoid_iterator last_mid = mid_it;
|
||||||
Dag_node* e_node = nullptr;
|
Dag_node* e_node = nullptr;
|
||||||
while (!!++mid_it) {
|
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();
|
deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove();
|
||||||
last_edge_fragment_it = mid_it;
|
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
|
//4. remove adjacency at right end point
|
||||||
|
|
||||||
//remove the final trapezoid representing the removed halfedge
|
//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();
|
deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove();
|
||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
|
|
@ -1945,7 +1945,7 @@ vertical_ray_shoot(const Point & p,Locate_type & lt,
|
||||||
p
|
p
|
||||||
x------x
|
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() &&
|
if ((up_direction && !tr.is_on_right_boundary() &&
|
||||||
(traits->compare_curve_end_x_2_object()
|
(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);
|
Td_map_item mrgp_item = locate(ce, lt);
|
||||||
|
|
||||||
//varifying that all trapezoids are not nullptr and are of type POINT
|
//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(std::visit(dag_node_visitor(), leftp_item) != nullptr);
|
||||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), rightp_item)!= nullptr);
|
CGAL_warning(std::visit(dag_node_visitor(), rightp_item)!= nullptr);
|
||||||
CGAL_warning(boost::apply_visitor(dag_node_visitor(), mrgp_item) != nullptr);
|
CGAL_warning(std::visit(dag_node_visitor(), mrgp_item) != nullptr);
|
||||||
|
|
||||||
//define the left curve and the right curve, according
|
//define the left curve and the right curve, according
|
||||||
// to the common point (that is merged)
|
// to the common point (that is merged)
|
||||||
|
|
@ -2679,8 +2679,8 @@ merge_edge(Halfedge_const_handle he1,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//get the nodes of leftmost point and merge point
|
//get the nodes of leftmost point and merge point
|
||||||
Dag_node& leftp_node = *(boost::apply_visitor(dag_node_visitor(), leftp_item));
|
Dag_node& leftp_node = *(std::visit(dag_node_visitor(), leftp_item));
|
||||||
Dag_node& mrgp_node = *(boost::apply_visitor(dag_node_visitor(), mrgp_item));
|
Dag_node& mrgp_node = *(std::visit(dag_node_visitor(), mrgp_item));
|
||||||
|
|
||||||
//set iterators for below left curve, on left curve & above left curve
|
//set iterators for below left curve, on left curve & above left curve
|
||||||
In_face_iterator
|
In_face_iterator
|
||||||
|
|
@ -2760,15 +2760,15 @@ merge_edge(Halfedge_const_handle he1,
|
||||||
merge_if_possible(below_cv_left, below_cv_right);
|
merge_if_possible(below_cv_left, below_cv_right);
|
||||||
|
|
||||||
// mark older trapezoids as inactive - nodes depth are updated here
|
// 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));
|
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));
|
above_cv_left));
|
||||||
deactivate_trapezoid( *above_cv_right_node, above_cv_left_node);
|
deactivate_trapezoid( *above_cv_right_node, above_cv_left_node);
|
||||||
//above_cv_right->remove(above_cv_left->dag_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));
|
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));
|
below_cv_left));
|
||||||
deactivate_trapezoid( *below_cv_right_node, below_cv_left_node);
|
deactivate_trapezoid( *below_cv_right_node, below_cv_left_node);
|
||||||
//below_cv_right->remove(below_cv_left->dag_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) &&
|
CGAL_assertion(traits->is_td_edge(on_cv_left) &&
|
||||||
traits->is_active(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);
|
e_left.set_next(on_cv_right);
|
||||||
|
|
||||||
CGAL_assertion(traits->is_td_edge(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) {
|
if (!minus_inf && !plus_inf) {
|
||||||
Td_map_item min_node_item(min_node.get_data());
|
Td_map_item min_node_item(min_node.get_data());
|
||||||
if (traits->is_fictitious_vertex(min_node_item)) {
|
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());
|
Td_map_item max_node_item(max_node.get_data());
|
||||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
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
|
//min-fict, max-fict
|
||||||
if (!is_end_point_left_low(min_ce, max_ce)) return 0;
|
if (!is_end_point_left_low(min_ce, max_ce)) return 0;
|
||||||
}
|
}
|
||||||
else {
|
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));
|
max_node_item));
|
||||||
|
|
||||||
//min-fict, max-pt
|
//min-fict, max-pt
|
||||||
|
|
@ -2849,18 +2849,18 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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));
|
min_node_item));
|
||||||
|
|
||||||
Td_map_item max_node_item(max_node.get_data());
|
Td_map_item max_node_item(max_node.get_data());
|
||||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
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
|
//min-pt, max-fict
|
||||||
if (!is_end_point_left_low(min_p, max_ce)) return 0;
|
if (!is_end_point_left_low(min_p, max_ce)) return 0;
|
||||||
}
|
}
|
||||||
else {
|
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));
|
max_node_item));
|
||||||
|
|
||||||
//min-pt, max-pt
|
//min-pt, max-pt
|
||||||
|
|
@ -2893,19 +2893,19 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node,
|
||||||
if (!minus_inf) {
|
if (!minus_inf) {
|
||||||
Td_map_item min_node_item(min_node.get_data());
|
Td_map_item min_node_item(min_node.get_data());
|
||||||
if (traits->is_fictitious_vertex(min_node_item)) {
|
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 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)) ||
|
//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(boost::apply_visitor(point_for_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)) {
|
if (is_end_point_right_top(min_ce, node)) {
|
||||||
new_min_node = min_node;
|
new_min_node = min_node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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 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)) ||
|
//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(boost::apply_visitor(point_for_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)) {
|
if (is_end_point_right_top(min_p, node)) {
|
||||||
new_min_node = min_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) {
|
if (!plus_inf) {
|
||||||
Td_map_item max_node_item(max_node.get_data());
|
Td_map_item max_node_item(max_node.get_data());
|
||||||
if (traits->is_fictitious_vertex(max_node_item)) {
|
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 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)) ||
|
//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(boost::apply_visitor(point_for_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))
|
if (is_end_point_left_low(max_ce, node))
|
||||||
{
|
{
|
||||||
new_max_node = max_node;
|
new_max_node = max_node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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));
|
max_node_item));
|
||||||
//if smaller than the point represented by min_node
|
//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)) ||
|
//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(boost::apply_visitor(point_for_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)) {
|
if (is_end_point_left_low(max_p, node)) {
|
||||||
new_max_node = max_node;
|
new_max_node = max_node;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,41 +15,10 @@
|
||||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
#include <CGAL/disable_warnings.h>
|
||||||
|
#include <CGAL/assertions.h>
|
||||||
|
|
||||||
// The macro CGAL_ARR_POINT_LOCATION_VERSION controls which version of the
|
#include <optional>
|
||||||
// point location is used. Currently two values are supported:
|
#include <variant>
|
||||||
// 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
|
|
||||||
|
|
||||||
namespace CGAL {
|
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::Halfedge_const_handle Halfedge_const_handle;
|
||||||
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
typedef typename Arrangement_2::Face_const_handle Face_const_handle;
|
||||||
|
|
||||||
#if CGAL_ARR_POINT_LOCATION_VERSION < 2
|
typedef typename std::variant<Vertex_const_handle,
|
||||||
typedef CGAL::Object Type;
|
|
||||||
#else
|
|
||||||
typedef typename boost::variant<Vertex_const_handle,
|
|
||||||
Halfedge_const_handle,
|
Halfedge_const_handle,
|
||||||
Face_const_handle> Type;
|
Face_const_handle> Type;
|
||||||
#endif
|
|
||||||
typedef Type type;
|
typedef Type type;
|
||||||
|
|
||||||
// This function returns either make_object() or a result_type constructor
|
// This function returns a result_type constructor
|
||||||
// to generate return values. The Object version takes a dummy template
|
// to generate return values.
|
||||||
// argument, which is needed for the return of the other option, e.g.,
|
|
||||||
// boost::optional<boost::variant> >.
|
|
||||||
// In theory a one parameter variant could be returned, but this _could_
|
// 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.
|
// lead to conversion overhead, and so we rather go for the real type.
|
||||||
// Overloads for empty returns are also provided.
|
// 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>
|
template <typename T>
|
||||||
static
|
static
|
||||||
inline Type make_result(T t) { return Type(t); }
|
inline Type make_result(T t) { return Type(t); }
|
||||||
|
|
||||||
static
|
static
|
||||||
inline boost::optional<Type> empty_optional_result()
|
inline std::optional<Type> empty_optional_result()
|
||||||
{ return boost::optional<Type>(); }
|
{ return std::optional<Type>(); }
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static
|
static
|
||||||
inline const T* assign(const Type* obj) { return boost::get<T>(obj); }
|
inline const T* assign(const Type* obj) { return std::get_if<T>(obj); }
|
||||||
#endif // CGAL_ARR_POINT_LOCATION_VERSION < 2
|
|
||||||
|
|
||||||
//this one is only to remove warnings in functions
|
//this one is only to remove warnings in functions
|
||||||
static
|
static
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <variant>
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
|
|
@ -185,9 +185,9 @@ public:
|
||||||
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
||||||
Arr_all_sides_oblivious_tag) const
|
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;
|
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;
|
Make_x_monotone_result;
|
||||||
|
|
||||||
// If the polycurve is empty, return.
|
// If the polycurve is empty, return.
|
||||||
|
|
@ -212,7 +212,7 @@ public:
|
||||||
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
||||||
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
||||||
auto it = x_seg_objects.begin();
|
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)
|
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||||
CGAL_assertion(x_seg_p != nullptr);
|
CGAL_assertion(x_seg_p != nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -260,7 +260,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (++it; it != x_seg_objects.end(); ++it) {
|
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)
|
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||||
CGAL_assertion(x_seg_p != nullptr);
|
CGAL_assertion(x_seg_p != nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -318,9 +318,9 @@ public:
|
||||||
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
OutputIterator operator_impl(const Curve_2& cv, OutputIterator oi,
|
||||||
Arr_not_all_sides_oblivious_tag) const
|
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;
|
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;
|
Make_x_monotone_result;
|
||||||
|
|
||||||
// If the polycurve is empty, return.
|
// If the polycurve is empty, return.
|
||||||
|
|
@ -350,7 +350,7 @@ public:
|
||||||
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
for (auto its = cv.subcurves_begin(); its != cv.subcurves_end(); ++its)
|
||||||
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
make_seg_x_monotone(*its, std::back_inserter(x_seg_objects));
|
||||||
auto it = x_seg_objects.begin();
|
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)
|
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||||
CGAL_assertion(x_seg_p != nullptr);
|
CGAL_assertion(x_seg_p != nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -398,7 +398,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (++it; it != x_seg_objects.end(); ++it) {
|
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)
|
#if ! defined (CGAL_NO_ASSERTIONS)
|
||||||
CGAL_assertion(x_seg_p != nullptr);
|
CGAL_assertion(x_seg_p != nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -696,10 +696,9 @@ public:
|
||||||
OutputIterator oi) const
|
OutputIterator oi) const
|
||||||
{
|
{
|
||||||
typedef std::pair<Point_2, Multiplicity> Intersection_point;
|
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;
|
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();
|
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();
|
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
|
// cv1's right endpoint equals cv2's left endpoint
|
||||||
// Thus we can return this single(!) intersection point
|
// Thus we can return this single(!) intersection point
|
||||||
Intersection_point p(max_vertex(cv1[i1]), 0);
|
Intersection_point p(max_vertex(cv1[i1]), 0);
|
||||||
*oi++ = Intersection_result(p);
|
*oi++ = p;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
dir1 == SMALLER ?
|
dir1 == SMALLER ?
|
||||||
|
|
@ -767,7 +766,7 @@ public:
|
||||||
// cv2's right endpoint equals cv1's left endpoint
|
// cv2's right endpoint equals cv1's left endpoint
|
||||||
// Thus we can return this single(!) intersection point
|
// Thus we can return this single(!) intersection point
|
||||||
Intersection_point p(max_vertex(cv2[i2]), 0);
|
Intersection_point p(max_vertex(cv2[i2]), 0);
|
||||||
*oi++ = Intersection_result(p);
|
*oi++ = p;
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -824,7 +823,7 @@ public:
|
||||||
intersect(cv1[i1], cv2[i2], std::back_inserter(xections));
|
intersect(cv1[i1], cv2[i2], std::back_inserter(xections));
|
||||||
for (const auto& xection : xections) {
|
for (const auto& xection : xections) {
|
||||||
const X_monotone_subcurve_2* subcv_p =
|
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) {
|
if (subcv_p != nullptr) {
|
||||||
ocv.push_back(*subcv_p);
|
ocv.push_back(*subcv_p);
|
||||||
oi = output_ocv (ocv, invert_ocv, oi);
|
oi = output_ocv (ocv, invert_ocv, oi);
|
||||||
|
|
@ -832,8 +831,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const Intersection_point* p_p =
|
const Intersection_point* p_p =
|
||||||
boost::get<Intersection_point>(&xection);
|
std::get_if<Intersection_point>(&xection);
|
||||||
if (p_p != nullptr) *oi++ = Intersection_result(*p_p);
|
if (p_p != nullptr) *oi++ = *p_p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (right_coincides && left_coincides) {
|
else if (right_coincides && left_coincides) {
|
||||||
|
|
@ -846,7 +845,7 @@ public:
|
||||||
|
|
||||||
for (const auto& item : sub_xections) {
|
for (const auto& item : sub_xections) {
|
||||||
const X_monotone_subcurve_2* x_seg =
|
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) {
|
if (x_seg != nullptr) {
|
||||||
X_monotone_subcurve_2 seg = *x_seg;
|
X_monotone_subcurve_2 seg = *x_seg;
|
||||||
// We maintain the variant that if the input curves have opposite
|
// We maintain the variant that if the input curves have opposite
|
||||||
|
|
@ -863,7 +862,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const Intersection_point* p_ptr =
|
const Intersection_point* p_ptr =
|
||||||
boost::get<Intersection_point>(&item);
|
std::get_if<Intersection_point>(&item);
|
||||||
if (p_ptr != nullptr) {
|
if (p_ptr != nullptr) {
|
||||||
// Any point that is not equal to the max_vertex of the
|
// Any point that is not equal to the max_vertex of the
|
||||||
// subcurve should be inserted into oi.
|
// subcurve should be inserted into oi.
|
||||||
|
|
@ -871,7 +870,7 @@ public:
|
||||||
// will be taken care of as the min_vertex of in the next
|
// will be taken care of as the min_vertex of in the next
|
||||||
// iteration.
|
// iteration.
|
||||||
if (! equal(p_ptr->first, max_vertex(cv1[i1])))
|
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.
|
// it multiplicity 0.
|
||||||
if (left_res == SMALLER) {
|
if (left_res == SMALLER) {
|
||||||
Intersection_point p(min_vertex(cv2[i2]), 0);
|
Intersection_point p(min_vertex(cv2[i2]), 0);
|
||||||
*oi++ = Intersection_result(p);
|
*oi++ = p;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Intersection_point p(min_vertex(cv1[i1]), 0);
|
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) ?
|
(i1 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||||
return_point(max_vertex(cv1[i1+1]), 0) :
|
return_point(max_vertex(cv1[i1+1]), 0) :
|
||||||
return_point(max_vertex(cv1[0]), 0);
|
return_point(max_vertex(cv1[0]), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
else if (right_res == LARGER) {
|
else if (right_res == LARGER) {
|
||||||
ip = (dir2 == SMALLER) ?
|
ip = (dir2 == SMALLER) ?
|
||||||
|
|
@ -949,7 +948,7 @@ public:
|
||||||
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||||
return_point(max_vertex(cv2[i2+1]), 0) :
|
return_point(max_vertex(cv2[i2+1]), 0) :
|
||||||
return_point(max_vertex(cv2[0]), 0);
|
return_point(max_vertex(cv2[0]), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
else if (((i1 > 0) && (dir1 == SMALLER)) ||
|
else if (((i1 > 0) && (dir1 == SMALLER)) ||
|
||||||
((i1 < n1) && (dir1 != SMALLER)) ||
|
((i1 < n1) && (dir1 != SMALLER)) ||
|
||||||
|
|
@ -961,7 +960,7 @@ public:
|
||||||
(i1 != Polycurve_traits_2::INVALID_INDEX) ?
|
(i1 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||||
return_point(max_vertex(cv1[i1+1]), 0) :
|
return_point(max_vertex(cv1[i1+1]), 0) :
|
||||||
return_point(max_vertex(cv1[0]), 0);
|
return_point(max_vertex(cv1[0]), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) ||
|
CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) ||
|
||||||
|
|
@ -976,7 +975,7 @@ public:
|
||||||
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
(i2 != Polycurve_traits_2::INVALID_INDEX) ?
|
||||||
return_point(max_vertex(cv2[i2+1]), 0) :
|
return_point(max_vertex(cv2[i2+1]), 0) :
|
||||||
return_point(max_vertex(cv2[0]), 0);
|
return_point(max_vertex(cv2[0]), 0);
|
||||||
*oi++ = Intersection_result(ip);
|
*oi++ = ip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -989,15 +988,12 @@ public:
|
||||||
inline OutputIterator output_ocv
|
inline OutputIterator output_ocv
|
||||||
(std::vector<X_monotone_subcurve_2>& ocv, bool invert_ocv, OutputIterator oi) const
|
(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;
|
X_monotone_curve_2 curve;
|
||||||
if (invert_ocv)
|
if (invert_ocv)
|
||||||
std::reverse (ocv.begin(), ocv.end());
|
std::reverse (ocv.begin(), ocv.end());
|
||||||
for (X_monotone_subcurve_2& sc : ocv)
|
for (X_monotone_subcurve_2& sc : ocv)
|
||||||
curve.push_back (sc);
|
curve.push_back (sc);
|
||||||
*(oi ++) = Intersection_result(curve);
|
*(oi ++) = curve;
|
||||||
|
|
||||||
ocv.clear();
|
ocv.clear();
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue