10 #ifndef OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED
11 #define OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED
26 #include <tbb/parallel_reduce.h>
28 #include <type_traits>
39 template<
typename ValueType>
50 size_t size()
const {
return mData.size(); }
56 const std::vector<value_type>& mData;
81 typename CompressionT,
82 typename PointDataGridT,
83 typename PositionArrayT,
84 typename PointIndexGridT>
85 inline typename PointDataGridT::Ptr
87 const PositionArrayT& positions,
89 const Metadata* positionDefaultValue =
nullptr);
102 template <
typename CompressionT,
typename Po
intDataGr
idT,
typename ValueT>
103 inline typename PointDataGridT::Ptr
106 const Metadata* positionDefaultValue =
nullptr);
120 template <
typename Po
intDataTreeT,
typename Po
intIndexTreeT,
typename Po
intArrayT>
123 const PointIndexTreeT& pointIndexTree,
125 const PointArrayT&
data,
127 const bool insertMetadata =
true);
139 template <
typename PositionAttribute,
typename Po
intDataGr
idT,
typename FilterT = NullFilter>
142 const PointDataGridT& grid,
145 const FilterT&
filter = NullFilter(),
146 const bool inCoreOnly =
false);
159 template <
typename TypedAttribute,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
162 const PointDataTreeT& tree,
163 const std::vector<Index64>& pointOffsets,
165 const unsigned arrayIndex,
167 const FilterT&
filter = NullFilter(),
168 const bool inCoreOnly =
false);
182 template <
typename Group,
typename Po
intDataTreeT,
typename FilterT = NullFilter>
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);
196 template <
typename T,
typename =
void>
198 template <
typename T>
216 template<
typename PositionWrapper,
217 typename InterrupterT = openvdb::util::NullInterrupter,
221 const uint32_t pointsPerVoxel,
223 const Index decimalPlaces = 5,
224 InterrupterT*
const interrupter =
nullptr);
232 #endif // OPENVDB_POINTS_POINT_CONVERSION_HAS_BEEN_INCLUDED
This tool produces a grid where every voxel that contains a point is active. It employs thread-local ...
GLdouble GLdouble GLint GLint const GLdouble * points
GLsizei const GLfloat * value
typename T::value_type Type
Point group manipulation in a VDB Point Grid.
#define OPENVDB_USE_VERSION_NAMESPACE
Index filters primarily designed to be used with a FilterIndexIter.
PointDataGridT::Ptr createPointDataGrid(const PointIndexGridT &pointIndexGrid, const PositionArrayT &positions, const math::Transform &xform, const Metadata *positionDefaultValue)
Localises points with position into a PointDataGrid into two stages: allocation of the leaf attribute...
void populateAttribute(PointDataTreeT &tree, const PointIndexTreeT &pointIndexTree, const openvdb::Name &attributeName, const PointArrayT &data, const Index stride, const bool insertMetadata)
Stores point attribute data in an existing PointDataGrid attribute.
Attribute array storage for string data using Descriptor Metadata.
GLint GLenum GLboolean GLsizei stride
GA_API const UT_StringHolder transform
Point attribute manipulation in a VDB Point Grid.
Set of Attribute Arrays which tracks metadata about each array.
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
void convertPointDataGridAttribute(TypedAttribute &attribute, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const unsigned arrayIndex, const Index stride, const FilterT &filter, const bool inCoreOnly)
Convert the attribute from a PointDataGrid.
static const Mat4< double > & identity()
Predefined constant for identity matrix.
Index64 pointOffsets(std::vector< Index64 > &pointOffsets, const PointDataTreeT &tree, const FilterT &filter, const bool inCoreOnly, const bool threaded)
Populate an array of cumulative point offsets per leaf node.
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
Point-partitioner compatible STL vector attribute wrapper for convenience.
void convertPointDataGridGroup(Group &group, const PointDataTreeT &tree, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const AttributeSet::Descriptor::GroupIndex index, const FilterT &filter, const bool inCoreOnly)
Convert the group from a PointDataGrid.
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Attribute-owned data structure for points. Point attributes are stored in leaf nodes and ordered by v...
void getPos(size_t n, ValueType &xyz) const
void convertPointDataGridPosition(PositionAttribute &positionAttribute, const PointDataGridT &grid, const std::vector< Index64 > &pointOffsets, const Index64 startOffset, const FilterT &filter, const bool inCoreOnly)
Convert the position attribute from a Point Data Grid.
float computeVoxelSize(const PositionWrapper &positions, const uint32_t pointsPerVoxel, const math::Mat4d transform, const Index decimalPlaces, InterrupterT *const interrupter)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
PointAttributeVector(const std::vector< value_type > &data, const Index stride=1)