CubbyFlow::PointHashGridUtils< N > Class Template Reference

Hash grid common utilities for N-D point searchers. More...

#include <Core/Utils/PointHashGridUtils.hpp>

Static Public Member Functions

template<size_t M = N>
static std::enable_if_t< M==2, size_t > HashKey (const Vector< ssize_t, 2 > &index, const Vector< ssize_t, 2 > &resolution)
 
template<size_t M = N>
static std::enable_if_t< M==3, size_t > HashKey (const Vector< ssize_t, 3 > &index, const Vector< ssize_t, 3 > &resolution)
 
static size_t GetHashKeyFromBucketIndex (const Vector< ssize_t, N > &bucketIndex, const Vector< ssize_t, N > &resolution)
 
static Vector< ssize_t, N > GetBucketIndex (const Vector< double, N > &position, double gridSpacing)
 
static size_t GetHashKeyFromPosition (const Vector< double, N > &position, double gridSpacing, const Vector< ssize_t, N > &resolution)
 
static void GetNearbyKeys (const Vector< double, N > &position, double gridSpacing, const Vector< ssize_t, N > &resolution, size_t *nearbyKeys)
 

Detailed Description

template<size_t N>
class CubbyFlow::PointHashGridUtils< N >

Hash grid common utilities for N-D point searchers.

Member Function Documentation

◆ GetBucketIndex()

template<size_t N>
static Vector<ssize_t, N> CubbyFlow::PointHashGridUtils< N >::GetBucketIndex ( const Vector< double, N > &  position,
double  gridSpacing 
)
static

Gets the bucket index from a point.

Parameters
[in]positionThe position of the point.
[in]gridSpacingThe grid spacing.
Returns
The bucket index.

◆ GetHashKeyFromBucketIndex()

template<size_t N>
static size_t CubbyFlow::PointHashGridUtils< N >::GetHashKeyFromBucketIndex ( const Vector< ssize_t, N > &  bucketIndex,
const Vector< ssize_t, N > &  resolution 
)
static

Returns the hash value for given N-D bucket index.

Parameters
[in]bucketIndexThe bucket index.
[in]resolutionThe resolution.
Returns
The hash key from bucket index.

◆ GetHashKeyFromPosition()

template<size_t N>
static size_t CubbyFlow::PointHashGridUtils< N >::GetHashKeyFromPosition ( const Vector< double, N > &  position,
double  gridSpacing,
const Vector< ssize_t, N > &  resolution 
)
static

◆ GetNearbyKeys()

template<size_t N>
static void CubbyFlow::PointHashGridUtils< N >::GetNearbyKeys ( const Vector< double, N > &  position,
double  gridSpacing,
const Vector< ssize_t, N > &  resolution,
size_t *  nearbyKeys 
)
static

◆ HashKey() [1/2]

template<size_t N>
template<size_t M = N>
static std::enable_if_t<M == 2, size_t> CubbyFlow::PointHashGridUtils< N >::HashKey ( const Vector< ssize_t, 2 > &  index,
const Vector< ssize_t, 2 > &  resolution 
)
static

◆ HashKey() [2/2]

template<size_t N>
template<size_t M = N>
static std::enable_if_t<M == 3, size_t> CubbyFlow::PointHashGridUtils< N >::HashKey ( const Vector< ssize_t, 3 > &  index,
const Vector< ssize_t, 3 > &  resolution 
)
static

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