10#ifndef OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED
11#define OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED
26#include <tbb/parallel_reduce.h>
39template<
typename ValueType>
46 const Index stride = 1)
50 size_t size()
const {
return mData.size(); }
51 void getPos(
size_t n, ValueType& xyz)
const { xyz = mData[n]; }
52 void get(ValueType& value,
size_t n)
const { value = mData[n]; }
53 void get(ValueType& value,
size_t n,
openvdb::Index m)
const { value = mData[n * mStride + m]; }
56 const std::vector<value_type>& mData;
81 typename CompressionT,
82 typename PointDataGridT,
83 typename PositionArrayT,
84 typename PointIndexGridT>
85inline typename PointDataGridT::Ptr
86createPointDataGrid(
const PointIndexGridT& pointIndexGrid,
87 const PositionArrayT& positions,
89 const Metadata* positionDefaultValue =
nullptr);
102template <
typename CompressionT,
typename Po
intDataGr
idT,
typename ValueT>
103inline typename PointDataGridT::Ptr
104createPointDataGrid(
const std::vector<ValueT>& positions,
106 const Metadata* positionDefaultValue =
nullptr);
120template <
typename Po
intDataTreeT,
typename Po
intIndexTreeT,
typename Po
intArrayT>
122populateAttribute( PointDataTreeT& tree,
123 const PointIndexTreeT& pointIndexTree,
125 const PointArrayT& data,
126 const Index stride = 1,
127 const bool insertMetadata =
true);
139template <
typename PositionAttribute,
typename Po
intDataGr
idT,
typename FilterT = NullFilter>
141convertPointDataGridPosition( PositionAttribute& positionAttribute,
142 const PointDataGridT& grid,
143 const std::vector<Index64>& pointOffsets,
145 const FilterT& filter = NullFilter(),
146 const bool inCoreOnly =
false);
159template <
typename TypedAttribute,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
161convertPointDataGridAttribute( TypedAttribute& attribute,
162 const PointDataTreeT& tree,
163 const std::vector<Index64>& pointOffsets,
165 const unsigned arrayIndex,
166 const Index stride = 1,
167 const FilterT& filter = NullFilter(),
168 const bool inCoreOnly =
false);
182template <
typename Group,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
184convertPointDataGridGroup( Group& group,
185 const PointDataTreeT& tree,
186 const std::vector<Index64>& pointOffsets,
188 const AttributeSet::Descriptor::GroupIndex index,
189 const FilterT& filter = NullFilter(),
190 const bool inCoreOnly =
false);
195template <
typename...>
using void_t = void;
196template <
typename T,
typename =
void>
199struct ValueTypeTraits <T, void_t<typename T::value_type>> {
using Type =
typename T::value_type; };
216template<
typename PositionWrapper,
217 typename InterrupterT = openvdb::util::NullInterrupter,
221 const uint32_t pointsPerVoxel,
222 const math::Mat4d transform = math::Mat4d::identity(),
223 const Index decimalPlaces = 5,
224 InterrupterT*
const interrupter =
nullptr);
Attribute array storage for string data using Descriptor Metadata.
Set of Attribute Arrays which tracks metadata about each array.
Index filters primarily designed to be used with a FilterIndexIter.
Point attribute manipulation in a VDB Point Grid.
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
Point group manipulation in a VDB Point Grid.
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
This tool produces a grid where every voxel that contains a point is active. It employs thread-local ...
Point-partitioner compatible STL vector attribute wrapper for convenience.
Definition PointConversion.h:40
size_t size() const
Definition PointConversion.h:50
void get(ValueType &value, size_t n, openvdb::Index m) const
Definition PointConversion.h:53
void get(ValueType &value, size_t n) const
Definition PointConversion.h:52
ValueType value_type
Definition PointConversion.h:43
PointAttributeVector(const std::vector< value_type > &data, const Index stride=1)
Definition PointConversion.h:45
void getPos(size_t n, ValueType &xyz) const
Definition PointConversion.h:51
ValueType PosType
Definition PointConversion.h:42
void void_t
Definition PointConversion.h:195
float computeVoxelSize(const PositionWrapper &positions, const uint32_t pointsPerVoxel, const math::Mat4d transform=math::Mat4d::identity(), const Index decimalPlaces=5, InterrupterT *const interrupter=nullptr)
Definition PointConversionImpl.h:675
std::string Name
Definition Name.h:19
Index32 Index
Definition Types.h:54
uint64_t Index64
Definition Types.h:53
Definition Exceptions.h:13
typename T::value_type Type
Definition PointConversion.h:199
Definition PointConversion.h:197
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212