Build-phase helpers shared by PackedBVH's constructors and static builds. Not part of the public API.
More...
|
| template<class P > |
| void | appendTreeLeaf (std::vector< P > &a_dst, const PrimitiveList< P > &a_leafPrims) |
| | Append one TreeBVH leaf's primitives to a flat primitive array under construction.
|
| |
| template<class List , size_t K> |
| void | requireNonEmptyPartitions (const Array< List, K > &a_partitions, const size_t a_numInput, const char *a_who) |
| | Abort unless every partition a partitioner returned holds at least one primitive.
|
| |
| template<class P > |
| void | appendAliased (std::vector< P > &a_dst, const std::shared_ptr< std::vector< P > > &a_block) |
| | Materialise a single contiguous buffer into a flat primitive array under construction.
|
| |
| void | requireLeafSetting (const char *a_who, const Construction a_construction, const ConstructionOptions &a_options) noexcept |
| | Abort unless the leaf-size setting that a_construction reads is positive.
|
| |
Build-phase helpers shared by PackedBVH's constructors and static builds. Not part of the public API.
◆ appendAliased()
template<class P >
| void EBGeometry::BVH::detail::appendAliased |
( |
std::vector< P > & |
a_dst, |
|
|
const std::shared_ptr< std::vector< P > > & |
a_block |
|
) |
| |
|
inline |
Materialise a single contiguous buffer into a flat primitive array under construction.
Appends a_block to a_dst, so the contract holds regardless of how many times it is called. When a_dst is still empty – the case for PackedBVH's single-call direct builds and its converting constructor – it takes the fast path of stealing the already-contiguous buffer wholesale, with no per-element move; otherwise it move-appends each element.
- Template Parameters
-
- Parameters
-
| [in,out] | a_dst | Flat primitive array under construction. |
| [in] | a_block | Single contiguous buffer holding every element to append. |
◆ appendTreeLeaf()
template<class P >
| void EBGeometry::BVH::detail::appendTreeLeaf |
( |
std::vector< P > & |
a_dst, |
|
|
const PrimitiveList< P > & |
a_leafPrims |
|
) |
| |
|
inline |
Append one TreeBVH leaf's primitives to a flat primitive array under construction.
Used by PackedBVH's identity pack() constructor and by buildTopDown(), both of which read TreeBVH leaves holding shared_ptr<const P>; this dereferences and copies each one by value. Appends to whatever a_dst already holds, so the contract is the same no matter how many leaves are packed.
- Template Parameters
-
- Parameters
-
| [in,out] | a_dst | Flat primitive array under construction. |
| [in] | a_leafPrims | One TreeBVH leaf's primitive list. |
◆ requireLeafSetting()
Abort unless the leaf-size setting that a_construction reads is positive.
Each preset construction method reads one field of ConstructionOptions; this checks that one, in every build. ClusterSAH's ClusterSpec is checked by PackedBVH::buildClusterSAH() itself, and a value outside Construction is left to the caller's own check.
- Parameters
-
| [in] | a_who | Class being built, for the message. |
| [in] | a_construction | Preset construction method. |
| [in] | a_options | Leaf-size settings. |
◆ requireNonEmptyPartitions()
template<class List , size_t K>
| void EBGeometry::BVH::detail::requireNonEmptyPartitions |
( |
const Array< List, K > & |
a_partitions, |
|
|
const size_t |
a_numInput, |
|
|
const char * |
a_who |
|
) |
| |
|
inline |
Abort unless every partition a partitioner returned holds at least one primitive.
An empty partition would become a leaf with no primitives, which the packed layout cannot represent: a node with no primitives reads as an interior node. The built-in partitioners never return one; a caller-supplied partitioner might, and this catches it at build time, in every build, where it is cheap and the message can say which call produced it.
- Template Parameters
-
| List | Partition type (a list of primitives with their bounding volumes). |
| K | Number of partitions. |
- Parameters
-
| [in] | a_partitions | Partitions returned by the partitioner. |
| [in] | a_numInput | Number of primitives the partitioner was given. |
| [in] | a_who | Name of the calling builder, for the message. |