OpenVDB 13.0.0

Loading...
Searching...
No Matches
ChannelAccessor< ChannelT, IndexT > Class Template Reference

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

`#include <nanovdb/NanoVDB.h>`

Inheritance diagram for ChannelAccessor< ChannelT, IndexT >:

## Public Types
using | ValueType = ChannelT
using | TreeType = NanoTree<IndexT>
using | AccessorType = ChannelAccessor<ChannelT, IndexT>
using | BuildType = BuildT
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.
__hostdev__ | ChannelAccessor (const NanoGrid< IndexT > &grid, ChannelT *channelPtr)
| Ctor from an IndexGrid and an external channel.
__hostdev__ | operator bool () const
| return true if this access was initialized correctly
__hostdev__ const NanoGrid< IndexT > & | grid () const
| Return a const reference to the IndexGrid.
__hostdev__ const TreeType & | tree () const
| Return a const reference to the tree of the IndexGrid.
__hostdev__ const Vec3d & | voxelSize () const
| Return a vector of the axial voxel sizes.
__hostdev__ const uint64_t & | valueCount () const
| Return total number of values indexed by the IndexGrid.
__hostdev__ ChannelT * | setChannel (ChannelT *channelPtr)
| Change to an external channel.
__hostdev__ ChannelT * | setChannel (uint32_t channelID)
| Change to an internal channel, assuming it exists as as blind data in the IndexGrid.
__hostdev__ uint64_t | getIndex (const math::Coord &ijk) const
| Return the linear offset into a channel that maps to the specified coordinate.
__hostdev__ uint64_t | idx (int i, int j, int k) const
__hostdev__ ChannelT & | getValue (const math::Coord &ijk) const
| Return the value from a cached channel that maps to the specified coordinate.
__hostdev__ ChannelT & | operator() (const math::Coord &ijk) const
__hostdev__ ChannelT & | operator() (int i, int j, int k) const
__hostdev__ bool | probeValue (const math::Coord &ijk, typename util::remove_const< ChannelT >::type &v) const
| return the state and updates the value of the specified voxel
template<typename T>
__hostdev__ T & | getValue (const math::Coord &ijk, T *channelPtr) const
| Return the value from a specified channel that maps to the specified coordinate.
__hostdev__ const RootT & | root () const
template<typename NodeT>
__hostdev__ const NodeT * | getNode () const
| Return a const point to the cached node of the specified type.
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.
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__ auto | getNodeInfo (const CoordType &ijk) const
__hostdev__ bool | isActive (const CoordType &ijk) const
__hostdev__ bool | probeValue (const CoordType &ijk, ValueType &v) const
__hostdev__ const LeafT * | probeLeaf (const CoordType &ijk) const
template<typename OpT, typename... ArgsT>
__hostdev__ OpT::Type | get (const CoordType &ijk, ArgsT &&... args) const
template<typename OpT, typename... ArgsT>
__hostdev__ void | set (const CoordType &ijk, ArgsT &&... args) const
template<typename RayT>
__hostdev__ uint32_t | getDim (const CoordType &ijk, const RayT &ray) const

## Static Public Attributes
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.

## Member Typedef Documentation

## ◆ AccessorType

template<typename ChannelT, typename IndexT = ValueIndex>

using AccessorType = ChannelAccessor<ChannelT, IndexT>

## ◆ BuildType

template<typename BuildT>

using BuildType = BuildT
| inherited

## ◆ CoordType

template<typename BuildT>

using CoordType = CoordT
| inherited

## ◆ TreeType

template<typename ChannelT, typename IndexT = ValueIndex>

using TreeType = NanoTree<IndexT>

## ◆ ValueType

template<typename ChannelT, typename IndexT = ValueIndex>

using ValueType = ChannelT

## Constructor & Destructor Documentation

## ◆ ChannelAccessor() [1/2]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ 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.

## ◆ ChannelAccessor() [2/2]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ ChannelAccessor | ( | const NanoGrid< IndexT > & | grid,
|  | ChannelT * | channelPtr )
| inline

Ctor from an IndexGrid and an external channel.

## Member Function Documentation

## ◆ clear()

template<typename BuildT>

__hostdev__ void clear | ( |  | ) |
| inline inherited

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

## ◆ get()

template<typename BuildT>
template<typename OpT, typename... ArgsT>

__hostdev__ OpT::Type get | ( | const CoordType & | ijk,
|  | ArgsT &&... | args ) const
| inline inherited

## ◆ getDim()

template<typename BuildT>
template<typename RayT>

__hostdev__ uint32_t getDim | ( | const CoordType & | ijk,
|  | const RayT & | ray ) const
| inline inherited

## ◆ getIndex()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ uint64_t getIndex | ( | const math::Coord & | ijk | ) | const
| inline

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

## ◆ getNode() [1/2]

template<typename BuildT>
template<int LEVEL>

__hostdev__ const NodeTrait< TreeT, LEVEL >::type * getNode | ( |  | ) | const
| inline inherited

## ◆ getNode() [2/2]

template<typename BuildT>
template<typename NodeT>

__hostdev__ const NodeT * getNode | ( |  | ) | const
| inline inherited

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

Warning
  The return value could be NULL.

## ◆ getNodeInfo()

template<typename BuildT>

__hostdev__ auto getNodeInfo | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ getValue() [1/4]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ ChannelT & getValue | ( | const math::Coord & | ijk | ) | const
| inline

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

## ◆ getValue() [2/4]

template<typename ChannelT, typename IndexT = ValueIndex>
template<typename T>

__hostdev__ T & getValue | ( | const math::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/4]

template<typename BuildT>

__hostdev__ ValueType getValue | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ getValue() [4/4]

template<typename BuildT>

__hostdev__ ValueType getValue | ( | int | i,
|  | int | j,
|  | int | k ) const
| inline inherited

## ◆ grid()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ const NanoGrid< IndexT > & grid | ( |  | ) | const
| inline

Return a const reference to the IndexGrid.

## ◆ idx()

template<typename ChannelT, typename IndexT = ValueIndex>

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

## ◆ isActive()

template<typename BuildT>

__hostdev__ bool isActive | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ isCached()

template<typename BuildT>
template<typename NodeT>

__hostdev__ bool isCached | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ operator bool()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ operator bool | ( |  | ) | const
| inline

return true if this access was initialized correctly

## ◆ operator()() [1/3]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ ChannelT & operator() | ( | const math::Coord & | ijk | ) | const
| inline

## ◆ operator()() [2/3]

template<typename ChannelT, typename IndexT = ValueIndex>

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

## ◆ operator()() [3/3]

template<typename BuildT>

__hostdev__ ValueType operator() | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ probeLeaf()

template<typename BuildT>

__hostdev__ const LeafT * probeLeaf | ( | const CoordType & | ijk | ) | const
| inline inherited

## ◆ probeValue() [1/2]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ bool probeValue | ( | const math::Coord & | ijk,
|  | typename util::remove_const< ChannelT >::type & | v ) const
| inline

return the state and updates the value of the specified voxel

## ◆ probeValue() [2/2]

template<typename BuildT>

__hostdev__ bool probeValue | ( | const CoordType & | ijk,
|  | ValueType & | v ) const
| inline inherited

## ◆ root()

template<typename BuildT>

__hostdev__ const RootT & root | ( |  | ) | const
| inline inherited

## ◆ set()

template<typename BuildT>
template<typename OpT, typename... ArgsT>

__hostdev__ void set | ( | const CoordType & | ijk,
|  | ArgsT &&... | args ) const
| inline inherited

## ◆ setChannel() [1/2]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ ChannelT * setChannel | ( | ChannelT * | channelPtr | ) |
| inline

Change to an external channel.

Returns
  Pointer to channel data

## ◆ setChannel() [2/2]

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ ChannelT * 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

## ◆ tree()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ const TreeType & tree | ( |  | ) | const
| inline

Return a const reference to the tree of the IndexGrid.

## ◆ valueCount()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ const uint64_t & valueCount | ( |  | ) | const
| inline

Return total number of values indexed by the IndexGrid.

## ◆ voxelSize()

template<typename ChannelT, typename IndexT = ValueIndex>

__hostdev__ const Vec3d & voxelSize | ( |  | ) | const
| inline

Return a vector of the axial voxel sizes.

## Member Data Documentation

## ◆ CacheLevels

template<typename BuildT>

const int CacheLevels = 3
| static inherited