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

using BuildType = BuildT
using LeafNodeType = typename RootNodeType::LeafNodeType
inherited
using Node0 = build::LeafNode<BuildT>
using TreeType = Tree<BuildT>
using ValueType = typename BuildToValueMap<BuildT>::type

Constructor & Destructor Documentation

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

Member Function Documentation

ValueAccessor<BuildT> getAccessor ( )
inlineinherited

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

const std::string& getName ( ) const
inline
ValueType getValue ( const Coord ijk) const
inlineinherited
ValueType getValue ( int  i,
int  j,
int  k 
) const
inlineinherited
WriteAccessor getWriteAccessor ( )
inlineinherited

special accessor for thread-safe writing only

const GridClass& gridClass ( ) const
inline
const std::string& gridName ( ) const
inline
const GridType& gridType ( ) const
inline
const Map& map ( ) const
inline
std::array<size_t,3> nodeCount ( ) const
inlineinherited
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.
RootNodeType& root ( )
inlineinherited
void setName ( const std::string &  name)
inline
void setTransform ( double  scale = 1.0,
const Vec3d translation = Vec3d(0.0) 
)
inline
void setValue ( const Coord ijk,
const ValueType value 
)
inlineinherited
TreeType& tree ( )
inline

Member Data Documentation

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