Skip to content
Merged
Show file tree
Hide file tree
Changes from 131 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
ff86d69
Replace box_intersection per AABB_tree in self_intersection.h and opt…
LeoValque Aug 27, 2026
0c035ca
Solved compile error in debug
LeoValque Aug 27, 2026
348e9c1
Parallellisation of fukter intersection of corefinement
LeoValque Aug 27, 2026
a67586d
Correct build error with CGALlab
LeoValque Aug 31, 2026
b12ecda
Use combine orientation computation to improve running time
LeoValque Aug 31, 2026
3afc093
Simple parallellization of conncted components in corefinement
LeoValque Aug 31, 2026
03e7749
add ConcurrencyTag to face_graph_output_builder
LeoValque Aug 31, 2026
ae886f2
Clean import polyline and fill tm2_to_output_vertices
LeoValque Aug 31, 2026
a87f92f
Clean unused lines
LeoValque Sep 2, 2026
94951c7
interior_vertices of patch is now a vector (instead of a set) and all…
LeoValque Sep 2, 2026
300e199
Replace unordered_map per property_map
LeoValque Sep 4, 2026
65e6338
Solved a bug where shared edges are not correctly linked to their new…
LeoValque Sep 7, 2026
1f9c17e
Solved a bug where shared edges are not correctly linked to their new…
LeoValque Sep 7, 2026
66995f0
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Sep 7, 2026
05ef55f
Remove left over
LeoValque Sep 7, 2026
315c580
Add postprocess of borders and correct a bug when borders are parts o…
LeoValque Sep 7, 2026
08b49de
Clean warnings and compilation error in debug
LeoValque Sep 9, 2026
13bd6af
Rewrite filter_intersections to consider differents callbacks
LeoValque Sep 9, 2026
cb42271
ConcurrencyTag in rebase and clean Callback in intersections_impl
LeoValque Sep 10, 2026
56f665f
Considered non_manifold_feature_map
LeoValque Sep 10, 2026
c86415c
Solved a bug with wrong orientation in the output
LeoValque Sep 11, 2026
71c4aa9
Correctly consider VPM in filter_intersections
LeoValque Sep 11, 2026
0c7ced2
does_self_intersect does not support Orthogonal_cut_plane_traits, tra…
LeoValque Sep 11, 2026
2c8c21d
Merge remote-tracking branch 'origin/main' into PMP-bool_ops
LeoValque Sep 14, 2026
17ab517
Solve merge conflict with main
LeoValque Sep 14, 2026
6937cc9
Transfer changement of face_graph_utils into boolean_operation_utils …
LeoValque Sep 14, 2026
968b471
Solved a bug in concurrency execution
LeoValque Sep 14, 2026
1cd9aca
Move specialization of surface_mesh from package Surface_mesh to PMP
LeoValque Sep 14, 2026
fe146e9
Remove const to reference of mesh to alloid visitors to modify them
LeoValque Sep 14, 2026
80a599f
Correct bug when doing corefine between a manifold mesh and a non-man…
LeoValque Sep 15, 2026
00ab167
Filter intersections with bbox instead of triangles
LeoValque Sep 15, 2026
bb4c172
Correct filtered_callback of corefine
LeoValque Sep 16, 2026
117596d
Correct resize of vectors in append_patches for surface_mesh
LeoValque Sep 16, 2026
254b372
Solve a bug with filter_intersections where the descriptors returned …
LeoValque Sep 17, 2026
82d3b3e
Correct wrong if statement for degenerate faces
LeoValque Sep 17, 2026
9a45376
Treat correctly the case of the faces to test are empty in self_inter…
LeoValque Sep 18, 2026
f5078b2
Avoid the copy
afabri Sep 21, 2026
662f7e1
update depencies
LeoValque Sep 21, 2026
e6b02f2
Solve bug in the testsuite
LeoValque Sep 22, 2026
74499f8
Replace box_intersection_d per AABB_tree in PMP/intersection.h
LeoValque Sep 22, 2026
503b55c
Remove unused include
LeoValque Sep 22, 2026
1a52c64
Replace box_intersection_d per AABB_tree in intersecting_meshes
LeoValque Sep 23, 2026
21043fc
Apply suggestions
LeoValque Sep 23, 2026
d02f46f
Merge remote-tracking branch 'origin/main' into PMP-bool_ops
LeoValque Sep 23, 2026
1421c4a
Solvebug in self-intersection
LeoValque Sep 23, 2026
775a309
Rename callback halfedges
LeoValque Sep 23, 2026
02b88e3
Solved a bug with invalid halfedges if the border of a remove patch h…
LeoValque Sep 23, 2026
2a8e5ee
Reorder callback of autorefine
LeoValque Sep 23, 2026
7f9aa4a
solve a bug of bad border connection when removed a patch
LeoValque Sep 24, 2026
66df6c7
Solve a bug with bad constructing tree
LeoValque Sep 24, 2026
8c8e491
Treat correctly singleton tree
LeoValque Sep 24, 2026
5e486a8
Singleton tree case
LeoValque Sep 24, 2026
2d2b481
Add missing function for singleton tree case
LeoValque Sep 24, 2026
18f675f
Make Throw_at_output and Throw_at_count thread safe
LeoValque Sep 24, 2026
16e82e4
Reintroduce depencies to Box_intersection_d, it is used by PMP_mesh_r…
LeoValque Sep 24, 2026
de53663
Add missing function for singleton case
LeoValque Sep 25, 2026
0c3d3b0
resolved ambiguity
soesau Sep 25, 2026
f46bdaa
added is_derived_from_Surface_mesh
soesau Sep 28, 2026
23bc3cc
renaming is_derived_from_Surface_mesh to is_Surface_mesh and moving i…
soesau Sep 28, 2026
656a69d
Make specialization compatible with derivation of surface mesh
LeoValque Sep 28, 2026
e632019
warning
sloriot Sep 29, 2026
8895de5
Go through face_range instead of all faces of the mesh
LeoValque Sep 29, 2026
8ae2052
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Sep 29, 2026
017ec9f
full namespace for IPCP
soesau Sep 30, 2026
49a0207
Add a test to check that output of aabb and box_intersection_d are id…
LeoValque Oct 1, 2026
1f9cf27
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Oct 1, 2026
1fc31c6
Fix bug where the specialization was not taken
LeoValque Oct 1, 2026
73a064b
Bench of fill_new_triangle_mesh + parallellization of extract_patch_s…
LeoValque Oct 1, 2026
8ccbe52
Apply suggestions from Laurent review
LeoValque Oct 1, 2026
e197a5f
Add ConstructBbox23(Bbox) in the documentation
LeoValque Oct 1, 2026
fbb0238
Update AABB_tree/test/AABB_tree/aabb_vs_box_intersection_d_test.cpp
LeoValque Oct 5, 2026
b2d0dd1
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Oct 5, 2026
6bc7155
Replace set per property_map in connected_component
LeoValque Oct 5, 2026
dba32e6
Add are_equal_polygon_soups and are_equal_meshes
LeoValque Oct 5, 2026
530f466
compatibility with fs
sloriot Oct 6, 2026
fad5231
Revert "Add are_equal_polygon_soups and are_equal_meshes"
LeoValque Oct 6, 2026
5943404
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Oct 6, 2026
80346e2
reorder depencies
LeoValque Oct 6, 2026
e002d60
Solve warnings of conversion to std::size_t to SM::size_type
LeoValque Oct 6, 2026
d46095f
Add missing def
LeoValque Oct 6, 2026
aed7ba1
Add missing concurrency_tag and changes the associate wording in the …
LeoValque Oct 7, 2026
ed4734d
Update changes.md
LeoValque Oct 7, 2026
f44d569
Benchmark for autorefine and boolop
LeoValque Oct 7, 2026
7acbe0d
Reduce shift of the duplicate in tesrt
LeoValque Oct 7, 2026
c1fd3c4
re-add operators for compatibility with exterior code
sloriot Oct 16, 2026
791b561
Add singleton case to self_intersection
LeoValque Oct 16, 2026
ac43246
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Oct 16, 2026
ef85b04
Desactivate enable_if if CGAL_DO_NOT_USE_SURFACE_MESH_SPECIALIZATIONS…
LeoValque Oct 19, 2026
e29408a
Update borders of a patch when removing an edge from shared edges
LeoValque Oct 22, 2026
b26223d
Remove output building modifications
LeoValque Oct 26, 2026
8db2046
Remove output building modifications
LeoValque Oct 26, 2026
25d97b7
Solved merge conflict with main
LeoValque Oct 26, 2026
02eb118
Solved conflict with main
LeoValque Oct 26, 2026
d1595b3
remove surface_mesh_specializations.h
LeoValque Oct 26, 2026
8dca07b
fix filtering of edges
sloriot Nov 6, 2026
0a52acd
cosmetic
sloriot Nov 6, 2026
eff08ef
filter faces in sequential mode too
sloriot Nov 6, 2026
17d427e
filter out shared edges in manifold case too
sloriot Nov 9, 2026
982d75a
missing vertex point map
sloriot Nov 9, 2026
65a59d0
avoid reference to dangling transformation
sloriot Nov 9, 2026
81030fb
do not write twice self-intersecting pairs
sloriot Nov 9, 2026
2b90877
restrict the test to collected faces
sloriot Nov 9, 2026
4136b41
handle empty polyline range + restrict bbox to face_range
sloriot Nov 9, 2026
d819efa
handle update of output iterator returned
sloriot Nov 9, 2026
16cefdb
remove extra useless call
sloriot Nov 9, 2026
3b1512b
copy/paste error
sloriot Nov 9, 2026
f2d8aa0
fix license,, clean up and add TODO
sloriot Nov 9, 2026
80ebee0
hide non-accepted/reviewed APIs
sloriot Nov 9, 2026
6642fe8
remove self-reference
sloriot Nov 9, 2026
f10baba
remove leftover no longer used
sloriot Nov 9, 2026
89b8355
cosmetic
sloriot Nov 9, 2026
a8db7b2
Make the build compatible with non-random-access ranges
LeoValque Nov 9, 2026
b7d2136
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Nov 9, 2026
3affed8
missing include
sloriot Nov 9, 2026
d994859
Reintroduce polygon_mesh_slicer in PMP benchmark
LeoValque Nov 9, 2026
67e1071
Rewrite parallelisation to avoid std::next(begin, i) potentially expe…
LeoValque Nov 9, 2026
2e99a60
Apply suggestions from the review
LeoValque Nov 9, 2026
d670930
missing vpm
sloriot Nov 9, 2026
8d610b7
Complete missing commentaries
LeoValque Nov 9, 2026
a31dbce
take a reference so that the output iterator is really updated
sloriot Nov 9, 2026
57eeed2
Remove unnecessary copy
LeoValque Nov 9, 2026
69cbb8a
handle degenerate polylines and missing out it update
sloriot Nov 9, 2026
c8edea5
typo: use range size
sloriot Nov 9, 2026
1f088a7
no need to update it, taken by ref
sloriot Nov 9, 2026
bd9e2ca
idiom for output iterator wrapping
sloriot Nov 9, 2026
dfe442f
even when skipping polylines, index should be registered
sloriot Nov 9, 2026
526dcd9
same fix here too
sloriot Nov 9, 2026
010c707
get rid of internal functions and use AABB_trees::do_intersect() instead
sloriot Nov 9, 2026
8928285
avoid a copy
sloriot Nov 10, 2026
4250455
Solve merge conflict
LeoValque Nov 10, 2026
8859328
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Nov 10, 2026
aa60b13
Apply batched suggestions from code review
LeoValque Nov 10, 2026
8b09b1b
Move an assertion to CGAL_expensive_assertion()
LeoValque Nov 10, 2026
7966565
Apply suggestions from the review
LeoValque Nov 10, 2026
2f4fc19
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Nov 10, 2026
a4bf708
Apply suggestions from the review
LeoValque Nov 10, 2026
a2fab02
Reintroduce necessary include
LeoValque Nov 10, 2026
f951101
() for std::min
LeoValque Nov 10, 2026
fb0a691
leftover
sloriot Nov 10, 2026
bb629df
auto in a lambda in not in c++17
sloriot Nov 12, 2026
01a7bad
fix concurrency issue
sloriot Nov 12, 2026
6129c09
no need to change the halfedge, let the filter below pick the right one
sloriot Nov 12, 2026
7e8c4e1
init to map to avoid concurrent insert issues
sloriot Nov 12, 2026
c2c64ac
one more TODO
sloriot Nov 12, 2026
0055d38
In troduces intersections for polylines and repair CGAL Lab
LeoValque Nov 13, 2026
200054c
Replace EPICK per Simple_cartesian for reference point
LeoValque Nov 13, 2026
b07468a
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Nov 13, 2026
9c42394
Missing change from EPick to cartesian
LeoValque Nov 13, 2026
e8a7fbf
Merge remote-tracking branch 'origin/main' into PMP-bool_ops
LeoValque Nov 13, 2026
00c63fb
Update CHANGES.md
LeoValque Nov 13, 2026
6ae21d6
avoid conversion warning
sloriot Nov 17, 2026
6dac706
Add missing operator for Orthogonal_cut_plane_traits be compatible wi…
LeoValque Nov 17, 2026
3415711
Merge branch 'PMP-bool_ops' of github.com:LeoValque/cgal into PMP-boo…
LeoValque Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AABB_tree/include/CGAL/AABB_traits_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ class AABB_traits_3
}

/// Comparison functions
static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits_3<GeomTraits,AABBPrimitive, BboxMap>& traits)
static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits_3<GeomTraits, AABBPrimitive, BboxMap>& traits)
{
return GeomTraits().less_x_3_object()( internal::Primitive_helper<AT>::get_reference_point(pr1,traits),
internal::Primitive_helper<AT>::get_reference_point(pr2,traits) );
Expand Down
3 changes: 2 additions & 1 deletion AABB_tree/include/CGAL/AABB_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,12 @@ namespace CGAL {
return std::addressof(m_nodes[0]);
}

private:
/// @private
Comment thread
LeoValque marked this conversation as resolved.
Resolved
const Primitive& singleton_data() const {
CGAL_assertion(size() == 1);
return *m_primitives.begin();
}
private:

// search KD-tree
mutable std::unique_ptr<const Search_tree> m_p_search_tree;
Expand Down
69 changes: 34 additions & 35 deletions AABB_tree/include/CGAL/AABB_tree/internal/AABB_traversal_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,10 @@ class Listing_primitive_traits
};

/**
* It is more efficient to apply the inverse transformation to the query and then use the original traits,
* but except if the constructions are exact, the result may differ from applying the original transformation to the tree.
* @class Listing_primitive_traits_with_transformation
* @class Listing_bbox_primitive_traits
*/
template<typename AABBTraits, typename Query, typename OutputIterator, typename AffTransformation, typename SUPPORTS_ROTATION = CGAL::Tag_true>
class Listing_primitive_traits_with_transformation
template<typename AABBTraits, typename Query, typename OutputIterator>
class Listing_bbox_primitive_traits
{
typedef typename AABBTraits::FT FT;
typedef typename AABBTraits::Point Point;
Expand All @@ -201,50 +199,37 @@ class Listing_primitive_traits_with_transformation
typedef ::CGAL::AABB_node<AABBTraits> Node;

public:
Listing_primitive_traits_with_transformation(OutputIterator out_it, const AABBTraits& traits)
: m_out_it(out_it), m_traits(traits), m_transfo(CGAL::IDENTITY), m_has_rotation(false)
{}

Listing_primitive_traits_with_transformation(OutputIterator out_it, const AABBTraits& traits, const AffTransformation& transfo)
: m_out_it(out_it), m_traits(traits), m_transfo(transfo), m_has_rotation(transfo.has_rotation())
{}
Listing_bbox_primitive_traits(OutputIterator out_it, const AABBTraits& traits)
: m_out_it(out_it), m_traits(traits) {}

constexpr bool go_further() const { return true; }

void intersection(const Query& query, const Primitive& primitive)
{
auto datum_transformed = internal::Primitive_helper<AABBTraits>::get_datum(primitive, m_traits).transform(m_transfo);
if( CGAL::do_intersect(query, datum_transformed) )
if( m_traits.do_intersect_object()(query.bbox(),
internal::Primitive_helper<AABBTraits>::get_datum(primitive, m_traits).bbox()) )
{
*m_out_it++ = primitive.id();
}
}

bool do_intersect(const Query& query, const Node& node) const
{
return m_traits.do_intersect_object()(query, compute_transformed_bbox(m_transfo, node.bbox(), m_has_rotation));
}

const AffTransformation& transformation() const { return m_transfo; }
void set_transformation(const AffTransformation& transfo)
{
m_transfo = transfo;
m_has_rotation = m_transfo.has_rotation();
return m_traits.do_intersect_object()(query.bbox(), node.bbox());
}

private:
OutputIterator m_out_it;
const AABBTraits& m_traits;
AffTransformation m_transfo;
bool m_has_rotation;
};

/**
* @class Listing_distinct_primitive_traits
* used by `all_pairs_of_intersecting_primitives()` to avoid reporting `(i, i)` and twice `(i, j)`.
* It is more efficient to apply the inverse transformation to the query and then use the original traits,
* but except if the constructions are exact, the result may differ from applying the original transformation to the tree.
* @class Listing_primitive_traits_with_transformation
*/
template<typename AABBTraits, typename OutputIterator>
class Listing_distinct_primitive_traits
template<typename AABBTraits, typename Query, typename OutputIterator, typename AffTransformation, typename SUPPORTS_ROTATION = CGAL::Tag_true>
class Listing_primitive_traits_with_transformation
{
typedef typename AABBTraits::FT FT;
typedef typename AABBTraits::Point Point;
Expand All @@ -256,30 +241,44 @@ class Listing_distinct_primitive_traits
typedef ::CGAL::AABB_node<AABBTraits> Node;

public:
Listing_distinct_primitive_traits(OutputIterator out_it, const AABBTraits& traits)
: m_out_it(out_it), m_traits(traits) {}
Listing_primitive_traits_with_transformation(OutputIterator out_it, const AABBTraits& traits)
: m_out_it(out_it), m_traits(traits), m_transfo(CGAL::IDENTITY), m_has_rotation(false)
{}

Listing_primitive_traits_with_transformation(OutputIterator out_it, const AABBTraits& traits, const AffTransformation& transfo)
: m_out_it(out_it), m_traits(traits), m_transfo(transfo), m_has_rotation(transfo.has_rotation())
{}

constexpr bool go_further() const { return true; }

void intersection(const Primitive& query, const Primitive& primitive)
void intersection(const Query& query, const Primitive& primitive)
{
if( query.id()<primitive.id() && m_traits.do_intersect_object()(internal::Primitive_helper<AABBTraits>::get_datum(query, m_traits), primitive) )
auto datum_transformed = internal::Primitive_helper<AABBTraits>::get_datum(primitive, m_traits).transform(m_transfo);
if( CGAL::do_intersect(query, datum_transformed) )
{
*m_out_it++ = primitive.id();
}
}

bool do_intersect(const Primitive& query, const Node& node) const
bool do_intersect(const Query& query, const Node& node) const
{
return m_traits.do_intersect_object()(internal::Primitive_helper<AABBTraits>::get_datum(query, m_traits), node.bbox());
return m_traits.do_intersect_object()(query, compute_transformed_bbox(m_transfo, node.bbox(), m_has_rotation));
}

const AffTransformation& transformation() const { return m_transfo; }
void set_transformation(const AffTransformation& transfo)
{
m_transfo = transfo;
m_has_rotation = m_transfo.has_rotation();
}

private:
OutputIterator m_out_it;
const AABBTraits& m_traits;
AffTransformation m_transfo;
bool m_has_rotation;
};


/**
* @class First_primitive_traits
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include <CGAL/AABB_tree/internal/AABB_node.h>
#include <CGAL/AABB_tree/internal/AABB_traversal_traits.h>

#if CGAL_LINKED_WITH_TBB
#include <tbb/task_group.h>
#endif

namespace CGAL {

namespace internal { namespace AABB_tree {
Expand All @@ -34,7 +38,7 @@ void two_trees_traversal(const ::CGAL::AABB_node<AABBTraits_A>& node_A,
TwoTreeTraversalTraits& traversal_traits)
{
#if CGAL_LINKED_WITH_TBB
const std::size_t cutoff_parallel_call = 100000;
const std::size_t cutoff_parallel_call = 3000;
Comment thread
LeoValque marked this conversation as resolved.
Resolved
Comment thread
LeoValque marked this conversation as resolved.
Resolved
#endif
auto recursive_call = [](const auto &node_A, const auto &node_B, const std::size_t nb_primitives_A, const std::size_t nb_primitives_B, auto &traversal_traits){
if(traversal_traits.prefer_A_for_next_step(node_A, node_B, nb_primitives_A, nb_primitives_B))
Expand Down Expand Up @@ -117,11 +121,94 @@ template<typename ConcurrencyTag = Sequential_tag,
typename Tree_B,
typename TwoTreeTraversalTraits>
void two_trees_traversal(const Tree_A& tree_A,
const Tree_B& tree_B,
TwoTreeTraversalTraits &traits)
const Tree_B& tree_B,
TwoTreeTraversalTraits &traits)
{
CGAL_precondition(tree_A.size() != 0 && tree_B.size() != 0);
two_trees_traversal<true, ConcurrencyTag>(*tree_A.root_node(), *tree_B.root_node(), tree_A.size(), tree_B.size(), traits);
if(tree_A.size() == 1){
if(tree_B.size() == 1)
traits.intersection(tree_A.singleton_data(), tree_B.singleton_data());
else
traits.intersection(tree_A.singleton_data(), *tree_B.root_node(), tree_B.size());
}
else if(tree_B.size() == 1)
traits.intersection(*tree_A.root_node(), tree_A.size(), tree_B.singleton_data());
else
two_trees_traversal<true, ConcurrencyTag>(*tree_A.root_node(), *tree_B.root_node(), tree_A.size(), tree_B.size(), traits);
}

// An optimization to traverse a tree with itself
template <typename ConcurrencyTag = Sequential_tag,
typename AABBTraits,
typename TwoTreeTraversalTraits>
void one_tree_traversal(const ::CGAL::AABB_node<AABBTraits>& node,
const std::size_t nb_primitives,
TwoTreeTraversalTraits& traversal_traits)
{
#if CGAL_LINKED_WITH_TBB
const std::size_t cutoff_parallel_call = 3000;
#endif
switch(nb_primitives)
{
case 2:
{
traversal_traits.intersection(node.left_data(), node.right_data());
break;
}
case 3:
{
traversal_traits.intersection(node.left_data(), node.right_child(), 2);
one_tree_traversal(node.right_child(), 2, traversal_traits);
break;
}
default:
{
#if CGAL_LINKED_WITH_TBB
if constexpr(ConcurrencyTag::is_parallel)
{
if(nb_primitives > cutoff_parallel_call)
{
oneapi::tbb::task_group tg;
if(traversal_traits.do_intersect(node.left_child(), node.right_child())){
tg.run([&]{
two_trees_traversal<true, ConcurrencyTag>(node.left_child(), node.right_child(), nb_primitives/2, nb_primitives - nb_primitives/2, traversal_traits);}
);
}
tg.run([&]{
one_tree_traversal<ConcurrencyTag>(node.left_child(), nb_primitives/2, traversal_traits);}
);
one_tree_traversal<ConcurrencyTag>(node.right_child(), nb_primitives - nb_primitives/2, traversal_traits);
tg.wait();
}
else
{
if(traversal_traits.do_intersect(node.left_child(), node.right_child()))
two_trees_traversal(node.left_child(), node.right_child(), nb_primitives/2, nb_primitives - nb_primitives/2, traversal_traits);
one_tree_traversal(node.left_child(), nb_primitives/2, traversal_traits);
one_tree_traversal(node.right_child(), nb_primitives - nb_primitives/2, traversal_traits);
}
}
else
#endif
{
if(traversal_traits.do_intersect(node.left_child(), node.right_child()))
two_trees_traversal(node.left_child(), node.right_child(), nb_primitives/2, nb_primitives - nb_primitives/2, traversal_traits);
one_tree_traversal(node.left_child(), nb_primitives/2, traversal_traits);
one_tree_traversal(node.right_child(), nb_primitives - nb_primitives/2, traversal_traits);
}
}} // switch end
}

template<typename ConcurrencyTag = Sequential_tag,
typename Tree,
typename TwoTreeTraversalTraits>
void one_tree_traversal(const Tree& tree,
TwoTreeTraversalTraits &traits)
{
// Nothing to do if the tree is a singleton
if(tree.size() < 2)
return;
one_tree_traversal<ConcurrencyTag>(*tree.root_node(), tree.size(), traits);
}

namespace experimental{
Expand All @@ -139,7 +226,7 @@ void two_trees_partial_traversal(const ::CGAL::AABB_node<AABBTraits_A>& node_A,
TwoTreeTraversalTraits& traversal_traits)
{
#if CGAL_LINKED_WITH_TBB
const std::size_t cutoff_parallel_call = 100000;
const std::size_t cutoff_parallel_call = 3000;
Comment thread
LeoValque marked this conversation as resolved.
Resolved
#endif
auto recursive_call = [&](const auto &node_A, const auto &node_B, const std::size_t nb_primitives_A, const std::size_t nb_primitives_B, auto &traversal_traits){
if(traversal_traits.prefer_A_for_next_step(node_A, node_B, nb_primitives_A, nb_primitives_B))
Expand Down
Loading
Loading