OpenVDB  4.0.2
Namespaces | Classes | Typedefs | Functions
openvdb::v4_0_2::points Namespace Reference

Namespaces

 attribute_traits
 
 index_filter_internal
 
 internal
 
 point_attribute_internal
 
 point_conversion_internal
 
 point_count_internal
 
 point_delete_internal
 
 point_group_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  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::defaultValue< ValueType >(), 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::defaultValue< ValueType >(), 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::defaultValue< ValueType >())
 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 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...
 
OPENVDB_DEPRECATED void initialize ()
 
OPENVDB_DEPRECATED void uninitialize ()
 
template<typename PointDataTree >
void deleteFromGroups (PointDataTree &pointTree, const std::vector< std::string > &groups, bool invert=false)
 Delete points that are members of specific groups. More...
 
template<typename PointDataTree >
void deleteFromGroup (PointDataTree &pointTree, const std::string &group, bool invert=false)
 Delete points that are members of a group. More...
 
template<typename PointDataTreeT >
void deleteFromGroups (PointDataTreeT &pointTree, const std::vector< std::string > &groups, bool invert)
 
template<typename PointDataTreeT >
void deleteFromGroup (PointDataTreeT &pointTree, const std::string &group, bool invert)
 
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)
 

Typedef Documentation

◆ GroupAttributeArray

◆ GroupType

using GroupType = uint8_t

◆ PointDataGrid

Point data grid.

◆ PointDataTree

Point index tree configured to match the default VDB configurations.

◆ StringAttributeArray

◆ 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
treePointDataTree.
namegroup name.
inCoreOnlyif 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
treePointDataTree.
inCoreOnlyif 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
treethe PointDataTree to be appended to.
namename for the new attribute.
typethe type of the attibute.
strideOrTotalSizethe stride of the attribute
constantStrideif false, stride is interpreted as total size of the array
metaDefaultValuemetadata default attribute value
hiddenmark attribute as hidden
transientmark attribute as transient

◆ appendAttribute() [2/3]

void appendAttribute ( PointDataTree tree,
const std::string &  name,
const ValueType &  uniformValue = point_attribute_internal::defaultValue<ValueType>(),
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
treethe PointDataTree to be appended to.
namename for the new attribute
uniformValuethe initial value of the attribute
strideOrTotalSizethe stride of the attribute
constantStrideif false, stride is interpreted as total size of the array
metaDefaultValuemetadata default attribute value
hiddenmark attribute as hidden
transientmark attribute as transient

◆ appendAttribute() [3/3]

void appendAttribute ( PointDataTree tree,
const std::string &  name,
const ValueType &  uniformValue = point_attribute_internal::defaultValue<ValueType>(),
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
treethe PointDataTree to be appended to.
namename for the new attribute.
uniformValuethe initial value of the attribute
strideOrTotalSizethe stride of the attribute
constantStrideif false, stride is interpreted as total size of the array
metaDefaultValuemetadata default attribute value
hiddenmark attribute as hidden
transientmark attribute as transient

◆ appendGroup()

void appendGroup ( PointDataTree tree,
const Name group 
)
inline

Appends a new empty group to the VDB tree.

Parameters
treethe PointDataTree to be appended to.
groupname of the new group.

◆ appendGroups()

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

Appends new empty groups to the VDB tree.

Parameters
treethe PointDataTree to be appended to.
groupsnames of the new groups.

◆ bloscCompressAttribute()

void bloscCompressAttribute ( PointDataTree tree,
const Name name 
)
inline

Apply Blosc compression to one attribute in the VDB tree.

Parameters
treethe PointDataTree.
namename of the attribute to compress.

◆ collapseAttribute()

void collapseAttribute ( PointDataTree tree,
const Name name,
const ValueType &  uniformValue = point_attribute_internal::defaultValue<ValueType>() 
)
inline

Collapse the attribute into a uniform value.

Parameters
treethe PointDataTree in which to collapse the attribute.
namename for the attribute.
uniformValuevalue of the attribute

◆ compactAttributes()

void compactAttributes ( PointDataTree tree)
inline

Compact attributes in a VDB tree (if possible).

Parameters
treethe PointDataTree.

◆ compactGroups()

void compactGroups ( PointDataTree tree)
inline

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

Parameters
treethe 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
positionsarray of world space positions
pointsPerVoxelthe target number of points per voxel, must be positive and non-zero
transformvoxel size will be computed using this optional transform if provided
decimalPlacesfor readability, truncate voxel size to this number of decimals
interrupteran 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
attributethe attribute to be populated.
treethe PointDataTree to be converted.
pointOffsetsa vector of cumulative point offsets for each leaf.
startOffseta value to shift all the point offsets by
arrayIndexthe index in the Descriptor of the array to be converted.
stridethe stride of the attribute
includeGroupsa vector of VDB Points groups to be included (default is all)
excludeGroupsa vector of VDB Points groups to be excluded (default is none)
inCoreOnlytrue 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
groupthe group to be populated.
treethe PointDataTree to be converted.
pointOffsetsa vector of cumulative point offsets for each leaf
startOffseta value to shift all the point offsets by
indexthe group index to be converted.
includeGroupsa vector of VDB Points groups to be included (default is all)
excludeGroupsa vector of VDB Points groups to be excluded (default is none)
inCoreOnlytrue 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
positionAttributethe position attribute to be populated.
gridthe PointDataGrid to be converted.
pointOffsetsa vector of cumulative point offsets for each leaf
startOffseta value to shift all the point offsets by
includeGroupsa vector of VDB Points groups to be included (default is all)
excludeGroupsa vector of VDB Points groups to be excluded (default is none)
inCoreOnlytrue if out-of-core leaf nodes are to be ignored

◆ 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
pointIndexGrida PointIndexGrid into the points.
positionslist of world space point positions.
xformworld to index space transform.
positionDefaultValuemetadata 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
positionslist of world space point positions.
xformworld to index space transform.
positionDefaultValuemetadata 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() [1/2]

void openvdb::v4_0_2::points::deleteFromGroup ( PointDataTree pointTree,
const std::string &  group,
bool  invert = false 
)
inline

Delete points that are members of a group.

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

Parameters
pointTreethe point tree with the group to delete
groupthe name of the group to delete
invertIf this flag is set to true, points not in this group will be deleted
Note
If the invert flag is true, the group will not be dropped after deleting points.

◆ deleteFromGroup() [2/2]

void openvdb::v4_0_2::points::deleteFromGroup ( PointDataTreeT &  pointTree,
const std::string &  group,
bool  invert 
)
inline

◆ deleteFromGroups() [1/2]

void openvdb::v4_0_2::points::deleteFromGroups ( PointDataTree pointTree,
const std::vector< std::string > &  groups,
bool  invert = false 
)
inline

Delete points that are members of specific groups.

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

Parameters
pointTreethe point tree
groupsthe groups from which to delete points
invertif enabled, points not belonging to any of the groups will be deleted
Note
If the invert flag is true, none of the groups will be dropped after deleting points.

◆ deleteFromGroups() [2/2]

void openvdb::v4_0_2::points::deleteFromGroups ( PointDataTreeT &  pointTree,
const std::vector< std::string > &  groups,
bool  invert 
)
inline

◆ deleteMissingPointGroups()

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

Delete any group that is not present in the Descriptor.

Parameters
groupsthe vector of group names.
descriptorthe descriptor that holds the group map.

◆ dropAttribute() [1/2]

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

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

Parameters
treethe PointDataTree to be dropped from.
indexindex 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
treethe PointDataTree to be dropped from.
namename 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
treethe PointDataTree to be dropped from.
indicesindices 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
treethe PointDataTree to be dropped from.
namesnames 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
treethe PointDataTree to be dropped from.
groupname of the group.
compactcompact 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
treethe PointDataTree to be dropped from.
groupsnames 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
treethe PointDataTree to be dropped from.

◆ fixedPointToFloatingPoint() [1/2]

FloatT openvdb::v4_0_2::points::fixedPointToFloatingPoint ( const IntegerT  s)
inline

◆ fixedPointToFloatingPoint() [2/2]

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

◆ floatingPointToFixedPoint() [1/2]

IntegerT openvdb::v4_0_2::points::floatingPointToFixedPoint ( const FloatT  s)
inline

◆ floatingPointToFixedPoint() [2/2]

IntegerVectorT openvdb::v4_0_2::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
pointOffsetsarray of offsets to be populated.
treePointDataTree from which to populate the offsets.
includeGroupsthe group of names to include.
excludeGroupsthe group of names to exclude.
inCoreOnlyif 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
treePointDataTree.
namegroup name.
inCoreOnlyif 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
treePointDataTree.
namegroup name.
inCoreOnlyif 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
treePointDataTree.
inCoreOnlyif true, points in out-of-core leaf nodes are not counted

◆ initialize()

OPENVDB_DEPRECATED void openvdb::v4_0_2::points::initialize ( )

◆ isGroup()

bool openvdb::v4_0_2::points::isGroup ( const AttributeArray array)
inline

◆ isString()

bool openvdb::v4_0_2::points::isString ( const AttributeArray array)
inline

◆ iterCount()

Index64 iterCount ( const IterT &  iter)
inline

Count up the number of times the iterator can iterate.

Parameters
iterthe 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
treethe PointDataTree.
Returns
the new descriptor.
Note
This method will fail if the Descriptors in the tree are not all identical.

◆ pointCount()

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

Total points in the PointDataTree.

Parameters
treePointDataTree.
inCoreOnlyif true, points in out-of-core leaf nodes are not counted

◆ 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
treethe PointDataGrid to be populated.
pointIndexTreea PointIndexTree into the points.
attributeNamethe name of the VDB Points attribute to be populated.
dataa wrapper to the attribute data.
stridethe stride of the attribute
insertMetadatatrue 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
treethe PointDataTree.

◆ renameAttribute()

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

Rename an attribute in a VDB tree.

Parameters
treethe PointDataTree.
oldNamethe old attribute name to rename from.
newNamethe 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
treethe PointDataTree.
oldNamesa list of old attribute names to rename from.
newNamesa 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
treethe PointDataTree.
indexTreethe PointIndexTree.
membership1 if the point is in the group, 0 otherwise.
groupthe name of the group.
removeif 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
treethe PointDataTree.
groupthe name of the group.
membertrue / 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
treethe PointDataTree.
groupthe name of the group.
filterfilter data that is used to create a per-leaf filter

◆ setGroupByRandomPercentage()

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

◆ setGroupByRandomTarget()

void openvdb::v4_0_2::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
treethe PointDataTree.
ontrue to enable streaming
Note
Multiple threads cannot safely access the same AttributeArray when using streaming.

◆ uninitialize()

OPENVDB_DEPRECATED void openvdb::v4_0_2::points::uninitialize ( )