|
|
using | Sphere = SphereCloud::Sphere< T > |
| | A sphere: a center and a radius.
|
| |
|
using | Hit = SphereCloud::Hit< T > |
| | One query result: the cloud index of a sphere and the signed distance to its surface.
|
| |
|
using | SphereGroup = SphereAoSoA< T, W > |
| | The SoA leaf primitive: a group of up to W spheres carrying their cloud indices.
|
| |
|
using | Packed = BVH::PackedBVH< T, SphereGroup, K > |
| | The packed BVH this class holds over its sphere groups.
|
| |
|
using | AABB = BoundingVolumes::AABBT< T > |
| | Axis-aligned bounding box type.
|
| |
|
using | Item = typename Prim::Item |
| | What a source of the primitives returns.
|
| |
|
using | Group = typename Prim::Group |
| | The SoA leaf primitive: a group of up to W primitives carrying their cloud indices.
|
| |
|
using | Packed = BVH::PackedBVH< T, Group, K > |
| | The packed BVH over the groups.
|
| |
|
using | Node = typename Packed::Node |
| | Flat node type of the held BVH.
|
| |
|
using | AABB = BoundingVolumes::AABBT< T > |
| | Axis-aligned bounding box type.
|
| |
|
| | SphereCloudBVH (Pool &a_pool, const std::vector< Sphere > &a_spheres, std::size_t a_targetLeafSize=16 *W) |
| | Build a BVH over spheres on the host: shorthand for build(a_pool, a_spheres, a_targetLeafSize).
|
| |
| | SphereCloudBVH (Pool &a_pool, const std::vector< Vec3T< T > > &a_centers, const std::vector< T > &a_radii, std::size_t a_targetLeafSize=16 *W) |
| | Build a BVH over spheres given as centers and radii, on the host: shorthand for build(a_pool,
a_centers, a_radii, a_targetLeafSize).
|
| |
| template<class Source > |
| void | rebuild (const Source &a_source, uint32_t a_numSpheres) |
| | Build the BVH again, in the arrays build() reserved, from new spheres.
|
| |
| uint32_t | maxSpheres () const noexcept |
| | The most spheres rebuild() can take.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Signed distance to the union of the spheres: min_i(|p - c_i| - r_i); see the class.
|
| |
| Hit | closestSphere (const Vec3T< T > &a_point) const noexcept |
| | The sphere whose surface is nearest to a point, in the signed sense of signedDistance().
|
| |
| AABB | computeBoundingVolume () const noexcept |
| | The box of all the spheres.
|
| |
| uint32_t | numSpheres () const noexcept |
| | Number of spheres in the cloud.
|
| |
| Sphere | sphere (uint32_t a_index) const noexcept |
| | The sphere with a cloud index.
|
| |
| Packed | getBVH () const noexcept |
| | The held packed BVH over the sphere groups.
|
| |
| SphereCloudBVH | rebasedView (const Pool &a_pool) const noexcept |
| | Produce a copy of this object that resolves against a_pool.
|
| |
| SphereCloudBVH | deepCopy (Pool &a_dstPool) const |
| | Duplicate this object's storage into a_dstPool.
|
| |
| void * | base () noexcept |
| | The base address this object's arrays are offsets from; see PoolHandle::base().
|
| |
| const void * | base () const noexcept |
| | The base address this object's arrays are offsets from; see PoolHandle::base().
|
| |
Public Member Functions inherited from EBGeometry::PoolHandle |
| PoolLocation | location () const noexcept |
| | Where this handle's arrays live.
|
| |
| bool | isAttachedTo (const Pool &a_pool) const noexcept |
| | Check whether this handle's arrays were reserved from a_pool.
|
| |
|
|
| CloudBVH () noexcept=default |
| | An empty BVH, to be reserved and filled.
|
| |
| template<class Source > |
| void | initialize (Pool &a_pool, const Source &a_source, uint32_t a_numItems, std::size_t a_targetLeafSize, uint32_t a_maxItems, const char *a_who) |
| | Build over the primitives of a source, where the pool's memory is: the body of PointCloudBVH::build().
|
| |
| void | initialize (Pool &a_pool, const std::vector< Item > &a_items, std::size_t a_targetLeafSize, uint32_t a_maxItems, const char *a_who) |
| | Build over the primitives of a host array, where the pool's memory is: for a pool in device memory, the primitives are checked on the host and copied to scratch there first.
|
| |
| template<class Source > |
| void | reinitialize (const Source &a_source, uint32_t a_numItems, const char *a_who) |
| | Build again in the arrays initialize() reserved: the body of PointCloudBVH::rebuild().
|
| |
| void | rebase (const Pool &a_pool) noexcept |
| | Resolve this object against a_pool: the body of PointCloudBVH::rebasedView(), on a copy.
|
| |
| void | copyInto (CloudBVH &a_copy, Pool &a_dstPool) const |
| | Duplicate this object's storage into a_dstPool, for a_copy, a copy of this object: the body of PointCloudBVH::deepCopy().
|
| |
| void | reserveArrays (Pool &a_pool, const Sizes &a_sizes, uint32_t a_numItems) |
| | Reserve the BVH's and the cloud's arrays from a_pool.
|
| |
| template<class Source > |
| Sizes | shape (const Scratch &a_scratch, void *a_base, const Source &a_source, uint32_t a_numItems, const char *a_who) |
| | Build steps 1 to 5 (see PointCloudBVH): the box, the sorted keys, the tree's levels, the subtree sizes, boxes and depth-first indices, and the scans that place the rows and the groups.
|
| |
| template<class Source > |
| void | write (const Scratch &a_scratch, void *a_base, const Sizes &a_sizes, const Source &a_source, uint32_t a_numItems) |
| | Build step 6 (see PointCloudBVH): write the arrays reserved for the tree shape() gave.
|
| |
| template<class F > |
| void | run (std::size_t a_count, const F &a_f) const |
| | Run a build step: through GPU::parallelFor() for a build there, and in a host loop otherwise.
|
| |
| std::uint32_t | scan (std::uint32_t *a_values, std::uint32_t a_count, std::uint32_t *a_scratch) const |
| | An exclusive scan, where the build runs; see GPU::exclusiveScan().
|
| |
Protected Member Functions inherited from EBGeometry::PoolHandle |
|
| PoolHandle () noexcept=default |
| | An unset location; the first reservation attaches it.
|
| |
| | PoolHandle (const PoolLocation &a_location) noexcept |
| | Adopt a location, as a handle rebuilt from a stored layout does.
|
| |
| | PoolHandle (const PoolHandle &) noexcept=default |
| | Copy a handle, as a derived handle's copy does.
|
| |
|
| PoolHandle (PoolHandle &&) noexcept=default |
| | Move a handle; the same as a copy.
|
| |
| PoolHandle & | operator= (const PoolHandle &) noexcept=default |
| | Copy-assign a handle, as a derived handle's assignment does.
|
| |
| PoolHandle & | operator= (PoolHandle &&) noexcept=default |
| | Move-assign a handle; the same as a copy.
|
| |
|
| ~PoolHandle () noexcept=default |
| | Destructor; protected, since a PoolHandle exists only as the base of a handle.
|
| |
| void * | base () noexcept |
| | The base address this handle's offsets resolve against; see PoolLocation::base().
|
| |
| const void * | base () const noexcept |
| | The base address this handle's offsets resolve against, for read-only access.
|
| |
| void | attach (const Pool &a_pool, const char *a_who, const bool a_deviceWritten=false) noexcept |
| | Follow a_pool, as the first reservation does; see PoolLocation::attach().
|
| |
| PoolLocation | rebasedLocation (const Pool &a_pool, uint64_t a_endByte, const char *a_who) const noexcept |
| | The location of this handle's arrays in another pool of its mirror chain; see PoolLocation::rebasedOnto().
|
| |
| void | setLocation (const PoolLocation &a_location) noexcept |
| | Replace the location, for a view or a copy made by a derived handle.
|
| |
| static Sizes | sizesFor (uint32_t a_numItems, uint32_t a_leafSize, const char *a_who) noexcept |
| | Bounds on the array sizes of a build over a_numItems primitives.
|
| |
| static Scratch | reserveScratch (Pool &a_pool, uint32_t a_numItems, uint32_t a_leafSize, const char *a_who) |
| | Reserve a build's scratch from a_pool, for up to a_numItems primitives.
|
| |
| template<class U > |
| static std::vector< U > | toHost (const PODVector< U > &a_array, const void *a_base) |
| | Copy one pool-resident array back into a host std::vector.
|
| |
|
Packed::Layout | m_bvhLayout |
| | The packed BVH over the groups, as a layout: it shares this object's location.
|
| |
|
PODVector< Item > | m_items |
| | The primitives, indexed by cloud index.
|
| |
|
PODVector< std::uint32_t > | m_leafOff |
| | Per-primitive own-leaf group offset (for seeding).
|
| |
|
PODVector< std::uint32_t > | m_leafCnt |
| | Per-primitive own-leaf group count (for seeding).
|
| |
|
PODVector< std::uint32_t > | m_order |
| | Cloud indices in leaf (build) order; the spatially coherent batch-query order.
|
| |
|
Scratch | m_scratch |
| | The scratch arrays a rebuild uses; empty for a BVH without room for one.
|
| |
|
std::uint32_t | m_maxItems = 0 |
| | The most primitives a rebuild can take, 0 for none.
|
| |
|
std::uint32_t | m_leafSize = 0 |
| | The largest leaf, max(a_targetLeafSize, K): a node of more primitives is cut.
|
| |
|
std::uint32_t | m_depth = 0 |
| | The tree's depth in node levels (the root is level 1), 0 for an empty cloud.
|
| |
|
bool | m_parallel = false |
| | Whether the build runs through GPU::parallelFor() (the pool's memory is device-accessible).
|
| |
template<class T, size_t K = BVH::DefaultBranchingRatio<T>(), size_t W = PointSoA::DefaultWidth<T>()>
class EBGeometry::SphereCloudBVH< T, K, W >
A BVH over spheres of differing radii (polydisperse particles), with the signed distance to their union and the closest sphere.
A shape: signedDistance() and computeBoundingVolume(), negative inside a sphere. The distance is min_i(|p - c_i| - r_i) over the spheres: exact outside their union, and inside it a bound in magnitude (where spheres overlap, the union's surface can be farther than every sphere's own), as for a Union of the spheres. Spheres of one radius need no SphereCloudBVH: the distance from a PointCloudBVH of the centers, less the radius, is the same.
The build is PointCloudBVH's linear build (see there), over the centers: the Morton keys and cuts come from the centers, and every box is grown by its spheres' radii. It runs where the pool's memory is, on a device included, and every side gives the same tree. The leaves are SphereAoSoA groups carrying each sphere's cloud index, which closestSphere() reports.
- Note
- Device portability, as for PointCloudBVH: the packed BVH and the cloud's arrays are reserved from one Pool and the class stores only offsets into it, so it is trivially copyable. Freeze and mirror the pool, call rebasedView(), and pass the value into a kernel; signedDistance(), closestSphere() and computeBoundingVolume() are device-callable. The pool must outlive the BVH and every copy of it.
- Template Parameters
-