OpenVDB 5.1.0

Namespaces | Classes | Typedefs | Functions
openvdb::v5_1::points Namespace Reference

## Namespaces
| attribute_traits
| future
| A container for ABI=5 to help ease introduction of upcoming features.
| index_filter_internal
| internal
| point_attribute_internal
| point_conversion_internal
| point_count_internal
| point_delete_internal
| point_group_internal
| point_mask_internal
| point_scatter_internal

## Classes
struct | AccessorEval
| Accessor to call unsafe get and set methods based on templated Codec and Value. More...
struct | AccessorEval< UnknownCodec, ValueType >
| Partial specialization when Codec is not known at compile-time to use the supplied functor instead. More...
class | AttributeArray
| Base class for storing attribute data. More...
class | AttributeHandle
class | AttributeHashFilter
class | AttributeSet
| Ordered collection of uniquely-named attribute arrays. More...
class | AttributeWriteHandle
| Write-able version of AttributeHandle. More...
class | BBoxFilter
class | BinaryFilter
struct | FilterTraits
struct | FilterTraits< BBoxFilter >
struct | FilterTraits< BinaryFilter< T0, T1, And > >
struct | FilterTraits< LevelSetFilter< T > >
struct | FixedPointCodec
struct | GroupCodec
class | GroupFilter
| Index filtering on group membership. More...
class | GroupHandle
class | GroupWriteHandle
class | IndexIter
| A forward iterator over array indices with filtering IteratorT can be either IndexIter or ValueIndexIter (or some custom index iterator) FilterT should be a struct or class with a valid() method than can be evaluated per index Here's a simple filter example that only accepts even indices: More...
class | LevelSetFilter
class | MultiGroupFilter
struct | NullCodec
class | NullFilter
| A no-op filter that can be used when iterating over all indices. More...
class | PointAttributeVector
| Point-partitioner compatible STL vector attribute wrapper for convenience. More...
class | PointDataLeafNode
struct | PositionRange
class | RandomLeafFilter
class | StringAttributeHandle
class | StringAttributeWriteHandle
struct | StringCodec
class | StringMetaInserter
struct | TreeConverter
| Similiar to ValueConverter, but allows for tree configuration conversion to a PointDataTree. ValueConverter<PointDataIndex32> cannot be used as a PointDataLeafNode is not a specialization of LeafNode. More...
struct | TruncateCodec
class | TypedAttributeArray
| Typed class for storing attribute data. More...
struct | UnitRange
struct | UnitVecCodec
struct | UnknownCodec
class | ValueVoxelCIter
| A forward iterator over array indices in a single voxel. More...

## Typedefs
using | StringIndexType = uint32_t
using | StringAttributeArray = TypedAttributeArray< StringIndexType, StringCodec< false > >
using | GroupType = uint8_t
using | GroupAttributeArray = TypedAttributeArray< GroupType, GroupCodec >
using | PointDataTree = tree::Tree< tree::RootNode< tree::InternalNode< tree::InternalNode< PointDataLeafNode< PointDataIndex32, 3 >, 4 >, 5 > >>
| Point index tree configured to match the default VDB configurations. More...
using | PointDataGrid = Grid< PointDataTree >
| Point data grid. More...

## Functions
template<typename IntegerT , typename FloatT >
IntegerT | floatingPointToFixedPoint (const FloatT s)
template<typename FloatT , typename IntegerT >
FloatT | fixedPointToFloatingPoint (const IntegerT s)
template<typename IntegerVectorT , typename FloatT >
IntegerVectorT | floatingPointToFixedPoint (const math::Vec3< FloatT > &v)
template<typename FloatVectorT , typename IntegerT >
FloatVectorT | fixedPointToFloatingPoint (const math::Vec3< IntegerT > &v)
bool | isString (const AttributeArray &array)
bool | isGroup (const AttributeArray &array)
template<typename IterT >
Index64 | iterCount (const IterT &iter)
| Count up the number of times the iterator can iterate. More...
template<typename PointDataTree >
void | appendAttribute (PointDataTree &tree, const Name &name, const NamePair &type, const Index strideOrTotalSize=1, const bool constantStride=true, Metadata::Ptr metaDefaultValue=Metadata::Ptr(), const bool hidden=false, const bool transient=false)
| Appends a new attribute to the VDB tree (this method does not require a templated AttributeType) More...
template<typename ValueType , typename CodecType , typename PointDataTree >
void | appendAttribute (PointDataTree &tree, const std::string &name, const ValueType &uniformValue=point_attribute_internal::Default< ValueType >::value(), const Index strideOrTotalSize=1, const bool constantStride=true, Metadata::Ptr metaDefaultValue=Metadata::Ptr(), const bool hidden=false, const bool transient=false)
| Appends a new attribute to the VDB tree. More...
template<typename ValueType , typename PointDataTree >
void | appendAttribute (PointDataTree &tree, const std::string &name, const ValueType &uniformValue=point_attribute_internal::Default< ValueType >::value(), const Index strideOrTotalSize=1, const bool constantStride=true, Metadata::Ptr metaDefaultValue=Metadata::Ptr(), const bool hidden=false, const bool transient=false)
| Appends a new attribute to the VDB tree. More...
template<typename ValueType , typename PointDataTree >
void | collapseAttribute (PointDataTree &tree, const Name &name, const ValueType &uniformValue=point_attribute_internal::Default< ValueType >::value())
| Collapse the attribute into a uniform value. More...
template<typename PointDataTree >
void | dropAttributes (PointDataTree &tree, const std::vector< size_t > &indices)
| Drops attributes from the VDB tree. More...
template<typename PointDataTree >
void | dropAttributes (PointDataTree &tree, const std::vector< Name > &names)
| Drops attributes from the VDB tree. More...
template<typename PointDataTree >
void | dropAttribute (PointDataTree &tree, const size_t &index)
| Drop one attribute from the VDB tree (convenience method). More...
template<typename PointDataTree >
void | dropAttribute (PointDataTree &tree, const Name &name)
| Drop one attribute from the VDB tree (convenience method). More...
template<typename PointDataTree >
void | renameAttributes (PointDataTree &tree, const std::vector< Name > &oldNames, const std::vector< Name > &newNames)
| Rename attributes in a VDB tree. More...
template<typename PointDataTree >
void | renameAttribute (PointDataTree &tree, const Name &oldName, const Name &newName)
| Rename an attribute in a VDB tree. More...
template<typename PointDataTree >
void | compactAttributes (PointDataTree &tree)
| Compact attributes in a VDB tree (if possible). More...
template<typename PointDataTree >
void | bloscCompressAttribute (PointDataTree &tree, const Name &name)
| Apply Blosc compression to one attribute in the VDB tree. More...
template<typename CompressionT , typename PointDataGridT , typename PositionArrayT , typename PointIndexGridT >
PointDataGridT::Ptr | createPointDataGrid (const PointIndexGridT &pointIndexGrid, const PositionArrayT &positions, const math::Transform &xform, Metadata::Ptr positionDefaultValue=Metadata::Ptr())
| Localises points with position into a `PointDataGrid` into two stages: allocation of the leaf attribute data and population of the positions. More...
template<typename CompressionT , typename PointDataGridT , typename ValueT >
PointDataGridT::Ptr | createPointDataGrid (const std::vector< ValueT > &positions, const math::Transform &xform, Metadata::Ptr positionDefaultValue=Metadata::Ptr())
| Convenience method to create a `PointDataGrid` from a std::vector of point positions. More...
template<typename PointDataTreeT , typename PointIndexTreeT , typename PointArrayT >
void | populateAttribute (PointDataTreeT &tree, const PointIndexTreeT &pointIndexTree, const openvdb::Name &attributeName, const PointArrayT &data, const Index stride=1, const bool insertMetadata=true)
| Stores point attribute data in an existing `PointDataGrid` attribute. More...
template<typename PositionAttribute , typename PointDataGridT >
void | convertPointDataGridPosition (PositionAttribute &positionAttribute, const PointDataGridT &grid, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >(), const bool inCoreOnly=false)
| Convert the position attribute from a Point Data Grid. More...
template<typename TypedAttribute , typename PointDataTreeT >
void | convertPointDataGridAttribute (TypedAttribute &attribute, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const unsigned arrayIndex, const Index stride=1, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >(), const bool inCoreOnly=false)
| Convert the attribute from a PointDataGrid. More...
template<typename Group , typename PointDataTreeT >
void | convertPointDataGridGroup (Group &group, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const AttributeSet::Descriptor::GroupIndex index, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >(), const bool inCoreOnly=false)
| Convert the group from a PointDataGrid. More...
template<typename PositionWrapper , typename InterrupterT = openvdb::util::NullInterrupter>
float | computeVoxelSize (const PositionWrapper &positions, const uint32_t pointsPerVoxel, const math::Mat4d transform=math::Mat4d::identity(), const Index decimalPlaces=5, InterrupterT *const interrupter=nullptr)
template<typename PointDataTreeT >
Index64 | pointCount (const PointDataTreeT &tree, const bool inCoreOnly=false)
| Total points in the PointDataTree. More...
template<typename PointDataTreeT >
Index64 | activePointCount (const PointDataTreeT &tree, const bool inCoreOnly=false)
| Total active points in the PointDataTree. More...
template<typename PointDataTreeT >
Index64 | inactivePointCount (const PointDataTreeT &tree, const bool inCoreOnly=false)
| Total inactive points in the PointDataTree. More...
template<typename PointDataTreeT >
Index64 | getPointOffsets (std::vector< Index64 > &pointOffsets, const PointDataTreeT &tree, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >(), const bool inCoreOnly=false)
| Populate an array of cumulative point offsets per leaf node. More...
template<typename PointDataTreeT >
Index64 | groupPointCount (const PointDataTreeT &tree, const Name &name, const bool inCoreOnly=false)
| Total points in the group in the PointDataTree. More...
template<typename PointDataTreeT >
Index64 | activeGroupPointCount (const PointDataTreeT &tree, const Name &name, const bool inCoreOnly=false)
| Total active points in the group in the PointDataTree. More...
template<typename PointDataTreeT >
Index64 | inactiveGroupPointCount (const PointDataTreeT &tree, const Name &name, const bool inCoreOnly=false)
| Total inactive points in the group in the PointDataTree. More...
template<typename PointDataGridT , typename GridT = typename PointDataGridT::template ValueConverter<Int32>::Type>
std::enable_if< std::is_integral< typename GridT::ValueType >::value||std::is_floating_point< typename GridT::ValueType >::value, typename GridT::Ptr >::type | pointCountGrid (const PointDataGridT &grid, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >())
| Generate a new grid with voxel values to store the number of points per voxel. More...
template<typename PointDataGridT , typename GridT = typename PointDataGridT::template ValueConverter<Int32>::Type>
std::enable_if< std::is_integral< typename GridT::ValueType >::value||std::is_floating_point< typename GridT::ValueType >::value, typename GridT::Ptr >::type | pointCountGrid (const PointDataGridT &grid, const openvdb::math::Transform &transform, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >())
| Generate a new grid that uses the supplied transform with voxel values to store the number of points per voxel. More...
template<typename PointDataTreeT >
AttributeSet::Descriptor::Ptr | makeDescriptorUnique (PointDataTreeT &tree)
| Deep copy the descriptor across all leaf nodes. More...
template<typename PointDataTreeT >
void | setStreamingMode (PointDataTreeT &tree, bool on=true)
| Toggle the streaming mode on all attributes in the tree to collapse the attributes after deconstructing a bound AttributeHandle to each array. This results in better memory efficiency when the data is streamed into another data structure (typically for rendering). More...
template<typename PointDataTreeT >
void | prefetch (PointDataTreeT &tree)
| Sequentially pre-fetch all delayed-load voxel and attribute data from disk in order to accelerate subsequent random access. More...
template<typename PointDataTreeT >
void | deleteFromGroups (PointDataTreeT &pointTree, const std::vector< std::string > &groups, bool invert=false, bool drop=true)
| Delete points that are members of specific groups. More...
template<typename PointDataTreeT >
void | deleteFromGroup (PointDataTreeT &pointTree, const std::string &group, bool invert=false, bool drop=true)
| Delete points that are members of a group. More...
void | deleteMissingPointGroups (std::vector< std::string > &groups, const AttributeSet::Descriptor &descriptor)
| Delete any group that is not present in the Descriptor. More...
template<typename PointDataTree >
void | appendGroup (PointDataTree &tree, const Name &group)
| Appends a new empty group to the VDB tree. More...
template<typename PointDataTree >
void | appendGroups (PointDataTree &tree, const std::vector< Name > &groups)
| Appends new empty groups to the VDB tree. More...
template<typename PointDataTree >
void | dropGroup (PointDataTree &tree, const Name &group, const bool compact=true)
| Drops an existing group from the VDB tree. More...
template<typename PointDataTree >
void | dropGroups (PointDataTree &tree, const std::vector< Name > &groups)
| Drops existing groups from the VDB tree, the tree is compacted after dropping. More...
template<typename PointDataTree >
void | dropGroups (PointDataTree &tree)
| Drops all existing groups from the VDB tree, the tree is compacted after dropping. More...
template<typename PointDataTree >
void | compactGroups (PointDataTree &tree)
| Compacts existing groups of a VDB Tree to use less memory if possible. More...
template<typename PointDataTree , typename PointIndexTree >
void | setGroup (PointDataTree &tree, const PointIndexTree &indexTree, const std::vector< short > &membership, const Name &group, const bool remove=false)
| Sets group membership from a PointIndexTree-ordered vector. More...
template<typename PointDataTree >
void | setGroup (PointDataTree &tree, const Name &group, const bool member=true)
| Sets membership for the specified group for all points (on/off). More...
template<typename PointDataTree , typename FilterT >
void | setGroupByFilter (PointDataTree &tree, const Name &group, const FilterT &filter)
| Sets group membership based on a provided filter. More...
template<typename PointDataTree >
void | setGroupByRandomTarget (PointDataTree &tree, const Name &group, const Index64 targetPoints, const unsigned int seed=0)
template<typename PointDataTree >
void | setGroupByRandomPercentage (PointDataTree &tree, const Name &group, const float percentage=10.0f, const unsigned int seed=0)
template<typename PointDataGridT , typename MaskT = typename PointDataGridT::template ValueConverter<bool>::Type>
std::enable_if< std::is_same< typename MaskT::ValueType, bool >::value, typename MaskT::Ptr >::type | convertPointsToMask (const PointDataGridT &grid, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >())
| Extract a Mask Grid from a Point Data Grid. More...
template<typename PointDataGridT , typename MaskT = typename PointDataGridT::template ValueConverter<bool>::Type>
std::enable_if< std::is_same< typename MaskT::ValueType, bool >::value, typename MaskT::Ptr >::type | convertPointsToMask (const PointDataGridT &grid, const openvdb::math::Transform &transform, const std::vector< Name > &includeGroups=std::vector< Name >(), const std::vector< Name > &excludeGroups=std::vector< Name >())
| Extract a Mask Grid from a Point Data Grid using a new transform. More...
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | uniformPointScatter (const GridT &grid, const Index64 count, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| The free functions depend on the following class: More...
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | denseUniformPointScatter (const GridT &grid, const float pointsPerVoxel, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| Uniformly scatter a fixed number of points per active voxel. If the pointsPerVoxel value provided is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point. More...
template<typename GridT , typename RandGenT = std::mt19937, typename PositionArrayT = TypedAttributeArray<Vec3f, NullCodec>, typename PointDataGridT = Grid< typename points::TreeConverter<typename GridT::TreeType>::Type>, typename InterrupterT = util::NullInterrupter>
PointDataGridT::Ptr | nonUniformPointScatter (const GridT &grid, const float pointsPerVoxel, const unsigned int seed=0, const float spread=1.0f, InterrupterT *interrupter=nullptr)
| Non uniformly scatter points per active voxel. The pointsPerVoxel value is used to weight each grids cell value to compute a fixed number of points for every active voxel. If the computed result is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point. More...

## Typedef Documentation

## ◆ GroupAttributeArray

using GroupAttributeArray = TypedAttributeArray<GroupType, GroupCodec>

## ◆ GroupType

using GroupType = uint8_t

## ◆ PointDataGrid

using PointDataGrid = Grid<PointDataTree>

Point data grid.

## ◆ PointDataTree

using PointDataTree = tree::Tree<tree::RootNode<tree::InternalNode<tree::InternalNode <PointDataLeafNode<PointDataIndex32, 3>, 4>, 5> >>

Point index tree configured to match the default VDB configurations.

## ◆ StringAttributeArray

using StringAttributeArray = TypedAttributeArray<StringIndexType, StringCodec<false> >

## ◆ StringIndexType

using StringIndexType = uint32_t

## Function Documentation

## ◆ activeGroupPointCount()

Index64 activeGroupPointCount | ( | const PointDataTreeT & | tree,
|  | const Name & | name,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total active points in the group in the PointDataTree.

Parameters

  tree | PointDataTree.
  name | group name.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ activePointCount()

Index64 activePointCount | ( | const PointDataTreeT & | tree,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total active points in the PointDataTree.

Parameters

  tree | PointDataTree.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ appendAttribute() [1/3]

void appendAttribute | ( | PointDataTree & | tree,
|  | const Name & | name,
|  | const NamePair & | type,
|  | const Index | strideOrTotalSize = `1`,
|  | const bool | constantStride = `true`,
|  | Metadata::Ptr | metaDefaultValue = `Metadata::Ptr()`,
|  | const bool | hidden = `false`,
|  | const bool | transient = `false`
| ) |  |
| inline

Appends a new attribute to the VDB tree (this method does not require a templated AttributeType)

Parameters

  tree | the PointDataTree to be appended to.
  name | name for the new attribute.
  type | the type of the attibute.
  strideOrTotalSize | the stride of the attribute
  constantStride | if `false`, stride is interpreted as total size of the array
  metaDefaultValue | metadata default attribute value
  hidden | mark attribute as hidden
  transient | mark attribute as transient

## ◆ appendAttribute() [2/3]

void appendAttribute | ( | PointDataTree & | tree,
|  | const std::string & | name,
|  | const ValueType & | uniformValue = `point_attribute_internal::Default<ValueType>::value()`,
|  | const Index | strideOrTotalSize = `1`,
|  | const bool | constantStride = `true`,
|  | Metadata::Ptr | metaDefaultValue = `Metadata::Ptr()`,
|  | const bool | hidden = `false`,
|  | const bool | transient = `false`
| ) |  |
| inline

Appends a new attribute to the VDB tree.

Parameters

  tree | the PointDataTree to be appended to.
  name | name for the new attribute
  uniformValue | the initial value of the attribute
  strideOrTotalSize | the stride of the attribute
  constantStride | if `false`, stride is interpreted as total size of the array
  metaDefaultValue | metadata default attribute value
  hidden | mark attribute as hidden
  transient | mark attribute as transient

## ◆ appendAttribute() [3/3]

void appendAttribute | ( | PointDataTree & | tree,
|  | const std::string & | name,
|  | const ValueType & | uniformValue = `point_attribute_internal::Default<ValueType>::value()`,
|  | const Index | strideOrTotalSize = `1`,
|  | const bool | constantStride = `true`,
|  | Metadata::Ptr | metaDefaultValue = `Metadata::Ptr()`,
|  | const bool | hidden = `false`,
|  | const bool | transient = `false`
| ) |  |
| inline

Appends a new attribute to the VDB tree.

Parameters

  tree | the PointDataTree to be appended to.
  name | name for the new attribute.
  uniformValue | the initial value of the attribute
  strideOrTotalSize | the stride of the attribute
  constantStride | if `false`, stride is interpreted as total size of the array
  metaDefaultValue | metadata default attribute value
  hidden | mark attribute as hidden
  transient | mark attribute as transient

## ◆ appendGroup()

void appendGroup | ( | PointDataTree & | tree,
|  | const Name & | group
| ) |  |
| inline

Appends a new empty group to the VDB tree.

Parameters

  tree | the PointDataTree to be appended to.
  group | name of the new group.

## ◆ appendGroups()

void appendGroups | ( | PointDataTree & | tree,
|  | const std::vector< Name > & | groups
| ) |  |
| inline

Appends new empty groups to the VDB tree.

Parameters

  tree | the PointDataTree to be appended to.
  groups | names of the new groups.

## ◆ bloscCompressAttribute()

void bloscCompressAttribute | ( | PointDataTree & | tree,
|  | const Name & | name
| ) |  |
| inline

Apply Blosc compression to one attribute in the VDB tree.

Parameters

  tree | the PointDataTree.
  name | name of the attribute to compress.

## ◆ collapseAttribute()

void collapseAttribute | ( | PointDataTree & | tree,
|  | const Name & | name,
|  | const ValueType & | uniformValue = `point_attribute_internal::Default<ValueType>::value()`
| ) |  |
| inline

Collapse the attribute into a uniform value.

Parameters

  tree | the PointDataTree in which to collapse the attribute.
  name | name for the attribute.
  uniformValue | value of the attribute

## ◆ compactAttributes()

void compactAttributes | ( | PointDataTree & | tree | ) |
| inline

Compact attributes in a VDB tree (if possible).

Parameters

  tree | the PointDataTree.

## ◆ compactGroups()

void compactGroups | ( | PointDataTree & | tree | ) |
| inline

Compacts existing groups of a VDB Tree to use less memory if possible.

Parameters

  tree | the PointDataTree to be compacted.

## ◆ computeVoxelSize()

float computeVoxelSize | ( | const PositionWrapper & | positions,
|  | const uint32_t | pointsPerVoxel,
|  | const math::Mat4d | transform = `math::Mat4d::identity()`,
|  | const Index | decimalPlaces = `5`,
|  | InterrupterT *const | interrupter = `nullptr`
| ) |  |
| inline

@ brief Given a container of world space positions and a target points per voxel, compute a uniform voxel size that would best represent the storage of the points in a grid. This voxel size is typically used for conversion of the points into a PointDataGrid.

Parameters

  positions | array of world space positions
  pointsPerVoxel | the target number of points per voxel, must be positive and non-zero
  transform | voxel size will be computed using this optional transform if provided
  decimalPlaces | for readability, truncate voxel size to this number of decimals
  interrupter | an optional interrupter

Note
  if none or one point provided in positions, the default voxel size of 0.1 will be returned

## ◆ convertPointDataGridAttribute()

void convertPointDataGridAttribute | ( | TypedAttribute & | attribute,
|  | const PointDataTreeT & | tree,
|  | const std::vector< Index64 > & | pointOffsets,
|  | const Index64 | startOffset,
|  | const unsigned | arrayIndex,
|  | const Index | stride = `1`,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`,
|  | const bool | inCoreOnly = `false`
| ) |  |
| inline

Convert the attribute from a PointDataGrid.

Parameters

  attribute | the attribute to be populated.
  tree | the PointDataTree to be converted.
  pointOffsets | a vector of cumulative point offsets for each leaf.
  startOffset | a value to shift all the point offsets by
  arrayIndex | the index in the Descriptor of the array to be converted.
  stride | the stride of the attribute
  includeGroups | a vector of VDB Points groups to be included (default is all)
  excludeGroups | a vector of VDB Points groups to be excluded (default is none)
  inCoreOnly | true if out-of-core leaf nodes are to be ignored

## ◆ convertPointDataGridGroup()

void convertPointDataGridGroup | ( | Group & | group,
|  | const PointDataTreeT & | tree,
|  | const std::vector< Index64 > & | pointOffsets,
|  | const Index64 | startOffset,
|  | const AttributeSet::Descriptor::GroupIndex | index,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`,
|  | const bool | inCoreOnly = `false`
| ) |  |
| inline

Convert the group from a PointDataGrid.

Parameters

  group | the group to be populated.
  tree | the PointDataTree to be converted.
  pointOffsets | a vector of cumulative point offsets for each leaf
  startOffset | a value to shift all the point offsets by
  index | the group index to be converted.
  includeGroups | a vector of VDB Points groups to be included (default is all)
  excludeGroups | a vector of VDB Points groups to be excluded (default is none)
  inCoreOnly | true if out-of-core leaf nodes are to be ignored

## ◆ convertPointDataGridPosition()

void convertPointDataGridPosition | ( | PositionAttribute & | positionAttribute,
|  | const PointDataGridT & | grid,
|  | const std::vector< Index64 > & | pointOffsets,
|  | const Index64 | startOffset,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`,
|  | const bool | inCoreOnly = `false`
| ) |  |
| inline

Convert the position attribute from a Point Data Grid.

Parameters

  positionAttribute | the position attribute to be populated.
  grid | the PointDataGrid to be converted.
  pointOffsets | a vector of cumulative point offsets for each leaf
  startOffset | a value to shift all the point offsets by
  includeGroups | a vector of VDB Points groups to be included (default is all)
  excludeGroups | a vector of VDB Points groups to be excluded (default is none)
  inCoreOnly | true if out-of-core leaf nodes are to be ignored

## ◆ convertPointsToMask() [1/2]

std::enable_if< std::is_same< typename MaskT::ValueType, bool >::value, typename MaskT::Ptr >::type convertPointsToMask | ( | const PointDataGridT & | grid,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`
| ) |  |
| inline

Extract a Mask Grid from a Point Data Grid.

Parameters

  grid | the PointDataGrid to extract the mask from.
  includeGroups | a vector of VDB Points groups to be included (default is all).
  excludeGroups | a vector of VDB Points groups to be excluded (default is none).

Note
  this method is only available for Bool Grids and Mask Grids

## ◆ convertPointsToMask() [2/2]

std::enable_if< std::is_same< typename MaskT::ValueType, bool >::value, typename MaskT::Ptr >::type convertPointsToMask | ( | const PointDataGridT & | grid,
|  | const openvdb::math::Transform & | transform,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`
| ) |  |
| inline

Extract a Mask Grid from a Point Data Grid using a new transform.

Parameters

  grid | the PointDataGrid to extract the mask from.
  transform | target transform for the mask.
  includeGroups | a vector of VDB Points groups to be included (default is all).
  excludeGroups | a vector of VDB Points groups to be excluded (default is none).

Note
  this method is only available for Bool Grids and Mask Grids

## ◆ createPointDataGrid() [1/2]

PointDataGridT::Ptr createPointDataGrid | ( | const PointIndexGridT & | pointIndexGrid,
|  | const PositionArrayT & | positions,
|  | const math::Transform & | xform,
|  | Metadata::Ptr | positionDefaultValue = `Metadata::Ptr()`
| ) |  |
| inline

Localises points with position into a `PointDataGrid` into two stages: allocation of the leaf attribute data and population of the positions.

Parameters

  pointIndexGrid | a PointIndexGrid into the points.
  positions | list of world space point positions.
  xform | world to index space transform.
  positionDefaultValue | metadata default position value

Note
  The position data must be supplied in a Point-Partitioner compatible data structure. A convenience PointAttributeVector class is offered.
  The position data is populated separately to perform world space to voxel space conversion and apply quantisation.
  A `PointIndexGrid` to the points must be supplied to perform this operation. Typically this is built implicitly by the PointDataGrid constructor.

## ◆ createPointDataGrid() [2/2]

PointDataGridT::Ptr createPointDataGrid | ( | const std::vector< ValueT > & | positions,
|  | const math::Transform & | xform,
|  | Metadata::Ptr | positionDefaultValue = `Metadata::Ptr()`
| ) |  |
| inline

Convenience method to create a `PointDataGrid` from a std::vector of point positions.

Parameters

  positions | list of world space point positions.
  xform | world to index space transform.
  positionDefaultValue | metadata default position value

Note
  This method implicitly wraps the std::vector for a Point-Partitioner compatible data structure and creates the required `PointIndexGrid` to the points.

## ◆ deleteFromGroup()

void deleteFromGroup | ( | PointDataTreeT & | pointTree,
|  | const std::string & | group,
|  | bool | invert = `false`,
|  | bool | drop = `true`
| ) |  |
| inline

Delete points that are members of a group.

This method will delete points which are members of the supplied group and will optionally drop the group from the tree. An invert flag can be used to delete points that belong to none of the groups.

Parameters

  pointTree | the point tree with the group to delete
  group | the name of the group to delete
  invert | if enabled, points not belonging to any of the groups will be deleted
  drop | if enabled and invert is disabled, the group will be dropped from the tree

Note
  If the invert flag is true, the group will not be dropped after deleting points regardless of the value of the drop parameter.

## ◆ deleteFromGroups()

void deleteFromGroups | ( | PointDataTreeT & | pointTree,
|  | const std::vector< std::string > & | groups,
|  | bool | invert = `false`,
|  | bool | drop = `true`
| ) |  |
| inline

Delete points that are members of specific groups.

This method will delete points which are members of any of the supplied groups and will optionally drop the groups from the tree. An invert flag can be used to delete points that belong to none of the groups.

Parameters

  pointTree | the point tree
  groups | the groups from which to delete points
  invert | if enabled, points not belonging to any of the groups will be deleted
  drop | if enabled and invert is disabled, the groups will be dropped from the tree

Note
  If the invert flag is true, none of the groups will be dropped after deleting points regardless of the value of the drop parameter.

## ◆ deleteMissingPointGroups()

void deleteMissingPointGroups | ( | std::vector< std::string > & | groups,
|  | const AttributeSet::Descriptor & | descriptor
| ) |  |
| inline

Delete any group that is not present in the Descriptor.

Parameters

  groups | the vector of group names.
  descriptor | the descriptor that holds the group map.

## ◆ denseUniformPointScatter()

PointDataGridT::Ptr denseUniformPointScatter | ( | const GridT & | grid,
|  | const float | pointsPerVoxel,
|  | const unsigned int | seed = `0`,
|  | const float | spread = `1.0f`,
|  | InterrupterT * | interrupter = `nullptr`
| ) |  |
| inline

Uniformly scatter a fixed number of points per active voxel. If the pointsPerVoxel value provided is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point.

Parameters

  grid | A source grid. The resulting PointDataGrid will copy this grids transform and scatter in its active voxelized topology.
  pointsPerVoxel | The number of points to scatter per voxel
  seed | A seed for the RandGenT
  spread | The spread of points as a scale from each voxels center. A value of 1.0f indicates points can be placed anywhere within the voxel, where as a value of 0.0f will force all points to be created exactly at the centers of each voxel.
  interrupter | An optional interrupter

Note
  returns the scattered PointDataGrid

## ◆ dropAttribute() [1/2]

void dropAttribute | ( | PointDataTree & | tree,
|  | const size_t & | index
| ) |  |
| inline

Drop one attribute from the VDB tree (convenience method).

Parameters

  tree | the PointDataTree to be dropped from.
  index | index of the attribute to drop.

## ◆ dropAttribute() [2/2]

void dropAttribute | ( | PointDataTree & | tree,
|  | const Name & | name
| ) |  |
| inline

Drop one attribute from the VDB tree (convenience method).

Parameters

  tree | the PointDataTree to be dropped from.
  name | name of the attribute to drop.

## ◆ dropAttributes() [1/2]

void dropAttributes | ( | PointDataTree & | tree,
|  | const std::vector< size_t > & | indices
| ) |  |
| inline

Drops attributes from the VDB tree.

Parameters

  tree | the PointDataTree to be dropped from.
  indices | indices of the attributes to drop.

## ◆ dropAttributes() [2/2]

void dropAttributes | ( | PointDataTree & | tree,
|  | const std::vector< Name > & | names
| ) |  |
| inline

Drops attributes from the VDB tree.

Parameters

  tree | the PointDataTree to be dropped from.
  names | names of the attributes to drop.

## ◆ dropGroup()

void dropGroup | ( | PointDataTree & | tree,
|  | const Name & | group,
|  | const bool | compact = `true`
| ) |  |
| inline

Drops an existing group from the VDB tree.

Parameters

  tree | the PointDataTree to be dropped from.
  group | name of the group.
  compact | compact attributes if possible to reduce memory - if dropping more than one group, compacting once at the end will be faster

## ◆ dropGroups() [1/2]

void dropGroups | ( | PointDataTree & | tree,
|  | const std::vector< Name > & | groups
| ) |  |
| inline

Drops existing groups from the VDB tree, the tree is compacted after dropping.

Parameters

  tree | the PointDataTree to be dropped from.
  groups | names of the groups.

## ◆ dropGroups() [2/2]

void dropGroups | ( | PointDataTree & | tree | ) |
| inline

Drops all existing groups from the VDB tree, the tree is compacted after dropping.

Parameters

  tree | the PointDataTree to be dropped from.

## ◆ fixedPointToFloatingPoint() [1/2]

FloatT openvdb::v5_1::points::fixedPointToFloatingPoint | ( | const IntegerT | s | ) |
| inline

## ◆ fixedPointToFloatingPoint() [2/2]

FloatVectorT openvdb::v5_1::points::fixedPointToFloatingPoint | ( | const math::Vec3< IntegerT > & | v | ) |
| inline

## ◆ floatingPointToFixedPoint() [1/2]

IntegerT openvdb::v5_1::points::floatingPointToFixedPoint | ( | const FloatT | s | ) |
| inline

## ◆ floatingPointToFixedPoint() [2/2]

IntegerVectorT openvdb::v5_1::points::floatingPointToFixedPoint | ( | const math::Vec3< FloatT > & | v | ) |
| inline

## ◆ getPointOffsets()

Index64 getPointOffsets | ( | std::vector< Index64 > & | pointOffsets,
|  | const PointDataTreeT & | tree,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`,
|  | const bool | inCoreOnly = `false`
| ) |  |

Populate an array of cumulative point offsets per leaf node.

Parameters

  pointOffsets | array of offsets to be populated.
  tree | PointDataTree from which to populate the offsets.
  includeGroups | the group of names to include.
  excludeGroups | the group of names to exclude.
  inCoreOnly | if true, points in out-of-core leaf nodes are ignored

Note
  returns the final cumulative point offset.

## ◆ groupPointCount()

Index64 groupPointCount | ( | const PointDataTreeT & | tree,
|  | const Name & | name,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total points in the group in the PointDataTree.

Parameters

  tree | PointDataTree.
  name | group name.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ inactiveGroupPointCount()

Index64 inactiveGroupPointCount | ( | const PointDataTreeT & | tree,
|  | const Name & | name,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total inactive points in the group in the PointDataTree.

Parameters

  tree | PointDataTree.
  name | group name.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ inactivePointCount()

Index64 inactivePointCount | ( | const PointDataTreeT & | tree,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total inactive points in the PointDataTree.

Parameters

  tree | PointDataTree.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ isGroup()

bool openvdb::v5_1::points::isGroup | ( | const AttributeArray & | array | ) |
| inline

## ◆ isString()

bool openvdb::v5_1::points::isString | ( | const AttributeArray & | array | ) |
| inline

## ◆ iterCount()

Index64 iterCount | ( | const IterT & | iter | ) |
| inline

Count up the number of times the iterator can iterate.

Parameters

  iter | the iterator.

Note
  counting by iteration only performed where a dynamic filter is in use,

## ◆ makeDescriptorUnique()

AttributeSet::Descriptor::Ptr makeDescriptorUnique | ( | PointDataTreeT & | tree | ) |
| inline

Deep copy the descriptor across all leaf nodes.

Parameters

  tree | the PointDataTree.

Returns
  the new descriptor.

Note
  This method will fail if the Descriptors in the tree are not all identical.

## ◆ nonUniformPointScatter()

PointDataGridT::Ptr nonUniformPointScatter | ( | const GridT & | grid,
|  | const float | pointsPerVoxel,
|  | const unsigned int | seed = `0`,
|  | const float | spread = `1.0f`,
|  | InterrupterT * | interrupter = `nullptr`
| ) |  |
| inline

Non uniformly scatter points per active voxel. The pointsPerVoxel value is used to weight each grids cell value to compute a fixed number of points for every active voxel. If the computed result is a fractional value, each voxel calculates a delta value of how likely it is to contain an extra point.

Parameters

  grid | A source grid. The resulting PointDataGrid will copy this grids transform, voxelized topology and use its values to compute a target points per voxel. The grids ValueType must be convertible to a scalar value. Only active and larger than zero values will contain points.
  pointsPerVoxel | The number of points to scatter per voxel
  seed | A seed for the RandGenT
  spread | The spread of points as a scale from each voxels center. A value of 1.0f indicates points can be placed anywhere within the voxel, where as a value of 0.0f will force all points to be created exactly at the centers of each voxel.
  interrupter | An optional interrupter

Note
  returns the scattered PointDataGrid

## ◆ pointCount()

Index64 pointCount | ( | const PointDataTreeT & | tree,
|  | const bool | inCoreOnly = `false`
| ) |  |

Total points in the PointDataTree.

Parameters

  tree | PointDataTree.
  inCoreOnly | if true, points in out-of-core leaf nodes are not counted

## ◆ pointCountGrid() [1/2]

std::enable_if< std::is_integral< typename GridT::ValueType >::value||std::is_floating_point< typename GridT::ValueType >::value, typename GridT::Ptr >::type pointCountGrid | ( | const PointDataGridT & | grid,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`
| ) |  |
| inline

Generate a new grid with voxel values to store the number of points per voxel.

Parameters

  grid | the PointDataGrid to use to compute the count grid
  includeGroups | a vector of VDB Points groups to be included (default is all).
  excludeGroups | a vector of VDB Points groups to be excluded (default is none).

Note
  this method is only available for integer or floating point grid types

## ◆ pointCountGrid() [2/2]

std::enable_if< std::is_integral< typename GridT::ValueType >::value||std::is_floating_point< typename GridT::ValueType >::value, typename GridT::Ptr >::type pointCountGrid | ( | const PointDataGridT & | grid,
|  | const openvdb::math::Transform & | transform,
|  | const std::vector< Name > & | includeGroups = `std::vector<Name>()`,
|  | const std::vector< Name > & | excludeGroups = `std::vector<Name>()`
| ) |  |
| inline

Generate a new grid that uses the supplied transform with voxel values to store the number of points per voxel.

Parameters

  grid | the PointDataGrid to use to compute the count grid
  transform | the transform to use to compute the count grid
  includeGroups | a vector of VDB Points groups to be included (default is all).
  excludeGroups | a vector of VDB Points groups to be excluded (default is none).

Note
  this method is only available for integer or floating point grid types

## ◆ populateAttribute()

void populateAttribute | ( | PointDataTreeT & | tree,
|  | const PointIndexTreeT & | pointIndexTree,
|  | const openvdb::Name & | attributeName,
|  | const PointArrayT & | data,
|  | const Index | stride = `1`,
|  | const bool | insertMetadata = `true`
| ) |  |
| inline

Stores point attribute data in an existing `PointDataGrid` attribute.

Parameters

  tree | the PointDataGrid to be populated.
  pointIndexTree | a PointIndexTree into the points.
  attributeName | the name of the VDB Points attribute to be populated.
  data | a wrapper to the attribute data.
  stride | the stride of the attribute
  insertMetadata | true if strings are to be automatically inserted as metadata.

Note
  A `PointIndexGrid` to the points must be supplied to perform this operation. This is required to ensure the same point index ordering.

## ◆ prefetch()

void prefetch | ( | PointDataTreeT & | tree | ) |
| inline

Sequentially pre-fetch all delayed-load voxel and attribute data from disk in order to accelerate subsequent random access.

Parameters

  tree | the PointDataTree.

## ◆ renameAttribute()

void renameAttribute | ( | PointDataTree & | tree,
|  | const Name & | oldName,
|  | const Name & | newName
| ) |  |
| inline

Rename an attribute in a VDB tree.

Parameters

  tree | the PointDataTree.
  oldName | the old attribute name to rename from.
  newName | the new attribute name to rename to.

Note
  newName must not already exist and must not be a group attribute.

## ◆ renameAttributes()

void renameAttributes | ( | PointDataTree & | tree,
|  | const std::vector< Name > & | oldNames,
|  | const std::vector< Name > & | newNames
| ) |  |
| inline

Rename attributes in a VDB tree.

Parameters

  tree | the PointDataTree.
  oldNames | a list of old attribute names to rename from.
  newNames | a list of new attribute names to rename to.

Note
  Number of oldNames must match the number of newNames.
  Duplicate names and renaming group attributes are not allowed.

## ◆ setGroup() [1/2]

void setGroup | ( | PointDataTree & | tree,
|  | const PointIndexTree & | indexTree,
|  | const std::vector< short > & | membership,
|  | const Name & | group,
|  | const bool | remove = `false`
| ) |  |
| inline

Sets group membership from a PointIndexTree-ordered vector.

Parameters

  tree | the PointDataTree.
  indexTree | the PointIndexTree.
  membership | `1` if the point is in the group, 0 otherwise.
  group | the name of the group.
  remove | if `true` also perform removal of points from the group.

Note
  vector<bool> is not thread-safe on concurrent write, so use vector<short> instead

## ◆ setGroup() [2/2]

void setGroup | ( | PointDataTree & | tree,
|  | const Name & | group,
|  | const bool | member = `true`
| ) |  |
| inline

Sets membership for the specified group for all points (on/off).

Parameters

  tree | the PointDataTree.
  group | the name of the group.
  member | true / false for membership of the group.

## ◆ setGroupByFilter()

void setGroupByFilter | ( | PointDataTree & | tree,
|  | const Name & | group,
|  | const FilterT & | filter
| ) |  |
| inline

Sets group membership based on a provided filter.

Parameters

  tree | the PointDataTree.
  group | the name of the group.
  filter | filter data that is used to create a per-leaf filter

## ◆ setGroupByRandomPercentage()

void openvdb::v5_1::points::setGroupByRandomPercentage | ( | PointDataTree & | tree,
|  | const Name & | group,
|  | const float | percentage = `10.0f`,
|  | const unsigned int | seed = `0`
| ) |  |
| inline

## ◆ setGroupByRandomTarget()

void openvdb::v5_1::points::setGroupByRandomTarget | ( | PointDataTree & | tree,
|  | const Name & | group,
|  | const Index64 | targetPoints,
|  | const unsigned int | seed = `0`
| ) |  |
| inline

## ◆ setStreamingMode()

void setStreamingMode | ( | PointDataTreeT & | tree,
|  | bool | on = `true`
| ) |  |
| inline

Toggle the streaming mode on all attributes in the tree to collapse the attributes after deconstructing a bound AttributeHandle to each array. This results in better memory efficiency when the data is streamed into another data structure (typically for rendering).

Parameters

  tree | the PointDataTree.
  on | `true` to enable streaming

Note
  Multiple threads cannot safely access the same AttributeArray when using streaming.

## ◆ uniformPointScatter()

PointDataGridT::Ptr uniformPointScatter | ( | const GridT & | grid,
|  | const Index64 | count,
|  | const unsigned int | seed = `0`,
|  | const float | spread = `1.0f`,
|  | InterrupterT * | interrupter = `nullptr`
| ) |  |
| inline

The free functions depend on the following class:

The `InterrupterT` template argument below refers to any class with the following interface:

class Interrupter {
...
public:
void start(const char* name = nullptr) // called when computations begin
void end() // called when computations end
bool wasInterrupted(int percent=-1) // return true to break computation
};

Note
  If no template argument is provided for this InterrupterT the util::NullInterrupter is used which implies that all interrupter calls are no-ops (i.e. incurs no computational overhead). Uniformly scatter a total amount of points in active regions

Parameters

  grid | A source grid. The resulting PointDataGrid will copy this grids transform and scatter in its active voxelized topology.
  count | The total number of points to scatter
  seed | A seed for the RandGenT
  spread | The spread of points as a scale from each voxels center. A value of 1.0f indicates points can be placed anywhere within the voxel, where as a value of 0.0f will force all points to be created exactly at the centers of each voxel.
  interrupter | An optional interrupter

Note
  returns the scattered PointDataGrid