OpenVDB  11.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Grid< BuildT > Struct Template Reference

#include <nanovdb/util/GridBuilder.h>

Inherits 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. More...
 
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 More...
 
WriteAccessor getWriteAccessor ()
 special accessor for thread-safe writing only More...
 

Public Attributes

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

Member Typedef Documentation

◆ BuildType

using BuildType = BuildT

◆ LeafNodeType

using LeafNodeType = typename RootNodeType::LeafNodeType
inherited

◆ Node0

using Node0 = build::LeafNode<BuildT>

◆ Node1

◆ Node2

◆ RootNodeType

◆ TreeType

using TreeType = Tree<BuildT>

◆ ValueType

using ValueType = typename BuildToValueMap<BuildT>::type

Constructor & Destructor Documentation

◆ Grid()

Grid ( const ValueType background,
const std::string &  name = "",
GridClass  gClass = GridClass::Unknown 
)
inline

Member Function Documentation

◆ getAccessor()

ValueAccessor<BuildT> getAccessor ( )
inlineinherited

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

◆ getName()

const std::string& getName ( ) const
inline

◆ getValue() [1/2]

ValueType getValue ( const Coord ijk) const
inlineinherited

◆ getValue() [2/2]

ValueType getValue ( int  i,
int  j,
int  k 
) const
inlineinherited

◆ getWriteAccessor()

WriteAccessor getWriteAccessor ( )
inlineinherited

special accessor for thread-safe writing only

◆ gridClass()

const GridClass& gridClass ( ) const
inline

◆ gridName()

const std::string& gridName ( ) const
inline

◆ gridType()

const GridType& gridType ( ) const
inline

◆ map()

const Map& map ( ) const
inline

◆ nodeCount()

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

◆ operator()()

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()

RootNodeType& root ( )
inlineinherited

◆ setName()

void setName ( const std::string &  name)
inline

◆ setTransform()

void setTransform ( double  scale = 1.0,
const Vec3d translation = Vec3d(0.0) 
)
inline

◆ setValue()

void setValue ( const Coord ijk,
const ValueType value 
)
inlineinherited

◆ tree()

TreeType& tree ( )
inline

Member Data Documentation

◆ mGridClass

GridClass mGridClass

◆ mGridType

GridType mGridType

◆ mMap

Map mMap

◆ mMutex

std::mutex mMutex
inherited

◆ mName

std::string mName

◆ mRoot

RootNodeType mRoot
inherited