mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/master' into Tet_remeshing-wip-jtournois
This commit is contained in:
commit
9e69592328
|
|
@ -21,7 +21,6 @@
|
|||
#include <CGAL/AABB_primitive.h>
|
||||
#include <CGAL/boost/graph/property_maps.h>
|
||||
#include <CGAL/Default.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -57,9 +56,9 @@ template < class FaceGraph,
|
|||
class CacheDatum=Tag_false >
|
||||
class AABB_face_graph_triangle_primitive
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
: public AABB_primitive<typename boost::mpl::if_<OneFaceGraphPerTree,
|
||||
: public AABB_primitive<std::conditional_t<OneFaceGraphPerTree::value,
|
||||
typename boost::graph_traits<FaceGraph>::face_descriptor,
|
||||
std::pair<typename boost::graph_traits<FaceGraph>::face_descriptor, const FaceGraph*> >::type,
|
||||
std::pair<typename boost::graph_traits<FaceGraph>::face_descriptor, const FaceGraph*> >,
|
||||
Triangle_from_face_descriptor_map<
|
||||
FaceGraph,
|
||||
typename Default::Get<VertexPointPMap,
|
||||
|
|
@ -76,7 +75,7 @@ class AABB_face_graph_triangle_primitive
|
|||
{
|
||||
typedef typename Default::Get<VertexPointPMap, typename boost::property_map< FaceGraph, vertex_point_t>::const_type >::type VertexPointPMap_;
|
||||
typedef typename boost::graph_traits<FaceGraph>::face_descriptor FD;
|
||||
typedef typename boost::mpl::if_<OneFaceGraphPerTree, FD, std::pair<FD, const FaceGraph*> >::type Id_;
|
||||
typedef std::conditional_t<OneFaceGraphPerTree::value, FD, std::pair<FD, const FaceGraph*> > Id_;
|
||||
|
||||
typedef Triangle_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Triangle_property_map;
|
||||
typedef One_point_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Point_property_map;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <iterator>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <CGAL/type_traits/is_iterator.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
|
|
@ -70,9 +69,9 @@ template < class HalfedgeGraph,
|
|||
class CacheDatum = Tag_false >
|
||||
class AABB_halfedge_graph_segment_primitive
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
: public AABB_primitive< typename boost::mpl::if_<OneHalfedgeGraphPerTree,
|
||||
: public AABB_primitive< std::conditional_t<OneHalfedgeGraphPerTree::value,
|
||||
typename boost::graph_traits<HalfedgeGraph>::edge_descriptor,
|
||||
std::pair<typename boost::graph_traits<HalfedgeGraph>::edge_descriptor, const HalfedgeGraph*> >::type,
|
||||
std::pair<typename boost::graph_traits<HalfedgeGraph>::edge_descriptor, const HalfedgeGraph*> >,
|
||||
Segment_from_edge_descriptor_map<
|
||||
HalfedgeGraph,
|
||||
typename Default::Get<VertexPointPMap,
|
||||
|
|
@ -89,7 +88,7 @@ class AABB_halfedge_graph_segment_primitive
|
|||
{
|
||||
typedef typename Default::Get<VertexPointPMap,typename boost::property_map< HalfedgeGraph,vertex_point_t>::const_type >::type VertexPointPMap_;
|
||||
typedef typename boost::graph_traits<HalfedgeGraph>::edge_descriptor ED;
|
||||
typedef typename boost::mpl::if_<OneHalfedgeGraphPerTree, ED, std::pair<ED, const HalfedgeGraph*> >::type Id_;
|
||||
typedef std::conditional_t<OneHalfedgeGraphPerTree::value, ED, std::pair<ED, const HalfedgeGraph*> > Id_;
|
||||
|
||||
typedef Segment_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Segment_property_map;
|
||||
typedef Source_point_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Point_property_map;
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_cartesian_const_iterator_3,Cartesian_const
|
|||
|
||||
template<typename GeomTraits>
|
||||
struct Is_ray_intersection_geomtraits
|
||||
: boost::mpl::and_< Has_ray_3<GeomTraits>,
|
||||
Has_construct_source_3<GeomTraits>,
|
||||
Has_vector_3<GeomTraits>,
|
||||
Has_construct_cartesian_const_iterator_3<GeomTraits>,
|
||||
Has_cartesian_const_iterator_3<GeomTraits> >::type
|
||||
: std::bool_constant< Has_ray_3<GeomTraits>::value &&
|
||||
Has_construct_source_3<GeomTraits>::value &&
|
||||
Has_vector_3<GeomTraits>::value &&
|
||||
Has_construct_cartesian_const_iterator_3<GeomTraits>::value &&
|
||||
Has_cartesian_const_iterator_3<GeomTraits>::value >
|
||||
{};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -194,21 +194,21 @@ root_of( int k, Input_iterator begin, Input_iterator end ) {
|
|||
template< class Number_type >
|
||||
inline
|
||||
// select a Is_zero functor
|
||||
typename boost::mpl::if_c<
|
||||
::std::is_same< typename Algebraic_structure_traits< Number_type >::Is_zero,
|
||||
Null_functor >::value ,
|
||||
typename std::conditional_t<
|
||||
std::is_same_v< typename Algebraic_structure_traits< Number_type >::Is_zero,
|
||||
Null_functor >,
|
||||
typename Real_embeddable_traits< Number_type >::Is_zero,
|
||||
typename Algebraic_structure_traits< Number_type >::Is_zero
|
||||
>::type::result_type
|
||||
>::result_type
|
||||
is_zero( const Number_type& x ) {
|
||||
// We take the Algebraic_structure_traits<>::Is_zero functor by default. If it
|
||||
// is not available, we take the Real_embeddable_traits functor
|
||||
typename ::boost::mpl::if_c<
|
||||
::std::is_same<
|
||||
std::conditional_t<
|
||||
std::is_same_v<
|
||||
typename Algebraic_structure_traits< Number_type >::Is_zero,
|
||||
Null_functor >::value ,
|
||||
Null_functor > ,
|
||||
typename Real_embeddable_traits< Number_type >::Is_zero,
|
||||
typename Algebraic_structure_traits< Number_type >::Is_zero >::type
|
||||
typename Algebraic_structure_traits< Number_type >::Is_zero >
|
||||
is_zero;
|
||||
return is_zero( x );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <CGAL/Surface_sweep_2/Arr_batched_pl_ss_visitor.h>
|
||||
|
||||
#include <vector>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -120,7 +119,7 @@ locate(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Bgt2>, const Bgt2&, Bgt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Bgt2>, const Bgt2&, Bgt2>
|
||||
ex_traits(*geom_traits);
|
||||
|
||||
// Define the sweep-line visitor and perform the sweep.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
|
|
@ -247,8 +246,8 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt_adaptor_2, Ovl_gt2>,
|
||||
const Ovl_gt2&, Ovl_gt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt_adaptor_2, Ovl_gt2>,
|
||||
const Ovl_gt2&, Ovl_gt2>
|
||||
ex_traits(*traits_adaptor);
|
||||
|
||||
Ovl_visitor visitor(&arr1, &arr2, &arr, &ovl_tr);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include <CGAL/config.h>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
|
|
@ -246,14 +245,14 @@ struct Arr_all_sides_not_finite_tag :
|
|||
struct Arr_not_all_sides_not_finite_tag :
|
||||
public virtual Arr_not_all_sides_oblivious_tag {};
|
||||
|
||||
typedef boost::mpl::bool_<true> Arr_true;
|
||||
typedef boost::mpl::bool_<false> Arr_false;
|
||||
typedef std::true_type Arr_true;
|
||||
typedef std::false_type Arr_false;
|
||||
|
||||
template <typename ArrSideCategory>
|
||||
struct Arr_is_side_oblivious {
|
||||
typedef ArrSideCategory Side_cat;
|
||||
typedef std::is_same<Side_cat, Arr_oblivious_side_tag> Is_same;
|
||||
typedef boost::mpl::if_<Is_same, Arr_true, Arr_false> result;
|
||||
typedef std::bool_constant<Is_same::value> result;
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
|
|
@ -261,7 +260,7 @@ template <typename ArrSideCategory>
|
|||
struct Arr_is_side_open {
|
||||
typedef ArrSideCategory Side_cat;
|
||||
typedef std::is_same<Side_cat, Arr_open_side_tag> Is_same;
|
||||
typedef boost::mpl::if_<Is_same, Arr_true, Arr_false> result;
|
||||
typedef std::bool_constant<Is_same::value> result;
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
|
|
@ -269,15 +268,19 @@ template <typename ArrSideCategory>
|
|||
struct Arr_is_side_identified {
|
||||
typedef ArrSideCategory Side_cat;
|
||||
typedef std::is_same<Side_cat, Arr_identified_side_tag> Is_same;
|
||||
typedef boost::mpl::if_<Is_same, Arr_true, Arr_false> result;
|
||||
typedef std::bool_constant<Is_same::value> result;
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
template <typename ArrSideCategory>
|
||||
inline constexpr bool Arr_is_side_identified_v =
|
||||
Arr_is_side_identified<ArrSideCategory>::type::value;
|
||||
|
||||
template <typename ArrSideCategory>
|
||||
struct Arr_is_side_contracted {
|
||||
typedef ArrSideCategory Side_cat;
|
||||
typedef std::is_same<Side_cat, Arr_contracted_side_tag> Is_same;
|
||||
typedef boost::mpl::if_<Is_same, Arr_true, Arr_false> result;
|
||||
typedef std::bool_constant<Is_same::value> result;
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
|
|
@ -285,7 +288,7 @@ template <typename ArrSideCategory>
|
|||
struct Arr_is_side_closed {
|
||||
typedef ArrSideCategory Side_cat;
|
||||
typedef std::is_same<Side_cat, Arr_closed_side_tag> Is_same;
|
||||
typedef boost::mpl::if_<Is_same, Arr_true, Arr_false> result;
|
||||
typedef std::bool_constant<Is_same::value> result;
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
|
|
@ -307,10 +310,10 @@ struct Arr_all_sides_oblivious_category {
|
|||
/*! Boolean tag that is Arr_all_sides_oblivious_tag if all sides are
|
||||
* oblivious, otherwise Arr_not_all_sides_oblivious_tag
|
||||
*/
|
||||
typedef typename boost::mpl::if_<boost::mpl::and_<Lef_obl, Rig_obl,
|
||||
Bot_obl, Top_obl>,
|
||||
typedef std::conditional_t<Lef_obl::value && Rig_obl::value &&
|
||||
Bot_obl::value && Top_obl::value,
|
||||
Arr_all_sides_oblivious_tag,
|
||||
Arr_not_all_sides_oblivious_tag>::type
|
||||
Arr_not_all_sides_oblivious_tag>
|
||||
result;
|
||||
};
|
||||
|
||||
|
|
@ -331,19 +334,19 @@ private:
|
|||
typedef typename Arr_is_side_open<Bot_side_cat>::result Bot_ope;
|
||||
typedef typename Arr_is_side_open<Top_side_cat>::result Top_ope;
|
||||
|
||||
typedef boost::mpl::not_<Lef_ope> Lef_not_ope;
|
||||
typedef boost::mpl::not_<Rig_ope> Rig_not_ope;
|
||||
typedef boost::mpl::not_<Bot_ope> Bot_not_ope;
|
||||
typedef boost::mpl::not_<Top_ope> Top_not_ope;
|
||||
static inline constexpr bool lef_not_ope = !Lef_ope::value;
|
||||
static inline constexpr bool rig_not_ope = !Rig_ope::value;
|
||||
static inline constexpr bool bot_not_ope = !Bot_ope::value;
|
||||
static inline constexpr bool top_not_ope = !Top_ope::value;
|
||||
|
||||
public:
|
||||
/*! Boolean tag that is Arr_all_sides_not_open_tag if all sides are not-open,
|
||||
* otherwise Arr_not_all_sides_not_open_tag
|
||||
*/
|
||||
typedef typename boost::mpl::if_<boost::mpl::and_<Lef_not_ope, Rig_not_ope,
|
||||
Bot_not_ope, Top_not_ope>,
|
||||
typedef std::conditional_t<lef_not_ope && rig_not_ope &&
|
||||
bot_not_ope && top_not_ope,
|
||||
Arr_all_sides_not_open_tag,
|
||||
Arr_not_all_sides_not_open_tag>::type
|
||||
Arr_not_all_sides_not_open_tag>
|
||||
result;
|
||||
};
|
||||
|
||||
|
|
@ -374,23 +377,23 @@ private:
|
|||
typedef typename Arr_is_side_open<Bot_side_cat>::result Bot_ope;
|
||||
typedef typename Arr_is_side_open<Top_side_cat>::result Top_ope;
|
||||
|
||||
typedef boost::mpl::or_<Lef_obl, Lef_ope> Lef_obl_or_ope;
|
||||
typedef boost::mpl::or_<Rig_obl, Rig_ope> Rig_obl_or_ope;
|
||||
typedef boost::mpl::or_<Bot_obl, Bot_ope> Bot_obl_or_ope;
|
||||
typedef boost::mpl::or_<Top_obl, Top_ope> Top_obl_or_ope;
|
||||
static inline constexpr bool lef_obl_or_ope = Lef_obl::value || Lef_ope::value;
|
||||
static inline constexpr bool rig_obl_or_ope = Rig_obl::value || Rig_ope::value;
|
||||
static inline constexpr bool bot_obl_or_ope = Bot_obl::value || Bot_ope::value;
|
||||
static inline constexpr bool top_obl_or_ope = Top_obl::value || Top_ope::value;
|
||||
|
||||
typedef typename boost::mpl::if_<boost::mpl::and_<Lef_obl_or_ope,
|
||||
Rig_obl_or_ope,
|
||||
Bot_obl_or_ope,
|
||||
Top_obl_or_ope>,
|
||||
typedef std::conditional_t<lef_obl_or_ope &&
|
||||
rig_obl_or_ope &&
|
||||
bot_obl_or_ope &&
|
||||
top_obl_or_ope,
|
||||
Arr_all_sides_not_finite_tag,
|
||||
Arr_not_all_sides_not_finite_tag>::type
|
||||
Arr_not_all_sides_not_finite_tag>
|
||||
tmp;
|
||||
|
||||
public:
|
||||
typedef typename boost::mpl::if_<boost::mpl::and_<Lef_obl, Rig_obl,
|
||||
Bot_obl, Top_obl>,
|
||||
Arr_all_sides_oblivious_tag, tmp>::type
|
||||
typedef std::conditional_t<Lef_obl::value && Rig_obl::value &&
|
||||
Bot_obl::value && Top_obl::value,
|
||||
Arr_all_sides_oblivious_tag, tmp>
|
||||
result;
|
||||
};
|
||||
|
||||
|
|
@ -404,32 +407,27 @@ struct Arr_sane_identified_tagging {
|
|||
typedef ArrBottomSideCategory Bot_side_cat;
|
||||
typedef ArrTopSideCategory Top_side_cat;
|
||||
|
||||
typedef typename Arr_is_side_identified<Lef_side_cat>::result Lef_ide;
|
||||
typedef typename Arr_is_side_identified<Rig_side_cat>::result Rig_ide;
|
||||
typedef typename Arr_is_side_identified<Bot_side_cat>::result Bot_ide;
|
||||
typedef typename Arr_is_side_identified<Top_side_cat>::result Top_ide;
|
||||
static inline constexpr bool lef_ide = Arr_is_side_identified_v<Lef_side_cat>;
|
||||
static inline constexpr bool rig_ide = Arr_is_side_identified_v<Rig_side_cat>;
|
||||
static inline constexpr bool bot_ide = Arr_is_side_identified_v<Bot_side_cat>;
|
||||
static inline constexpr bool top_ide = Arr_is_side_identified_v<Top_side_cat>;
|
||||
|
||||
typedef boost::mpl::and_<Lef_ide, Rig_ide> LR_ide;
|
||||
typedef boost::mpl::and_<Bot_ide, Top_ide> BT_ide;
|
||||
static inline constexpr bool lr_ide = lef_ide && rig_ide;
|
||||
static inline constexpr bool bt_ide = bot_ide && top_ide;
|
||||
|
||||
typedef boost::mpl::not_<Lef_ide> Lef_not_ide;
|
||||
typedef boost::mpl::not_<Rig_ide> Rig_not_ide;
|
||||
typedef boost::mpl::not_<Bot_ide> Bot_not_ide;
|
||||
typedef boost::mpl::not_<Top_ide> Top_not_ide;
|
||||
static inline constexpr bool lr_not_ide = !lef_ide && !rig_ide;
|
||||
|
||||
typedef boost::mpl::and_<Lef_not_ide, Rig_not_ide> LR_not_ide;
|
||||
static inline constexpr bool bt_not_ide = !bot_ide && !top_ide;
|
||||
|
||||
typedef boost::mpl::and_<Bot_not_ide, Top_not_ide> BT_not_ide;
|
||||
static inline constexpr bool lr_ok = lr_ide || lr_not_ide;
|
||||
static inline constexpr bool bt_ok = bt_ide || bt_not_ide;
|
||||
|
||||
typedef boost::mpl::or_<LR_ide, LR_not_ide> LR_ok;
|
||||
typedef boost::mpl::or_<BT_ide, BT_not_ide> BT_ok;
|
||||
|
||||
/*! Boolean tag that is bool_<true> if opposite sides are either
|
||||
/*! Boolean tag that is bool_constant<true> if opposite sides are either
|
||||
* both identified or both not-identified,
|
||||
* otherwise bool_<false>
|
||||
* otherwise bool_constant<false>
|
||||
*/
|
||||
typedef boost::mpl::and_<LR_ok, BT_ok> result;
|
||||
static constexpr bool value = result::value;
|
||||
typedef std::bool_constant<lr_ok && bt_ok> result;
|
||||
static inline constexpr bool value = result::value;
|
||||
};
|
||||
|
||||
/*! Checks whether one of two boundary sides are identified
|
||||
|
|
@ -448,10 +446,10 @@ struct Arr_has_identified_sides {
|
|||
typedef typename Arr_is_side_identified<Side_one_cat>::result Side_one_ide;
|
||||
typedef typename Arr_is_side_identified<Side_two_cat>::result Side_two_ide;
|
||||
|
||||
/*! Boolean tag that is bool_<true> if one side is identified,
|
||||
* otherwise bool_<false>
|
||||
/*! Boolean tag that is bool_constant<true> if one side is identified,
|
||||
* otherwise bool_constant<false>
|
||||
*/
|
||||
typedef boost::mpl::or_<Side_one_ide, Side_two_ide> result;
|
||||
typedef std::bool_constant<Side_one_ide::value || Side_two_ide::value> result;
|
||||
};
|
||||
|
||||
/*! Checks whether one of two boundary sides are contracted
|
||||
|
|
@ -464,10 +462,11 @@ struct Arr_has_contracted_sides_two {
|
|||
typedef typename Arr_is_side_contracted<Side_one_cat>::result Side_one_con;
|
||||
typedef typename Arr_is_side_contracted<Side_two_cat>::result Side_two_con;
|
||||
|
||||
/*!\ Boolean tag that is bool_<true> if one side is identified,
|
||||
* otherwise bool_<false>
|
||||
/*!\ Boolean tag that is bool_constant<true> if one side is identified,
|
||||
* otherwise bool_constant<false>
|
||||
*/
|
||||
typedef boost::mpl::or_<Side_one_con, Side_two_con> result;
|
||||
typedef std::bool_constant<Side_one_con::value ||
|
||||
Side_two_con::value> result;
|
||||
};
|
||||
|
||||
/*! Checks whether one of two boundary sides are closed
|
||||
|
|
@ -480,10 +479,11 @@ struct Arr_has_closed_sides_two {
|
|||
typedef typename Arr_is_side_closed<Side_one_cat>::result Side_one_clo;
|
||||
typedef typename Arr_is_side_closed<Side_two_cat>::result Side_two_clo;
|
||||
|
||||
/*! Boolean tag that is bool_<true> if one side is identified,
|
||||
* otherwise bool_<false>
|
||||
/*! Boolean tag that is bool_constant<true> if one side is identified,
|
||||
* otherwise bool_constant<false>
|
||||
*/
|
||||
typedef boost::mpl::or_<Side_one_clo, Side_two_clo> result;
|
||||
typedef std::bool_constant<Side_one_clo::value ||
|
||||
Side_two_clo::value> result;
|
||||
};
|
||||
|
||||
/*! Checks whether one of two boundary sides are open
|
||||
|
|
@ -496,10 +496,11 @@ struct Arr_has_open_sides_two {
|
|||
typedef typename Arr_is_side_open<Side_one_cat>::result Side_one_ope;
|
||||
typedef typename Arr_is_side_open<Side_two_cat>::result Side_two_ope;
|
||||
|
||||
/*! Boolean tag that is bool_<true> if one side is identified,
|
||||
* otherwise bool_<false>
|
||||
/*! Boolean tag that is bool_constant<true> if one side is identified,
|
||||
* otherwise bool_constant<false>
|
||||
*/
|
||||
typedef boost::mpl::or_<Side_one_ope, Side_two_ope> result;
|
||||
typedef std::bool_constant<Side_one_ope::value ||
|
||||
Side_two_ope::value> result;
|
||||
};
|
||||
|
||||
/*! Categorizes two boundary sides:
|
||||
|
|
@ -532,11 +533,11 @@ struct Arr_two_sides_category {
|
|||
Is_open;
|
||||
|
||||
public:
|
||||
typedef typename boost::mpl::if_<Is_identified, Arr_has_identified_side_tag,
|
||||
typename boost::mpl::if_<Is_contracted, Arr_has_contracted_side_tag,
|
||||
typename boost::mpl::if_<Is_closed, Arr_has_closed_side_tag,
|
||||
typename boost::mpl::if_<Is_open, Arr_has_open_side_tag,
|
||||
Arr_all_sides_oblivious_tag>::type>::type>::type>::type
|
||||
typedef std::conditional_t<Is_identified::value, Arr_has_identified_side_tag,
|
||||
std::conditional_t<Is_contracted::value, Arr_has_contracted_side_tag,
|
||||
std::conditional_t<Is_closed::value, Arr_has_closed_side_tag,
|
||||
std::conditional_t<Is_open::value, Arr_has_open_side_tag,
|
||||
Arr_all_sides_oblivious_tag>>>>
|
||||
result;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
#include <CGAL/Surface_sweep_2/Arr_vert_decomp_ss_visitor.h>
|
||||
|
||||
#include <vector>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -124,7 +123,7 @@ decompose(const Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Vgt2>, const Vgt2&, Vgt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Vgt2>, const Vgt2&, Vgt2>
|
||||
ex_traits(*geom_traits);
|
||||
|
||||
// Define the sweep-line visitor and perform the sweep.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
|
|
@ -59,25 +58,22 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
typedef boost::mpl::bool_< true > true_;
|
||||
typedef boost::mpl::bool_< false > false_;
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v< Arr_smaller_implementation_tag, Arr_use_traits_tag >,
|
||||
std::true_type, std::false_type > Smaller_traits;
|
||||
|
||||
typedef boost::mpl::if_<
|
||||
std::is_same< Arr_smaller_implementation_tag, Arr_use_traits_tag >,
|
||||
true_, false_ > Smaller_traits;
|
||||
|
||||
typedef boost::mpl::if_<
|
||||
std::is_same< Arr_larger_implementation_tag, Arr_use_traits_tag >,
|
||||
true_, false_ > Larger_traits;
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v< Arr_larger_implementation_tag, Arr_use_traits_tag >,
|
||||
std::true_type, std::false_type > Larger_traits;
|
||||
|
||||
public:
|
||||
|
||||
//! the result type (if one side asks for traits, then ask traits!
|
||||
//! Or vice versa: If both ask for dummy, then dummy!)
|
||||
typedef typename boost::mpl::if_<
|
||||
boost::mpl::or_< Smaller_traits, Larger_traits >,
|
||||
typedef std::conditional_t<
|
||||
Smaller_traits::value || Larger_traits::value,
|
||||
Arr_use_traits_tag,
|
||||
Arr_use_dummy_tag >::type type;
|
||||
Arr_use_dummy_tag > type;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
#include <list>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <list>
|
||||
|
||||
#include <CGAL/Arr_accessor.h>
|
||||
|
|
@ -66,7 +64,7 @@ namespace Ss2 = Surface_sweep_2;
|
|||
//
|
||||
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&,
|
||||
// mpl_::bool_< true>)'
|
||||
// std::bool_constant< true>)'
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename PointLocation, typename ZoneVisitor>
|
||||
|
|
@ -137,7 +135,7 @@ void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
//
|
||||
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&,
|
||||
// mpl_::bool_< true>)'
|
||||
// std::bool_constant< true>)'
|
||||
//
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
|
|
@ -271,7 +269,7 @@ insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Cgt2>, const Cgt2&, Cgt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Cgt2>, const Cgt2&, Cgt2>
|
||||
traits(*geom_traits);
|
||||
|
||||
// Define a surface-sweep instance and perform the sweep:
|
||||
|
|
@ -326,7 +324,7 @@ void insert_empty(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>&
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Cgt2>, const Cgt2&, Cgt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Cgt2>, const Cgt2&, Cgt2>
|
||||
traits(*geom_traits);
|
||||
|
||||
// Define a surface-sweep instance and perform the sweep.
|
||||
|
|
@ -379,7 +377,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Igt2>, const Igt2&, Igt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Igt2>, const Igt2&, Igt2>
|
||||
traits(*geom_traits);
|
||||
|
||||
// Create a set of existing as well as new curves and points.
|
||||
|
|
@ -411,7 +409,7 @@ void insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
//
|
||||
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&,
|
||||
// mpl_::bool_< true>)'
|
||||
// std::bool_constant< true>)'
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename InputIterator>
|
||||
|
|
@ -465,7 +463,7 @@ void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
//
|
||||
// error: no matching function for call to `do_intersect(Arrangement_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&,
|
||||
// mpl_::bool_< true>)'
|
||||
// std::bool_constant< true>)'
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename InputIterator>
|
||||
|
|
@ -979,7 +977,7 @@ non_intersecting_insert_non_empty(Arrangement_on_surface_2<GeometryTraits_2,
|
|||
* Use the form 'A a(*b);' and not ''A a = b;' to handle the case where A has
|
||||
* only an implicit constructor, (which takes *b as a parameter).
|
||||
*/
|
||||
typename boost::mpl::if_<std::is_same<Gt2, Igt2>, const Igt2&, Igt2>::type
|
||||
std::conditional_t<std::is_same_v<Gt2, Igt2>, const Igt2&, Igt2>
|
||||
traits(*geom_traits);
|
||||
|
||||
// Create a set of existing as well as new curves and points.
|
||||
|
|
@ -1526,7 +1524,7 @@ zone(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
// workaround since it didn't compile in FC3_g++-3.4.4 with the error of:
|
||||
//
|
||||
// error: no matching function for call to `do_intersect(Arrangement_on_surface_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, mpl_::bool_< true>)'
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, std::bool_constant< true>)'
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename PointLocation>
|
||||
|
|
@ -1564,7 +1562,7 @@ do_intersect(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
|
|||
//
|
||||
// error: no matching function for call to
|
||||
// `do_intersect(Arrangement_on_surface_2<>&,
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, mpl_::bool_< true>)'
|
||||
// const Arr_segment_2&, const Arr_walk_along_line_point_location<>&, std::bool_constant< true>)'
|
||||
//
|
||||
template <typename GeometryTraits_2, typename TopologyTraits,
|
||||
typename PointLocation>
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ protected:
|
|||
* \param tag The tag used for dispatching.
|
||||
*/
|
||||
void _map_boundary_vertices(Event* event, Vertex_handle v,
|
||||
boost::mpl::bool_<true> /* tag */);
|
||||
std::bool_constant<true> /* tag */);
|
||||
|
||||
/*!
|
||||
* Update the boundary vertices map.
|
||||
|
|
@ -306,7 +306,7 @@ protected:
|
|||
* \param tag The tag used for dispatching.
|
||||
*/
|
||||
void _map_boundary_vertices(Event* event, Vertex_handle v,
|
||||
boost::mpl::bool_<false> /* tag */);
|
||||
std::bool_constant<false> /* tag */);
|
||||
|
||||
/*!
|
||||
* Update a newly created vertex using the overlay traits.
|
||||
|
|
@ -319,7 +319,7 @@ protected:
|
|||
* \param tag The tag used for dispatching.
|
||||
*/
|
||||
void _create_vertex(Event* event, Vertex_handle res_v, Subcurve* sc,
|
||||
boost::mpl::bool_<true> /* tag */);
|
||||
std::bool_constant<true> /* tag */);
|
||||
|
||||
/*!
|
||||
* Update a newly created vertex using the overlay traits.
|
||||
|
|
@ -331,7 +331,7 @@ protected:
|
|||
* \param tag The tag used for dispatching.
|
||||
*/
|
||||
void _create_vertex(Event* event, Vertex_handle res_v, Subcurve* sc,
|
||||
boost::mpl::bool_<false> /* tag */);
|
||||
std::bool_constant<false> /* tag */);
|
||||
|
||||
/*!
|
||||
* Update a newly created edge using the overlay traits.
|
||||
|
|
@ -922,7 +922,7 @@ _map_halfedge_and_twin(Halfedge_handle he,
|
|||
//
|
||||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_ss_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_<true>)
|
||||
_map_boundary_vertices(Event* event, Vertex_handle v, std::bool_constant<true>)
|
||||
{
|
||||
// Update the red and blue object if the last event on sc is on the boundary.
|
||||
if ((event->parameter_space_in_x() != ARR_INTERIOR) ||
|
||||
|
|
@ -960,7 +960,7 @@ _map_boundary_vertices(Event* event, Vertex_handle v, boost::mpl::bool_<true>)
|
|||
template <typename OvlHlpr, typename OvlTr, typename Vis>
|
||||
void Arr_overlay_ss_visitor<OvlHlpr, OvlTr, Vis>::
|
||||
_map_boundary_vertices(Event* /* event */, Vertex_handle /* v */,
|
||||
boost::mpl::bool_<false>)
|
||||
std::bool_constant<false>)
|
||||
{}
|
||||
|
||||
/* Notify the overlay traits about a newly created vertex.
|
||||
|
|
@ -974,7 +974,7 @@ void Arr_overlay_ss_visitor<OvlHlpr, OvlTr, Vis>::
|
|||
_create_vertex(Event* event,
|
||||
Vertex_handle new_v,
|
||||
Subcurve* sc,
|
||||
boost::mpl::bool_<true>)
|
||||
std::bool_constant<true>)
|
||||
{
|
||||
const Point_2& pt = event->point();
|
||||
const Cell_handle_red* red_handle = pt.red_cell_handle();
|
||||
|
|
@ -1011,7 +1011,7 @@ _create_vertex(Event* event,
|
|||
return;
|
||||
}
|
||||
|
||||
_create_vertex(event, new_v, sc, boost::mpl::bool_<false>());
|
||||
_create_vertex(event, new_v, sc, std::bool_constant<false>());
|
||||
}
|
||||
|
||||
/* Notify the overlay traits about a newly created vertex. */
|
||||
|
|
@ -1020,7 +1020,7 @@ void Arr_overlay_ss_visitor<OvlHlpr, OvlTr, Vis>::
|
|||
_create_vertex(Event* event,
|
||||
Vertex_handle new_v,
|
||||
Subcurve* sc,
|
||||
boost::mpl::bool_<false>)
|
||||
std::bool_constant<false>)
|
||||
{
|
||||
const Point_2& pt = event->point();
|
||||
const Cell_handle_red* red_handle = pt.red_cell_handle();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
struct Traits1 {
|
||||
typedef CGAL::Arr_open_side_tag Left_side_category;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h>
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
int dispatch(CGAL::Arr_use_dummy_tag) {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ private:
|
|||
// This function is invoked for traits classes where at least one
|
||||
// boundary is not oblivious and all boundaries are not identified.
|
||||
bool operator()(const Point_2& p1, const Point_2& p2,
|
||||
boost::mpl::bool_<false>) const
|
||||
std::bool_constant<false>) const
|
||||
{ return (m_traits.compare_xy_2_object()(p1, p2) == CGAL::SMALLER); }
|
||||
|
||||
// This function should be invoked for traits classes where at least one
|
||||
// boundary is identified.
|
||||
bool operator()(const Point_2& p1, const Point_2& p2,
|
||||
boost::mpl::bool_<true>) const
|
||||
std::bool_constant<true>) const
|
||||
{
|
||||
// Compare in y boundaries:
|
||||
CGAL::Arr_parameter_space ps_y1 =
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
#include <boost/operators.hpp>
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
// adapted from circulator.h, does not support
|
||||
|
|
@ -45,23 +43,20 @@ public:
|
|||
|
||||
typedef typename I__traits::iterator_category iterator_category;
|
||||
|
||||
typedef typename
|
||||
boost::mpl::if_c< Prevent_deref
|
||||
typedef std::conditional_t< Prevent_deref
|
||||
, C
|
||||
, typename C::value_type
|
||||
>::type value_type;
|
||||
, typename C::value_type>
|
||||
value_type;
|
||||
|
||||
typedef typename C::difference_type difference_type;
|
||||
typedef typename
|
||||
boost::mpl::if_c< Prevent_deref
|
||||
typedef std::conditional_t< Prevent_deref
|
||||
, C&
|
||||
, typename C::reference
|
||||
>::type reference;
|
||||
typedef typename
|
||||
boost::mpl::if_c< Prevent_deref
|
||||
> reference;
|
||||
typedef std::conditional_t< Prevent_deref
|
||||
, C*
|
||||
, typename C::reference
|
||||
>::type pointer;
|
||||
> pointer;
|
||||
|
||||
OM_iterator_from_circulator(){}
|
||||
|
||||
|
|
|
|||
|
|
@ -276,8 +276,8 @@ class GetInitializedIndexMap
|
|||
{
|
||||
public:
|
||||
// Check if there is an internal property map; if not, we must a dynamic property map
|
||||
typedef typename boost::mpl::if_c<
|
||||
CGAL::graph_has_property<Graph, Tag>::value, Tag, DynamicTag>::type Final_tag;
|
||||
typedef std::conditional_t<
|
||||
CGAL::graph_has_property<Graph, Tag>::value, Tag, DynamicTag> Final_tag;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<
|
||||
PropertyTag,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -43,14 +42,13 @@ class property_map_selector
|
|||
{
|
||||
public:
|
||||
typedef typename graph_has_property<PolygonMesh, PropertyTag>::type Has_internal_pmap;
|
||||
typedef typename boost::mpl::if_c<Has_internal_pmap::value,
|
||||
typedef std::conditional_t<Has_internal_pmap::value,
|
||||
typename boost::property_map<PolygonMesh, PropertyTag>::type,
|
||||
typename boost::cgal_no_property::type
|
||||
>::type type;
|
||||
typedef typename boost::mpl::if_c<Has_internal_pmap::value,
|
||||
typename boost::cgal_no_property::type> type;
|
||||
typedef std::conditional_t<Has_internal_pmap::value,
|
||||
typename boost::property_map<PolygonMesh, PropertyTag>::const_type,
|
||||
typename boost::cgal_no_property::const_type
|
||||
>::type const_type;
|
||||
> const_type;
|
||||
|
||||
type get_pmap(const PropertyTag& p, PolygonMesh& pmesh)
|
||||
{
|
||||
|
|
@ -209,10 +207,10 @@ struct GetGeomTraits_impl<PolygonMesh, internal_np::Param_not_found, NamedParame
|
|||
|
||||
struct Fake_GT {}; // to be used if there is no internal vertex_point_map in PolygonMesh
|
||||
|
||||
typedef typename boost::mpl::if_c<Has_internal_pmap::value ||
|
||||
typedef std::conditional_t<Has_internal_pmap::value ||
|
||||
!std::is_same<internal_np::Param_not_found, NP_vpm>::value,
|
||||
typename GetK<PolygonMesh, NamedParametersVPM>::Kernel,
|
||||
Fake_GT>::type type;
|
||||
Fake_GT> type;
|
||||
};
|
||||
|
||||
template <typename PolygonMesh,
|
||||
|
|
|
|||
|
|
@ -140,9 +140,9 @@ struct Point_accessor<Handle, ValueType, ConstReference, true>
|
|||
typedef ValueType value_type;
|
||||
typedef Handle key_type;
|
||||
|
||||
typedef typename boost::mpl::if_< std::is_reference<ConstReference>,
|
||||
typedef std::conditional_t< std::is_reference_v<ConstReference>,
|
||||
ValueType&,
|
||||
ValueType >::type Reference;
|
||||
ValueType > Reference;
|
||||
|
||||
Point_accessor() {}
|
||||
Point_accessor(Point_accessor<Handle, ValueType, Reference, false>) {}
|
||||
|
|
@ -172,9 +172,9 @@ struct Is_writable_property_map<PropertyMap, boost::read_write_property_map_tag>
|
|||
// property map must define.
|
||||
template <typename PropertyMap>
|
||||
struct Is_writable_property_map<PropertyMap, boost::lvalue_property_map_tag>
|
||||
: boost::mpl::if_c<std::is_const<typename std::remove_reference<
|
||||
: std::conditional_t<std::is_const<typename std::remove_reference<
|
||||
typename boost::property_traits<PropertyMap>::reference>::type>::value,
|
||||
CGAL::Tag_false, CGAL::Tag_true>::type
|
||||
CGAL::Tag_false, CGAL::Tag_true>
|
||||
{ };
|
||||
|
||||
} // namespace internal
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#ifndef OPEN_MESH_CLASS
|
||||
#error OPEN_MESH_CLASS is not defined
|
||||
|
|
@ -29,13 +28,13 @@ namespace CGAL {
|
|||
template <typename Mesh, typename Descriptor, typename Value>
|
||||
class OM_pmap {
|
||||
public:
|
||||
typedef typename boost::mpl::if_<std::is_same<Descriptor, typename boost::graph_traits<Mesh>::vertex_descriptor>,
|
||||
typedef std::conditional_t<std::is_same_v<Descriptor, typename boost::graph_traits<Mesh>::vertex_descriptor>,
|
||||
OpenMesh::VPropHandleT<Value>,
|
||||
typename boost::mpl::if_<std::is_same<Descriptor, typename boost::graph_traits<Mesh>::face_descriptor>,
|
||||
std::conditional_t<std::is_same_v<Descriptor, typename boost::graph_traits<Mesh>::face_descriptor>,
|
||||
OpenMesh::FPropHandleT<Value>,
|
||||
typename boost::mpl::if_<std::is_same<Descriptor, typename boost::graph_traits<Mesh>::halfedge_descriptor>,
|
||||
std::conditional_t<std::is_same_v<Descriptor, typename boost::graph_traits<Mesh>::halfedge_descriptor>,
|
||||
OpenMesh::HPropHandleT<Value>,
|
||||
OpenMesh::EPropHandleT<Value> >::type>::type>::type H;
|
||||
OpenMesh::EPropHandleT<Value> >>> H;
|
||||
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
#include <CGAL/property_map.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL{
|
||||
|
||||
|
|
|
|||
|
|
@ -636,12 +636,11 @@ public:
|
|||
template<class iterator>
|
||||
void
|
||||
draw_in_ipe(const iterator begin,const iterator end,const Iso_rectangle_2& bbox,bool make_grp=true,bool deselect_all=false,
|
||||
std::enable_if_t< boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Point_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Segment_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Circle_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Circular_arc_2> ,
|
||||
std::is_same<typename std::iterator_traits<iterator>::value_type,Polygon_2>
|
||||
> > > >::value
|
||||
std::enable_if_t< std::is_same_v<typename std::iterator_traits<iterator>::value_type,Point_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Segment_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Circle_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Circular_arc_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Polygon_2>
|
||||
>* = nullptr) const
|
||||
{
|
||||
for (iterator it=begin;it!=end;++it)
|
||||
|
|
|
|||
|
|
@ -645,12 +645,11 @@ public:
|
|||
template<class iterator>
|
||||
void
|
||||
draw_in_ipe(const iterator begin,const iterator end,const Iso_rectangle_2& bbox,bool make_grp=true,bool deselect_all=false,
|
||||
std::enable_if_t< boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Point_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Segment_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Circle_2> ,
|
||||
boost::mpl::or_< std::is_same<typename std::iterator_traits<iterator>::value_type,Circular_arc_2> ,
|
||||
std::is_same<typename std::iterator_traits<iterator>::value_type,Polygon_2>
|
||||
> > > >::value
|
||||
std::enable_if_t< std::is_same_v<typename std::iterator_traits<iterator>::value_type,Point_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Segment_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Circle_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Circular_arc_2> ||
|
||||
std::is_same_v<typename std::iterator_traits<iterator>::value_type,Polygon_2>
|
||||
>* = nullptr) const
|
||||
{
|
||||
for (iterator it=begin;it!=end;++it)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <CGAL/Compact_container_with_index.h>
|
||||
|
||||
#include <queue>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
|
|
@ -68,24 +67,24 @@ namespace CGAL {
|
|||
class CMap_dart_iterator;
|
||||
|
||||
template < typename Map_,bool Const>
|
||||
class CMap_dart_iterator<Map_, Const, Tag_false>: public boost::mpl::if_c< Const,
|
||||
class CMap_dart_iterator<Map_, Const, Tag_false>: public std::conditional_t< Const,
|
||||
typename Map_::Dart_container::const_iterator,
|
||||
typename Map_::Dart_container::iterator>::type
|
||||
typename Map_::Dart_container::iterator>
|
||||
//public internal::CC_iterator<typename Map_::Dart_container,Const>
|
||||
{
|
||||
public:
|
||||
typedef CMap_dart_iterator<Map_,Const> Self;
|
||||
|
||||
typedef typename boost::mpl::if_c< Const,
|
||||
typedef std::conditional_t< Const,
|
||||
typename Map_::Dart_container::const_iterator,
|
||||
typename Map_::Dart_container::iterator>::type Base;
|
||||
typename Map_::Dart_container::iterator> Base;
|
||||
// typedef internal::CC_iterator<typename Map_::Dart_container,Const> Base;
|
||||
|
||||
typedef typename boost::mpl::if_c< Const,
|
||||
typedef std::conditional_t< Const,
|
||||
typename Map_::Dart_const_descriptor,
|
||||
typename Map_::Dart_descriptor>::type
|
||||
typename Map_::Dart_descriptor>
|
||||
Dart_descriptor;
|
||||
typedef typename boost::mpl::if_c< Const, const Map_, Map_>::type Map;
|
||||
typedef std::conditional_t< Const, const Map_, Map_> Map;
|
||||
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef typename Base::value_type value_type;
|
||||
|
|
@ -180,25 +179,24 @@ namespace CGAL {
|
|||
|
||||
template < typename Map_,bool Const >
|
||||
class CMap_dart_iterator<Map_, Const, Tag_true>:
|
||||
/*public boost::mpl::if_c< Const,
|
||||
/*public std::conditional_t< Const,
|
||||
typename Map_::Dart_container::const_iterator,
|
||||
typename Map_::Dart_container::iterator>::type*/
|
||||
typename Map_::Dart_container::iterator>*/
|
||||
public internal::CC_iterator_with_index<typename Map_::Dart_container,Const>
|
||||
{
|
||||
public:
|
||||
typedef CMap_dart_iterator<Map_,Const> Self;
|
||||
|
||||
/*typedef typename boost::mpl::if_c< Const,
|
||||
/*typedef std::conditional_t< Const,
|
||||
typename Map_::Dart_container::const_iterator,
|
||||
typename Map_::Dart_container::iterator>::type Base;*/
|
||||
typename Map_::Dart_container::iterator> Base;*/
|
||||
typedef internal::CC_iterator_with_index<typename Map_::Dart_container,Const> Base;
|
||||
|
||||
typedef typename boost::mpl::if_c< Const,
|
||||
typedef std::conditional_t< Const,
|
||||
typename Map_::Dart_const_descriptor,
|
||||
typename Map_::Dart_descriptor>::type
|
||||
typename Map_::Dart_descriptor>
|
||||
Dart_descriptor;
|
||||
typedef typename boost::mpl::if_c< Const, const Map_,
|
||||
Map_>::type Map;
|
||||
typedef std::conditional_t< Const, const Map_, Map_> Map;
|
||||
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef typename Base::value_type value_type;
|
||||
|
|
|
|||
|
|
@ -861,14 +861,13 @@ namespace internal {
|
|||
typedef typename DSC::value_type value_type;
|
||||
typedef typename DSC::size_type size_type;
|
||||
typedef typename DSC::difference_type difference_type;
|
||||
typedef typename boost::mpl::if_c< Const, const value_type*,
|
||||
value_type*>::type pointer;
|
||||
typedef typename boost::mpl::if_c< Const, const value_type&,
|
||||
value_type&>::type reference;
|
||||
typedef std::conditional_t< Const, const value_type*,
|
||||
value_type*> pointer;
|
||||
typedef std::conditional_t< Const, const value_type&,
|
||||
value_type&> reference;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
typedef typename boost::mpl::if_c< Const, const DSC*, DSC*>::type
|
||||
cc_pointer;
|
||||
typedef std::conditional_t< Const, const DSC*, DSC*> cc_pointer;
|
||||
|
||||
CC_iterator_with_index(): m_ptr_to_cc(nullptr),
|
||||
m_index(0)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
// For interior_polyhedron_3
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
#include <CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h>
|
||||
#endif
|
||||
#include <CGAL/Number_types/internal/Exact_type_selector.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
|
@ -227,7 +229,11 @@ namespace CGAL
|
|||
template <class PlaneIterator, class Polyhedron>
|
||||
void halfspace_intersection_3 (PlaneIterator begin, PlaneIterator end,
|
||||
Polyhedron &P,
|
||||
std::optional<typename Kernel_traits<typename std::iterator_traits<PlaneIterator>::value_type>::Kernel::Point_3> origin = std::nullopt) {
|
||||
std::optional<typename Kernel_traits<typename std::iterator_traits<PlaneIterator>::value_type>::Kernel::Point_3> origin
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
= std::nullopt
|
||||
#endif
|
||||
) {
|
||||
// Checks whether the intersection is a polyhedron
|
||||
CGAL_assertion_msg(Convex_hull_3::internal::is_intersection_dim_3(begin, end), "halfspace_intersection_3: intersection not a polyhedron");
|
||||
|
||||
|
|
@ -238,8 +244,10 @@ namespace CGAL
|
|||
|
||||
// if a point inside is not provided find one using linear programming
|
||||
if (!origin) {
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
// find a point inside the intersection
|
||||
origin = halfspace_intersection_interior_point_3(begin, end);
|
||||
#endif
|
||||
|
||||
CGAL_assertion_msg(origin!=std::nullopt, "halfspace_intersection_3: problem when determining a point inside the intersection");
|
||||
if (origin==std::nullopt)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@
|
|||
#include <CGAL/assertions.h>
|
||||
|
||||
// For interior_polyhedron_3
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
#include <CGAL/Convex_hull_3/dual/halfspace_intersection_interior_point_3.h>
|
||||
#endif
|
||||
#include <CGAL/Number_types/internal/Exact_type_selector.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
|
@ -99,7 +101,9 @@ namespace CGAL
|
|||
// if a point inside is not provided find one using linear programming
|
||||
if (!origin) {
|
||||
// find a point inside the intersection
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
origin = halfspace_intersection_interior_point_3(pbegin, pend);
|
||||
#endif
|
||||
|
||||
CGAL_assertion_msg(origin!=std::nullopt, "halfspace_intersection_with_constructions_3: problem when determining a point inside the intersection");
|
||||
if (origin==std::nullopt)
|
||||
|
|
@ -134,7 +138,11 @@ namespace CGAL
|
|||
void halfspace_intersection_with_constructions_3 (PlaneIterator pbegin,
|
||||
PlaneIterator pend,
|
||||
Polyhedron &P,
|
||||
std::optional<typename Kernel_traits<typename std::iterator_traits<PlaneIterator>::value_type>::Kernel::Point_3> const& origin = std::nullopt) {
|
||||
std::optional<typename Kernel_traits<typename std::iterator_traits<PlaneIterator>::value_type>::Kernel::Point_3> const& origin
|
||||
#ifndef CGAL_CH3_DUAL_WITHOUT_QP_SOLVER
|
||||
= std::nullopt
|
||||
#endif
|
||||
) {
|
||||
typedef typename Kernel_traits<typename std::iterator_traits<PlaneIterator>::value_type>::Kernel K;
|
||||
typedef typename K::Point_3 Point_3;
|
||||
typedef typename Convex_hull_3::internal::Default_traits_for_Chull_3<Point_3>::type Traits;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#include <CGAL/Filtered_kernel/internal/Static_filters/tools.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <boost/none.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <CGAL/Lazy_exact_nt.h>
|
||||
|
||||
|
|
@ -199,9 +198,9 @@ private:
|
|||
boost::mpl::eval_if< std::is_same< typename internal::Lazy_result_type<Construction>::type,
|
||||
CGAL::Object >,
|
||||
boost::mpl::int_<OBJECT>,
|
||||
boost::mpl::eval_if< boost::mpl::or_<
|
||||
std::is_same< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_2 >,
|
||||
std::is_same< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_3 > >,
|
||||
boost::mpl::eval_if< std::bool_constant<
|
||||
std::is_same_v< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_2 > ||
|
||||
std::is_same_v< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_3 > >,
|
||||
boost::mpl::int_<BBOX>,
|
||||
boost::mpl::int_<NONE> > > >,
|
||||
boost::mpl::int_<NONE> >::type {};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include <CGAL/Compact_container.h>
|
||||
#include <queue>
|
||||
#include <type_traits>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ public:
|
|||
|
||||
template < typename Tx, typename Ty >
|
||||
PointH2(const Tx & x, const Ty & y,
|
||||
std::enable_if_t< boost::mpl::and_<std::is_convertible<Tx, RT>,
|
||||
std::is_convertible<Ty, RT> >::value >* = 0)
|
||||
std::enable_if_t< std::is_convertible_v<Tx, RT> &&
|
||||
std::is_convertible_v<Ty, RT> >* = 0)
|
||||
: base(x, y) {}
|
||||
|
||||
PointH2(const FT& x, const FT& y)
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ public:
|
|||
|
||||
template < typename Tx, typename Ty, typename Tz >
|
||||
PointH3(const Tx & x, const Ty & y, const Tz & z,
|
||||
std::enable_if_t< boost::mpl::and_< boost::mpl::and_< std::is_convertible<Tx, RT>,
|
||||
std::is_convertible<Ty, RT> >,
|
||||
std::is_convertible<Tz, RT> >::value >* = 0)
|
||||
std::enable_if_t<std::is_convertible_v<Tx, RT> &&
|
||||
std::is_convertible_v<Ty, RT> &&
|
||||
std::is_convertible_v<Tz, RT>>* = 0)
|
||||
: base(x, y, z) {}
|
||||
|
||||
PointH3(const FT& x, const FT& y, const FT& z)
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ public:
|
|||
|
||||
template < typename Tx, typename Ty >
|
||||
VectorH2(const Tx & x, const Ty & y,
|
||||
std::enable_if_t< boost::mpl::and_<std::is_convertible<Tx, RT>,
|
||||
std::is_convertible<Ty, RT> >::value >* = 0)
|
||||
std::enable_if_t<std::is_convertible_v<Tx, RT> &&
|
||||
std::is_convertible_v<Ty, RT>>* = 0)
|
||||
: base(CGAL::make_array<RT>(x, y, RT(1))) {}
|
||||
|
||||
VectorH2(const FT& x, const FT& y)
|
||||
|
|
|
|||
|
|
@ -67,9 +67,9 @@ public:
|
|||
|
||||
template < typename Tx, typename Ty, typename Tz >
|
||||
VectorH3(const Tx & x, const Ty & y, const Tz & z,
|
||||
std::enable_if_t< boost::mpl::and_< boost::mpl::and_< std::is_convertible<Tx, RT>,
|
||||
std::is_convertible<Ty, RT> >,
|
||||
std::is_convertible<Tz, RT> >::value >* = 0)
|
||||
std::enable_if_t< std::is_convertible_v<Tx, RT> &&
|
||||
std::is_convertible_v<Ty, RT> &&
|
||||
std::is_convertible_v<Tz, RT>>* = 0)
|
||||
: base(CGAL::make_array<RT>(x, y, z, RT(1))) {}
|
||||
|
||||
VectorH3(const FT& x, const FT& y, const FT& z)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Release date: October 2023
|
|||
- **Breaking change**: The usage of `boost::shared_ptr` has been replaced by `std::shared_ptr`. Packages affected are 2D Straight Line Skeleton and Shape Detection.
|
||||
- **Breaking change**: The usage of `boost::optional` has been replaced by `std::optional`. Packages affected are 2D Straight Line Skeleton, 3D Fast Intersection and Distance Computation (AABB Tree), and the Kernel intersection.
|
||||
- **Breaking change**: The usage of `boost::variant` has been replaced by `std::variant`. Packages affected are 2D Arrangements, and the Kernel intersection.
|
||||
- **Breaking chahge**: The file CMake file `UseCGAL.cmake` has been removed from CGAL. Usages of the CMake variables `${CGAL_USE_FILE}` and `${CGAL_LIBRARIES}` must be replaced by a link to the imported target `CGAL::CGAL`, for example: `target_link_library(the_target PRIVATE CGAL::CGAL)`.
|
||||
- **Breaking change**: The file CMake file `UseCGAL.cmake` has been removed from CGAL. Usages of the CMake variables `${CGAL_USE_FILE}` and `${CGAL_LIBRARIES}` must be replaced by a link to the imported target `CGAL::CGAL`, for example: `target_link_library(the_target PRIVATE CGAL::CGAL)`.
|
||||
|
||||
|
||||
#### 2D Arrangements
|
||||
|
|
@ -45,6 +45,10 @@ Release date: October 2023
|
|||
- Added the option to use a variable sizing field for `CGAL::Polygon_mesh_processing::isotropic_remeshing()`,
|
||||
and a sizing function based on a measure of local curvature for adaptive remeshing.
|
||||
- Added the function `CGAL::Polygon_mesh_processing::refine_mesh_at_isolevel()` that refines a polygon mesh along an isocurve.
|
||||
- Added the function
|
||||
`CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` that refines a soup of triangles so that no pair of triangles intersects
|
||||
in their interiors. Also added, the function `autorefine()` operating directly on a triangle mesh and updating it
|
||||
using the aforementioned function on a triangle soup.
|
||||
|
||||
### [2D Arrangements](https://doc.cgal.org/6.0/Manual/packages.html#PkgArrangementOnSurface2)
|
||||
- Fixed a bug in the zone construction code applied to arrangements of geodesic arcs on a sphere,
|
||||
|
|
|
|||
|
|
@ -1253,6 +1253,6 @@ if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
|
|||
"USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'"
|
||||
)
|
||||
if(Qt6_FOUND)
|
||||
message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION_STRING}'")
|
||||
message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION}'")
|
||||
endif()#Qt6_FOUND
|
||||
endif()#RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <functional>
|
||||
|
||||
#include <any>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
#include <iterator>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#ifndef CGAL_INTERNAL_INTERSECTIONS_TRIANGLE_3_TRIANGLE_3_INTERSECTION_H
|
||||
#define CGAL_INTERNAL_INTERSECTIONS_TRIANGLE_3_TRIANGLE_3_INTERSECTION_H
|
||||
|
||||
//#define CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
|
||||
#include <CGAL/Intersection_traits_3.h>
|
||||
#include <CGAL/Intersections_3/internal/Line_3_Triangle_3_intersection.h>
|
||||
#include <CGAL/Intersections_3/internal/Line_3_Line_3_intersection.h>
|
||||
|
|
@ -21,6 +23,9 @@
|
|||
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
|
||||
#include <boost/next_prior.hpp>
|
||||
#include <boost/container/flat_set.hpp>
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
|
@ -30,53 +35,338 @@ namespace Intersections {
|
|||
namespace internal{
|
||||
|
||||
template <class Kernel>
|
||||
void intersection_coplanar_triangles_cutoff(const typename Kernel::Point_3& p,
|
||||
struct Point_on_triangle
|
||||
{
|
||||
// triangle points are not stored in this class but are expected
|
||||
// to always be passed in the same order. For a triangle pqr,
|
||||
// edge 0 is pq, edge 1 qr and edge 2 rp. Point 0 is p, 1 is q and 2 is r.
|
||||
//
|
||||
// (id, -1) point on t1
|
||||
// (-1, id) point on t2
|
||||
// (id1, id2) intersection of edges
|
||||
std::pair<int, int> t1_t2_ids;
|
||||
boost::container::flat_set<int> extra_t1; // store other ids of edges containing the point
|
||||
typename Kernel::FT alpha; //
|
||||
|
||||
//////
|
||||
|
||||
static
|
||||
inline
|
||||
const typename Kernel::Point_3&
|
||||
point_from_id(const typename Kernel::Point_3& p,
|
||||
const typename Kernel::Point_3& q,
|
||||
const typename Kernel::Point_3& r,
|
||||
const Kernel& k,
|
||||
std::list<typename Kernel::Point_3>& inter_pts)
|
||||
int id)
|
||||
{
|
||||
typedef typename std::list<typename Kernel::Point_3>::iterator Iterator;
|
||||
switch(id)
|
||||
{
|
||||
case 0:
|
||||
return p;
|
||||
case 1:
|
||||
return q;
|
||||
default:
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
Point_on_triangle(int i1, int i2=-1, typename Kernel::FT alpha = 0.) // TODO add global zero()?
|
||||
: t1_t2_ids(i1,i2)
|
||||
, alpha(alpha)
|
||||
{}
|
||||
|
||||
// orientation of the current point wrt to edge id1 (p1q1)
|
||||
Orientation
|
||||
orientation (const typename Kernel::Point_3& p1, // source of edge edge_id1
|
||||
const typename Kernel::Point_3& q1, // target of edge edge_id1
|
||||
const typename Kernel::Point_3& r1,
|
||||
int edge_id1,
|
||||
const typename Kernel::Point_3& p2,
|
||||
const typename Kernel::Point_3& q2,
|
||||
const typename Kernel::Point_3& r2,
|
||||
const Kernel& k) const
|
||||
{
|
||||
if (t1_t2_ids.first!=-1)
|
||||
{
|
||||
if (t1_t2_ids.second==-1)
|
||||
return (edge_id1==t1_t2_ids.first || (edge_id1+1)%3==t1_t2_ids.first) ? ZERO:POSITIVE; // it is a point on t1
|
||||
// this is an intersection point
|
||||
|
||||
if (t1_t2_ids.first==edge_id1)
|
||||
return ZERO;
|
||||
if (t1_t2_ids.first==(edge_id1+1)%3)
|
||||
{
|
||||
if (alpha==0) return ZERO;
|
||||
return alpha>=0 ? POSITIVE:NEGATIVE;
|
||||
}
|
||||
CGAL_assertion((t1_t2_ids.first+1)%3==edge_id1);
|
||||
if (alpha==1) return ZERO;
|
||||
return alpha<=1?POSITIVE:NEGATIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
//this is an input point of t2
|
||||
typename Kernel::Coplanar_orientation_3 orient = k.coplanar_orientation_3_object();
|
||||
const typename Kernel::Point_3& query = point_from_id(p2,q2,r2,t1_t2_ids.second);
|
||||
return orient(p1,q1,r1,query);
|
||||
}
|
||||
}
|
||||
|
||||
int id1() const { return t1_t2_ids.first; }
|
||||
int id2() const { return t1_t2_ids.second; }
|
||||
|
||||
// construct the intersection point from the info stored
|
||||
typename Kernel::Point_3
|
||||
point(const typename Kernel::Point_3& p1,
|
||||
const typename Kernel::Point_3& q1,
|
||||
const typename Kernel::Point_3& r1,
|
||||
const typename Kernel::Point_3& p2,
|
||||
const typename Kernel::Point_3& q2,
|
||||
const typename Kernel::Point_3& r2,
|
||||
const Kernel& k) const
|
||||
{
|
||||
if (t1_t2_ids.first==-1)
|
||||
return point_from_id(p2,q2,r2,t1_t2_ids.second);
|
||||
if (t1_t2_ids.second==-1)
|
||||
return point_from_id(p1,q1,r1,t1_t2_ids.first);
|
||||
|
||||
return k.construct_barycenter_3_object()(point_from_id(p1,q1,r1,(t1_t2_ids.first+1)%3), alpha, point_from_id(p1,q1,r1,t1_t2_ids.first)) ;
|
||||
}
|
||||
};
|
||||
|
||||
// the intersection of two triangles is computed by interatively intersection t2
|
||||
// with halfspaces defined by edges of t1. The following function is called
|
||||
// for each each on t1 on edge of the current intersection.
|
||||
// pq is such an edge and p1q1 from t1 defines the halfspace intersection
|
||||
// we are currently interseted in. We return the intersection point of
|
||||
// pq with p1q1
|
||||
template <class Kernel>
|
||||
Point_on_triangle<Kernel>
|
||||
intersection(const Point_on_triangle<Kernel>& p,
|
||||
const Point_on_triangle<Kernel>& q,
|
||||
int edge_id_t1,
|
||||
const typename Kernel::Point_3& p1,
|
||||
const typename Kernel::Point_3& q1,
|
||||
// const typename Kernel::Point_3& r1,
|
||||
const typename Kernel::Point_3& p2,
|
||||
const typename Kernel::Point_3& q2,
|
||||
const typename Kernel::Point_3& r2,
|
||||
const Kernel& k)
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " calling intersection: ";
|
||||
std::cout << " (" << p.id1() << "," << p.id2() << ",[" << p.alpha << "]) -";
|
||||
std::cout << " (" << q.id1() << "," << q.id2() << ",[" << q.alpha << "]) || e" << edge_id_t1;
|
||||
#endif
|
||||
typename Kernel::Compute_alpha_for_coplanar_triangle_intersection_3 compute_alpha
|
||||
= k.compute_alpha_for_coplanar_triangle_intersection_3_object();
|
||||
typedef Point_on_triangle<Kernel> Pot;
|
||||
switch(p.id1())
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
switch(q.id1())
|
||||
{
|
||||
case -1: // A: (-1, ip2) - (-1, iq2)
|
||||
{
|
||||
CGAL_assertion((p.id2()+1)%3 == q.id2() || (q.id2()+1)%3 == p.id2());
|
||||
// CGAL_assertion(p.extra_t1.empty() && q.extra_t1.empty()); // TMP to see if it's worth implementing special case
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 1\n";
|
||||
#endif
|
||||
typename Kernel::FT alpha = compute_alpha(p1, q1,
|
||||
Pot::point_from_id(p2, q2, r2, p.id2()),
|
||||
Pot::point_from_id(p2, q2, r2, q.id2()));
|
||||
int id2 = (p.id2()+1)%3 == q.id2() ? p.id2() : q.id2();
|
||||
return Point_on_triangle<Kernel>(edge_id_t1, id2, alpha); // intersection with an original edge of t2
|
||||
}
|
||||
default:
|
||||
if (q.id2()!=-1) // B: (-1, ip2) - (iq1, iq2)
|
||||
{
|
||||
if (p.id2() == q.id2() || p.id2() == (q.id2()+1)%3)
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 2\n";
|
||||
#endif
|
||||
// points are on the same edge of t2 --> we shorten an already cut edge
|
||||
typename Kernel::FT alpha = compute_alpha(p1, q1,
|
||||
Pot::point_from_id(p2, q2, r2, q.id2()),
|
||||
Pot::point_from_id(p2, q2, r2, (q.id2()+1)%3));
|
||||
|
||||
return Point_on_triangle<Kernel>(edge_id_t1, q.id2(), alpha);
|
||||
}
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 3\n";
|
||||
#endif
|
||||
// point of t1: look for an edge of t1 containing both points
|
||||
CGAL_assertion( p.extra_t1.count(q.id1())!=0 || p.extra_t1.count(3-q.id1()-edge_id_t1)!=0 );
|
||||
int eid1 = p.extra_t1.count(q.id1())!=0 ? q.id1() : 3-q.id1()-edge_id_t1;
|
||||
return Point_on_triangle<Kernel>((eid1+1)%3==edge_id_t1?edge_id_t1:(edge_id_t1+1)%3, -1); // vertex of t1
|
||||
}
|
||||
// C: (-1, ip2) - (iq1, -1)
|
||||
//vertex of t1, special case t1 edge passed thru a vertex of t2
|
||||
CGAL_assertion(edge_id_t1 == 2);
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 4\n";
|
||||
#endif
|
||||
CGAL_assertion(q.id1()==1);
|
||||
CGAL_assertion(!p.extra_t1.empty());
|
||||
return Point_on_triangle<Kernel>(p.extra_t1.count(0)==1?0:2,-1);
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
switch(p.id2())
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
switch(q.id1())
|
||||
{
|
||||
case -1: // G: (ip1, -1) - (-1, iq2)
|
||||
//vertex of t1, special case t1 edge passed thru a vertex of t2
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 5\n";
|
||||
#endif
|
||||
CGAL_assertion(edge_id_t1 == 2);
|
||||
CGAL_assertion(p.id1()==1);
|
||||
CGAL_assertion(!q.extra_t1.empty());
|
||||
return Point_on_triangle<Kernel>(q.extra_t1.count(0)==1?0:2,-1);
|
||||
default:
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 6\n";
|
||||
#endif
|
||||
CGAL_assertion(q.id2()!=-1); // I: (ip1, -1) - (iq2, -1)
|
||||
//H: (ip1,-1), (iq1, iq2)
|
||||
CGAL_assertion(edge_id_t1==2);
|
||||
// p and q are on the same edge of t1
|
||||
CGAL_assertion(p.id1()==q.id1() || p.id1()==(q.id1()+1)%3);
|
||||
return Point_on_triangle<Kernel>((q.id1()+1)%3==edge_id_t1?edge_id_t1:(edge_id_t1+1)%3 , -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
switch(q.id1())
|
||||
{
|
||||
case -1: // D: (ip1, ip2) - (-1, iq2)
|
||||
{
|
||||
if (q.id2() == p.id2() || q.id2() == (p.id2()+1)%3)
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 7\n";
|
||||
#endif
|
||||
// points are on the same edge of t2 --> we shorten an already cut edge
|
||||
typename Kernel::FT alpha = compute_alpha(p1, q1,
|
||||
Pot::point_from_id(p2, q2, r2, p.id2()),
|
||||
Pot::point_from_id(p2, q2, r2, (p.id2()+1)%3));
|
||||
|
||||
return Point_on_triangle<Kernel>(edge_id_t1, p.id2(), alpha);
|
||||
}
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 8\n";
|
||||
#endif
|
||||
// point of t1
|
||||
//std::cout << "q.extra_t1: "; for(int qet1 : q.extra_t1) std::cout << " " << qet1; std::cout << "\n";
|
||||
CGAL_assertion( q.extra_t1.count(p.id1())!=0 || q.extra_t1.count(3-p.id1()-edge_id_t1)!=0 );
|
||||
int eid1 = q.extra_t1.count(p.id1())!=0 ? p.id1() : 3-p.id1()-edge_id_t1;
|
||||
return Point_on_triangle<Kernel>((eid1+1)%3==edge_id_t1?edge_id_t1:(edge_id_t1+1)%3, -1); // vertex of t1
|
||||
}
|
||||
default:
|
||||
{
|
||||
switch(q.id2())
|
||||
{
|
||||
case -1: // F: (ip1, ip2) - (iq1, -1)
|
||||
{
|
||||
// p and q are on the same edge of t1
|
||||
CGAL_assertion(q.id1()==p.id1() || q.id1()==(p.id1()+1)%3);
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 9\n";
|
||||
#endif
|
||||
return Point_on_triangle<Kernel>((p.id1()+1)%3==edge_id_t1?edge_id_t1:(edge_id_t1+1)%3 , -1);
|
||||
}
|
||||
default: // E: (ip1, ip2) - (iq1, iq2)
|
||||
{
|
||||
if (p.id2()==q.id2())
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " -- case 10\n";
|
||||
#endif
|
||||
typename Kernel::FT alpha = compute_alpha(p1, q1,
|
||||
Pot::point_from_id(p2, q2, r2, q.id2()),
|
||||
Pot::point_from_id(p2, q2, r2, (q.id2()+1)%3));
|
||||
return Point_on_triangle<Kernel>(edge_id_t1, q.id2(), alpha);
|
||||
}
|
||||
// we are intersecting an edge of t1
|
||||
CGAL_assertion(p.id1()==q.id1() || edge_id_t1==2);
|
||||
int eid1 = p.id1()==q.id1() ? p.id1() : 1;
|
||||
return Point_on_triangle<Kernel>((eid1+1)%3==edge_id_t1?edge_id_t1:(edge_id_t1+1)%3, -1); // vertex of t1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class Kernel>
|
||||
void intersection_coplanar_triangles_cutoff(const typename Kernel::Point_3& p1,
|
||||
const typename Kernel::Point_3& q1,
|
||||
const typename Kernel::Point_3& r1,
|
||||
int edge_id,
|
||||
const typename Kernel::Point_3& p2,
|
||||
const typename Kernel::Point_3& q2,
|
||||
const typename Kernel::Point_3& r2,
|
||||
const Kernel& k,
|
||||
std::list<Point_on_triangle<Kernel>>& inter_pts)
|
||||
{
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " cutoff using e" << edge_id << ": "
|
||||
<< to_double(p1.x()) << " " << to_double(p1.y()) << " " << to_double(p1.z()) << " "
|
||||
<< to_double(q1.x()) << " " << to_double(q1.y()) << " " << to_double(q1.z()) << "\n";
|
||||
#endif
|
||||
typedef typename std::list<Point_on_triangle<Kernel>>::iterator Iterator;
|
||||
|
||||
if(inter_pts.empty())
|
||||
return;
|
||||
|
||||
typename Kernel::Coplanar_orientation_3 orient = k.coplanar_orientation_3_object();
|
||||
typename Kernel::Construct_line_3 line = k.construct_line_3_object();
|
||||
//orient(p1,q1,r1,r1) is POSITIVE
|
||||
std::map<const Point_on_triangle<Kernel>*,Orientation> orientations; // TODO skip map
|
||||
for (Point_on_triangle<Kernel>& pot : inter_pts)
|
||||
{
|
||||
orientations[ &pot ]=pot.orientation(p1,q1,r1,edge_id,p2,q2,r2,k);
|
||||
if (pot.id1()==-1 && orientations[ &pot ]==COLLINEAR)
|
||||
pot.extra_t1.insert(edge_id);
|
||||
}
|
||||
|
||||
//orient(p,q,r,r) is POSITIVE
|
||||
std::map<const typename Kernel::Point_3*,Orientation> orientations;
|
||||
for (Iterator it=inter_pts.begin();it!=inter_pts.end();++it)
|
||||
orientations[ &(*it) ]=orient(p,q,r,*it);
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " Orientations:";
|
||||
for (const Point_on_triangle<Kernel>& pot : inter_pts)
|
||||
std::cout << " " << orientations[ &pot ];
|
||||
std::cout << "\n";
|
||||
#endif
|
||||
CGAL_kernel_assertion_code(int pt_added = 0);
|
||||
|
||||
CGAL_kernel_assertion_code(int pt_added = 0;)
|
||||
Iterator prev = std::prev(inter_pts.end());
|
||||
|
||||
const typename Kernel::Point_3* prev = &(*std::prev(inter_pts.end()));
|
||||
Iterator stop = inter_pts.size() > 2 ? inter_pts.end() : std::prev(inter_pts.end());
|
||||
for(Iterator it=inter_pts.begin(); it!=stop; ++it)
|
||||
{
|
||||
const typename Kernel::Point_3& curr = *it;
|
||||
Orientation or_prev = orientations[prev],
|
||||
or_curr = orientations[&curr];
|
||||
Orientation or_prev = orientations[&(*prev)],
|
||||
or_curr = orientations[&(*it)];
|
||||
|
||||
if((or_prev == POSITIVE && or_curr == NEGATIVE) ||
|
||||
(or_prev == NEGATIVE && or_curr == POSITIVE))
|
||||
{
|
||||
typename Intersection_traits<Kernel, typename Kernel::Line_3, typename Kernel::Line_3>::result_type
|
||||
obj = intersection(line(p,q), line(*prev,curr), k);
|
||||
Point_on_triangle<Kernel> new_pt = intersection(*prev, *it, edge_id, p1, q1, p2, q2, r2, k);
|
||||
|
||||
// assert "not empty"
|
||||
CGAL_kernel_assertion(bool(obj));
|
||||
|
||||
const typename Kernel::Point_3* inter = intersect_get<typename Kernel::Point_3>(obj);
|
||||
CGAL_kernel_assertion(inter != nullptr);
|
||||
|
||||
prev = &(*inter_pts.insert(it,*inter));
|
||||
orientations[prev] = COLLINEAR;
|
||||
CGAL_kernel_assertion_code(++pt_added;)
|
||||
prev = inter_pts.insert(it,new_pt);
|
||||
orientations[&(*prev)] = COLLINEAR;
|
||||
CGAL_kernel_assertion_code(++pt_added);
|
||||
}
|
||||
|
||||
prev = &(*it);
|
||||
prev = it;
|
||||
}
|
||||
|
||||
CGAL_kernel_assertion(pt_added<3);
|
||||
|
|
@ -96,35 +386,77 @@ intersection_coplanar_triangles(const typename K::Triangle_3& t1,
|
|||
const typename K::Triangle_3& t2,
|
||||
const K& k)
|
||||
{
|
||||
const typename K::Point_3& p = t1.vertex(0),
|
||||
q = t1.vertex(1),
|
||||
r = t1.vertex(2);
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
auto to_string = [](const typename K::Triangle_3& t)
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "4 "
|
||||
<< to_double(t[0].x()) << " " << to_double(t[0].y()) << " " << to_double(t[0].z()) << " "
|
||||
<< to_double(t[1].x()) << " " << to_double(t[1].y()) << " " << to_double(t[1].z()) << " "
|
||||
<< to_double(t[2].x()) << " " << to_double(t[2].y()) << " " << to_double(t[2].z()) << " "
|
||||
<< to_double(t[0].x()) << " " << to_double(t[0].y()) << " " << to_double(t[0].z()) << "\n";
|
||||
return sstr.str();
|
||||
};
|
||||
|
||||
std::list<typename K::Point_3> inter_pts;
|
||||
inter_pts.push_back(t2.vertex(0));
|
||||
inter_pts.push_back(t2.vertex(1));
|
||||
inter_pts.push_back(t2.vertex(2));
|
||||
std::cout << "intersection_coplanar_triangles\n";
|
||||
std::ofstream("/tmp/t1.polylines.txt") << std::setprecision(17) << to_string(t1) << "\n";
|
||||
std::ofstream("/tmp/t2.polylines.txt") << std::setprecision(17) << to_string(t2) << "\n";
|
||||
#endif
|
||||
const typename K::Point_3& p1 = t1.vertex(0),
|
||||
q1 = t1.vertex(1),
|
||||
r1 = t1.vertex(2);
|
||||
|
||||
const typename K::Point_3& p2 = t2.vertex(0),
|
||||
q2 = t2.vertex(1),
|
||||
r2 = t2.vertex(2);
|
||||
|
||||
std::list<Point_on_triangle<K>> inter_pts;
|
||||
inter_pts.push_back(Point_on_triangle<K>(-1,0));
|
||||
inter_pts.push_back(Point_on_triangle<K>(-1,1));
|
||||
inter_pts.push_back(Point_on_triangle<K>(-1,2));
|
||||
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
auto print_points = [&]()
|
||||
{
|
||||
for(auto p : inter_pts) std::cout << " (" << p.id1() << "," << p.id2() << ",[" << p.alpha << "]) "; std::cout <<"\n";
|
||||
};
|
||||
std::cout << " ipts size: " << inter_pts.size() << "\n";
|
||||
print_points();
|
||||
#endif
|
||||
//intersect t2 with the three half planes which intersection defines t1
|
||||
intersection_coplanar_triangles_cutoff(p,q,r,k,inter_pts); //line pq
|
||||
intersection_coplanar_triangles_cutoff(q,r,p,k,inter_pts); //line qr
|
||||
intersection_coplanar_triangles_cutoff(r,p,q,k,inter_pts); //line rp
|
||||
intersection_coplanar_triangles_cutoff(p1,q1,r1,0,p2,q2,r2,k,inter_pts); //line pq
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " ipts size: " << inter_pts.size() << "\n";
|
||||
print_points();
|
||||
#endif
|
||||
intersection_coplanar_triangles_cutoff(q1,r1,p1,1,p2,q2,r2,k,inter_pts); //line qr
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " ipts size: " << inter_pts.size() << "\n";
|
||||
print_points();
|
||||
#endif
|
||||
intersection_coplanar_triangles_cutoff(r1,p1,q1,2,p2,q2,r2,k,inter_pts); //line rp
|
||||
#ifdef CGAL_DEBUG_COPLANAR_T3_T3_INTERSECTION
|
||||
std::cout << " ipts size: " << inter_pts.size() << "\n";
|
||||
print_points();
|
||||
#endif
|
||||
|
||||
auto point = [&](const Point_on_triangle<K>& pot){ return pot.point(p1,q1,r1,p2,q2,r2,k); };
|
||||
switch(inter_pts.size())
|
||||
{
|
||||
case 0:
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>();
|
||||
case 1:
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(*inter_pts.begin());
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(point(*inter_pts.begin()));
|
||||
case 2:
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(
|
||||
k.construct_segment_3_object()(*inter_pts.begin(), *std::next(inter_pts.begin())) );
|
||||
k.construct_segment_3_object()(point(*inter_pts.begin()), point(*std::next(inter_pts.begin()))) );
|
||||
case 3:
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(
|
||||
k.construct_triangle_3_object()(*inter_pts.begin(), *std::next(inter_pts.begin()), *std::prev(inter_pts.end())) );
|
||||
k.construct_triangle_3_object()(point(*inter_pts.begin()), point(*std::next(inter_pts.begin())), point(*std::prev(inter_pts.end()))) );
|
||||
default:
|
||||
return intersection_return<typename K::Intersect_3, typename K::Triangle_3, typename K::Triangle_3>(
|
||||
std::vector<typename K::Point_3>(inter_pts.begin(),inter_pts.end()));
|
||||
std::vector<typename K::Point_3>(boost::make_transform_iterator(inter_pts.begin(), point),
|
||||
boost::make_transform_iterator(inter_pts.end(), point)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,6 +96,13 @@ void test_coplanar_triangles(){
|
|||
assert(CGAL::object_cast<Triangle>(&obj)!=nullptr);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Triangle>(&obj)!=nullptr);
|
||||
// TK10 case C'
|
||||
t1=Triangle(Point(88.7921, 89.0007, 1.25), Point(88.1912, 88.3997, 1.25), Point(89.8224, 90.031, 1.25));
|
||||
t2=Triangle(Point(88.0497, 88.2583, 1.25), Point(82.9292, 81.8747, 1.25), Point(91.1726, 91.3812, 1.25));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Triangle>(&obj)!=nullptr);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Triangle>(&obj)!=nullptr);
|
||||
//Intersection is a point
|
||||
//edges are collinear, one vertex in common
|
||||
t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) );
|
||||
|
|
@ -153,6 +160,13 @@ void test_coplanar_triangles(){
|
|||
assert(CGAL::object_cast<Segment>(&obj)!=nullptr);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Segment>(&obj)!=nullptr);
|
||||
// TK10 case D
|
||||
t1=Triangle(Point(-34.893700000000003, -16.0351, 3.1334899999999998e-12), Point(-34.893700000000003, -18.5351, 3.1334899999999998e-12), Point(-42.393700000000003, -16.0351, 3.1334899999999998e-12));
|
||||
t2=Triangle(Point(-34.893700000000003, -32.0351, 3.1334899999999998e-12), Point(-34.893700000000003, -9.7851400000000002, 3.1334899999999998e-12), Point(-31.643699999999999, -17.201799999999999, 3.1334899999999998e-12));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Segment>(&obj)!=nullptr);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Segment>(&obj)!=nullptr);
|
||||
//Intersection is a polygon
|
||||
//David's star
|
||||
t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0.5,1.5,0) );
|
||||
|
|
@ -181,6 +195,51 @@ void test_coplanar_triangles(){
|
|||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
// TK10 case A
|
||||
t1=Triangle(Point(3.74861, 12.4822, 14.0112), Point(5.40582, 12.4822, 15.6895), Point(5.37748, 12.4822, 15.7206));
|
||||
t2=Triangle(Point(5.49972, 12.4822, 13.491), Point(5.27627, 12.4822, 15.8106), Point(5.32119, 12.4822, 15.8126));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
// TK10 case C
|
||||
t1=Triangle(Point(5, -94.6659, 3.85175), Point(5, -94.5682, 3.08638), Point(5, -94.8182, 3.08638));
|
||||
t2=Triangle(Point(5, -94.4317, 3.76399), Point(5, -97.6182, 3.08638), Point(5, -94.5659, 2.99682));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
// TK10 case E
|
||||
t1=Triangle(Point(-955.858, -45.032, -0.016), Point(-955.856, -45.032, -0.004), Point(-955.856, -45.032, -0.002));
|
||||
t2=Triangle(Point(-955.856, -45.032, 0.006), Point(-955.854, -45.032, -0.002), Point(-955.876, -45.032, -0.034));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
// TK10 case F
|
||||
t1=Triangle(Point(141.172, 20.576, 155.764), Point(141.172, 20.588, 155.766), Point(141.172, 20.59, 155.766));
|
||||
t2=Triangle(Point(141.172, 20.602, 155.768), Point(141.172, 20.594, 155.766), Point(141.172, 20.574, 155.764));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
// TK10 case D
|
||||
t1=Triangle(Point(152.864, 126.324, 0.950001), Point(152.77, 126.483, 0.950001), Point(153.072, 125.973, 0.950001));
|
||||
t2=Triangle(Point(153.322, 125.551, 0.950001), Point(152.218, 127.415, 0.950001), Point(153.66, 124.768, 0.950001));
|
||||
obj=CGAL::intersection(t1,t2);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
obj=CGAL::intersection(t2,t1);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)!=nullptr);
|
||||
assert(CGAL::object_cast<Polygon2>(&obj)->size()==4);
|
||||
//Intersection is empty
|
||||
t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) );
|
||||
t2=Triangle( Point(-0.1,-0.1,0),Point(-0.1,-0.9,0),Point(-1,-0.1,0) );
|
||||
|
|
|
|||
|
|
@ -2224,6 +2224,107 @@ namespace CommonKernelFunctors {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_planes_intersection_point_3
|
||||
{
|
||||
typedef typename K::Plane_3 Plane;
|
||||
typedef typename K::Point_3 Point;
|
||||
typename K::Construct_plane_3 construct_plane;
|
||||
public:
|
||||
typedef Point result_type;
|
||||
|
||||
Point
|
||||
operator()(const Point& p1, const Point& q1, const Point& r1,
|
||||
const Point& p2, const Point& q2, const Point& r2,
|
||||
const Point& p3, const Point& q3, const Point& r3) const
|
||||
{
|
||||
Plane plane1 = construct_plane(p1, q1, r1);
|
||||
Plane plane2 = construct_plane(p2, q2, r2);
|
||||
Plane plane3 = construct_plane(p3, q3, r3);
|
||||
|
||||
const auto res = typename K::Intersect_3()(plane1, plane2, plane3);
|
||||
CGAL_assertion(res!=std::nullopt);
|
||||
const Point* e_pt = std::get_if<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=nullptr);
|
||||
return *e_pt;
|
||||
}
|
||||
|
||||
Point
|
||||
operator()(const Plane& plane1, const Plane& plane2, const Plane& plane3) const
|
||||
{
|
||||
const auto res = typename K::Intersect_3()(plane1, plane2, plane3);
|
||||
CGAL_assertion(res!=std::nullopt);
|
||||
const Point* e_pt = std::get_if<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=nullptr);
|
||||
return *e_pt;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_coplanar_segments_intersection_point_3
|
||||
{
|
||||
typedef typename K::Segment_3 Segment;
|
||||
typedef typename K::Point_3 Point;
|
||||
typename K::Construct_segment_3 construct_segment;
|
||||
public:
|
||||
typedef Point result_type;
|
||||
|
||||
Point
|
||||
operator()(const Point& p1, const Point& q1,
|
||||
const Point& p2, const Point& q2) const
|
||||
{
|
||||
Segment s1 = construct_segment(p1, q1);
|
||||
Segment s2 = construct_segment(p2, q2);
|
||||
|
||||
const auto res = typename K::Intersect_3()(s1, s2);
|
||||
CGAL_assertion(res!=std::nullopt);
|
||||
const Point* e_pt = std::get_if<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=nullptr);
|
||||
return *e_pt;
|
||||
}
|
||||
|
||||
Point
|
||||
operator()(const Segment& s1, const Segment& s2) const
|
||||
{
|
||||
const auto res = typename K::Intersect_3()(s1, s2);
|
||||
CGAL_assertion(res!=std::nullopt);
|
||||
const Point* e_pt = std::get_if<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=nullptr);
|
||||
return *e_pt;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Compute_alpha_for_coplanar_triangle_intersection_3
|
||||
{
|
||||
typedef typename K::Point_3 Point_3;
|
||||
typedef typename K::Vector_3 Vector_3;
|
||||
public:
|
||||
typedef typename K::FT result_type;
|
||||
result_type
|
||||
operator()(const Point_3& p1, const Point_3& p2, // segment 1
|
||||
const Point_3& p3, const Point_3& p4) const // segment 2
|
||||
{
|
||||
typename K::Construct_vector_3 vector = K().construct_vector_3_object();
|
||||
typename K::Construct_cross_product_vector_3 cross_product =
|
||||
K().construct_cross_product_vector_3_object();
|
||||
|
||||
const Vector_3 v1 = vector(p1, p2);
|
||||
const Vector_3 v2 = vector(p3, p4);
|
||||
|
||||
CGAL_assertion(K().coplanar_3_object()(p1,p2,p3,p4));
|
||||
|
||||
const Vector_3 v3 = vector(p1, p3);
|
||||
const Vector_3 v3v2 = cross_product(v3,v2);
|
||||
const Vector_3 v1v2 = cross_product(v1,v2);
|
||||
const typename K::FT sl = K().compute_squared_length_3_object()(v1v2);
|
||||
CGAL_assertion(!certainly(is_zero(sl)));
|
||||
|
||||
const typename K::FT t = ((v3v2.x()*v1v2.x()) + (v3v2.y()*v1v2.y()) + (v3v2.z()*v1v2.z())) / sl;
|
||||
return t; // p1 + (p2-p1) * t
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_point_on_2
|
||||
{
|
||||
|
|
|
|||
|
|
@ -398,6 +398,12 @@ CGAL_Kernel_cons(Construct_plane_3,
|
|||
construct_plane_3_object)
|
||||
CGAL_Kernel_cons(Construct_plane_line_intersection_point_3,
|
||||
construct_plane_line_intersection_point_3_object)
|
||||
CGAL_Kernel_cons(Construct_planes_intersection_point_3,
|
||||
construct_planes_intersection_point_3_object)
|
||||
CGAL_Kernel_cons(Construct_coplanar_segments_intersection_point_3,
|
||||
construct_coplanar_segments_intersection_point_3_object)
|
||||
CGAL_Kernel_cons(Compute_alpha_for_coplanar_triangle_intersection_3,
|
||||
compute_alpha_for_coplanar_triangle_intersection_3_object)
|
||||
CGAL_Kernel_cons(Construct_point_on_2,
|
||||
construct_point_on_2_object)
|
||||
CGAL_Kernel_cons(Construct_point_on_3,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include <CGAL/Kernel_traits_fwd.h>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ sub print_platform_descriptions()
|
|||
<th>BOOST</th>
|
||||
<th>MPFR</th>
|
||||
<th>GMP</th>
|
||||
<th>QT5</th>
|
||||
<th>QT</th>
|
||||
<th>LEDA</th>
|
||||
<th>CXXFLAGS</th>
|
||||
<th>LDFLAGS</th>
|
||||
|
|
@ -544,6 +544,7 @@ EOF
|
|||
print OUTPUT ">$pf_short</a>";
|
||||
my $index = 12;
|
||||
while ($index) {
|
||||
$index--;
|
||||
print OUTPUT "<td>?</td>\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ sub reformat_results($)
|
|||
$_ = $line;
|
||||
open (PLATFORM_INFO,">${platform}.info") or return;
|
||||
open (PLATFORM_NEW_RESULTS,">${platform}.new_results") or return;
|
||||
my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$QT4,$QT5,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","no");
|
||||
my ($CGAL_VERSION,$LEDA_VERSION,$COMPILER,$TESTER_NAME,$TESTER_ADDRESS,$GMP,$MPFR,$ZLIB,$OPENGL,$BOOST,$QT,$CMAKE) = ("-","-","-","-","-","-","-","-","-","-","-","-","-","no");
|
||||
my ($LDFLAGS,$CXXFLAGS) = ("", "");
|
||||
while (! /^------/) {
|
||||
if(/^\s*$/) {
|
||||
|
|
@ -97,10 +97,13 @@ sub reformat_results($)
|
|||
$QT="$1";
|
||||
}
|
||||
if (/QT4_VERSION = '([^']+)'/) {
|
||||
$QT4="$1";
|
||||
$QT="$1";
|
||||
}
|
||||
if (/Qt5_VERSION = '([^']+)'/) {
|
||||
$QT5="$1";
|
||||
$QT="$1";
|
||||
}
|
||||
if (/Qt6_VERSION = '([^']+)'/) {
|
||||
$QT="$1";
|
||||
}
|
||||
if (/BOOST_VERSION = '([^']+)'/) {
|
||||
$BOOST="$1";
|
||||
|
|
@ -147,7 +150,7 @@ $CMAKE
|
|||
$BOOST
|
||||
$MPFR
|
||||
$GMP
|
||||
$QT5
|
||||
$QT
|
||||
$LEDA_VERSION
|
||||
$CXXFLAGS
|
||||
$LDFLAGS
|
||||
|
|
|
|||
|
|
@ -42,11 +42,9 @@
|
|||
#include <boost/mpl/clear.hpp>
|
||||
#include <boost/mpl/contains.hpp>
|
||||
#include <boost/mpl/end.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/has_key.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/insert.hpp>
|
||||
#include <boost/mpl/insert_fwd.hpp>
|
||||
#include <boost/mpl/iterator_range.hpp>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include <boost/dynamic_bitset.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
|
@ -67,9 +66,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
typedef typename boost::mpl::if_<boost::is_function<Function_>,
|
||||
typedef std::conditional_t<std::is_function_v<Function_>,
|
||||
Function_*,
|
||||
Function_>::type Stored_function;
|
||||
Function_> Stored_function;
|
||||
/// Function to wrap
|
||||
Stored_function f_;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <CGAL/Image_3.h>
|
||||
#include <CGAL/function_objects.h>
|
||||
#include <functional>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -139,8 +139,8 @@ public:
|
|||
Protect_edges_sizing_field(C3T3& c3t3,
|
||||
const MeshDomain& domain,
|
||||
SizingFunction size=SizingFunction(),
|
||||
const FT minimal_size = FT(),
|
||||
std::size_t maximal_number_of_vertices = 0,
|
||||
const FT minimal_size = FT(-1),
|
||||
const std::size_t maximal_number_of_vertices = 0,
|
||||
Mesh_error_code* error_code = 0
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, std::atomic<bool>* stop_ptr = 0
|
||||
|
|
@ -455,17 +455,29 @@ private:
|
|||
return s;
|
||||
}
|
||||
|
||||
bool use_minimal_size() const
|
||||
{
|
||||
return minimal_size_ != FT(-1);
|
||||
}
|
||||
Weight minimal_weight() const
|
||||
{
|
||||
if (use_minimal_size())
|
||||
return minimal_weight_;
|
||||
else
|
||||
return Weight(0);
|
||||
}
|
||||
|
||||
private:
|
||||
C3T3& c3t3_;
|
||||
const MeshDomain& domain_;
|
||||
SizingFunction size_;
|
||||
FT minimal_size_;
|
||||
Weight minimal_weight_;
|
||||
const FT minimal_size_;
|
||||
const Weight minimal_weight_;
|
||||
std::set<Curve_index> treated_edges_;
|
||||
Vertex_set unchecked_vertices_;
|
||||
int refine_balls_iteration_nb;
|
||||
bool nonlinear_growth_of_balls;
|
||||
std::size_t maximal_number_of_vertices_;
|
||||
const std::size_t maximal_number_of_vertices_;
|
||||
Mesh_error_code* const error_code_;
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
/// Pointer to the atomic Boolean that can stop the process
|
||||
|
|
@ -478,7 +490,7 @@ template <typename C3T3, typename MD, typename Sf>
|
|||
Protect_edges_sizing_field<C3T3, MD, Sf>::
|
||||
Protect_edges_sizing_field(C3T3& c3t3, const MD& domain,
|
||||
Sf size, const FT minimal_size,
|
||||
std::size_t maximal_number_of_vertices,
|
||||
const std::size_t maximal_number_of_vertices,
|
||||
Mesh_error_code* error_code
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, std::atomic<bool>* stop_ptr
|
||||
|
|
@ -540,7 +552,7 @@ operator()(const bool refine)
|
|||
std::cerr << "refine_balls() done. Nb of points in triangulation: "
|
||||
<< c3t3_.triangulation().number_of_vertices() << std::endl;
|
||||
#endif
|
||||
CGAL_assertion(minimal_size_ > 0 || c3t3_.is_valid());
|
||||
CGAL_assertion(use_minimal_size() || c3t3_.is_valid());
|
||||
}
|
||||
|
||||
// debug_dump_c3t3("dump-mesh-after-protect_edges.binary.cgal", c3t3_);
|
||||
|
|
@ -760,10 +772,10 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index,
|
|||
while ( ! is_special(nearest_vh) &&
|
||||
cwsr(c3t3_.triangulation().point(nearest_vh), - sq_d) == CGAL::SMALLER )
|
||||
{
|
||||
CGAL_assertion( minimal_size_ > 0 || sq_d > 0 );
|
||||
CGAL_assertion( use_minimal_size() || sq_d > 0);
|
||||
|
||||
bool special_ball = false;
|
||||
if(minimal_weight_ != Weight() && sq_d < minimal_weight_)
|
||||
if(use_minimal_size() && sq_d < minimal_weight_)
|
||||
{
|
||||
sq_d = minimal_weight_;
|
||||
w = minimal_weight_;
|
||||
|
|
@ -817,16 +829,16 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index,
|
|||
|
||||
const FT sq_d = tr.min_squared_distance(p, cp(c3t3_.triangulation().point(v)));
|
||||
|
||||
if(minimal_weight_ != Weight() && sq_d < minimal_weight_) {
|
||||
if(use_minimal_size() && sq_d < minimal_weight()) {
|
||||
insert_a_special_ball = true;
|
||||
#if CGAL_MESH_3_PROTECTION_DEBUG & 1
|
||||
nearest_point = c3t3_.triangulation().point(v);
|
||||
#endif
|
||||
min_sq_d = minimal_weight_;
|
||||
min_sq_d = minimal_weight();
|
||||
if(! is_special(v))
|
||||
{
|
||||
*out++ = v;
|
||||
ch = change_ball_size(v, minimal_weight_, true)->cell(); // special ball
|
||||
ch = change_ball_size(v, minimal_weight(), true)->cell(); // special ball
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -876,10 +888,10 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index,
|
|||
if ( cwsr(it_wp, - sq_d) == CGAL::SMALLER )
|
||||
{
|
||||
bool special_ball = false;
|
||||
if(minimal_weight_ != Weight() && sq_d < minimal_weight_)
|
||||
if(use_minimal_size() && sq_d < minimal_weight())
|
||||
{
|
||||
sq_d = minimal_weight_;
|
||||
w = minimal_weight_;
|
||||
sq_d = minimal_weight();
|
||||
w = minimal_weight();
|
||||
special_ball = true;
|
||||
insert_a_special_ball = true;
|
||||
}
|
||||
|
|
@ -933,13 +945,13 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index,
|
|||
add_handle_to_unchecked = true;
|
||||
}
|
||||
|
||||
if( w < minimal_weight_) {
|
||||
if( w < minimal_weight()) {
|
||||
#if CGAL_MESH_3_PROTECTION_DEBUG & 1
|
||||
std::cerr << "smart_insert_point: weight " << w
|
||||
<< " was smaller than minimal weight (" << minimal_weight_ << ")\n";
|
||||
<< " was smaller than minimal weight (" << minimal_weight() << ")\n";
|
||||
#endif
|
||||
|
||||
w = minimal_weight_;
|
||||
w = minimal_weight();
|
||||
insert_a_special_ball = true;
|
||||
}
|
||||
Vertex_handle v = insert_point(p,w,dim,index, insert_a_special_ball);
|
||||
|
|
@ -1174,7 +1186,7 @@ insert_balls(const Vertex_handle& vp,
|
|||
|
||||
const FT d_signF = static_cast<FT>(d_sign);
|
||||
int n = static_cast<int>(std::floor(FT(2)*(d-sq) / (sp+sq))+.5);
|
||||
// if( minimal_weight_ != 0 && n == 0 ) return;
|
||||
// if( minimal_weight() != 0 && n == 0 ) return;
|
||||
|
||||
if(nonlinear_growth_of_balls && refine_balls_iteration_nb < 3)
|
||||
{
|
||||
|
|
@ -1183,7 +1195,7 @@ insert_balls(const Vertex_handle& vp,
|
|||
// balls at corner. When the curve segment is long enough, pick a point
|
||||
// at the middle and choose a new size.
|
||||
if(n >= internal::max_nb_vertices_to_reevaluate_size &&
|
||||
d >= (internal::max_nb_vertices_to_reevaluate_size * minimal_weight_)) {
|
||||
d >= (internal::max_nb_vertices_to_reevaluate_size * minimal_weight())) {
|
||||
#if CGAL_MESH_3_PROTECTION_DEBUG & 1
|
||||
const Weighted_point& vq_wp = c3t3_.triangulation().point(vq);
|
||||
std::cerr << "Number of to-be-inserted balls is: "
|
||||
|
|
@ -1436,9 +1448,9 @@ refine_balls()
|
|||
const Vertex_handle v = it->first;
|
||||
const FT new_size = it->second;
|
||||
// Set size of the ball to new value
|
||||
if(minimal_size_ != FT() && new_size < minimal_size_) {
|
||||
if(use_minimal_size() && new_size < minimal_size_) {
|
||||
if(!is_special(v)) {
|
||||
change_ball_size(v, minimal_weight_, true); // special ball
|
||||
change_ball_size(v, minimal_weight(), true); // special ball
|
||||
|
||||
// Loop will have to be run again
|
||||
restart = true;
|
||||
|
|
@ -1751,18 +1763,33 @@ is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2,
|
|||
FT size_v1 = get_radius(v1);
|
||||
FT size_v2 = get_radius(v2);
|
||||
|
||||
bool v1_valid_curve_index = true;
|
||||
bool v2_valid_curve_index = true;
|
||||
|
||||
if(use_minimal_size())
|
||||
{
|
||||
v1_valid_curve_index = (get_dimension(v1) != 1
|
||||
|| curve_index == domain_.curve_index(v1->index()));
|
||||
v2_valid_curve_index = (get_dimension(v2) != 1
|
||||
|| curve_index == domain_.curve_index(v2->index()));
|
||||
}
|
||||
else
|
||||
{
|
||||
CGAL_assertion(get_dimension(v1) != 1 ||
|
||||
curve_index == domain_.curve_index(v1->index()));
|
||||
CGAL_assertion(get_dimension(v2) != 1 ||
|
||||
curve_index == domain_.curve_index(v2->index()));
|
||||
}
|
||||
|
||||
const Weighted_point& v1_wp = c3t3_.triangulation().point(v1);
|
||||
const Weighted_point& v2_wp = c3t3_.triangulation().point(v2);
|
||||
|
||||
FT arc_length = domain_.curve_segment_length(cp(v1_wp),
|
||||
FT arc_length = (v1_valid_curve_index && v2_valid_curve_index)
|
||||
? domain_.curve_segment_length(cp(v1_wp),
|
||||
cp(v2_wp),
|
||||
curve_index,
|
||||
orientation);
|
||||
orientation)
|
||||
: compute_distance(v1, v2); //curve polyline may not be consistent
|
||||
|
||||
// Sufficient condition so that the curve portion between v1 and v2 is
|
||||
// inside the union of the two balls.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <sstream>
|
||||
#include <atomic>
|
||||
|
||||
|
|
@ -172,9 +171,9 @@ template<class Tr,
|
|||
class Previous_,
|
||||
class Concurrency_tag,
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
class Container_ = typename boost::mpl::if_c // (parallel/sequential?)
|
||||
class Container_ = std::conditional_t // (parallel/sequential?)
|
||||
<
|
||||
std::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
||||
std::is_convertible_v<Concurrency_tag, Parallel_tag>,
|
||||
|
||||
// Parallel
|
||||
# ifdef CGAL_MESH_3_USE_LAZY_UNSORTED_REFINEMENT_QUEUE
|
||||
|
|
@ -209,7 +208,7 @@ template<class Tr,
|
|||
Meshes::Double_map_container<typename Tr::Cell_handle,
|
||||
typename Criteria::Cell_quality>
|
||||
# endif
|
||||
>::type // boost::if (parallel/sequential)
|
||||
> // std::conditional (parallel/sequential)
|
||||
|
||||
#else // !CGAL_LINKED_WITH_TBB
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
#include <optional>
|
||||
#include <boost/optional/optional_io.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <CGAL/tuple.h>
|
||||
#include <sstream>
|
||||
#include <atomic>
|
||||
|
|
@ -640,9 +639,9 @@ template<class Tr,
|
|||
template<class Tr_, class Cr_, class MD_, class C3T3_2, class Ct_, class C_2>
|
||||
class Base_ = Refine_facets_3_base,
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
class Container_ = typename boost::mpl::if_c // (parallel/sequential?)
|
||||
class Container_ = std::conditional_t // (parallel/sequential?)
|
||||
<
|
||||
std::is_convertible<Concurrency_tag, Parallel_tag>::value,
|
||||
std::is_convertible_v<Concurrency_tag, Parallel_tag>,
|
||||
// Parallel
|
||||
# ifdef CGAL_MESH_3_USE_LAZY_UNSORTED_REFINEMENT_QUEUE
|
||||
Meshes::Filtered_deque_container
|
||||
|
|
@ -679,7 +678,7 @@ template<class Tr,
|
|||
Meshes::Double_map_container<typename Tr::Facet,
|
||||
typename Criteria::Facet_quality>
|
||||
# endif
|
||||
>::type // boost::if (parallel/sequential)
|
||||
> // std::conditional (parallel/sequential)
|
||||
|
||||
#else // !CGAL_LINKED_WITH_TBB
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <CGAL/STL_Extension/internal/Has_nested_type_Bare_point.h>
|
||||
#include <CGAL/Time_stamper.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <CGAL/NewKernel_d/KernelD_converter.h>
|
||||
#include <CGAL/NewKernel_d/Filtered_predicate2.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -65,10 +64,10 @@ struct Cartesian_filter_K : public Base_
|
|||
EK_rt exact_kernel()const{return sek.kernel();}
|
||||
|
||||
// MSVC is too dumb to perform the empty base optimization.
|
||||
typedef boost::mpl::and_<
|
||||
internal::Do_not_store_kernel<Kernel_base>,
|
||||
internal::Do_not_store_kernel<AK>,
|
||||
internal::Do_not_store_kernel<EK> > Do_not_store_kernel;
|
||||
typedef std::bool_constant<
|
||||
internal::Do_not_store_kernel<Kernel_base>::value &&
|
||||
internal::Do_not_store_kernel<AK>::value &&
|
||||
internal::Do_not_store_kernel<EK>::value > Do_not_store_kernel;
|
||||
|
||||
//TODO: C2A/C2E could be able to convert *this into this->kernel() or this->kernel2().
|
||||
typedef KernelD_converter<Kernel_base,AK> C2A;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include <CGAL/Filtered_kernel/internal/Static_filters/tools.h> // bug, should be included by the next one
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_2.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
namespace SFA { // static filter adapter
|
||||
|
|
@ -98,9 +97,9 @@ struct Cartesian_static_filters<Dimension_tag<2>, R_, Derived_> : public R_ {
|
|||
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
|
||||
template <class D> struct Functor <Orientation_of_points_tag,D> {
|
||||
typedef
|
||||
//typename boost::mpl::if_ <
|
||||
//std::is_same<D,No_filter_tag>,
|
||||
//typename Get_functor<R_, Orientation_of_points_tag>::type,
|
||||
//std::conditional_t <
|
||||
//std::is_same_v<D,No_filter_tag>,
|
||||
//typename Get_functor<R_, Orientation_of_points_tag>,
|
||||
SFA::Orientation_of_points_2<R_,Derived>
|
||||
// >::type
|
||||
type;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <CGAL/Kernel/mpl.h>
|
||||
#include <CGAL/type_traits/is_iterator.h>
|
||||
#include <CGAL/transforming_iterator.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <CGAL/NewKernel_d/store_kernel.h>
|
||||
#include <CGAL/NewKernel_d/Kernel_object_converter.h>
|
||||
|
||||
|
|
@ -80,12 +79,12 @@ class KernelD_converter_
|
|||
|
||||
// Explicit calls to boost::mpl functions to avoid parenthesis
|
||||
// warning on some versions of GCC
|
||||
typedef typename boost::mpl::if_ <
|
||||
typedef std::conditional_t <
|
||||
// If Point==Vector, keep only one conversion
|
||||
boost::mpl::or_<boost::mpl::bool_<duplicate::value>,
|
||||
duplicate::value ||
|
||||
// For iterator objects, the default is make_transforming_iterator
|
||||
boost::mpl::bool_<(iterator_tag_traits<Tag_>::is_iterator && no_converter::value)> >,
|
||||
Do_not_use,K1_Obj>::type argument_type;
|
||||
(iterator_tag_traits<Tag_>::is_iterator && no_converter::value),
|
||||
Do_not_use,K1_Obj> argument_type;
|
||||
//typedef typename KOC::argument_type K1_Obj;
|
||||
//typedef typename KOC::result_type K2_Obj;
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -260,9 +260,9 @@ struct Lazy_cartesian :
|
|||
void set_dimension(int dim){ak.set_dimension(dim);ek.set_dimension(dim);}
|
||||
|
||||
// For compilers that do not handle [[no_unique_address]]
|
||||
typedef boost::mpl::and_<
|
||||
internal::Do_not_store_kernel<AK_>,
|
||||
internal::Do_not_store_kernel<EK_> > Do_not_store_kernel;
|
||||
typedef std::bool_constant<
|
||||
internal::Do_not_store_kernel<AK_>::value &&
|
||||
internal::Do_not_store_kernel<EK_>::value > Do_not_store_kernel;
|
||||
|
||||
typedef typename EK_::Dimension Dimension; // ?
|
||||
typedef Lazy_cartesian Self;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ template <class T> struct result_<T,false,true>{typedef transforming_iterator<Fo
|
|||
template<class> struct result;
|
||||
template<class T> struct result<Forward_rep(T)> : result_<T> {};
|
||||
|
||||
template <class T> std::enable_if_t<!boost::mpl::or_<Is_wrapper<T>,Is_wrapper_iterator<T> >::value,T> const& operator()(T const& t) const {return t;}
|
||||
template <class T> std::enable_if_t<!boost::mpl::or_<Is_wrapper<T>,Is_wrapper_iterator<T> >::value,T>& operator()(T& t) const {return t;}
|
||||
template <class T> std::enable_if_t<!Is_wrapper<T>::value || Is_wrapper_iterator<T>::value,T> const& operator()(T const& t) const {return t;}
|
||||
template <class T> std::enable_if_t<!Is_wrapper<T>::value || Is_wrapper_iterator<T>::value,T>& operator()(T& t) const {return t;}
|
||||
|
||||
template <class T> typename T::Rep const& operator()(T const& t, std::enable_if_t<Is_wrapper<T>::value >* = 0) const {return t.rep();}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <boost/type_traits.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/mpl/empty.hpp>
|
||||
#include <boost/mpl/front.hpp>
|
||||
|
|
@ -65,16 +64,16 @@ namespace CGAL {
|
|||
: Has_type_different_from<Get_functor<Kernel, Tg, O>, Null_functor> {};
|
||||
|
||||
template<class K, class List, bool=boost::mpl::empty<List>::type::value>
|
||||
struct Provides_functors : boost::mpl::and_ <
|
||||
Provides_functor<K, typename boost::mpl::front<List>::type>,
|
||||
Provides_functors<K, typename boost::mpl::pop_front<List>::type> > {};
|
||||
struct Provides_functors : std::bool_constant<
|
||||
Provides_functor<K, typename boost::mpl::front<List>::type>::value &&
|
||||
Provides_functors<K, typename boost::mpl::pop_front<List>::type>::value > {};
|
||||
template<class K, class List>
|
||||
struct Provides_functors<K, List, true> : std::true_type {};
|
||||
|
||||
template<class K, class List, bool=boost::mpl::empty<List>::type::value>
|
||||
struct Provides_types : boost::mpl::and_ <
|
||||
Provides_type<K, typename boost::mpl::front<List>::type>,
|
||||
Provides_types<K, typename boost::mpl::pop_front<List>::type> > {};
|
||||
struct Provides_types : std::bool_constant<
|
||||
Provides_type<K, typename boost::mpl::front<List>::type>::value &&
|
||||
Provides_types<K, typename boost::mpl::pop_front<List>::type>::value > {};
|
||||
template<class K, class List>
|
||||
struct Provides_types<K, List, true> : std::true_type {};
|
||||
|
||||
|
|
@ -233,7 +232,7 @@ namespace CGAL {
|
|||
#undef CGAL_DECL_ITER_OBJ
|
||||
|
||||
template<class A,class T,class B,class C>struct Get_functor_category<A,Construct_ttag<T>,B,C> :
|
||||
boost::mpl::if_c<iterator_tag_traits<T>::is_iterator,
|
||||
std::conditional<iterator_tag_traits<T>::is_iterator,
|
||||
Construct_iterator_tag,
|
||||
Construct_tag> {};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ template <class T, class No, bool=internal::has_type<T>::value /*false*/>
|
|||
struct Has_type_different_from : std::false_type {};
|
||||
template <class T, class No>
|
||||
struct Has_type_different_from <T, No, true>
|
||||
: boost::mpl::not_<std::is_same<typename T::type, No> > {};
|
||||
: std::bool_constant<!std::is_same_v<typename T::type, No>> {};
|
||||
|
||||
|
||||
template <class T> struct Wrap_type { typedef T type; };
|
||||
|
|
@ -145,11 +145,11 @@ struct Has_type_different_from <T, No, true>
|
|||
#define CGAL_KD_DEFAULT_FUNCTOR(Tg,Name,ReqTyp,ReqFun) \
|
||||
template <class K, class O> \
|
||||
struct Get_functor<K, Tg, O, \
|
||||
typename boost::mpl::if_c< \
|
||||
std::conditional_t< \
|
||||
Provides_functor_i<K, Tg, O>::value \
|
||||
|| !Provides_types<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqTyp> >::value \
|
||||
|| !Provides_functors<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqFun> >::value \
|
||||
, int, void>::type> \
|
||||
, int, void>> \
|
||||
{ \
|
||||
typedef CGAL_STRIP_PAREN_ Name type; \
|
||||
typedef K Bound_kernel; \
|
||||
|
|
@ -159,11 +159,11 @@ struct Has_type_different_from <T, No, true>
|
|||
#define CGAL_KD_DEFAULT_TYPE(Tg,Name,ReqTyp,ReqFun) \
|
||||
template <class K> \
|
||||
struct Get_type<K, Tg, \
|
||||
typename boost::mpl::if_c< \
|
||||
std::conditional_t< \
|
||||
Provides_type_i<K, Tg>::value \
|
||||
|| !Provides_types<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqTyp> >::value \
|
||||
|| !Provides_functors<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqFun> >::value \
|
||||
, int, void>::type> \
|
||||
, int, void>> \
|
||||
{ \
|
||||
typedef CGAL_STRIP_PAREN_ Name type; \
|
||||
typedef K Bound_kernel; \
|
||||
|
|
|
|||
|
|
@ -509,8 +509,8 @@ void test3(){
|
|||
;
|
||||
CP_ cp_ Kinit(construct_point_d_object);
|
||||
CV_ cv_ Kinit(construct_vector_d_object);
|
||||
typename boost::mpl::if_<std::is_same<typename Ker::Default_ambient_dimension,CGAL::Dynamic_dimension_tag>,Construct_point3_helper<CP_>,CP_>::type cp(cp_);
|
||||
typename boost::mpl::if_<std::is_same<typename Ker::Default_ambient_dimension,CGAL::Dynamic_dimension_tag>,Construct_point3_helper<CV_>,CV_>::type cv(cv_);
|
||||
std::conditional_t<std::is_same_v<typename Ker::Default_ambient_dimension,CGAL::Dynamic_dimension_tag>,Construct_point3_helper<CP_>,CP_> cp(cp_);
|
||||
std::conditional_t<std::is_same_v<typename Ker::Default_ambient_dimension,CGAL::Dynamic_dimension_tag>,Construct_point3_helper<CV_>,CV_> cv(cv_);
|
||||
CCI ci Kinit(construct_cartesian_const_iterator_d_object);
|
||||
CC cc Kinit(compute_coordinate_d_object);
|
||||
CL cl Kinit(compare_lexicographically_d_object);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include <CGAL/boost/iterator/transform_iterator.hpp> // for Root_of functor
|
||||
#include <boost/operators.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/logical.hpp>
|
||||
|
||||
#include <CGAL/Interval_nt.h>
|
||||
|
|
@ -383,9 +382,9 @@ public :
|
|||
|
||||
// Also check that ET and AT are constructible from T?
|
||||
template<class T>
|
||||
Lazy_exact_nt (T i, std::enable_if_t<boost::mpl::and_<
|
||||
boost::mpl::or_<std::is_arithmetic<T>, std::is_enum<T> >,
|
||||
boost::mpl::not_<std::is_same<T,ET> > >::value,void*> = 0)
|
||||
Lazy_exact_nt (T i, std::enable_if_t<
|
||||
(std::is_arithmetic_v<T> || std::is_enum_v<T>) &&
|
||||
!std::is_same_v<T,ET>,void*> = 0)
|
||||
: Base(new Lazy_exact_Cst<ET,T>(i)) {}
|
||||
|
||||
Lazy_exact_nt (const ET & e)
|
||||
|
|
@ -1181,10 +1180,9 @@ struct Coercion_traits< Lazy_exact_nt<ET1>, Lazy_exact_nt<ET2> >
|
|||
static const bool interoperable \
|
||||
=std::is_same< Are_implicit_interoperable, Tag_false>::value; \
|
||||
public: \
|
||||
typedef typename boost::mpl::if_c <interoperable,Null_tag,NT> \
|
||||
::type Type; \
|
||||
typedef typename boost::mpl::if_c <interoperable, Null_functor, \
|
||||
INTERN_CT::Cast_from_to<NTX,NT> >::type Cast; \
|
||||
typedef std::conditional_t <interoperable,Null_tag,NT> Type; \
|
||||
typedef std::conditional_t <interoperable, Null_functor, \
|
||||
INTERN_CT::Cast_from_to<NTX,NT> > Cast; \
|
||||
}; \
|
||||
\
|
||||
template<class ET> \
|
||||
|
|
|
|||
|
|
@ -627,13 +627,13 @@ public:
|
|||
|
||||
};
|
||||
|
||||
typedef typename boost::mpl::if_c<
|
||||
!std::is_same< typename Algebraic_structure_traits<NT>::Sqrt,
|
||||
Null_functor >::value,
|
||||
typedef std::conditional_t<
|
||||
!std::is_same_v< typename Algebraic_structure_traits<NT>::Sqrt,
|
||||
Null_functor >,
|
||||
typename INTERN_QUOTIENT::Sqrt_selector< Type,
|
||||
Is_exact >::Sqrt,
|
||||
Null_functor
|
||||
>::type Sqrt;
|
||||
> Sqrt;
|
||||
|
||||
class Simplify
|
||||
: public CGAL::cpp98::unary_function< Type&, void > {
|
||||
|
|
|
|||
|
|
@ -204,10 +204,10 @@ public:
|
|||
typedef Sqrt_extension< COEFF_, ROOT_, ACDE_TAG,FP_TAG > Type;
|
||||
|
||||
// Tag_true if COEFF and ROOT are exact
|
||||
typedef typename ::boost::mpl::if_c<
|
||||
bool( ::std::is_same<typename CGAL::Algebraic_structure_traits<ROOT_ >::Is_exact,::CGAL::Tag_true>::value )&&
|
||||
bool( ::std::is_same<typename CGAL::Algebraic_structure_traits<COEFF_>::Is_exact,::CGAL::Tag_true>::value )
|
||||
,::CGAL::Tag_true,::CGAL::Tag_false>::type Is_exact;
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v<typename CGAL::Algebraic_structure_traits<ROOT_ >::Is_exact,::CGAL::Tag_true> &&
|
||||
std::is_same_v<typename CGAL::Algebraic_structure_traits<COEFF_>::Is_exact,::CGAL::Tag_true>
|
||||
,::CGAL::Tag_true,::CGAL::Tag_false> Is_exact;
|
||||
|
||||
typedef typename Algebraic_structure_traits<COEFF_>::Is_numerical_sensitive
|
||||
Is_numerical_sensitive;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ template <class A, class B> struct CT_ext_not_to_fwsqrt;
|
|||
//<EXT,ANY>
|
||||
template <class COEFF, class ROOT, class ACDE_TAG,class FP_TAG, class B>
|
||||
struct Coercion_traits_for_level<Sqrt_extension<COEFF, ROOT, ACDE_TAG,FP_TAG>, B , CTL_SQRT_EXT>
|
||||
:public ::boost::mpl::if_c<
|
||||
:public std::conditional_t<
|
||||
// if B is fwsqrt
|
||||
::boost::is_base_and_derived<
|
||||
Field_with_sqrt_tag,
|
||||
|
|
@ -192,7 +192,7 @@ typename Algebraic_structure_traits<B>::Algebraic_category >::value
|
|||
,
|
||||
//else take Intern::Coercion_traits not for fwsqrt
|
||||
INTERN_CT::CT_ext_not_to_fwsqrt< Sqrt_extension<COEFF,ROOT, ACDE_TAG,FP_TAG> ,B>
|
||||
>::type
|
||||
>
|
||||
{};
|
||||
|
||||
// <ANY,EXT>
|
||||
|
|
|
|||
|
|
@ -178,10 +178,10 @@ public:
|
|||
*/
|
||||
template <class NTX>
|
||||
explicit Sqrt_extension(const NTX& a, const NTX& b, const NTX& c, const bool is_smaller,
|
||||
std::enable_if_t< boost::mpl::and_<
|
||||
std::is_same< typename Fraction_traits<NT>::Numerator_type,NTX >,
|
||||
std::is_same< typename Fraction_traits<ROOT>::Numerator_type,NTX >
|
||||
>::value >* = 0 )
|
||||
std::enable_if_t<
|
||||
std::is_same_v< typename Fraction_traits<NT>::Numerator_type,NTX > &&
|
||||
std::is_same_v< typename Fraction_traits<ROOT>::Numerator_type,NTX >
|
||||
>* = 0 )
|
||||
{
|
||||
typename Fraction_traits<NT>::Compose compose_nt;
|
||||
typename Fraction_traits<ROOT>::Compose compose_root;
|
||||
|
|
|
|||
|
|
@ -435,10 +435,9 @@ public:
|
|||
boost::zip_iterator< boost::tuple<InputIterator_1, InputIterator_2> > last,
|
||||
bool is_large_point_set = true,
|
||||
std::enable_if_t <
|
||||
boost::mpl::and_ <
|
||||
std::is_convertible< typename std::iterator_traits<InputIterator_1>::value_type, Point >,
|
||||
std::is_convertible< typename std::iterator_traits<InputIterator_2>::value_type, typename internal::Info_check<typename Tds::Vertex>::type >
|
||||
>::value >* = nullptr)
|
||||
std::is_convertible_v< typename std::iterator_traits<InputIterator_1>::value_type, Point > &&
|
||||
std::is_convertible_v< typename std::iterator_traits<InputIterator_2>::value_type, typename internal::Info_check<typename Tds::Vertex>::type >
|
||||
>* = nullptr)
|
||||
{
|
||||
return insert_with_info< boost::tuple<Point, typename internal::Info_check<typename Tds::Vertex>::type> >(first, last, is_large_point_set);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#include <CGAL/license/Periodic_3_mesh_3.h>
|
||||
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
|
|
@ -47,9 +46,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
typedef typename boost::mpl::if_<boost::is_function<Function_>,
|
||||
typedef std::conditional_t<std::is_function_v<Function_>,
|
||||
Function_*,
|
||||
Function_>::type Stored_function;
|
||||
Function_> Stored_function;
|
||||
|
||||
/// Function to wrap
|
||||
Stored_function f_;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <CGAL/Periodic_3_mesh_triangulation_3.h>
|
||||
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -46,9 +45,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
typedef typename boost::mpl::if_<boost::is_function<Function_>,
|
||||
typedef std::conditional_t<std::is_function_v<Function_>,
|
||||
Function_*,
|
||||
Function_>::type Stored_function;
|
||||
Function_> Stored_function;
|
||||
|
||||
/// Function to wrap
|
||||
Stored_function f_;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <CGAL/spatial_sort.h>
|
||||
#include <CGAL/utility.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/property_map/function_property_map.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
/// \ingroup PkgPolygonMeshProcessingConcepts
|
||||
/// \cgalConcept
|
||||
///
|
||||
/// The concept `PMPAutorefinementVisitor` defines the requirements for the visitor
|
||||
/// used in `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` to track
|
||||
/// the creation of new triangles.
|
||||
///
|
||||
/// \cgalRefines{CopyConstructible}
|
||||
/// \cgalHasModelsBegin
|
||||
/// \cgalHasModels{CGAL::Polygon_mesh_processing::Autorefinement::Default_visitor}
|
||||
/// \cgalHasModelsEnd
|
||||
|
||||
class PMPAutorefinementVisitor{
|
||||
public:
|
||||
|
||||
/// @name Functions called only if at least one intersection has been found
|
||||
/// @{
|
||||
/// called when the final number of output triangles is known, `nbt` being the total number of triangles in the output.
|
||||
void number_of_output_triangles(std::size_t nbt);
|
||||
/// called for triangle with no intersection, `tgt_id` is the position in the triangle container after calling
|
||||
/// `autorefine_triangle_soup()`, while `src_id` was its position before calling the function.
|
||||
void verbatim_triangle_copy(std::size_t tgt_id, std::size_t src_id);
|
||||
/// called for each subtriangle created from a triangle with intersection, `tgt_id` is the position in the triangle container after calling
|
||||
/// `autorefine_triangle_soup()` of the subtriangle, while `src_id` was the position of the original support triangle before calling the function.
|
||||
void new_subtriangle(std::size_t tgt_id, std::size_t src_id);
|
||||
/// @}
|
||||
};
|
||||
|
|
@ -113,6 +113,8 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage.
|
|||
- `CGAL::Polygon_mesh_processing::surface_intersection()`
|
||||
- `CGAL::Polygon_mesh_processing::clip()`
|
||||
- `CGAL::Polygon_mesh_processing::split()`
|
||||
- `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()`
|
||||
- `CGAL::Polygon_mesh_processing::autorefine()`
|
||||
|
||||
\cgalCRPSection{Meshing Functions}
|
||||
- `CGAL::Polygon_mesh_processing::remesh_planar_patches()`
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ it can try to equalize the angles between incident edges, or (and) move vertices
|
|||
Border vertices are considered constrained and do not move at any step of the procedure. No vertices are inserted at any time.
|
||||
Angle and area smoothing algorithms are based on Surazhsky and Gotsman \cgalCite{cgal:sg-hqct-04}.
|
||||
Since area smoothing considers only areas as a smoothing criterion, it may result in long and skinny
|
||||
triangles. To paliate this phenomenon, area smoothing is followed by an (optional) step of Delaunay-based edge flips.
|
||||
triangles. To palliate this phenomenon, area smoothing is followed by an (optional) step of Delaunay-based edge flips.
|
||||
In any case, area smoothing is guaranteed to improve the spatial distribution of the vertices
|
||||
over the area that is being smoothed. A simple example can be found in \ref Polygon_mesh_processing/mesh_smoothing_example.cpp.
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ depicted in red); (iii) `clip_volume=true`: clipping of the volume bounded by th
|
|||
\cgalFigureEnd
|
||||
|
||||
\cgalFigureBegin{coref_clip_compact, clip_compact.png}
|
||||
Clipping a cube with a halfspace: compacity of the clipper (`clip_volume=false` in both cases).
|
||||
Clipping a cube with a halfspace: compactivity of the clipper (`clip_volume=false` in both cases).
|
||||
From left to right: (i) initial cube and the plane defining the clipping halfspace,
|
||||
note that a whole face of the cube (2 triangles) is exactly contained in the plane;
|
||||
(ii) `use_compact_clipper=true`: clipping of the surface mesh with a compact halfspace: coplanar faces are part of the output;
|
||||
|
|
@ -879,6 +879,19 @@ vertices at identical positions, can be used to repair this configuration.
|
|||
\section PMPGeometricRepair Geometric Repair
|
||||
****************************************
|
||||
|
||||
\subsection PMPAutoref Self-intersection Resolution (Autorefinement) in Triangle Soups
|
||||
Given a soup of triangles, a self-intersection is defined as the intersection of two triangles from the soup
|
||||
such that the intersection is not defined by the convex hull of one, two or three shared vertices.
|
||||
In other words, it is an intersection that happens in the interior of one of the two triangles, or in the interior
|
||||
of one their edges, except if identical points are associated to different vertices of the triangle soup which
|
||||
would then also includes overlaps of duplicated points.
|
||||
|
||||
The function `CGAL::Polygon_mesh_processing::autorefine_triangle_soup()` provides a way to refine a triangle soup
|
||||
using the intersections of the triangles from the soup. In particular, if some points are duplicated they will be
|
||||
merged. Note that if a kernel with exact predicates but inexact constructions is used, some new self-intersections
|
||||
might be introduced due to rounding issues of points coordinates.
|
||||
To guarantee that the triangle soup is free from self-intersections, a kernel with exact constructions must be used.
|
||||
|
||||
\subsection PMPRemoveCapsNeedles Removal of Almost Degenerate Triangle Faces
|
||||
Triangle faces of a mesh made up of almost collinear points are badly shaped elements that
|
||||
might not be desirable to have in a mesh. The function
|
||||
|
|
|
|||
|
|
@ -47,5 +47,6 @@
|
|||
\example Polygon_mesh_processing/remesh_planar_patches.cpp
|
||||
\example Polygon_mesh_processing/remesh_almost_planar_patches.cpp
|
||||
\example Polygon_mesh_processing/sample_example.cpp
|
||||
\example Polygon_mesh_processing/soup_autorefinement.cpp
|
||||
*/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ create_single_source_cgal_program("cc_compatible_orientations.cpp")
|
|||
create_single_source_cgal_program("hausdorff_distance_remeshing_example.cpp")
|
||||
create_single_source_cgal_program("hausdorff_bounded_error_distance_example.cpp")
|
||||
create_single_source_cgal_program("isotropic_remeshing_with_custom_sizing_example.cpp")
|
||||
create_single_source_cgal_program("triangle_mesh_autorefinement.cpp")
|
||||
create_single_source_cgal_program("soup_autorefinement.cpp")
|
||||
|
||||
find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater)
|
||||
include(CGAL_Eigen3_support)
|
||||
|
|
@ -133,6 +135,7 @@ if(TARGET CGAL::TBB_support)
|
|||
target_link_libraries(self_intersections_example PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(hausdorff_distance_remeshing_example PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(hausdorff_bounded_error_distance_example PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(soup_autorefinement PUBLIC CGAL::TBB_support)
|
||||
|
||||
create_single_source_cgal_program("corefinement_parallel_union_meshes.cpp")
|
||||
target_link_libraries(corefinement_parallel_union_meshes PUBLIC CGAL::TBB_support)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Polygon_mesh_processing/autorefinement.h>
|
||||
#include <CGAL/Polygon_mesh_processing/repair_polygon_soup.h>
|
||||
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
|
||||
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
|
||||
#include <CGAL/IO/polygon_soup_io.h>
|
||||
#include <CGAL/Real_timer.h>
|
||||
|
||||
#include <boost/container/small_vector.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
const std::string filename = argc == 1 ? CGAL::data_file_path("meshes/elephant.off")
|
||||
: std::string(argv[1]);
|
||||
|
||||
std::vector<Point> input_points;
|
||||
std::vector<boost::container::small_vector<std::size_t, 3>> input_triangles;
|
||||
CGAL::IO::read_polygon_soup(filename, input_points, input_triangles);
|
||||
PMP::repair_polygon_soup(input_points, input_triangles);
|
||||
PMP::triangulate_polygons(input_points, input_triangles);
|
||||
|
||||
CGAL::Real_timer t;
|
||||
t.start();
|
||||
PMP::autorefine_triangle_soup(input_points, input_triangles,
|
||||
CGAL::parameters::concurrency_tag(CGAL::Parallel_if_available_tag()));
|
||||
t.stop();
|
||||
std::cout << "#points = " << input_points.size() << " and #triangles = " << input_triangles.size() << " in " << t.time() << " sec." << std::endl;
|
||||
CGAL::IO::write_polygon_soup("autorefined.off", input_points, input_triangles, CGAL::parameters::stream_precision(17));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
|
||||
#include <CGAL/Polygon_mesh_processing/autorefinement.h>
|
||||
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_3 Point;
|
||||
|
||||
typedef CGAL::Surface_mesh<Point> Mesh;
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Mesh mesh;
|
||||
|
||||
const std::string filename = argc == 1 ? CGAL::data_file_path("meshes/elephant.off")
|
||||
: std::string(argv[1]);
|
||||
CGAL::IO::read_polygon_mesh(filename, mesh);
|
||||
|
||||
PMP::autorefine(mesh);
|
||||
|
||||
CGAL::IO::write_polygon_mesh("autorefined.off", mesh, CGAL::parameters::stream_precision(17));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -28,8 +28,8 @@ struct Non_manifold_feature_map
|
|||
typedef typename Graph_traits::halfedge_descriptor halfedge_descriptor;
|
||||
typedef dynamic_edge_property_t<std::size_t> Edge_to_id_tag;
|
||||
typedef dynamic_vertex_property_t<std::size_t> Vertex_to_id_tag;
|
||||
typedef typename boost::property_map<PolygonMesh, Edge_to_id_tag>::type Edge_to_nm_id;
|
||||
typedef typename boost::property_map<PolygonMesh, Vertex_to_id_tag>::type Vertex_to_nm_id;
|
||||
typedef typename boost::property_map<PolygonMesh, Edge_to_id_tag>::const_type Edge_to_nm_id;
|
||||
typedef typename boost::property_map<PolygonMesh, Vertex_to_id_tag>::const_type Vertex_to_nm_id;
|
||||
Edge_to_nm_id e_nm_id;
|
||||
Vertex_to_nm_id v_nm_id;
|
||||
std::vector< std::vector<edge_descriptor> > non_manifold_edges;
|
||||
|
|
@ -39,7 +39,7 @@ struct Non_manifold_feature_map
|
|||
{}
|
||||
|
||||
template <class Vpm>
|
||||
Non_manifold_feature_map(PolygonMesh& pm, Vpm vpm)
|
||||
Non_manifold_feature_map(const PolygonMesh& pm, Vpm vpm)
|
||||
: e_nm_id(get(Edge_to_id_tag(), pm))
|
||||
, v_nm_id(get(Vertex_to_id_tag(), pm))
|
||||
{
|
||||
|
|
@ -99,6 +99,14 @@ struct Non_manifold_feature_map
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
non_manifold_edges.clear();
|
||||
non_manifold_vertices.clear();
|
||||
e_nm_id = Edge_to_nm_id();
|
||||
v_nm_id = Vertex_to_nm_id();
|
||||
}
|
||||
};
|
||||
|
||||
} } // end of CGAL::Polygon_mesh_processing
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -27,7 +27,6 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
|
||||
#include <CGAL/Aff_transformation_3.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include <CGAL/Polygon_mesh_processing/orientation.h>
|
||||
#include <CGAL/property_map.h>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
|
@ -388,12 +387,12 @@ struct TweakedGetVertexPointMap
|
|||
typedef typename std::is_same<Point_3,
|
||||
typename boost::property_traits<Default_map>::value_type>::type Use_default_tag;
|
||||
|
||||
typedef typename boost::mpl::if_<
|
||||
Use_default_tag,
|
||||
typedef std::conditional_t<
|
||||
Use_default_tag::value,
|
||||
Default_map,
|
||||
Dummy_default_vertex_point_map<Point_3,
|
||||
typename boost::graph_traits<PolygonMesh>::vertex_descriptor >
|
||||
>::type type;
|
||||
> type;
|
||||
};
|
||||
|
||||
template <class PT, class NP, class PM>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
#include <CGAL/Side_of_triangle_mesh.h>
|
||||
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <exception>
|
||||
#include <iterator>
|
||||
|
|
@ -1427,18 +1426,16 @@ bool do_intersect(const TriangleMesh& tm,
|
|||
const Polyline& polyline,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, const std::enable_if_t<
|
||||
! boost::mpl::or_<
|
||||
typename std::is_same<TriangleMesh, Polyline>::type, // Added to please MSVC 2015
|
||||
typename boost::mpl::not_<typename boost::has_range_iterator<Polyline>::type>::type, // not a range
|
||||
typename boost::has_range_iterator<
|
||||
, const std::enable_if_t<!(
|
||||
std::is_same_v<TriangleMesh, Polyline> || // Added to please MSVC 2015
|
||||
!boost::has_range_iterator<Polyline>::value || // not a range
|
||||
boost::has_range_iterator<
|
||||
typename boost::mpl::eval_if<
|
||||
boost::has_range_iterator<Polyline>,
|
||||
boost::range_value<Polyline>,
|
||||
std::false_type
|
||||
>::type
|
||||
>::type // not a range of a range
|
||||
std::false_type>::type
|
||||
>::value
|
||||
)
|
||||
>* = 0
|
||||
#endif
|
||||
)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <CGAL/use.h>
|
||||
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <variant>
|
||||
|
||||
#include <array>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <CGAL/Polygon_mesh_processing/internal/Polygon_mesh_slicer/Axis_parallel_plane_traits.h>
|
||||
|
||||
#include <variant>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <CGAL/boost/graph/split_graph_into_polylines.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
|
|
@ -79,12 +78,12 @@ template<class TriangleMesh,
|
|||
class AABBTree = AABB_tree<
|
||||
AABB_traits<Traits,
|
||||
AABB_halfedge_graph_segment_primitive<TriangleMesh,
|
||||
typename boost::mpl::if_<
|
||||
typename std::is_same<
|
||||
std::conditional_t<
|
||||
std::is_same_v<
|
||||
VertexPointMap,
|
||||
typename boost::property_map< TriangleMesh, vertex_point_t>::type >::type,
|
||||
typename boost::property_map< TriangleMesh, vertex_point_t>::type >,
|
||||
Default,
|
||||
VertexPointMap>::type> > >,
|
||||
VertexPointMap>>>>,
|
||||
bool UseParallelPlaneOptimization=true>
|
||||
class Polygon_mesh_slicer
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ if(TARGET CGAL::TBB_support)
|
|||
target_link_libraries(test_pmp_distance PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(orient_polygon_soup_test PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(self_intersection_surface_mesh_test PUBLIC CGAL::TBB_support)
|
||||
target_link_libraries(test_autorefinement PUBLIC CGAL::TBB_support)
|
||||
else()
|
||||
message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
data-autoref/test_01.off 0 0 4 1 4 0
|
||||
data-autoref/test_02.off 1 5 13 1 5 0
|
||||
data-autoref/test_03.off 4 8 18 0 18 0
|
||||
data-autoref/test_04.off 1 5 17 0 17 0
|
||||
data-autoref/test_05.off 1 5 17 0 17 0
|
||||
data-autoref/test_06.off 3 55 141 1 76 0
|
||||
data-autoref/test_07.off 1 4 10 1 4 0
|
||||
data-autoref/test_08.off 1 31 87 1 52 0
|
||||
data-autoref/test_09.off 1 4 5 1 4 0
|
||||
data-autoref/test_10.off 1 3 13 0 13 0
|
||||
data-autoref/test_11.off 1 3 12 0 12 0
|
||||
data-autoref/test_12.off 2 2 11 1 11 0
|
||||
data-autoref/test_13.off 1 5 16 1 8 0
|
||||
data-autoref/test_14.off 1 5 16 1 12 0
|
||||
data-autoref/test_15.off 3 8 16 1 12 0
|
||||
data-autoref/test_16.off 1 2 6 1 4 0
|
||||
data-autoref/test_17.off 1 2 6 1 4 0
|
||||
data-autoref/triple_inter_exception/triple.off 0 0 0 0 0 1
|
||||
data-autoref/triple_inter_exception/cubes_cpln_1.off 0 0 0 0 0 1
|
||||
data-autoref/triple_inter_exception/cubes_cpln_2.off 0 0 0 0 0 1
|
||||
data-autoref/triple_inter_exception/cubes_cpln_3.off 0 0 0 0 0 1
|
||||
data-autoref/open_01.off 1 65 1377 1 1313 0
|
||||
data-autoref/open_02.off 1 33 595 1 562 0
|
||||
data-autoref/cpln_01.off 18 42 48 1 30 0
|
||||
data-autoref/cpln_02.off 28 56 40 1 24 0
|
||||
data-autoref/cpln_03.off 15 35 42 1 27 0
|
||||
data-autoref/four_cubes.off 12 94 184 1 78 0
|
||||
data-autoref/spiral.off 7 14 26 0 26 0
|
||||
data-autoref/test_01.off 0 0 4 1 4 0 4 2
|
||||
data-autoref/test_02.off 1 5 13 1 5 0 10 17
|
||||
data-autoref/test_03.off 4 8 18 0 18 0 14 20
|
||||
data-autoref/test_04.off 1 5 17 0 17 0 13 20
|
||||
data-autoref/test_05.off 1 5 17 0 17 0 13 20
|
||||
data-autoref/test_06.off 3 55 141 1 76 0 92 248
|
||||
data-autoref/test_07.off 1 4 10 1 4 0 8 12
|
||||
data-autoref/test_08.off 1 31 87 1 52 0 57 148
|
||||
data-autoref/test_09.off 1 4 5 1 4 0 4 4
|
||||
data-autoref/test_10.off 1 3 13 0 13 0 10 13
|
||||
data-autoref/test_11.off 1 3 12 0 12 0 9 12
|
||||
data-autoref/test_12.off 2 2 11 1 11 0 9 6
|
||||
data-autoref/test_13.off 1 5 16 1 8 0 16 22
|
||||
data-autoref/test_14.off 1 5 16 1 12 0 16 22
|
||||
data-autoref/test_15.off 3 8 16 1 12 0 16 24
|
||||
data-autoref/test_16.off 1 2 6 1 4 0 6 2
|
||||
data-autoref/test_17.off 1 2 6 1 4 0 6 2
|
||||
data-autoref/triple_inter_exception/triple.off 0 0 0 0 0 1 15 18
|
||||
data-autoref/triple_inter_exception/cubes_cpln_1.off 0 0 0 0 0 1 66 224
|
||||
data-autoref/triple_inter_exception/cubes_cpln_2.off 0 0 0 0 0 1 54 196
|
||||
data-autoref/triple_inter_exception/cubes_cpln_3.off 0 0 0 0 0 1 61 204
|
||||
data-autoref/open_01.off 1 65 1377 1 1313 0 1317 2622
|
||||
data-autoref/open_02.off 1 33 595 1 562 0 565 1056
|
||||
data-autoref/cpln_01.off 18 42 48 1 30 0 30 88
|
||||
data-autoref/cpln_02.off 28 56 40 1 24 0 24 72
|
||||
data-autoref/cpln_03.off 15 35 42 1 27 0 27 76
|
||||
data-autoref/four_cubes.off 12 94 184 1 78 0 106 352
|
||||
data-autoref/spiral.off 7 14 26 0 26 0 19 31
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
#include <CGAL/Polygon_mesh_processing/intersection.h>
|
||||
#include <CGAL/Polygon_mesh_processing/corefinement.h>
|
||||
#include <CGAL/Polygon_mesh_processing/autorefinement.h>
|
||||
#include <CGAL/Polygon_mesh_processing/self_intersections.h>
|
||||
|
||||
#include <CGAL/IO/polygon_soup_io.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
|
@ -13,23 +17,64 @@ typedef CGAL::Surface_mesh<K::Point_3> Mesh;
|
|||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
template <class TriangleMesh>
|
||||
struct My_visitor :
|
||||
struct My_exp_visitor :
|
||||
public CGAL::Polygon_mesh_processing::Corefinement::Default_visitor<TriangleMesh>
|
||||
{
|
||||
void after_subface_creations(TriangleMesh&){++(*i);}
|
||||
|
||||
My_visitor()
|
||||
My_exp_visitor()
|
||||
: i (new int(0) )
|
||||
{}
|
||||
|
||||
std::shared_ptr<int> i;
|
||||
};
|
||||
|
||||
void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_points,
|
||||
struct My_visitor
|
||||
{
|
||||
My_visitor(std::size_t nb_input, std::size_t expected_nb_output)
|
||||
: nb_input(nb_input)
|
||||
, expected_nb_output(expected_nb_output)
|
||||
{}
|
||||
|
||||
~My_visitor()
|
||||
{
|
||||
for(std::size_t i=0; i<tgt_check.size(); ++i)
|
||||
{
|
||||
assert( tgt_check[i]==1 );
|
||||
}
|
||||
}
|
||||
void number_of_output_triangles(std::size_t nbt)
|
||||
{
|
||||
tgt_check.assign(expected_nb_output, 0);
|
||||
assert(nbt==expected_nb_output);
|
||||
}
|
||||
|
||||
void verbatim_triangle_copy(std::size_t tgt_id, std::size_t src_id)
|
||||
{
|
||||
assert(src_id<nb_input);
|
||||
assert(tgt_id<expected_nb_output);
|
||||
assert(tgt_check.size()==expected_nb_output && tgt_check[tgt_id]==0);
|
||||
tgt_check[tgt_id]=1;
|
||||
}
|
||||
|
||||
void new_subtriangle(std::size_t tgt_id, std::size_t src_id)
|
||||
{
|
||||
assert(src_id<nb_input);
|
||||
assert(tgt_id<expected_nb_output);
|
||||
assert(tgt_check.size()==expected_nb_output && tgt_check[tgt_id]==0);
|
||||
tgt_check[tgt_id]=1;
|
||||
}
|
||||
|
||||
std::size_t nb_input;
|
||||
std::size_t expected_nb_output;
|
||||
std::vector<int> tgt_check;
|
||||
};
|
||||
|
||||
void test_coref_based(const char* fname, std::size_t nb_polylines, std::size_t total_nb_points,
|
||||
std::size_t nb_vertices_after_autorefine, bool all_fixed, std::size_t nb_vertices_after_fix,
|
||||
bool triple_intersection)
|
||||
{
|
||||
std::cout << "Running tests on " << fname << "\n";
|
||||
std::cout << "Running tests (coref based) on " << fname << "\n";
|
||||
std::ifstream input(fname);
|
||||
|
||||
Mesh mesh;
|
||||
|
|
@ -41,7 +86,7 @@ void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_poin
|
|||
input.close();
|
||||
std::size_t nb_vertices_before_autorefine = num_vertices(mesh);
|
||||
|
||||
// Testing surface_self_intersection()
|
||||
// Testing PMP::experimental::surface_self_intersection()
|
||||
try{
|
||||
std::vector< std::vector<K::Point_3> >polylines;
|
||||
PMP::experimental::surface_self_intersection(mesh, std::back_inserter(polylines));
|
||||
|
|
@ -57,9 +102,9 @@ void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_poin
|
|||
assert( triple_intersection );
|
||||
}
|
||||
|
||||
// Testing autorefine()
|
||||
// Testing PMP::experimental::autorefine()
|
||||
try{
|
||||
My_visitor<Mesh> visitor;
|
||||
My_exp_visitor<Mesh> visitor;
|
||||
PMP::experimental::autorefine(mesh,
|
||||
CGAL::parameters::visitor(visitor));
|
||||
mesh.collect_garbage();
|
||||
|
|
@ -72,7 +117,7 @@ void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_poin
|
|||
assert( triple_intersection );
|
||||
}
|
||||
|
||||
// Testing autorefine_and_remove_self_intersections()
|
||||
// Testing PMP::experimental::autorefine_and_remove_self_intersections()
|
||||
try{
|
||||
input.open(fname);
|
||||
mesh.clear();
|
||||
|
|
@ -89,10 +134,42 @@ void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_poin
|
|||
}
|
||||
}
|
||||
|
||||
template <class Tag>
|
||||
void test(const char* fname, std::size_t nb_vertices_after_autorefine, std::size_t expected_nb_output, Tag tag)
|
||||
{
|
||||
std::cout << "Running tests on " << fname;
|
||||
if (std::is_same_v<Tag, CGAL::Sequential_tag>)
|
||||
std::cout << " (Sequential)\n";
|
||||
else
|
||||
std::cout << " (Parallel)\n";
|
||||
|
||||
std::vector<K::Point_3> points;
|
||||
std::vector< std::vector<std::size_t> > triangles;
|
||||
if (!CGAL::IO::read_polygon_soup(fname, points, triangles))
|
||||
{
|
||||
std::cerr << " Input mesh is not a valid file." << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Testing autorefine()
|
||||
My_visitor visitor(triangles.size(), expected_nb_output);
|
||||
PMP::autorefine_triangle_soup(points, triangles, CGAL::parameters::visitor(visitor).concurrency_tag(tag));
|
||||
assert( nb_vertices_after_autorefine==points.size());
|
||||
assert( expected_nb_output==triangles.size());
|
||||
assert( !PMP::does_triangle_soup_self_intersect(points, triangles) );
|
||||
// CGAL::IO::write_polygon_soup("/tmp/debug.off", points, triangles);
|
||||
}
|
||||
|
||||
int main(int argc, const char** argv)
|
||||
{
|
||||
// file nb_polylines total_nb_points nb_vertices_after_autorefine all_fixed nb_vertices_after_fix triple_intersection
|
||||
for (int i=0;i<(argc-1)/7; ++i)
|
||||
test(argv[1+7*i], atoi(argv[1+7*i+1]), atoi(argv[1+7*i+2]),
|
||||
atoi(argv[1+7*i+3]), atoi(argv[1+7*i+4])==0?false:true, atoi(argv[1+7*i+5]), atoi(argv[1+7*i+6])==0?false:true);
|
||||
for (int i=0;i<(argc-1)/9; ++i)
|
||||
{
|
||||
test_coref_based(argv[1+9*i], atoi(argv[1+9*i+1]), atoi(argv[1+9*i+2]),
|
||||
atoi(argv[1+9*i+3]), atoi(argv[1+9*i+4])==0?false:true, atoi(argv[1+9*i+5]), atoi(argv[1+9*i+6])==0?false:true);
|
||||
test(argv[1+9*i], atoi(argv[1+9*i+7]), atoi(argv[1+9*i+8]), CGAL::Sequential_tag());
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
test(argv[1+9*i], atoi(argv[1+9*i+7]), atoi(argv[1+9*i+8]), CGAL::Parallel_tag());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,12 +614,20 @@ endPointSet(const QMatrix4x4& transform_matrix)
|
|||
Point_set* new_ps = new_item->point_set();
|
||||
CGAL::qglviewer::Vec c = aff_transformed_item->center();
|
||||
|
||||
QMatrix3x3 normal_matrix = transform_matrix.normalMatrix();
|
||||
|
||||
for(Point_set::Index idx : *new_ps)
|
||||
{
|
||||
QVector3D vec = transform_matrix.map(QVector3D(new_ps->point(idx).x() - c.x,
|
||||
new_ps->point(idx).y() - c.y,
|
||||
new_ps->point(idx).z() - c.z));
|
||||
new_ps->point(idx) = Kernel::Point_3(vec.x(), vec.y(), vec.z());
|
||||
if (new_ps->has_normal_map()) {
|
||||
QVector3D n(new_ps->normal(idx).x(), new_ps->normal(idx).y(), new_ps->normal(idx).z());
|
||||
new_ps->normal(idx) = Kernel::Vector_3(normal_matrix(0, 0) * n[0] + normal_matrix(0, 1) * n[1] + normal_matrix(0, 2) * n[2],
|
||||
normal_matrix(1, 0) * n[0] + normal_matrix(1, 1) * n[1] + normal_matrix(1, 2) * n[2],
|
||||
normal_matrix(2, 0) * n[0] + normal_matrix(2, 1) * n[1] + normal_matrix(2, 2) * n[2]);
|
||||
}
|
||||
}
|
||||
|
||||
new_item->setName(aff_transformed_item->name());
|
||||
|
|
|
|||
|
|
@ -133,7 +133,11 @@ target_link_libraries(
|
|||
|
||||
qt6_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui SelfSnapDialog.ui)
|
||||
polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin ${repairUI_FILES} KEYWORDS PMP)
|
||||
target_link_libraries(repair_polyhedron_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item)
|
||||
target_link_libraries(repair_polyhedron_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_polygon_soup_item)
|
||||
if(TARGET CGAL::TBB_support)
|
||||
target_link_libraries(repair_polyhedron_plugin PUBLIC CGAL::TBB_support)
|
||||
endif()
|
||||
|
||||
|
||||
if(TARGET CGAL::Eigen3_support)
|
||||
qt6_wrap_ui(isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <QtCore/qglobal.h>
|
||||
|
||||
#include "Scene_surface_mesh_item.h"
|
||||
#include "Scene_polygon_soup_item.h"
|
||||
#include "Scene_points_with_normal_item.h"
|
||||
#include <CGAL/Three/Scene_interface.h>
|
||||
#include <CGAL/Three/Polyhedron_demo_plugin_interface.h>
|
||||
|
|
@ -19,6 +20,8 @@
|
|||
#include <CGAL/Polygon_mesh_processing/repair_degeneracies.h>
|
||||
#include <CGAL/Polygon_mesh_processing/merge_border_vertices.h>
|
||||
#include <CGAL/Polygon_mesh_processing/internal/Snapping/snap.h>
|
||||
#include <CGAL/Polygon_mesh_processing/autorefinement.h>
|
||||
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
|
||||
|
||||
#include "ui_RemoveNeedlesDialog.h"
|
||||
#include "ui_SelfSnapDialog.h"
|
||||
|
|
@ -52,8 +55,9 @@ public:
|
|||
actionDuplicateNMVertices = new QAction(tr("Duplicate Non-Manifold Vertices"), mw);
|
||||
actionExtractNMVertices = new QAction(tr("Extract Non-Manifold Vertices"), mw);
|
||||
actionMergeDuplicatedVerticesOnBoundaryCycles = new QAction(tr("Merge Duplicated Vertices on Boundary Cycles"), mw);
|
||||
actionAutorefine = new QAction(tr("Autorefine Mesh"), mw);
|
||||
actionAutorefineAndRMSelfIntersections = new QAction(tr("Autorefine and Remove Self-Intersections"), mw);
|
||||
actionAutorefine = new QAction(tr("Autorefine Mesh (Deprecated)"), mw);
|
||||
actionNewAutorefine = new QAction(tr("Autorefine"), mw);
|
||||
actionAutorefineAndRMSelfIntersections = new QAction(tr("Autorefine and Remove Self-Intersections (Deprecated)"), mw);
|
||||
actionRemoveNeedlesAndCaps = new QAction(tr("Remove Needles And Caps"));
|
||||
actionSnapBorders = new QAction(tr("Snap Boundaries"));
|
||||
|
||||
|
|
@ -65,6 +69,7 @@ public:
|
|||
actionExtractNMVertices->setObjectName("actionExtractNMVertices");
|
||||
actionMergeDuplicatedVerticesOnBoundaryCycles->setObjectName("actionMergeDuplicatedVerticesOnBoundaryCycles");
|
||||
actionAutorefine->setObjectName("actionAutorefine");
|
||||
actionNewAutorefine->setObjectName("actionNewAutorefine");
|
||||
actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections");
|
||||
actionRemoveNeedlesAndCaps->setObjectName("actionRemoveNeedlesAndCaps");
|
||||
actionSnapBorders->setObjectName("actionSnapBorders");
|
||||
|
|
@ -77,6 +82,7 @@ public:
|
|||
actionExtractNMVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair");
|
||||
actionMergeDuplicatedVerticesOnBoundaryCycles->setProperty("subMenuName", "Polygon Mesh Processing/Repair");
|
||||
actionAutorefine->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
|
||||
actionNewAutorefine->setProperty("subMenuName", "Polygon Mesh Processing/Repair");
|
||||
actionAutorefineAndRMSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
|
||||
actionSnapBorders->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
|
||||
|
||||
|
|
@ -93,16 +99,29 @@ public:
|
|||
<< actionExtractNMVertices
|
||||
<< actionMergeDuplicatedVerticesOnBoundaryCycles
|
||||
<< actionAutorefine
|
||||
<< actionNewAutorefine
|
||||
<< actionAutorefineAndRMSelfIntersections
|
||||
<< actionRemoveNeedlesAndCaps
|
||||
<< actionSnapBorders;
|
||||
}
|
||||
|
||||
bool applicable(QAction*) const
|
||||
bool applicable(QAction* action) const
|
||||
{
|
||||
if (action!=actionNewAutorefine)
|
||||
{
|
||||
int item_id = scene->mainSelectionIndex();
|
||||
return qobject_cast<Scene_surface_mesh_item*>(scene->item(item_id));
|
||||
}
|
||||
for (Scene_interface::Item_id index : scene->selectionIndices())
|
||||
{
|
||||
if (qobject_cast<Scene_surface_mesh_item*>(scene->item(index)))
|
||||
return true;
|
||||
if (qobject_cast<Scene_polygon_soup_item*>(scene->item(index)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Item>
|
||||
void on_actionRemoveIsolatedVertices_triggered(Scene_interface::Item_id index);
|
||||
template <typename Item>
|
||||
|
|
@ -120,6 +139,8 @@ public:
|
|||
template <typename Item>
|
||||
void on_actionAutorefine_triggered(Scene_interface::Item_id index);
|
||||
template <typename Item>
|
||||
void on_actionNewAutorefine_triggered(const std::vector<Scene_interface::Item_id>& indices);
|
||||
template <typename Item>
|
||||
void on_actionAutorefineAndRMSelfIntersections_triggered(Scene_interface::Item_id index);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
|
@ -131,6 +152,7 @@ public Q_SLOTS:
|
|||
void on_actionExtractNMVertices_triggered();
|
||||
void on_actionMergeDuplicatedVerticesOnBoundaryCycles_triggered();
|
||||
void on_actionAutorefine_triggered();
|
||||
void on_actionNewAutorefine_triggered();
|
||||
void on_actionAutorefineAndRMSelfIntersections_triggered();
|
||||
void on_actionRemoveNeedlesAndCaps_triggered();
|
||||
void on_actionSnapBorders_triggered();
|
||||
|
|
@ -144,6 +166,7 @@ private:
|
|||
QAction* actionExtractNMVertices;
|
||||
QAction* actionMergeDuplicatedVerticesOnBoundaryCycles;
|
||||
QAction* actionAutorefine;
|
||||
QAction* actionNewAutorefine;
|
||||
QAction* actionAutorefineAndRMSelfIntersections;
|
||||
QAction* actionRemoveNeedlesAndCaps;
|
||||
QAction* actionSnapBorders;
|
||||
|
|
@ -421,6 +444,78 @@ void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefine_triggered()
|
|||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
template <typename Item>
|
||||
void Polyhedron_demo_repair_polyhedron_plugin::on_actionNewAutorefine_triggered(const std::vector<Scene_interface::Item_id>& indices)
|
||||
{
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
Polygon_soup::Points points;
|
||||
Polygon_soup::Polygons polygons;
|
||||
|
||||
if (indices.size()==1)
|
||||
{
|
||||
if (Scene_surface_mesh_item* smi_ptr = qobject_cast<Scene_surface_mesh_item*>(scene->item(indices[0])))
|
||||
PMP::polygon_mesh_to_polygon_soup(*smi_ptr->polyhedron(), points, polygons);
|
||||
else if (Scene_polygon_soup_item* spi_ptr = qobject_cast<Scene_polygon_soup_item*>(scene->item(indices[0])))
|
||||
{
|
||||
points = spi_ptr->points();
|
||||
polygons = spi_ptr->polygons();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Scene_interface::Item_id id : indices)
|
||||
{
|
||||
Polygon_soup::Points l_points;
|
||||
Polygon_soup::Polygons l_polygons;
|
||||
|
||||
if (Scene_surface_mesh_item* smi_ptr = qobject_cast<Scene_surface_mesh_item*>(scene->item(id)))
|
||||
PMP::polygon_mesh_to_polygon_soup(*smi_ptr->polyhedron(), l_points, l_polygons);
|
||||
else if (Scene_polygon_soup_item* spi_ptr = qobject_cast<Scene_polygon_soup_item*>(scene->item(id)))
|
||||
{
|
||||
l_points = spi_ptr->points();
|
||||
l_polygons = spi_ptr->polygons();
|
||||
}
|
||||
std::size_t offset=points.size();
|
||||
points.insert(points.end(), l_points.begin(), l_points.end());
|
||||
std::size_t psize=polygons.size();
|
||||
polygons.insert(polygons.end(), l_polygons.begin(), l_polygons.end());
|
||||
for (std::size_t i=psize; i<polygons.size(); ++i)
|
||||
for(std::size_t& id : polygons[i])
|
||||
id+=offset;
|
||||
}
|
||||
}
|
||||
|
||||
PMP::triangulate_polygons(points, polygons);
|
||||
PMP::autorefine_triangle_soup(points, polygons,
|
||||
CGAL::parameters::concurrency_tag(CGAL::Parallel_if_available_tag()));
|
||||
|
||||
Scene_polygon_soup_item* new_item = new Scene_polygon_soup_item();
|
||||
new_item->load(points, polygons);
|
||||
QString name = scene->item(indices[0])->name();
|
||||
for (std::size_t k=1; k<indices.size(); ++k)
|
||||
name += " + " + scene->item(indices[k])->name();
|
||||
new_item->setName(name+" autorefined");
|
||||
|
||||
scene->addItem(new_item);
|
||||
new_item->invalidateOpenGLBuffers();
|
||||
Q_EMIT new_item->itemChanged();
|
||||
}
|
||||
|
||||
void Polyhedron_demo_repair_polyhedron_plugin::on_actionNewAutorefine_triggered()
|
||||
{
|
||||
std::vector<Scene_interface::Item_id> indices;
|
||||
for (Scene_interface::Item_id index : scene->selectionIndices())
|
||||
{
|
||||
if (qobject_cast<Scene_surface_mesh_item*>(scene->item(index)))
|
||||
indices.push_back(index);
|
||||
else if (qobject_cast<Scene_polygon_soup_item*>(scene->item(index)))
|
||||
indices.push_back(index);
|
||||
}
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
on_actionNewAutorefine_triggered<Scene_surface_mesh_item>(indices);
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
template <typename Item>
|
||||
void Polyhedron_demo_repair_polyhedron_plugin::on_actionAutorefineAndRMSelfIntersections_triggered(Scene_interface::Item_id index)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Handle_with_policy.h>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <CGAL/Flattening_iterator.h>
|
||||
|
||||
#include <CGAL/Exponent_vector.h>
|
||||
|
|
|
|||
|
|
@ -486,9 +486,9 @@ public:
|
|||
// and NT would be changed by NTX
|
||||
typedef typename Fraction_traits<NTX>::Is_fraction Is_fraction;
|
||||
typedef typename Coercion_traits<NT,NTX>::Type Type;
|
||||
typedef typename ::boost::mpl::if_c<
|
||||
::std::is_same<Type,NT>::value, Is_fraction, CGAL::Tag_false
|
||||
>::type If_decomposable_AND_Type_equals_NT;
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v<Type,NT>, Is_fraction, CGAL::Tag_false
|
||||
> If_decomposable_AND_Type_equals_NT;
|
||||
|
||||
return sign_at_(x,If_decomposable_AND_Type_equals_NT());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ public:
|
|||
|
||||
// Sign_at, Sign_at_homogeneous, Compare
|
||||
// define XXX_ even though ICoeff may not be Real_embeddable
|
||||
// select propoer XXX among XXX_ or Null_functor using ::boost::mpl::if_
|
||||
// select propoer XXX among XXX_ or Null_functor using ::std::conditional_t
|
||||
private:
|
||||
struct Sign_at_ {
|
||||
private:
|
||||
|
|
@ -1036,8 +1036,8 @@ private:
|
|||
typedef Real_embeddable_traits<Innermost_coefficient_type> RET_IC;
|
||||
typedef typename RET_IC::Is_real_embeddable IC_is_real_embeddable;
|
||||
public:
|
||||
typedef typename ::boost::mpl::if_<IC_is_real_embeddable,Sign_at_,Null_functor>::type Sign_at;
|
||||
typedef typename ::boost::mpl::if_<IC_is_real_embeddable,Sign_at_homogeneous_,Null_functor>::type Sign_at_homogeneous;
|
||||
typedef std::conditional_t<IC_is_real_embeddable::value,Sign_at_,Null_functor> Sign_at;
|
||||
typedef std::conditional_t<IC_is_real_embeddable::value,Sign_at_homogeneous_,Null_functor> Sign_at_homogeneous;
|
||||
typedef typename Real_embeddable_traits<Polynomial_d>::Compare Compare;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include <CGAL/property_map.h>
|
||||
|
||||
#include <memory>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
@ -127,9 +126,9 @@ struct Dynamic_with_index
|
|||
{
|
||||
typedef Key key_type;
|
||||
typedef Value value_type;
|
||||
typedef typename boost::mpl::if_< std::is_same<bool, Value>,
|
||||
typedef std::conditional_t< std::is_same_v<bool, Value>,
|
||||
value_type,
|
||||
value_type&>::type reference;
|
||||
value_type&> reference;
|
||||
typedef boost::read_write_property_map_tag category;
|
||||
|
||||
Dynamic_with_index()
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ struct Boolean_property_map
|
|||
return pm.set_ptr->count(k) != 0;
|
||||
}
|
||||
|
||||
friend void put(Boolean_property_map<Set>& pm, const key_type& k, bool v)
|
||||
friend void put(Boolean_property_map<Set> pm, const key_type& k, bool v)
|
||||
{
|
||||
CGAL_assertion(pm.set_ptr!=nullptr);
|
||||
if (v)
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ bool process(const std::string& filename,
|
|||
{
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using CGAL::check_tag;
|
||||
|
||||
// extract verbosity:
|
||||
const int verbosity = options.find("Verbosity")->second;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include <boost/bimap/multiset_of.hpp>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/IO/io.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
// An STL like container with the following properties :
|
||||
// - to achieve compactness, it requires access to a pointer stored in T,
|
||||
// specified by a traits. This pointer is supposed to be 4 bytes aligned
|
||||
|
|
@ -866,10 +864,10 @@ namespace internal {
|
|||
typedef typename DSC::value_type value_type;
|
||||
typedef typename DSC::size_type size_type;
|
||||
typedef typename DSC::difference_type difference_type;
|
||||
typedef typename boost::mpl::if_c< Const, const value_type*,
|
||||
value_type*>::type pointer;
|
||||
typedef typename boost::mpl::if_c< Const, const value_type&,
|
||||
value_type&>::type reference;
|
||||
typedef std::conditional_t< Const, const value_type*,
|
||||
value_type*> pointer;
|
||||
typedef std::conditional_t< Const, const value_type&,
|
||||
value_type&> reference;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
// the initialization with nullptr is required by our Handle concept.
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@
|
|||
#include <tbb/enumerable_thread_specific.h>
|
||||
#include <tbb/queuing_mutex.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
#define CGAL_GENERATE_MEMBER_DETECTOR(X) \
|
||||
|
|
|
|||
|
|
@ -38,10 +38,8 @@ void resize(Container& c, std::size_t size,
|
|||
// Container without a resize() function, but with a size() function (e.g. an array)
|
||||
template <class Container>
|
||||
void resize(Container& CGAL_assertion_code(array), std::size_t CGAL_assertion_code(size),
|
||||
std::enable_if_t<
|
||||
boost::mpl::and_<
|
||||
boost::mpl::not_<has_resize<Container> >,
|
||||
has_size<Container> >::value >* = nullptr)
|
||||
std::enable_if_t<!has_resize<Container>::value &&
|
||||
has_size<Container>::value >* = nullptr)
|
||||
{
|
||||
CGAL_assertion(array.size() == size);
|
||||
}
|
||||
|
|
@ -50,8 +48,8 @@ void resize(Container& CGAL_assertion_code(array), std::size_t CGAL_assertion_co
|
|||
template <class Container>
|
||||
void resize(Container&, std::size_t,
|
||||
std::enable_if_t<
|
||||
!boost::mpl::or_<has_resize<Container>,
|
||||
has_size<Container> >::value >* = nullptr)
|
||||
!(has_resize<Container>::value ||
|
||||
has_size<Container>::value)>* = nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/use.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#ifdef CGAL_USE_LEDA
|
||||
|
|
@ -728,10 +726,10 @@ public:
|
|||
static Bind bind;
|
||||
|
||||
// Define type that is used for function matching
|
||||
typedef typename ::boost::mpl::if_c<
|
||||
typedef std::conditional_t<
|
||||
is_class_hierarchy,
|
||||
::CGAL::Tag_true,
|
||||
::CGAL::Tag_false >::type
|
||||
::CGAL::Tag_false >
|
||||
Class_hierarchy;
|
||||
|
||||
//! the internal representation, i.e., \c T plus a reference count
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include <CGAL/tags.h>
|
||||
#include <CGAL/STL_Extension/internal/mesh_option_classes.h>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
|
@ -143,14 +142,14 @@ struct Lookup_named_param_def
|
|||
typedef typename internal_np::Get_param<typename NP::base, Query_tag>::type NP_type;
|
||||
typedef typename internal_np::Get_param<typename NP::base, Query_tag>::reference NP_reference;
|
||||
|
||||
typedef typename boost::mpl::if_<
|
||||
std::is_same<NP_type, internal_np::Param_not_found>,
|
||||
D, NP_type>::type
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v<NP_type, internal_np::Param_not_found>,
|
||||
D, NP_type>
|
||||
type;
|
||||
|
||||
typedef typename boost::mpl::if_<
|
||||
std::is_same<NP_reference, internal_np::Param_not_found>,
|
||||
D&, NP_reference>::type
|
||||
typedef std::conditional_t<
|
||||
std::is_same_v<NP_reference, internal_np::Param_not_found>,
|
||||
D&, NP_reference>
|
||||
reference;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ CGAL_add_named_parameter(implementation_tag_t, implementation_tag, implementatio
|
|||
CGAL_add_named_parameter(prevent_unselection_t, prevent_unselection, prevent_unselection)
|
||||
|
||||
CGAL_add_named_parameter(verbose_t, verbose, verbose)
|
||||
CGAL_add_named_parameter(concurrency_tag_t, concurrency_tag, concurrency_tag)
|
||||
|
||||
// List of named parameters used for IO
|
||||
CGAL_add_named_parameter(vertex_normal_output_iterator_t, vertex_normal_output_iterator, vertex_normal_output_iterator)
|
||||
|
|
|
|||
|
|
@ -19,26 +19,13 @@
|
|||
#define CGAL_TAGS_H
|
||||
|
||||
#include <CGAL/IO/io_tags.h>
|
||||
#include <boost/mpl/integral_c.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
struct Void {};
|
||||
|
||||
// Boolean_tag<bool> is a model of the Boost Integral Constant concept.
|
||||
// https://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html
|
||||
template <bool b>
|
||||
struct Boolean_tag {
|
||||
typedef boost::mpl::integral_c_tag tag;
|
||||
typedef bool value_type;
|
||||
static const bool value = b;
|
||||
typedef Boolean_tag<b> type;
|
||||
operator bool() const { return this->value; }
|
||||
};
|
||||
/* In C++11, try:
|
||||
template <bool b>
|
||||
using Boolean_tag = std::integral_constant<bool, b>;
|
||||
*/
|
||||
using Boolean_tag = std::bool_constant<b>;
|
||||
|
||||
typedef Boolean_tag<true> Tag_true;
|
||||
typedef Boolean_tag<false> Tag_false;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue