HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::ChannelAccessor< ChannelT, IndexT > Class Template Reference

Class to access values in channels at a specific voxel location. More...

#include <NanoVDB.h>

+ Inheritance diagram for nanovdb::ChannelAccessor< ChannelT, IndexT >:

Public Types

using ValueType = ChannelT
 
using TreeType = NanoTree< IndexT >
 
using AccessorType = ChannelAccessor< ChannelT, IndexT >
 
- Public Types inherited from nanovdb::ReadAccessor< BuildT, 0, 1, 2 >
using BuildType = BuildT
 
using ValueType = ValueT
 
using CoordType = CoordT
 

Public Member Functions

__hostdev__ ChannelAccessor (const NanoGrid< IndexT > &grid, uint32_t channelID=0u)
 Ctor from an IndexGrid and an integer ID of an internal channel that is assumed to exist as blind data in the IndexGrid. More...
 
__hostdev__ ChannelAccessor (const NanoGrid< IndexT > &grid, ChannelT *channelPtr)
 Ctor from an IndexGrid and an external channel. More...
 
__hostdev__ operator bool () const
 return true if this access was initialized correctly More...
 
__hostdev__ const NanoGrid
< IndexT > & 
grid () const
 Return a const reference to the IndexGrid. More...
 
__hostdev__ const TreeTypetree () const
 Return a const reference to the tree of the IndexGrid. More...
 
__hostdev__ const Vec3dvoxelSize () const
 Return a vector of the axial voxel sizes. More...
 
__hostdev__ const uint64_t & valueCount () const
 Return total number of values indexed by the IndexGrid. More...
 
__hostdev__ ChannelT * setChannel (ChannelT *channelPtr)
 Change to an external channel. More...
 
__hostdev__ ChannelT * setChannel (uint32_t channelID)
 Change to an internal channel, assuming it exists as as blind data in the IndexGrid. More...
 
__hostdev__ uint64_t getIndex (const Coord &ijk) const
 Return the linear offset into a channel that maps to the specified coordinate. More...
 
__hostdev__ uint64_t idx (int i, int j, int k) const
 
__hostdev__ ChannelT & getValue (const Coord &ijk) const
 Return the value from a cached channel that maps to the specified coordinate. More...
 
__hostdev__ ChannelT & operator() (const Coord &ijk) const
 
__hostdev__ ChannelT & operator() (int i, int j, int k) const
 
__hostdev__ bool probeValue (const Coord &ijk, typename remove_const< ChannelT >::type &v) const
 return the state and updates the value of the specified voxel More...
 
template<typename T >
__hostdev__ T & getValue (const Coord &ijk, T *channelPtr) const
 Return the value from a specified channel that maps to the specified coordinate. More...
 
- Public Member Functions inherited from nanovdb::ReadAccessor< BuildT, 0, 1, 2 >
__hostdev__ ReadAccessor (const RootT &root)
 Constructor from a root node. More...
 
__hostdev__ ReadAccessor (const GridT &grid)
 Constructor from a grid. More...
 
__hostdev__ ReadAccessor (const TreeT &tree)
 Constructor from a tree. More...
 
__hostdev__ const RootTroot () const
 
 ReadAccessor (const ReadAccessor &)=default
 Defaults constructors. More...
 
 ~ReadAccessor ()=default
 
ReadAccessoroperator= (const ReadAccessor &)=default
 
template<typename NodeT >
__hostdev__ const NodeT * getNode () const
 Return a const point to the cached node of the specified type. More...
 
template<int LEVEL>
__hostdev__ const NodeTrait
< TreeT, LEVEL >::type
getNode () const
 
__hostdev__ void clear ()
 Reset this access to its initial state, i.e. with an empty cache. More...
 
template<typename NodeT >
__hostdev__ bool isCached (const CoordType &ijk) const
 
__hostdev__ ValueType getValue (const CoordType &ijk) const
 
__hostdev__ ValueType getValue (int i, int j, int k) const
 
__hostdev__ ValueType operator() (const CoordType &ijk) const
 
__hostdev__ ValueType operator() (int i, int j, int k) const
 
__hostdev__ auto getNodeInfo (const CoordType &ijk) const
 
__hostdev__ bool isActive (const CoordType &ijk) const
 
__hostdev__ bool probeValue (const CoordType &ijk, ValueType &v) const
 
__hostdev__ const LeafTprobeLeaf (const CoordType &ijk) const
 
template<typename OpT , typename... ArgsT>
__hostdev__ auto get (const CoordType &ijk, ArgsT &&...args) const
 
template<typename OpT , typename... ArgsT>
__hostdev__ auto set (const CoordType &ijk, ArgsT &&...args) const
 
template<typename RayT >
__hostdev__ uint32_t getDim (const CoordType &ijk, const RayT &ray) const
 

Additional Inherited Members

- Static Public Attributes inherited from nanovdb::ReadAccessor< BuildT, 0, 1, 2 >
static const int CacheLevels = 3
 

Detailed Description

template<typename ChannelT, typename IndexT = ValueIndex>
class nanovdb::ChannelAccessor< ChannelT, IndexT >

Class to access values in channels at a specific voxel location.

Note
The ChannelT template parameter can be either const and non-const.

Definition at line 7710 of file NanoVDB.h.

Member Typedef Documentation

template<typename ChannelT , typename IndexT = ValueIndex>
using nanovdb::ChannelAccessor< ChannelT, IndexT >::AccessorType = ChannelAccessor<ChannelT, IndexT>

Definition at line 7721 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
using nanovdb::ChannelAccessor< ChannelT, IndexT >::TreeType = NanoTree<IndexT>

Definition at line 7720 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
using nanovdb::ChannelAccessor< ChannelT, IndexT >::ValueType = ChannelT

Definition at line 7719 of file NanoVDB.h.

Constructor & Destructor Documentation

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ nanovdb::ChannelAccessor< ChannelT, IndexT >::ChannelAccessor ( const NanoGrid< IndexT > &  grid,
uint32_t  channelID = 0u 
)
inline

Ctor from an IndexGrid and an integer ID of an internal channel that is assumed to exist as blind data in the IndexGrid.

Definition at line 7725 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ nanovdb::ChannelAccessor< ChannelT, IndexT >::ChannelAccessor ( const NanoGrid< IndexT > &  grid,
ChannelT *  channelPtr 
)
inline

Ctor from an IndexGrid and an external channel.

Definition at line 7736 of file NanoVDB.h.

Member Function Documentation

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ uint64_t nanovdb::ChannelAccessor< ChannelT, IndexT >::getIndex ( const Coord ijk) const
inline

Return the linear offset into a channel that maps to the specified coordinate.

Definition at line 7774 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ ChannelT& nanovdb::ChannelAccessor< ChannelT, IndexT >::getValue ( const Coord ijk) const
inline

Return the value from a cached channel that maps to the specified coordinate.

Definition at line 7778 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
template<typename T >
__hostdev__ T& nanovdb::ChannelAccessor< ChannelT, IndexT >::getValue ( const Coord ijk,
T *  channelPtr 
) const
inline

Return the value from a specified channel that maps to the specified coordinate.

Note
The template parameter can be either const or non-const

Definition at line 7794 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ const NanoGrid<IndexT>& nanovdb::ChannelAccessor< ChannelT, IndexT >::grid ( ) const
inline

Return a const reference to the IndexGrid.

Definition at line 7749 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ uint64_t nanovdb::ChannelAccessor< ChannelT, IndexT >::idx ( int  i,
int  j,
int  k 
) const
inline

Definition at line 7775 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ nanovdb::ChannelAccessor< ChannelT, IndexT >::operator bool ( ) const
inline

return true if this access was initialized correctly

Definition at line 7746 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ ChannelT& nanovdb::ChannelAccessor< ChannelT, IndexT >::operator() ( const Coord ijk) const
inline

Definition at line 7779 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ ChannelT& nanovdb::ChannelAccessor< ChannelT, IndexT >::operator() ( int  i,
int  j,
int  k 
) const
inline

Definition at line 7780 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ bool nanovdb::ChannelAccessor< ChannelT, IndexT >::probeValue ( const Coord ijk,
typename remove_const< ChannelT >::type v 
) const
inline

return the state and updates the value of the specified voxel

Definition at line 7783 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ ChannelT* nanovdb::ChannelAccessor< ChannelT, IndexT >::setChannel ( ChannelT *  channelPtr)
inline

Change to an external channel.

Returns
Pointer to channel data

Definition at line 7762 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ ChannelT* nanovdb::ChannelAccessor< ChannelT, IndexT >::setChannel ( uint32_t  channelID)
inline

Change to an internal channel, assuming it exists as as blind data in the IndexGrid.

Returns
Pointer to channel data, which could be NULL if channelID is out of range or if ChannelT does not match the value type of the blind data

Definition at line 7768 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ const TreeType& nanovdb::ChannelAccessor< ChannelT, IndexT >::tree ( ) const
inline

Return a const reference to the tree of the IndexGrid.

Definition at line 7752 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ const uint64_t& nanovdb::ChannelAccessor< ChannelT, IndexT >::valueCount ( ) const
inline

Return total number of values indexed by the IndexGrid.

Definition at line 7758 of file NanoVDB.h.

template<typename ChannelT , typename IndexT = ValueIndex>
__hostdev__ const Vec3d& nanovdb::ChannelAccessor< ChannelT, IndexT >::voxelSize ( ) const
inline

Return a vector of the axial voxel sizes.

Definition at line 7755 of file NanoVDB.h.


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