EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
EBGeometry::PointCloudDetail Namespace Reference

Internal helpers shared by the point-cloud search structures; not part of the public API. More...

Classes

struct  BuildNode
 One node of a cloud BVH build, in breadth-first order. More...
 
struct  Centers
 A source of primitive centers, from a source of primitives. More...
 
class  CloudBVH
 The state and build of a linear BVH over a cloud of primitives (points or spheres), built where its pool is; the base of PointCloudBVH and SphereCloudBVH. More...
 
struct  PointPrimitive
 The primitive of PointCloudBVH: a point, packed into PointAoSoA groups. More...
 
struct  RadiiAsPoints
 A source of points that are a sphere's radius in every coordinate: GPU::boundingBoxOf() over it finds the smallest radius and whether every radius is finite. More...
 
struct  SpherePrimitive
 The primitive of SphereCloudBVH: a sphere, keyed at its center and packed into SphereAoSoA groups; see PointPrimitive. More...
 

Typedefs

using MortonKey = SFCDetail::MortonKey
 A primitive's sort key in a cloud BVH build: its center's Morton code, ties broken by its cloud index.
 

Functions

template<class T >
void requireValidCloud (const char *a_who, const std::vector< Vec3T< T > > &a_positions) noexcept
 Abort with a message unless a point cloud can be indexed.
 
uint32_t keyCount (const uint32_t a_n) noexcept
 The smallest power of two at least a_n, and 0 for 0: how many keys a build sorts with GPU::bitonicSort().
 
template<class T , class Source >
BoundingVolumes::AABBT< T > boxOf (const Source &a_source, const uint32_t a_numPoints, const bool a_parallel, Vec3T< T > *a_scratch, const char *a_who, const char *a_noun="point")
 The box of a cloud, found where a build runs, and every coordinate checked finite.
 

Detailed Description

Internal helpers shared by the point-cloud search structures; not part of the public API.

Typedef Documentation

◆ MortonKey

A primitive's sort key in a cloud BVH build: its center's Morton code, ties broken by its cloud index.

Internal; not part of the public API. The key GPU::mortonOrder() sorts too.

Function Documentation

◆ boxOf()

template<class T , class Source >
BoundingVolumes::AABBT< T > EBGeometry::PointCloudDetail::boxOf ( const Source &  a_source,
const uint32_t  a_numPoints,
const bool  a_parallel,
Vec3T< T > *  a_scratch,
const char *  a_who,
const char *  a_noun = "point" 
)
inline

The box of a cloud, found where a build runs, and every coordinate checked finite.

Internal helper; not part of the public API. Through GPU::parallelFor() (GPU::boundingBoxOf()), a non-finite point shows only as a non-finite box, so it is reported as "a point"; on the host it is reported by its index.

Template Parameters
TFloating-point precision.
SourceThe positions' source.
Parameters
[in]a_sourceThe positions.
[in]a_numPointsNumber of points.
[in]a_parallelWhether the build runs through GPU::parallelFor().
[in]a_scratchGPU::boundingBoxScratchSize(a_numPoints) elements the launches can write, for a build through GPU::parallelFor(); unused otherwise.
[in]a_whoThe calling function, for the message when a point is not finite.
[in]a_nounWhat a point is called in that message ("point", or "sphere" for a box of centers).
Returns
The box; zeros for no points.

◆ keyCount()

uint32_t EBGeometry::PointCloudDetail::keyCount ( const uint32_t  a_n)
inlinenoexcept

The smallest power of two at least a_n, and 0 for 0: how many keys a build sorts with GPU::bitonicSort().

Internal helper; not part of the public API.

Parameters
[in]a_nNumber of points, at most 2^31.
Returns
The key count.

◆ requireValidCloud()

template<class T >
void EBGeometry::PointCloudDetail::requireValidCloud ( const char *  a_who,
const std::vector< Vec3T< T > > &  a_positions 
)
inlinenoexcept

Abort with a message unless a point cloud can be indexed.

Checks, once per construction, that the number of points fits the uint32 cloud indices the structures store and report (with PointCloud::InvalidIndex left over as the "no point" sentinel), and that every coordinate is finite. Always on rather than an EBGEOMETRY_EXPECT: each would otherwise be a silently truncated cloud or a poisoned build in a Release build.

Template Parameters
TFloating-point precision.
Parameters
[in]a_whoClass being built, for the message.
[in]a_positionsPoint positions.