mirror of https://github.com/CGAL/cgal
add a constructor taking a lvalue of an AABB-tree
we can construct the tree for a subset of faces and still give the ownership to the class
This commit is contained in:
parent
8464fae660
commit
9dcbc58ec9
|
|
@ -164,7 +164,7 @@ public:
|
|||
* @param tree a \cgal `AABB_tree` with `AABB_face_graph_triangle_primitive` as `Primitive` type
|
||||
* @param gt an instance of the geometric traits class
|
||||
*
|
||||
* @pre `CGAL::is_closed(tmesh) && CGAL::is_triangle_mesh(tmesh)`
|
||||
* @pre `tree` contains a set of triangle faces representing a closed surface mesh
|
||||
*/
|
||||
Side_of_triangle_mesh(const AABB_tree& tree,
|
||||
const GeomTraits& gt = GeomTraits())
|
||||
|
|
@ -181,6 +181,34 @@ public:
|
|||
box = tree.bbox();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that takes a pre-built \cgal `AABB_tree`
|
||||
* of the triangulated surface mesh primitives, and moves it.
|
||||
*
|
||||
* @param tree a \cgal `AABB_tree` with `AABB_face_graph_triangle_primitive` as `Primitive` type
|
||||
* @param gt an instance of the geometric traits class
|
||||
*
|
||||
* @pre `tree` contains a set of triangle faces representing a closed surface mesh
|
||||
*/
|
||||
Side_of_triangle_mesh(AABB_tree&& tree,
|
||||
const GeomTraits& gt = GeomTraits())
|
||||
: ray_functor(gt.construct_ray_3_object())
|
||||
, vector_functor(gt.construct_vector_3_object())
|
||||
, tm_ptr(nullptr)
|
||||
, own_tree(true)
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
, atomic_tree_ptr(new AABB_tree(std::forward<AABB_tree>(tree)))
|
||||
#else
|
||||
, tree_ptr(new AABB_tree(std::forward<AABB_tree>(tree)))
|
||||
#endif
|
||||
{
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
box = atomic_tree_ptr.load()->bbox();
|
||||
#else
|
||||
box = tree_ptr->bbox();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor moving an instance of `Side_of_triangle_mesh` to a new memory
|
||||
* location with minimal memory copy.
|
||||
|
|
|
|||
Loading…
Reference in New Issue