10 #ifndef OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED 11 #define OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED 27 #include <tbb/parallel_reduce.h> 29 #include <type_traits> 40 template<
typename ValueType>
47 const Index stride = 1)
51 size_t size()
const {
return mData.size(); }
52 void getPos(
size_t n, ValueType& xyz)
const { xyz = mData[n]; }
53 void get(ValueType& value,
size_t n)
const { value = mData[n]; }
54 void get(ValueType& value,
size_t n,
openvdb::Index m)
const { value = mData[n * mStride + m]; }
57 const std::vector<value_type>& mData;
82 typename CompressionT,
83 typename PointDataGridT,
84 typename PositionArrayT,
85 typename PointIndexGridT>
86 inline typename PointDataGridT::Ptr
88 const PositionArrayT& positions,
90 const Metadata* positionDefaultValue =
nullptr);
103 template <
typename CompressionT,
typename Po
intDataGr
idT,
typename ValueT>
104 inline typename PointDataGridT::Ptr
107 const Metadata* positionDefaultValue =
nullptr);
121 template <
typename Po
intDataTreeT,
typename Po
intIndexTreeT,
typename Po
intArrayT>
124 const PointIndexTreeT& pointIndexTree,
126 const PointArrayT& data,
127 const Index stride = 1,
128 const bool insertMetadata =
true);
140 template <
typename PositionAttribute,
typename Po
intDataGr
idT,
typename FilterT = NullFilter>
143 const PointDataGridT& grid,
147 const bool inCoreOnly =
false);
160 template <
typename TypedAttribute,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
163 const PointDataTreeT& tree,
164 const std::vector<Index64>& pointOffsets,
166 const unsigned arrayIndex,
167 const Index stride = 1,
169 const bool inCoreOnly =
false);
183 template <
typename Group,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
186 const PointDataTreeT& tree,
187 const std::vector<Index64>& pointOffsets,
189 const AttributeSet::Descriptor::GroupIndex index,
191 const bool inCoreOnly =
false);
196 template <
typename...>
using void_t = void;
197 template <
typename T,
typename =
void>
199 template <
typename T>
217 template<
typename PositionWrapper,
218 typename InterrupterT = openvdb::util::NullInterrupter,
222 const uint32_t pointsPerVoxel,
223 const math::Mat4d transform = math::Mat4d::identity(),
224 const Index decimalPlaces = 5,
225 InterrupterT*
const interrupter =
nullptr);
233 #endif // OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED Index64 pointOffsets(std::vector< Index64 > &pointOffsets, const PointDataTreeT &tree, const FilterT &filter=NullFilter(), const bool inCoreOnly=false, const bool threaded=true)
Populate an array of cumulative point offsets per leaf node.
Definition: PointCountImpl.h:52
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
uint64_t Index64
Definition: Types.h:53
void getPos(size_t n, ValueType &xyz) const
Definition: PointConversion.h:52
void convertPointDataGridAttribute(TypedAttribute &attribute, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const unsigned arrayIndex, const Index stride=1, const FilterT &filter=NullFilter(), const bool inCoreOnly=false)
Convert the attribute from a PointDataGrid.
Definition: PointConversionImpl.h:615
PointAttributeVector(const std::vector< value_type > &data, const Index stride=1)
Definition: PointConversion.h:46
size_t size() const
Definition: PointConversion.h:51
Index32 Index
Definition: Types.h:54
Point attribute manipulation in a VDB Point Grid.
Point group manipulation in a VDB Point Grid.
Index filters primarily designed to be used with a FilterIndexIter.
ValueType value_type
Definition: PointConversion.h:44
typename T::value_type Type
Definition: PointConversion.h:200
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
Point-partitioner compatible STL vector attribute wrapper for convenience.
Definition: PointConversion.h:41
Definition: Exceptions.h:13
This tool produces a grid where every voxel that contains a point is active. It employs thread-local ...
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.
Definition: PointConversionImpl.h:544
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
PointDataGridT::Ptr createPointDataGrid(const std::vector< ValueT > &positions, const math::Transform &xform, const Metadata *positionDefaultValue=nullptr)
Convenience method to create a PointDataGrid from a std::vector of point positions.
Definition: PointConversionImpl.h:526
Attribute array storage for string data using Descriptor Metadata.
void convertPointDataGridGroup(Group &group, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const AttributeSet::Descriptor::GroupIndex index, const FilterT &filter=NullFilter(), const bool inCoreOnly=false)
Convert the group from a PointDataGrid.
Definition: PointConversionImpl.h:647
std::string Name
Definition: Name.h:19
void convertPointDataGridPosition(PositionAttribute &positionAttribute, const PointDataGridT &grid, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const FilterT &filter=NullFilter(), const bool inCoreOnly=false)
Convert the position attribute from a Point Data Grid.
Definition: PointConversionImpl.h:581
void void_t
Definition: PointConversion.h:196
ValueType PosType
Definition: PointConversion.h:43
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
Set of Attribute Arrays which tracks metadata about each array.
math::Vec3< Real > Vec3R
Definition: Types.h:72
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218
A no-op filter that can be used when iterating over all indices.
Definition: IndexIterator.h:51
Definition: PointConversion.h:198