HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointMove.h File Reference

Ability to move VDB Points using a custom deformer. More...

#include <openvdb/openvdb.h>
#include <openvdb/points/PointDataGrid.h>
#include <openvdb/points/PointMask.h>
#include <tbb/concurrent_vector.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <numeric>
#include <tuple>
#include <unordered_map>
#include <vector>
+ Include dependency graph for PointMove.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openvdb::OPENVDB_VERSION_NAME::points::future::Advect
 
class  openvdb::OPENVDB_VERSION_NAME::points::CachedDeformer< T >
 A Deformer that caches the resulting positions from evaluating another Deformer. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::points::CachedDeformer< T >::Cache
 
struct  openvdb::OPENVDB_VERSION_NAME::points::CachedDeformer< T >::Cache::Leaf
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::BuildMoveMapsOp< DeformerT, TreeT, FilterT >
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::ArrayProcessor< ValueType, OpType >
 Helper class used internally by processTypedArray() More...
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::AttributeHandles
 Cache read and write attribute handles to amortize construction cost. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::AttributeHandles::CacheHandleOp
 Create a handle and reinterpret cast as an int handle to store. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::GlobalMovePointsOp< TreeT >
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::GlobalMovePointsOp< TreeT >::PerformTypedMoveOp
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LocalMovePointsOp< TreeT >
 
struct  openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LocalMovePointsOp< TreeT >::PerformTypedMoveOp
 

Namespaces

 openvdb
 
 openvdb::OPENVDB_VERSION_NAME
 
 openvdb::OPENVDB_VERSION_NAME::points
 
 openvdb::OPENVDB_VERSION_NAME::points::future
 
 openvdb::OPENVDB_VERSION_NAME::points::point_move_internal
 

Typedefs

using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LeafIndex = Index32
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::IndexArray = std::vector< Index >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::IndexTriple = std::tuple< LeafIndex, Index, Index >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::IndexTripleArray = tbb::concurrent_vector< IndexTriple >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::GlobalPointIndexMap = std::vector< IndexTripleArray >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::GlobalPointIndexIndices = std::vector< IndexArray >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::IndexPair = std::pair< Index, Index >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::IndexPairArray = std::vector< IndexPair >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LocalPointIndexMap = std::vector< IndexPairArray >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LeafIndexArray = std::vector< LeafIndex >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LeafOffsetArray = std::vector< LeafIndexArray >
 
using openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::LeafMap = std::unordered_map< Coord, LeafIndex >
 

Functions

template<typename PointDataGridT , typename DeformerT , typename FilterT = NullFilter>
void openvdb::OPENVDB_VERSION_NAME::points::movePoints (PointDataGridT &points, DeformerT &deformer, const FilterT &filter=NullFilter(), future::Advect *objectNotInUse=nullptr, bool threaded=true)
 Move points in a PointDataGrid using a custom deformer. More...
 
template<typename PointDataGridT , typename DeformerT , typename FilterT = NullFilter>
void openvdb::OPENVDB_VERSION_NAME::points::movePoints (PointDataGridT &points, const math::Transform &transform, DeformerT &deformer, const FilterT &filter=NullFilter(), future::Advect *objectNotInUse=nullptr, bool threaded=true)
 Move points in a PointDataGrid using a custom deformer and a new transform. More...
 
template<typename LeafT >
Index openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::indexOffsetFromVoxel (const Index voxelOffset, const LeafT &leaf, IndexArray &offsets)
 
template<typename ArrayType , typename OpType >
bool openvdb::OPENVDB_VERSION_NAME::points::point_move_internal::processTypedArray (const ArrayType &array, OpType &op)
 Utility function that, given a generic attribute array, calls a functor with the fully-resolved value type of the array. More...
 

Detailed Description

Ability to move VDB Points using a custom deformer.

Author
Dan Bailey

Deformers used when moving points are in world space by default and must adhere to the interface described in the example below:

struct MyDeformer
{
// A reset is performed on each leaf in turn before the points in that leaf are
// deformed. A leaf and leaf index (standard leaf traversal order) are supplied as
// the arguments, which matches the functor interface for LeafManager::foreach().
template <typename LeafNoteType>
void reset(LeafNoteType& leaf, size_t idx);
// Evaluate the deformer and modify the given position to generate the deformed
// position. An index iterator is supplied as the argument to allow querying the
// point offset or containing voxel coordinate.
template <typename IndexIterT>
void apply(Vec3d& position, const IndexIterT& iter) const;
};
Note
The DeformerTraits struct (defined in PointMask.h) can be used to configure a deformer to evaluate in index space.

Definition in file PointMove.h.