9 #ifndef OPENVDB_POINTS_POINT_CONVERSION_IMPL_HAS_BEEN_INCLUDED 10 #define OPENVDB_POINTS_POINT_CONVERSION_IMPL_HAS_BEEN_INCLUDED 19 namespace point_conversion_internal {
23 template <
typename T>
struct ConversionTraits
25 using Handle = AttributeHandle<T, UnknownCodec>;
26 using WriteHandle = AttributeWriteHandle<T, UnknownCodec>;
27 static T zero() {
return zeroVal<T>(); }
28 template <
typename LeafT>
29 static std::unique_ptr<Handle> handleFromLeaf(
const LeafT& leaf,
const Index index) {
31 return std::make_unique<Handle>(array);
33 template <
typename LeafT>
34 static std::unique_ptr<WriteHandle> writeHandleFromLeaf(LeafT& leaf,
const Index index) {
36 return std::make_unique<WriteHandle>(array);
41 using Handle = StringAttributeHandle;
42 using WriteHandle = StringAttributeWriteHandle;
44 template <
typename LeafT>
45 static std::unique_ptr<Handle> handleFromLeaf(
const LeafT& leaf,
const Index index) {
47 const AttributeSet::Descriptor& descriptor = leaf.attributeSet().descriptor();
48 return std::make_unique<Handle>(array, descriptor.getMetadata());
50 template <
typename LeafT>
51 static std::unique_ptr<WriteHandle> writeHandleFromLeaf(LeafT& leaf,
const Index index) {
53 const AttributeSet::Descriptor& descriptor = leaf.attributeSet().descriptor();
54 return std::make_unique<WriteHandle>(array, descriptor.getMetadata());
58 template<
typename PointDataTreeType,
59 typename PointIndexTreeType,
60 typename AttributeListType>
61 struct PopulateAttributeOp {
63 using LeafManagerT =
typename tree::LeafManager<PointDataTreeType>;
64 using LeafRangeT =
typename LeafManagerT::LeafRange;
65 using PointIndexLeafNode =
typename PointIndexTreeType::LeafNodeType;
67 using ValueType =
typename AttributeListType::value_type;
68 using HandleT =
typename ConversionTraits<ValueType>::WriteHandle;
70 PopulateAttributeOp(
const PointIndexTreeType& pointIndexTree,
71 const AttributeListType& data,
73 const Index stride = 1)
74 : mPointIndexTree(pointIndexTree)
79 void operator()(
const typename LeafManagerT::LeafRange& range)
const {
81 for (
auto leaf = range.begin(); leaf; ++leaf) {
85 const PointIndexLeafNode* pointIndexLeaf =
86 mPointIndexTree.probeConstLeaf(leaf->origin());
88 if (!pointIndexLeaf)
continue;
90 auto attributeWriteHandle =
91 ConversionTraits<ValueType>::writeHandleFromLeaf(*leaf, static_cast<Index>(mIndex));
95 const IndexArray& indices = pointIndexLeaf->indices();
97 for (
const Index64 leafIndex: indices)
100 for (Index i = 0; i < mStride; i++) {
101 mData.get(value, leafIndex, i);
102 attributeWriteHandle->set(static_cast<Index>(index), i, value);
109 attributeWriteHandle->compact();
115 const PointIndexTreeType& mPointIndexTree;
116 const AttributeListType& mData;
121 template<
typename Po
intDataTreeType,
typename Attribute,
typename FilterT>
122 struct ConvertPointDataGridPositionOp {
124 using LeafNode =
typename PointDataTreeType::LeafNodeType;
125 using ValueType =
typename Attribute::ValueType;
126 using HandleT =
typename Attribute::Handle;
127 using SourceHandleT = AttributeHandle<ValueType>;
128 using LeafManagerT =
typename tree::LeafManager<const PointDataTreeType>;
129 using LeafRangeT =
typename LeafManagerT::LeafRange;
131 ConvertPointDataGridPositionOp( Attribute& attribute,
134 const math::Transform& transform,
136 const FilterT& filter,
137 const bool inCoreOnly)
138 : mAttribute(attribute)
139 , mPointOffsets(pointOffsets)
140 , mStartOffset(startOffset)
141 , mTransform(transform)
144 , mInCoreOnly(inCoreOnly)
148 std::is_floating_point<typename ValueType::ValueType>::value,
149 "ValueType is not Vec3f");
152 template <
typename IterT>
153 void convert(IterT& iter, HandleT& targetHandle,
154 SourceHandleT& sourceHandle,
Index64& offset)
const 156 for (; iter; ++iter) {
157 const Vec3d xyz = iter.getCoord().asVec3d();
158 const Vec3d pos = sourceHandle.get(*iter);
159 targetHandle.set(static_cast<Index>(offset++), 0,
160 mTransform.indexToWorld(pos + xyz));
164 void operator()(
const LeafRangeT& range)
const 166 HandleT pHandle(mAttribute);
168 for (
auto leaf = range.begin(); leaf; ++leaf) {
172 if (mInCoreOnly && leaf->buffer().isOutOfCore())
continue;
176 if (leaf.pos() > 0) offset += mPointOffsets[leaf.pos() - 1];
178 auto handle = SourceHandleT::create(leaf->constAttributeArray(mIndex));
181 auto iter = leaf->beginIndexOn();
182 convert(iter, pHandle, *handle, offset);
185 auto iter = leaf->beginIndexOn(mFilter);
186 convert(iter, pHandle, *handle, offset);
193 Attribute& mAttribute;
194 const std::vector<Index64>& mPointOffsets;
196 const math::Transform& mTransform;
198 const FilterT& mFilter;
199 const bool mInCoreOnly;
203 template<
typename Po
intDataTreeType,
typename Attribute,
typename FilterT>
204 struct ConvertPointDataGridAttributeOp {
206 using LeafNode =
typename PointDataTreeType::LeafNodeType;
207 using ValueType =
typename Attribute::ValueType;
208 using HandleT =
typename Attribute::Handle;
209 using SourceHandleT =
typename ConversionTraits<ValueType>::Handle;
210 using LeafManagerT =
typename tree::LeafManager<const PointDataTreeType>;
211 using LeafRangeT =
typename LeafManagerT::LeafRange;
213 ConvertPointDataGridAttributeOp(Attribute& attribute,
218 const FilterT& filter,
219 const bool inCoreOnly)
220 : mAttribute(attribute)
221 , mPointOffsets(pointOffsets)
222 , mStartOffset(startOffset)
226 , mInCoreOnly(inCoreOnly) { }
228 template <
typename IterT>
229 void convert(IterT& iter, HandleT& targetHandle,
230 SourceHandleT& sourceHandle,
Index64& offset)
const 232 if (sourceHandle.isUniform()) {
233 const ValueType uniformValue(sourceHandle.get(0));
234 for (; iter; ++iter) {
235 for (Index i = 0; i < mStride; i++) {
236 targetHandle.set(static_cast<Index>(offset), i, uniformValue);
242 for (; iter; ++iter) {
243 for (Index i = 0; i < mStride; i++) {
244 targetHandle.set(static_cast<Index>(offset), i,
245 sourceHandle.get(*iter, i));
252 void operator()(
const LeafRangeT& range)
const 254 HandleT pHandle(mAttribute);
256 for (
auto leaf = range.begin(); leaf; ++leaf) {
260 if (mInCoreOnly && leaf->buffer().isOutOfCore())
continue;
264 if (leaf.pos() > 0) offset += mPointOffsets[leaf.pos() - 1];
266 auto handle = ConversionTraits<ValueType>::handleFromLeaf(
267 *leaf, static_cast<Index>(mIndex));
270 auto iter = leaf->beginIndexOn();
271 convert(iter, pHandle, *handle, offset);
273 auto iter = leaf->beginIndexOn(mFilter);
274 convert(iter, pHandle, *handle, offset);
281 Attribute& mAttribute;
282 const std::vector<Index64>& mPointOffsets;
286 const FilterT& mFilter;
287 const bool mInCoreOnly;
290 template<
typename Po
intDataTreeType,
typename Group,
typename FilterT>
291 struct ConvertPointDataGridGroupOp {
293 using LeafNode =
typename PointDataTreeType::LeafNodeType;
294 using GroupIndex = AttributeSet::Descriptor::GroupIndex;
295 using LeafManagerT =
typename tree::LeafManager<const PointDataTreeType>;
296 using LeafRangeT =
typename LeafManagerT::LeafRange;
298 ConvertPointDataGridGroupOp(Group& group,
301 const AttributeSet::Descriptor::GroupIndex index,
302 const FilterT& filter,
303 const bool inCoreOnly)
305 , mPointOffsets(pointOffsets)
306 , mStartOffset(startOffset)
309 , mInCoreOnly(inCoreOnly) { }
311 template <
typename IterT>
314 const auto bitmask =
static_cast<GroupType>(1 << mIndex.second);
316 if (groupArray.isUniform()) {
317 if (groupArray.get(0) & bitmask) {
318 for (; iter; ++iter) {
319 mGroup.setOffsetOn(static_cast<Index>(offset));
325 for (; iter; ++iter) {
326 if (groupArray.get(*iter) & bitmask) {
327 mGroup.setOffsetOn(static_cast<Index>(offset));
334 void operator()(
const LeafRangeT& range)
const 336 for (
auto leaf = range.begin(); leaf; ++leaf) {
340 if (mInCoreOnly && leaf->buffer().isOutOfCore())
continue;
344 if (leaf.pos() > 0) offset += mPointOffsets[leaf.pos() - 1];
346 const AttributeArray& array = leaf->constAttributeArray(mIndex.first);
351 auto iter = leaf->beginIndexOn();
352 convert(iter, groupArray, offset);
355 auto iter = leaf->beginIndexOn(mFilter);
356 convert(iter, groupArray, offset);
364 const std::vector<Index64>& mPointOffsets;
366 const GroupIndex mIndex;
367 const FilterT& mFilter;
368 const bool mInCoreOnly;
371 template<
typename PositionArrayT,
typename VecT = Vec3R>
372 struct CalculatePositionBounds
374 CalculatePositionBounds(
const PositionArrayT& positions,
376 : mPositions(positions)
377 , mInverseMat(inverse)
381 CalculatePositionBounds(
const CalculatePositionBounds& other,
tbb::split)
382 : mPositions(other.mPositions)
383 , mInverseMat(other.mInverseMat)
387 void operator()(
const tbb::blocked_range<size_t>& range) {
389 for (
size_t n = range.begin(), N = range.end(); n != N; ++n) {
390 mPositions.getPos(n, pos);
391 pos = mInverseMat.transform(pos);
397 void join(
const CalculatePositionBounds& other) {
402 BBoxd getBoundingBox()
const {
403 return BBoxd(mMin, mMax);
407 const PositionArrayT& mPositions;
419 template<
typename CompressionT,
typename Po
intDataGr
idT,
typename PositionArrayT,
typename Po
intIndexGr
idT>
420 inline typename PointDataGridT::Ptr
422 const PositionArrayT& positions,
424 const Metadata* positionDefaultValue)
426 using PointDataTreeT =
typename PointDataGridT::TreeType;
427 using LeafT =
typename PointDataTreeT::LeafNodeType;
428 using PointIndexLeafT =
typename PointIndexGridT::TreeType::LeafNodeType;
429 using PointIndexT =
typename PointIndexLeafT::ValueType;
433 const NamePair positionType = PositionAttributeT::attributeType();
437 const auto& pointIndexTree = pointIndexGrid.tree();
438 typename PointDataTreeT::Ptr treePtr(
new PointDataTreeT(pointIndexTree));
442 auto descriptor = AttributeSet::Descriptor::create(positionType);
446 if (positionDefaultValue) descriptor->setDefaultValue(
"P", *positionDefaultValue);
450 const size_t positionIndex = descriptor->find(
"P");
459 LeafManagerT leafManager(*treePtr);
461 [&](LeafT& leaf,
size_t ) {
465 const auto* pointIndexLeaf = pointIndexTree.probeConstLeaf(leaf.origin());
470 Index pointCount(static_cast<Index>(pointIndexLeaf->indices().size()));
471 leaf.initializeAttributes(descriptor, pointCount, &lock);
476 leaf.attributeArray(positionIndex));
481 *begin =
static_cast<PointIndexT*
>(
nullptr),
482 *end = static_cast<PointIndexT*>(
nullptr);
486 for (
auto iter = pointIndexLeaf->cbeginValueOn(); iter; ++iter) {
490 const Coord& ijk = iter.getCoord();
491 const Vec3d& positionCellCenter(ijk.asVec3d());
495 pointIndexLeaf->getIndices(ijk, begin, end);
497 while (begin < end) {
499 typename PositionArrayT::value_type positionWorldSpace;
500 positions.getPos(*begin, positionWorldSpace);
504 const Vec3d positionIndexSpace = xform.
worldToIndex(positionWorldSpace);
505 const Vec3f positionVoxelSpace(positionIndexSpace - positionCellCenter);
507 attributeWriteHandle->set(index++, positionVoxelSpace);
515 auto grid = PointDataGridT::create(treePtr);
516 grid->setTransform(xform.
copy());
524 template <
typename CompressionT,
typename Po
intDataGr
idT,
typename ValueT>
525 inline typename PointDataGridT::Ptr
528 const Metadata* positionDefaultValue)
533 tools::createPointIndexGrid<tools::PointIndexGrid>(pointList, xform);
534 return createPointDataGrid<CompressionT, PointDataGridT>(
535 *pointIndexGrid, pointList, xform, positionDefaultValue);
542 template <
typename Po
intDataTreeT,
typename Po
intIndexTreeT,
typename Po
intArrayT>
546 const bool insertMetadata)
548 using point_conversion_internal::PopulateAttributeOp;
549 using ValueType =
typename PointArrayT::value_type;
551 auto iter = tree.cbeginLeaf();
555 const size_t index = iter->attributeSet().find(attributeName);
557 if (index == AttributeSet::INVALID_POS) {
561 if (insertMetadata) {
562 point_attribute_internal::MetadataStorage<PointDataTreeT, ValueType>::add(tree, data);
569 PopulateAttributeOp<PointDataTreeT,
571 PointArrayT> populate(pointIndexTree, data, index, stride);
572 tbb::parallel_for(leafManager.
leafRange(), populate);
579 template <
typename PositionAttribute,
typename Po
intDataGr
idT,
typename FilterT>
582 const PointDataGridT& grid,
585 const FilterT& filter,
586 const bool inCoreOnly)
588 using TreeType =
typename PointDataGridT::TreeType;
591 using point_conversion_internal::ConvertPointDataGridPositionOp;
593 const TreeType& tree = grid.
tree();
594 auto iter = tree.cbeginLeaf();
598 const size_t positionIndex = iter->attributeSet().find(
"P");
600 positionAttribute.expand();
601 LeafManagerT leafManager(tree);
602 ConvertPointDataGridPositionOp<TreeType, PositionAttribute, FilterT> convert(
603 positionAttribute, pointOffsets, startOffset, grid.transform(), positionIndex,
605 tbb::parallel_for(leafManager.leafRange(), convert);
606 positionAttribute.compact();
613 template <
typename TypedAttribute,
typename Po
intDataTreeT,
typename FilterT>
616 const PointDataTreeT& tree,
619 const unsigned arrayIndex,
621 const FilterT& filter,
622 const bool inCoreOnly)
626 using point_conversion_internal::ConvertPointDataGridAttributeOp;
628 auto iter = tree.cbeginLeaf();
633 LeafManagerT leafManager(tree);
634 ConvertPointDataGridAttributeOp<PointDataTreeT, TypedAttribute, FilterT> convert(
635 attribute, pointOffsets, startOffset, arrayIndex, stride,
637 tbb::parallel_for(leafManager.leafRange(), convert);
645 template <
typename Group,
typename Po
intDataTreeT,
typename FilterT>
648 const PointDataTreeT& tree,
651 const AttributeSet::Descriptor::GroupIndex index,
652 const FilterT& filter,
653 const bool inCoreOnly)
657 using point_conversion_internal::ConvertPointDataGridGroupOp;
659 auto iter = tree.cbeginLeaf();
662 LeafManagerT leafManager(tree);
663 ConvertPointDataGridGroupOp<PointDataTreeT, Group, FilterT> convert(
664 group, pointOffsets, startOffset, index,
666 tbb::parallel_for(leafManager.leafRange(), convert);
673 template<
typename PositionWrapper,
typename InterrupterT,
typename VecT>
676 const uint32_t pointsPerVoxel,
678 const Index decimalPlaces,
679 InterrupterT*
const interrupter)
681 using namespace point_conversion_internal;
685 static bool voxelSizeFromVolume(
const double volume,
686 const size_t estimatedVoxelCount,
690 static const double minimumVoxelVolume(3e-15);
693 double voxelVolume = volume /
static_cast<double>(estimatedVoxelCount);
696 if (voxelVolume < minimumVoxelVolume) {
697 voxelVolume = minimumVoxelVolume;
700 else if (voxelVolume > maximumVoxelVolume) {
701 voxelVolume = maximumVoxelVolume;
705 voxelSize =
static_cast<float>(
math::Pow(voxelVolume, 1.0/3.0));
709 static float truncate(
const float voxelSize,
Index decPlaces)
711 float truncatedVoxelSize = voxelSize;
714 for (
int i = decPlaces; i < 11; i++) {
715 truncatedVoxelSize =
static_cast<float>(
math::Truncate(
double(voxelSize), i));
716 if (truncatedVoxelSize != 0.0f)
break;
719 return truncatedVoxelSize;
727 float voxelSize(0.1f);
729 const size_t numPoints = positions.size();
733 if (numPoints <= 1)
return voxelSize;
735 size_t targetVoxelCount(numPoints /
size_t(pointsPerVoxel));
736 if (targetVoxelCount == 0) targetVoxelCount++;
741 inverseTransform =
math::unit(inverseTransform);
743 tbb::blocked_range<size_t> range(0, numPoints);
744 CalculatePositionBounds<PositionWrapper, VecT>
calculateBounds(positions, inverseTransform);
745 tbb::parallel_reduce(range, calculateBounds);
747 BBoxd bbox = calculateBounds.getBoundingBox();
751 if (bbox.
min() == bbox.
max())
return voxelSize;
753 double volume = bbox.
volume();
761 volume = extents[0]*extents[0]*extents[0];
765 volume = extents[0]*extents[1]*extents[1];
769 double previousVolume = volume;
771 if (!Local::voxelSizeFromVolume(volume, targetVoxelCount, voxelSize)) {
776 size_t previousVoxelCount(0);
777 size_t voxelCount(1);
779 if (interrupter) interrupter->start(
"Computing voxel size");
781 while (voxelCount > previousVoxelCount)
792 newTransform = math::Transform::createLinearTransform(matrix);
796 newTransform = math::Transform::createLinearTransform(voxelSize);
804 mask->setTransform(newTransform);
806 pointMaskOp.template addPoints<PositionWrapper, VecT>(positions);
810 previousVoxelCount = voxelCount;
811 voxelCount = mask->activeVoxelCount();
812 volume =
math::Pow3(voxelSize) *
static_cast<float>(voxelCount);
816 if (volume >= previousVolume)
break;
817 previousVolume = volume;
819 const float previousVoxelSize = voxelSize;
823 if (!Local::voxelSizeFromVolume(volume, targetVoxelCount, voxelSize)) {
824 voxelSize = previousVoxelSize;
831 if (voxelSize / previousVoxelSize > 0.9f)
break;
834 if (interrupter) interrupter->end();
838 return Local::truncate(voxelSize, decimalPlaces);
849 #endif // OPENVDB_POINTS_POINT_CONVERSION_IMPL_HAS_BEEN_INCLUDED Type Truncate(Type x, unsigned int digits)
Return x truncated to the given number of decimal digits.
Definition: Math.h:870
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
const Vec3T & max() const
Return a const reference to the maximum point of this bounding box.
Definition: BBox.h:64
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:74
uint8_t GroupType
Definition: AttributeSet.h:32
bool isGroup(const AttributeArray &array)
Definition: AttributeGroup.h:64
Mat4< double > Mat4d
Definition: Mat4.h:1355
TypedAttributeArray< GroupType, GroupCodec > GroupAttributeArray
Definition: AttributeGroup.h:41
#define OPENVDB_LOG_DEBUG(message)
In debug builds only, log a debugging message of the form 'someVar << "text" << ...'.
Definition: logging.h:266
ElementType volume() const
Return the volume enclosed by this bounding box.
Definition: BBox.h:100
uint64_t Index64
Definition: Types.h:53
PointDataGridT::Ptr createPointDataGrid(const PointIndexGridT &pointIndexGrid, const PositionArrayT &positions, const math::Transform &xform, const Metadata *positionDefaultValue=nullptr)
Localises points with position into a PointDataGrid into two stages: allocation of the leaf attribute...
Definition: PointConversionImpl.h:421
const Vec3T & min() const
Return a const reference to the minimum point of this bounding box.
Definition: BBox.h:62
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
math::BBox< Vec3d > BBoxd
Definition: Types.h:84
Type Pow(Type x, int n)
Return xn.
Definition: Math.h:561
static const int Size
Definition: Types.h:246
Index32 Index
Definition: Types.h:54
Vec3< double > Vec3d
Definition: Vec3.h:665
bool wasInterrupted(T *i, int percent=-1)
Definition: NullInterrupter.h:49
Vec3< T > reversed() const
Return the vector (z, y, x)
Definition: Vec3.h:461
Definition: Exceptions.h:65
Type Pow3(Type x)
Return x3.
Definition: Math.h:552
Definition: IndexIterator.h:44
Mat4 inverse(T tolerance=0) const
Definition: Mat4.h:485
void split(ContainerT &out, const std::string &in, const char delim)
Definition: Name.h:43
void preScale(const Vec3< T0 > &v)
Definition: Mat4.h:736
bool isApproxZero(const Type &x)
Return true if x is equal to zero to within the default floating-point comparison tolerance...
Definition: Math.h:349
#define OPENVDB_ASSERT(X)
Definition: Assert.h:41
LeafRange leafRange(size_t grainsize=1) const
Return a TBB-compatible LeafRange.
Definition: LeafManager.h:346
Index64 pointCount(const PointDataTreeT &tree, const FilterT &filter=NullFilter(), const bool inCoreOnly=false, const bool threaded=true)
Count the total number of points in a PointDataTree.
Definition: PointCountImpl.h:18
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
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix.
Definition: Mat.h:860
OPENVDB_API void calculateBounds(const Transform &t, const Vec3d &minWS, const Vec3d &maxWS, Vec3d &minIS, Vec3d &maxIS)
Calculate an axis-aligned bounding box in index space from an axis-aligned bounding box in world spac...
MatType unit(const MatType &mat, typename MatType::value_type eps=1.0e-8)
Return a copy of the given matrix with its upper 3×3 rows normalized.
Definition: Mat.h:648
SharedPtr< Grid > Ptr
Definition: Grid.h:573
Write-able version of AttributeHandle.
Definition: AttributeArray.h:834
Definition: Exceptions.h:13
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
std::pair< Name, Name > NamePair
Definition: AttributeArray.h:40
double Real
Definition: Types.h:60
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
Definition: Mat.h:633
Definition: AttributeArray.h:119
This class manages a linear array of pointers to a given tree's leaf nodes, as well as optional auxil...
Definition: LeafManager.h:85
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
Vec3< T > sorted() const
Return a vector with the components of this in ascending order.
Definition: Vec3.h:451
Vec3T extents() const
Return the extents of this bounding box, i.e., the length along each axis.
Definition: BBox.h:253
Vec2< T > maxComponent(const Vec2< T > &v1, const Vec2< T > &v2)
Return component-wise maximum of the two vectors.
Definition: Vec2.h:513
Vec2< T > minComponent(const Vec2< T > &v1, const Vec2< T > &v2)
Return component-wise minimum of the two vectors.
Definition: Vec2.h:504
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
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
std::vector< Index > IndexArray
Definition: PointMoveImpl.h:88
const TreeType & tree() const
Return a const reference to tree associated with this manager.
Definition: LeafManager.h:303
Typed class for storing attribute data.
Definition: AttributeArray.h:511
Definition: Exceptions.h:59
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218