OpenVDB  12.1.0
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
PcaTransfer< PointDataTreeT > Struct Template Reference

#include <openvdb/points/impl/PrincipalComponentAnalysisImpl.h>

Inherits VolumeTransfer< PointDataTreeT >, and InterruptableTransfer.

Inherited by CovarianceTransfer< PointDataTreeT >, and WeightPosSumsTransfer< PointDataTreeT >.

Public Types

using BaseT = VolumeTransfer< PointDataTreeT >
 
using LeafNodeType = typename PointDataTreeT::LeafNodeType
 
using PositionHandleT = points::AttributeHandle< Vec3d, NullCodec >
 
using TreeTupleT = std::tuple< TreeTypes *... >
 
using TreeType = typename std::tuple_element< Idx, std::tuple< TreeTypes... >>::type
 
using ValueType = typename TreeType< Idx >::ValueType
 
using NodeMaskT = typename TreeType< 0 >::LeafNodeType::NodeMaskType
 

Public Member Functions

 PcaTransfer (const AttrIndices &indices, const PcaSettings &settings, const Real vs, tree::LeafManager< PointDataTreeT > &manager, util::NullInterrupter *interrupt)
 
 PcaTransfer (const PcaTransfer &other)
 
float searchRadius () const
 
size_t neighbourThreshold () const
 
size_t maxSourcePointsPerVoxel () const
 
size_t maxTargetPointsPerVoxel () const
 
Vec3i range (const Coord &, size_t) const
 
Vec3i range () const
 
LeafNodeTypeinitialize (const Coord &origin, const size_t idx, const CoordBBox &bounds)
 
bool startPointLeaf (const typename PointDataTreeT::LeafNodeType &leaf)
 
bool endPointLeaf (const typename PointDataTreeT::LeafNodeType &)
 
TreeType< 0 > & topology ()
 
ValueType< Idx > * buffer ()
 
const ValueType< Idx > * buffer () const
 
NodeMaskTmask ()
 
NodeMaskTmask (const size_t idx)
 
const NodeMaskTmask () const
 
const NodeMaskTmask (const size_t idx) const
 
void foreach (const FunctorT &functor)
 
bool interrupted () const
 

Static Public Attributes

static const size_t Size
 

Protected Attributes

const AttrIndicesmIndices
 
const PcaSettingsmSettings
 
const Real mDxInv
 
const tree::LeafManager< PointDataTreeT > & mManager
 
std::unique_ptr< PositionHandleTmTargetPosition
 
std::unique_ptr< PositionHandleTmSourcePosition
 

Detailed Description

template<typename PointDataTreeT>
struct openvdb::v12_1::points::pca_internal::PcaTransfer< PointDataTreeT >

Note
The PCA transfer modules are broken into two separate steps, the first which computes the weighted neighbourhoods of points and the second which computes the covariance matrices. Both these steps perform an identical loop over each points neighbourhood, with the second being necessary to re-compute the exact positions and per position weights. In theory, only a single loop is required; each point could instead create and append a large list of the exact neighbourhood positions and weights that impact it and use these to compute the covariance after the first neighbourhood loop has completed (a true gather style approach).

The double loop technique was chosen to better handle the computation of anisotropy for all points and all neighbourhoods (i.e. no limiting via the max point per voxel (MPPV) options). It makes the PCA method extremely memory efficient for all MPPV and radius values. However it might be worth falling back to a gather stlye approach when the MPPV and radius values are relatively small. We should investigate this in the future.

Member Typedef Documentation

using BaseT = VolumeTransfer<PointDataTreeT>
using LeafNodeType = typename PointDataTreeT::LeafNodeType
using NodeMaskT = typename TreeType<0>::LeafNodeType::NodeMaskType
inherited
using TreeTupleT = std::tuple<TreeTypes*...>
inherited
using TreeType = typename std::tuple_element<Idx, std::tuple<TreeTypes...>>::type
inherited
using ValueType = typename TreeType<Idx>::ValueType
inherited

Constructor & Destructor Documentation

PcaTransfer ( const AttrIndices indices,
const PcaSettings settings,
const Real  vs,
tree::LeafManager< PointDataTreeT > &  manager,
util::NullInterrupter interrupt 
)
inline
PcaTransfer ( const PcaTransfer< PointDataTreeT > &  other)
inline

Member Function Documentation

ValueType<Idx>* buffer ( )
inlineinherited
const ValueType<Idx>* buffer ( ) const
inlineinherited
bool endPointLeaf ( const typename PointDataTreeT::LeafNodeType &  )
inline
void foreach ( const FunctorT &  functor)
inlineinherited
LeafNodeType* initialize ( const Coord &  origin,
const size_t  idx,
const CoordBBox &  bounds 
)
inline
bool interrupted ( ) const
inlineinherited
NodeMaskT* mask ( )
inlineinherited
NodeMaskT* mask ( const size_t  idx)
inlineinherited
const NodeMaskT* mask ( ) const
inlineinherited
const NodeMaskT* mask ( const size_t  idx) const
inlineinherited
size_t maxSourcePointsPerVoxel ( ) const
inline
size_t maxTargetPointsPerVoxel ( ) const
inline
size_t neighbourThreshold ( ) const
inline
Vec3i range ( const Coord &  ,
size_t   
) const
inline
Vec3i range ( ) const
inline
float searchRadius ( ) const
inline
bool startPointLeaf ( const typename PointDataTreeT::LeafNodeType &  leaf)
inline
TreeType<0>& topology ( )
inlineinherited

Member Data Documentation

const Real mDxInv
protected
const AttrIndices& mIndices
protected
const tree::LeafManager<PointDataTreeT>& mManager
protected
const PcaSettings& mSettings
protected
std::unique_ptr<PositionHandleT> mSourcePosition
protected
std::unique_ptr<PositionHandleT> mTargetPosition
protected
const size_t Size
staticinherited