|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Storage policy that stores primitives directly by value, with no pointer indirection at all. More...
#include <EBGeometry_BVH.hpp>
Public Types | |
| using | StorageType = P |
| Storage representation: the primitive itself, stored by value. | |
Static Public Member Functions | |
| static const P & | get (const StorageType &a_stored) noexcept |
| Identity access – the stored element already is the primitive. | |
| static void | appendTreeLeaf (std::vector< StorageType > &a_dst, const PrimitiveList< P > &a_leafPrims) |
| Append one TreeBVH leaf's primitives to PackedBVH's flat primitive array. | |
| static void | appendAliased (std::vector< StorageType > &a_dst, const std::shared_ptr< std::vector< P > > &a_block) |
| Materialise a converting packWith() constructor's single contiguous conversion buffer into PackedBVH's flat primitive array. | |
Storage policy that stores primitives directly by value, with no pointer indirection at all.
Removes the per-primitive heap allocation and pointer-chasing that SharedPtrStorage
pays on every leaf visit – worthwhile when P is a self-contained value type (no shared ownership needed) and leaves are visited often, e.g. a nearest-neighbor search over a point cloud.
| P | Primitive type. |
|
inlinestatic |
Materialise a converting packWith() constructor's single contiguous conversion buffer into PackedBVH's flat primitive array.
Like SharedPtrStorage
's equivalent, this appends a_block to a_dst, so the two policies honour the same contract regardless of how many times it is called. When a_dst is still empty (the case for PackedBVH's single-call converting constructor) it takes the fast path of stealing the already-contiguous buffer wholesale – no aliasing shared_ptr machinery, no control-block allocation, and no per-element move; otherwise it move-appends each element.
| [in,out] | a_dst | PackedBVH's flat primitive array. |
| [in] | a_block | Single contiguous buffer holding every converted primitive. |
|
inlinestatic |
Append one TreeBVH leaf's primitives to PackedBVH's flat primitive array.
Used by PackedBVH's identity pack() constructor. TreeBVH's own leaf primitives are always shared_ptr<const P> (TreeBVH itself is unaffected by the packed BVH's storage policy), so this policy dereferences and copies each one by value; unavoidable here, since the source is shared_ptr-based regardless of the destination policy.
|
inlinestaticnoexcept |
Identity access – the stored element already is the primitive.
| [in] | a_stored | Stored element. |