OpenVDB 11.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Grid< BuildT > Struct Template Reference

#include <nanovdb/util/GridBuilder.h>

Inheritance diagram for Grid< BuildT >:
Tree< BuildT >

Public Types

using BuildType = BuildT
 
using ValueType = typename BuildToValueMap<BuildT>::type
 
using TreeType = Tree<BuildT>
 
using Node0 = build::LeafNode<BuildT>
 
using Node1 = build::InternalNode<Node0>
 
using Node2 = build::InternalNode<Node1>
 
using RootNodeType = build::RootNode<Node2>
 
using LeafNodeType = typename RootNodeType::LeafNodeType
 

Public Member Functions

 Grid (const ValueType &background, const std::string &name="", GridClass gClass=GridClass::Unknown)
 
TreeTypetree ()
 
const GridTypegridType () const
 
const GridClassgridClass () const
 
const Mapmap () const
 
void setTransform (double scale=1.0, const Vec3d &translation=Vec3d(0.0))
 
const std::string & gridName () const
 
const std::string & getName () const
 
void setName (const std::string &name)
 
template<typename Func >
void operator() (const Func &func, const CoordBBox &bbox, ValueType delta=ValueType(0))
 Sets grids values in domain of the bbox to those returned by the specified func with the expected signature [](const Coord&)->ValueType.
 
RootNodeTyperoot ()
 
ValueType getValue (const Coord &ijk) const
 
ValueType getValue (int i, int j, int k) const
 
void setValue (const Coord &ijk, const ValueType &value)
 
std::array< size_t, 3 > nodeCount () const
 
ValueAccessor< BuildT > getAccessor ()
 regular accessor for thread-safe reading and non-thread-safe writing
 
WriteAccessor getWriteAccessor ()
 special accessor for thread-safe writing only
 

Public Attributes

GridClass mGridClass
 
GridType mGridType
 
Map mMap
 
std::string mName
 
RootNodeType mRoot
 
std::mutex mMutex
 

Member Typedef Documentation

◆ BuildType

template<typename BuildT >
using BuildType = BuildT

◆ LeafNodeType

template<typename BuildT >
using LeafNodeType = typename RootNodeType::LeafNodeType
inherited

◆ Node0

template<typename BuildT >
using Node0 = build::LeafNode<BuildT>

◆ Node1

template<typename BuildT >
using Node1 = build::InternalNode<Node0>

◆ Node2

template<typename BuildT >
using Node2 = build::InternalNode<Node1>

◆ RootNodeType

template<typename BuildT >
using RootNodeType = build::RootNode<Node2>

◆ TreeType

template<typename BuildT >
using TreeType = Tree<BuildT>

◆ ValueType

template<typename BuildT >
using ValueType = typename BuildToValueMap<BuildT>::type

Constructor & Destructor Documentation

◆ Grid()

template<typename BuildT >
Grid ( const ValueType & background,
const std::string & name = "",
GridClass gClass = GridClass::Unknown )
inline

Member Function Documentation

◆ getAccessor()

template<typename BuildT >
ValueAccessor< BuildT > getAccessor ( )
inlineinherited

regular accessor for thread-safe reading and non-thread-safe writing

◆ getName()

template<typename BuildT >
const std::string & getName ( ) const
inline

◆ getValue() [1/2]

template<typename BuildT >
ValueType getValue ( const Coord & ijk) const
inlineinherited

◆ getValue() [2/2]

template<typename BuildT >
ValueType getValue ( int i,
int j,
int k ) const
inlineinherited

◆ getWriteAccessor()

template<typename BuildT >
WriteAccessor getWriteAccessor ( )
inlineinherited

special accessor for thread-safe writing only

◆ gridClass()

template<typename BuildT >
const GridClass & gridClass ( ) const
inline

◆ gridName()

template<typename BuildT >
const std::string & gridName ( ) const
inline

◆ gridType()

template<typename BuildT >
const GridType & gridType ( ) const
inline

◆ map()

template<typename BuildT >
const Map & map ( ) const
inline

◆ nodeCount()

template<typename BuildT >
std::array< size_t, 3 > nodeCount ( ) const
inlineinherited

◆ operator()()

template<typename BuildT >
template<typename Func >
void operator() ( const Func & func,
const CoordBBox & bbox,
ValueType delta = ValueType(0) )

Sets grids values in domain of the bbox to those returned by the specified func with the expected signature [](const Coord&)->ValueType.

Note
If func returns a value equal to the background value of the input grid at a specific voxel coordinate, then the active state of that coordinate is off! Else the value value is set and the active state is on. This is done to allow for sparse grids to be generated.
Parameters
funcFunctor used to evaluate the grid values in the bbox
bboxCoordinate bounding-box over which the grid values will be set.
deltaSpecifies a lower threshold value for rendering (optional). Typically equals the voxel size for level sets and otherwise it's zero.

◆ root()

template<typename BuildT >
RootNodeType & root ( )
inlineinherited

◆ setName()

template<typename BuildT >
void setName ( const std::string & name)
inline

◆ setTransform()

template<typename BuildT >
void setTransform ( double scale = 1.0,
const Vec3d & translation = Vec3d(0.0) )
inline

◆ setValue()

template<typename BuildT >
void setValue ( const Coord & ijk,
const ValueType & value )
inlineinherited

◆ tree()

template<typename BuildT >
TreeType & tree ( )
inline

Member Data Documentation

◆ mGridClass

template<typename BuildT >
GridClass mGridClass

◆ mGridType

template<typename BuildT >
GridType mGridType

◆ mMap

template<typename BuildT >
Map mMap

◆ mMutex

template<typename BuildT >
std::mutex mMutex
inherited

◆ mName

template<typename BuildT >
std::string mName

◆ mRoot

template<typename BuildT >
RootNodeType mRoot
inherited