OpenVDB 10.0.1
Loading...
Searching...
No Matches
PointMove.h File Reference

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

#include <openvdb/openvdb.h>
#include "PointDataGrid.h"
#include "PointMask.h"
#include <tbb/concurrent_vector.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <numeric>
#include <tuple>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

struct  Advect
class  CachedDeformer< T >
 A Deformer that caches the resulting positions from evaluating another Deformer. More...
struct  CachedDeformer< T >::Cache
struct  CachedDeformer< T >::Cache::Leaf
struct  BuildMoveMapsOp< DeformerT, TreeT, FilterT >
struct  GlobalMovePointsOp< TreeT >
struct  GlobalMovePointsOp< TreeT >::CopyIterator
struct  LocalMovePointsOp< TreeT >
struct  LocalMovePointsOp< TreeT >::CopyIterator

Namespaces

namespace  openvdb
namespace  openvdb::v10_0
namespace  openvdb::v10_0::points
namespace  openvdb::v10_0::points::future
 A container for ABI=5 to help ease introduction of upcoming features.
namespace  openvdb::v10_0::points::point_move_internal

Typedefs

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

Functions

template<typename PointDataGridT, typename DeformerT, typename FilterT = NullFilter>
void 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.
template<typename PointDataGridT, typename DeformerT, typename FilterT = NullFilter>
void 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.
template<typename LeafT>
Index indexOffsetFromVoxel (const Index voxelOffset, const LeafT &leaf, IndexArray &offsets)

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.