|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Default storage policy for PackedBVH: primitives stored as std::shared_ptr<const P>, exactly as PackedBVH has always stored them. More...
#include <EBGeometry_BVH.hpp>
Public Types | |
| using | StorageType = std::shared_ptr< const P > |
| Storage representation: a shared pointer to a const primitive, as PackedBVH has always stored it. | |
Static Public Member Functions | |
| static const P & | get (const StorageType &a_stored) noexcept |
| Dereference stored element to the primitive it refers to. | |
| 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. | |
Default storage policy for PackedBVH: primitives stored as std::shared_ptr<const P>, exactly as PackedBVH has always stored them.
A storage policy is a stateless struct bundling an associated storage representation (StorageType) with the handful of operations PackedBVH needs to build and read it: get() (per-element access, used by every leaf-visit callback), appendTreeLeaf() (copying a TreeBVH leaf's primitives into PackedBVH's flat array during the identity pack() constructor), and appendAliased() (appending a converting packWith() constructor's single contiguous conversion buffer to PackedBVH's flat array). Both appendTreeLeaf() and appendAliased() are appenders: they add to whatever a_dst already holds rather than replacing it, so every policy behaves identically no matter how many times PackedBVH calls them. Swapping the policy changes nothing about tree construction or traversal – TreeBVH itself always stores primitives as shared_ptr, regardless of which policy the PackedBVH built from it uses – only what PackedBVH's own primitive array holds.
| P | Primitive type. |
|
inlinestatic |
Materialise a converting packWith() constructor's single contiguous conversion buffer into PackedBVH's flat primitive array.
Uses the shared_ptr aliasing constructor so every element shares one control block (one allocation for the whole buffer) while still presenting as an independent shared_ptr<const P> per element.
| [in,out] | a_dst | PackedBVH's flat primitive array. |
| [in] | a_block | Single contiguous buffer holding every converted primitive. |
|
inlinestatic |
|
inlinestaticnoexcept |
Dereference stored element to the primitive it refers to.
| [in] | a_stored | Stored element. |