OpenVDB 10.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
ChannelAccessor< ChannelT > Class Template Reference

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

#include <nanovdb/NanoVDB.h>

Inheritance diagram for ChannelAccessor< ChannelT >:
ReadAccessor< BuildT, 0, 1, 2 >

Public Types

using ValueType = ChannelT
 
using TreeType = IndexTree
 
using AccessorType = ChannelAccessor< ChannelT >
 
using CoordType = CoordT
 
using NodeInfo = typename ReadAccessor< ValueT, -1, -1, -1 >::NodeInfo
 

Public Member Functions

 ChannelAccessor (const IndexGrid &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...
 
 ChannelAccessor (const IndexGrid &grid, ChannelT *channelPtr)
 Ctor from an IndexGrid and an external channel. More...
 
const IndexGridgrid () const
 Return a const reference to the IndexGrid. More...
 
const IndexTreetree () const
 Return a const reference to the tree of the IndexGrid. More...
 
const Vec3RvoxelSize () const
 Return a vector of the axial voxel sizes. More...
 
const uint64_t & valueCount () const
 Return total number of values indexed by the IndexGrid. More...
 
void setChannel (ChannelT *channelPtr)
 Change to an external channel. More...
 
void setChannel (uint32_t channelID)
 Change to an internal channel, assuming it exists as as blind data in the IndexGrid. More...
 
uint64_t getIndex (const Coord &ijk) const
 Return the linear offset into a channel that maps to the specified coordinate. More...
 
uint64_t idx (int i, int j, int k) const
 
ChannelT & getValue (const Coord &ijk) const
 Return the value from a cached channel that maps to the specified coordinate. More...
 
ChannelT & operator() (const Coord &ijk) const
 
ChannelT & operator() (int i, int j, int k) const
 
bool probeValue (const CoordType &ijk, typename remove_const< ChannelT >::type &v) const
 return the state and updates the value of the specified voxel More...
 
template<typename T >
T & getValue (const Coord &ijk, T *channelPtr) const
 Return the value from a specified channel that maps to the specified coordinate. More...
 
const RootTroot () const
 
template<typename NodeT >
const NodeT * getNode () const
 Return a const point to the cached node of the specified type. More...
 
template<int LEVEL>
const NodeTrait< TreeT, LEVEL >::type * getNode () const
 
void clear ()
 Reset this access to its initial state, i.e. with an empty cache. More...
 
template<typename NodeT >
bool isCached (const CoordType &ijk) const
 
ValueType getValue (const CoordType &ijk) const
 
ValueType operator() (const CoordType &ijk) const
 
NodeInfo getNodeInfo (const CoordType &ijk) const
 
bool isActive (const CoordType &ijk) const
 
bool probeValue (const CoordType &ijk, ValueType &v) const
 
const LeafTprobeLeaf (const CoordType &ijk) const
 
template<typename RayT >
uint32_t getDim (const CoordType &ijk, const RayT &ray) const
 

Static Public Attributes

static const int CacheLevels = 3
 

Detailed Description

template<typename ChannelT>
class nanovdb::ChannelAccessor< ChannelT >

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

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

Member Typedef Documentation

◆ AccessorType

using AccessorType = ChannelAccessor<ChannelT>

◆ CoordType

using CoordType = CoordT
inherited

◆ NodeInfo

using NodeInfo = typename ReadAccessor<ValueT, -1, -1, -1>::NodeInfo
inherited

◆ TreeType

◆ ValueType

using ValueType = ChannelT

Constructor & Destructor Documentation

◆ ChannelAccessor() [1/2]

ChannelAccessor ( const IndexGrid 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.

◆ ChannelAccessor() [2/2]

ChannelAccessor ( const IndexGrid grid,
ChannelT *  channelPtr 
)
inline

Ctor from an IndexGrid and an external channel.

Member Function Documentation

◆ clear()

void clear ( )
inlineinherited

Reset this access to its initial state, i.e. with an empty cache.

◆ getDim()

uint32_t getDim ( const CoordType ijk,
const RayT &  ray 
) const
inlineinherited

◆ getIndex()

uint64_t getIndex ( const Coord ijk) const
inline

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

◆ getNode() [1/2]

const NodeT * getNode ( ) const
inlineinherited

Return a const point to the cached node of the specified type.

Warning
The return value could be NULL.

◆ getNode() [2/2]

const NodeTrait< TreeT, LEVEL >::type * getNode ( ) const
inlineinherited

◆ getNodeInfo()

NodeInfo getNodeInfo ( const CoordType ijk) const
inlineinherited

◆ getValue() [1/3]

ChannelT & getValue ( const Coord ijk) const
inline

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

◆ getValue() [2/3]

T & 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

◆ getValue() [3/3]

ValueType getValue ( const CoordType ijk) const
inlineinherited

◆ grid()

const IndexGrid & grid ( ) const
inline

Return a const reference to the IndexGrid.

◆ idx()

uint64_t idx ( int  i,
int  j,
int  k 
) const
inline

◆ isActive()

bool isActive ( const CoordType ijk) const
inlineinherited

◆ isCached()

bool isCached ( const CoordType ijk) const
inlineinherited

◆ operator()() [1/3]

ChannelT & operator() ( const Coord ijk) const
inline

◆ operator()() [2/3]

ValueType operator() ( const CoordType ijk) const
inlineinherited

◆ operator()() [3/3]

ChannelT & operator() ( int  i,
int  j,
int  k 
) const
inline

◆ probeLeaf()

const LeafT * probeLeaf ( const CoordType ijk) const
inlineinherited

◆ probeValue() [1/2]

bool probeValue ( const CoordType ijk,
typename remove_const< ChannelT >::type &  v 
) const
inline

return the state and updates the value of the specified voxel

◆ probeValue() [2/2]

bool probeValue ( const CoordType ijk,
ValueType v 
) const
inlineinherited

◆ root()

const RootT & root ( ) const
inlineinherited

◆ setChannel() [1/2]

void setChannel ( ChannelT *  channelPtr)
inline

Change to an external channel.

◆ setChannel() [2/2]

void setChannel ( uint32_t  channelID)
inline

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

◆ tree()

const IndexTree & tree ( ) const
inline

Return a const reference to the tree of the IndexGrid.

◆ valueCount()

const uint64_t & valueCount ( ) const
inline

Return total number of values indexed by the IndexGrid.

◆ voxelSize()

const Vec3R & voxelSize ( ) const
inline

Return a vector of the axial voxel sizes.

Member Data Documentation

◆ CacheLevels

const int CacheLevels = 3
staticinherited