EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
EBGeometry::PointAoSoA< T, W > Struct Template Reference

A PointSoAT<T, W> group that also carries each point's cloud index. More...

#include <EBGeometry_PointAoSoA.hpp>

Collaboration diagram for EBGeometry::PointAoSoA< T, W >:
Collaboration graph
[legend]

Public Member Functions

void pack (const Vec3T< T > *a_positions, const uint32_t *a_pointIds, uint32_t a_count) noexcept
 Pack a_count (position, point id) pairs into this group.
 
Array< T, W > getDistances2 (const Vec3T< T > &a_point) const noexcept
 Squared unsigned distances from a_point to every one of the W lane points.
 
Array< T, W > getDistances (const Vec3T< T > &a_point) const noexcept
 Unsigned distances from a_point to every one of the W lane points.
 
T getMinimumDistance2 (const Vec3T< T > &a_point) const noexcept
 Shortest squared unsigned distance from a_point to the closest point in this group.
 
T getMinimumDistance (const Vec3T< T > &a_point) const noexcept
 Shortest unsigned distance from a_point to the closest point in this group.
 
T getMaximumDistance2 (const Vec3T< T > &a_point) const noexcept
 Largest squared unsigned distance from a_point to the farthest point in this group.
 
T getMaximumDistance (const Vec3T< T > &a_point) const noexcept
 Largest unsigned distance from a_point to the farthest point in this group.
 
uint32_t getPointId (size_t a_lane) const noexcept
 Get the id of the point in one lane of this group.
 
uint32_t numValid () const noexcept
 Number of real (non-padded) points in this group.
 
template<class BV >
BV computeBoundingVolume () const noexcept
 Compute the bounding volume enclosing all valid points in this group.
 

Protected Attributes

PointSoAT< T, W > m_positions
 The wrapped, position-only SoA block. SIMD-hot: this is all the distance queries ever touch. It also holds the valid-point count.
 
Array< uint32_t, W > m_pointIds
 Per-lane point ids, physically separate from m_positions. m_pointIds[j] = id of point j. Never read by the distance queries.
 

Detailed Description

template<class T, size_t W = PointSoA::DefaultWidth<T>()>
struct EBGeometry::PointAoSoA< T, W >

A PointSoAT<T, W> group that also carries each point's cloud index.

Structurally this is an AoSoA (Array of Structures of Arrays): PointSoAT<T, W> itself is true SoA (one flat array per coordinate, no per-point structure at all), and PointAoSoA adds exactly one more member – an Array<uint32_t, W> of point ids – alongside it. The two are never merged or interleaved: the distance queries (getMinimumDistance2(), getMaximumDistance2(), getDistances2(), and their sqrt forms – all delegated straight through to the embedded PointSoAT) never read the ids at all, so a pure position-only distance traversal over PointAoSoA-packed leaves touches exactly the same bytes it would touch over bare PointSoAT-packed leaves – an id is only ever read afterward, once a query already knows which lane (and therefore which point) it cares about, via getPointId(). This is the point counterpart of TriangleAoSoA, which carries face ids the same way.

Template Parameters
TFloating-point precision.
WSIMD width; see PointSoAT. Defaults to PointSoA::DefaultWidth<T>(), matching PointSoAT's own default.

Member Function Documentation

◆ computeBoundingVolume()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
template<class BV >
BV EBGeometry::PointAoSoA< T, W >::computeBoundingVolume ( ) const
noexcept

Compute the bounding volume enclosing all valid points in this group.

Delegates entirely to the embedded PointSoAT<T, W>.

Template Parameters
BVBounding volume type (e.g. AABBT<T>); must be constructible from a point array (a Vec3T<T> pointer and a count).
Returns
Bounding volume enclosing all valid point positions.

◆ getDistances()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Array< T, W > EBGeometry::PointAoSoA< T, W >::getDistances ( const Vec3T< T > &  a_point) const
noexcept

Unsigned distances from a_point to every one of the W lane points.

Delegates to PointSoAT<T, W>::getDistances(); the sqrt of each getDistances2() lane.

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Per-lane distances, one per W lanes.

◆ getDistances2()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
Array< T, W > EBGeometry::PointAoSoA< T, W >::getDistances2 ( const Vec3T< T > &  a_point) const
noexcept

Squared unsigned distances from a_point to every one of the W lane points.

Delegates entirely to the embedded PointSoAT<T, W>; never touches the ids. Padded lanes repeat the last real point's value; see PointSoAT::getDistances2().

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Per-lane squared distances, one per W lanes.

◆ getMaximumDistance()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
T EBGeometry::PointAoSoA< T, W >::getMaximumDistance ( const Vec3T< T > &  a_point) const
noexcept

Largest unsigned distance from a_point to the farthest point in this group.

Delegates to PointSoAT<T, W>::getMaximumDistance(); the sqrt of getMaximumDistance2().

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Distance from a_point to the farthest valid point in this group.

◆ getMaximumDistance2()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
T EBGeometry::PointAoSoA< T, W >::getMaximumDistance2 ( const Vec3T< T > &  a_point) const
noexcept

Largest squared unsigned distance from a_point to the farthest point in this group.

Delegates entirely to the embedded PointSoAT<T, W>; never touches the ids.

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Squared distance from a_point to the farthest valid point in this group.

◆ getMinimumDistance()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
T EBGeometry::PointAoSoA< T, W >::getMinimumDistance ( const Vec3T< T > &  a_point) const
noexcept

Shortest unsigned distance from a_point to the closest point in this group.

Delegates to PointSoAT<T, W>::getMinimumDistance(); the sqrt of getMinimumDistance2().

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Distance from a_point to the closest valid point in this group.

◆ getMinimumDistance2()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
T EBGeometry::PointAoSoA< T, W >::getMinimumDistance2 ( const Vec3T< T > &  a_point) const
noexcept

Shortest squared unsigned distance from a_point to the closest point in this group.

Delegates entirely to the embedded PointSoAT<T, W>; never touches the ids. Avoids the sqrt that getMinimumDistance() pays – prefer it whenever the caller only needs the distance for comparison, not its actual magnitude.

Parameters
[in]a_pointQuery point. Must be finite.
Returns
Squared distance from a_point to the closest valid point in this group.

◆ getPointId()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
uint32_t EBGeometry::PointAoSoA< T, W >::getPointId ( size_t  a_lane) const
noexcept

Get the id of the point in one lane of this group.

Requires the group to have already been packed via pack().

Parameters
[in]a_laneLane index. Must satisfy 0 <= a_lane < W (padded lanes return the last real point's id – see pack()).
Returns
The id of the point at a_lane.

◆ numValid()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
uint32_t EBGeometry::PointAoSoA< T, W >::numValid ( ) const
inlinenoexcept

Number of real (non-padded) points in this group.

Returns
The count passed to pack(), 1..W (0 before pack()).

◆ pack()

template<class T , size_t W = PointSoA::DefaultWidth<T>()>
void EBGeometry::PointAoSoA< T, W >::pack ( const Vec3T< T > *  a_positions,
const uint32_t *  a_pointIds,
uint32_t  a_count 
)
noexcept

Pack a_count (position, point id) pairs into this group.

Pads lanes a_count..W-1 by repeating the last real position and id, matching PointSoAT::pack()'s own padding convention, so all W lanes hold valid data. Scans that must see each point once stop at numValid().

Parameters
[in]a_positionsSource position array with at least a_count elements. Must not be null.
[in]a_pointIdsSource id array (typically cloud indices) with at least a_count elements, same order and length as a_positions. Must not be null.
[in]a_countNumber of valid (position, id) pairs to pack. Must satisfy 1 <= a_count <= W.

The documentation for this struct was generated from the following file: