OpenVDB 12.0.0
|
Dense is a simple dense grid API used by the CopyToDense and CopyFromDense classes defined below. More...
#include </private/tmp/openvdb-20241101-6830-c2ql2h/openvdb-12.0.0/openvdb/openvdb/tools/Dense.h>
Public Types | |
using | ValueType = ValueT |
using | BaseT = DenseBase<ValueT, Layout> |
using | Ptr = SharedPtr<Dense> |
using | ConstPtr = SharedPtr<const Dense> |
Public Member Functions | |
Dense (const CoordBBox &bbox) | |
Construct a dense grid with a given range of coordinates. | |
Dense (const CoordBBox &bbox, const ValueT &value) | |
Construct a dense grid with a given range of coordinates and initial value. | |
Dense (const CoordBBox &bbox, ValueT *data) | |
Construct a dense grid that wraps an external array. | |
Dense (const Coord &dim, const Coord &min=Coord(0)) | |
Construct a dense grid with a given origin and dimensions. | |
ValueT * | data () |
Return a raw pointer to this grid's value array. | |
const ValueT * | data () const |
Return a raw pointer to this grid's value array. | |
const CoordBBox & | bbox () const |
Return the bounding box of the signed index domain of this grid. | |
const Coord & | origin () const |
Return the grid's origin in index coordinates. | |
Index64 | valueCount () const |
Return the number of voxels contained in this grid. | |
void | setValue (size_t offset, const ValueT &value) |
Set the value of the voxel at the given array offset. | |
const ValueT & | getValue (size_t offset) const |
Return a const reference to the value of the voxel at the given array offset. | |
ValueT & | getValue (size_t offset) |
Return a non-const reference to the value of the voxel at the given array offset. | |
void | setValue (size_t i, size_t j, size_t k, const ValueT &value) |
Set the value of the voxel at unsigned index coordinates (i, j, k). | |
const ValueT & | getValue (size_t i, size_t j, size_t k) const |
Return a const reference to the value of the voxel at unsigned index coordinates (i, j, k). | |
ValueT & | getValue (size_t i, size_t j, size_t k) |
Return a non-const reference to the value of the voxel at unsigned index coordinates (i, j, k). | |
void | setValue (const Coord &xyz, const ValueT &value) |
Set the value of the voxel at the given signed coordinates. | |
const ValueT & | getValue (const Coord &xyz) const |
Return a const reference to the value of the voxel at the given signed coordinates. | |
ValueT & | getValue (const Coord &xyz) |
Return a non-const reference to the value of the voxel at the given signed coordinates. | |
void | fill (const ValueT &value) |
Fill this grid with a constant value. | |
size_t | coordToOffset (const Coord &xyz) const |
Return the linear offset into this grid's value array given by the specified signed coordinates, i.e., coordinates in the space of this grid's bounding box. | |
Coord | offsetToCoord (size_t n) const |
Return the global coordinate corresponding to the specified linear offset. | |
Index64 | memUsage () const |
Return the memory footprint of this Dense grid in bytes. | |
void | print (const std::string &name="", std::ostream &os=std::cout) const |
Output a human-readable description of this grid to the specified stream. | |
size_t | coordToOffset (size_t i, size_t j, size_t k) const |
Return the linear offset into this grid's value array given by unsigned coordinates (i, j, k), i.e., coordinates relative to the origin of this grid's bounding box. | |
Coord | offsetToLocalCoord (size_t n) const |
Return the local coordinate corresponding to the specified linear offset. | |
size_t | xStride () const |
Return the stride of the array in the x direction ( = dimY*dimZ). | |
size_t | yStride () const |
Return the stride of the array in the y direction ( = dimZ). | |
Static Public Member Functions | |
static MemoryLayout | memoryLayout () |
Return the memory layout for this grid (see above for definitions). | |
static size_t | zStride () |
Return the stride of the array in the z direction ( = 1). | |
Protected Attributes | |
const CoordBBox | mBBox |
const size_t | mY |
const size_t | mX |
Dense is a simple dense grid API used by the CopyToDense and CopyFromDense classes defined below.
Use the Dense class to efficiently produce a dense in-memory representation of an OpenVDB grid. However, be aware that a dense grid could have a memory footprint that is orders of magnitude larger than the sparse grid from which it originates.
using BaseT = DenseBase<ValueT, Layout> |
using ConstPtr = SharedPtr<const Dense> |
using Ptr = SharedPtr<Dense> |
using ValueType = ValueT |
|
inline |
Construct a dense grid with a given range of coordinates.
bbox | the bounding box of the (signed) coordinate range of this grid |
ValueError | if the bounding box is empty. |
|
inline |
Construct a dense grid with a given range of coordinates and initial value.
bbox | the bounding box of the (signed) coordinate range of this grid |
value | the initial value of the grid. |
ValueError | if the bounding box is empty. |
|
inline |
Construct a dense grid that wraps an external array.
bbox | the bounding box of the (signed) coordinate range of this grid |
data | a raw C-style array whose size is commensurate with the coordinate domain of bbox |
ValueError | if the bounding box is empty. |
|
inline |
Construct a dense grid with a given origin and dimensions.
dim | the desired dimensions of the grid |
min | the signed coordinates of the first voxel in the dense grid |
ValueError | if any of the dimensions are zero. |
|
inline |
Return the bounding box of the signed index domain of this grid.
|
inline |
Return the linear offset into this grid's value array given by the specified signed coordinates, i.e., coordinates in the space of this grid's bounding box.
|
inlineinherited |
Return the linear offset into this grid's value array given by unsigned coordinates (i, j, k), i.e., coordinates relative to the origin of this grid's bounding box.
|
inline |
Return a raw pointer to this grid's value array.
|
inline |
Return a raw pointer to this grid's value array.
|
inline |
Fill this grid with a constant value.
|
inline |
Return a non-const reference to the value of the voxel at the given signed coordinates.
|
inline |
Return a const reference to the value of the voxel at the given signed coordinates.
|
inline |
Return a non-const reference to the value of the voxel at unsigned index coordinates (i, j, k).
|
inline |
Return a const reference to the value of the voxel at unsigned index coordinates (i, j, k).
|
inline |
Return a non-const reference to the value of the voxel at the given array offset.
|
inline |
Return a const reference to the value of the voxel at the given array offset.
|
inlinestatic |
Return the memory layout for this grid (see above for definitions).
|
inline |
Return the memory footprint of this Dense grid in bytes.
|
inline |
Return the global coordinate corresponding to the specified linear offset.
|
inlineinherited |
Return the local coordinate corresponding to the specified linear offset.
|
inline |
Return the grid's origin in index coordinates.
|
inline |
Output a human-readable description of this grid to the specified stream.
|
inline |
Set the value of the voxel at the given signed coordinates.
|
inline |
Set the value of the voxel at unsigned index coordinates (i, j, k).
|
inline |
Set the value of the voxel at the given array offset.
|
inline |
Return the number of voxels contained in this grid.
|
inlineinherited |
Return the stride of the array in the x direction ( = dimY*dimZ).
|
inlineinherited |
Return the stride of the array in the y direction ( = dimZ).
|
inlinestaticinherited |
Return the stride of the array in the z direction ( = 1).
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |