OpenVDB  4.0.2
Public Types | Public Member Functions | List of all members
ClosestSurfacePoint< GridT > Class Template Reference

Accelerated closest surface point queries for narrow band level sets. More...

#include <VolumeToSpheres.h>

Public Types

using TreeT = typename GridT::TreeType
 
using BoolTreeT = typename TreeT::template ValueConverter< bool >::Type
 
using Index32TreeT = typename TreeT::template ValueConverter< Index32 >::Type
 
using Int16TreeT = typename TreeT::template ValueConverter< Int16 >::Type
 

Public Member Functions

 ClosestSurfacePoint ()
 
template<typename InterrupterT = util::NullInterrupter>
bool initialize (const GridT &grid, float isovalue=0.0, InterrupterT *interrupter=nullptr)
 Extract surface points and construct a spatial acceleration structure. More...
 
bool search (const std::vector< Vec3R > &points, std::vector< float > &distances)
 Compute the distance from each input point to its closest surface point. More...
 
bool searchAndReplace (std::vector< Vec3R > &points, std::vector< float > &distances)
 Overwrite each input point with its closest surface point. More...
 
const Index32TreeTindexTree () const
 Tree accessor. More...
 
const Int16TreeTsignTree () const
 Tree accessor. More...
 

Detailed Description

template<typename GridT>
class openvdb::v4_0_2::tools::ClosestSurfacePoint< GridT >

Accelerated closest surface point queries for narrow band level sets.

Supports queries that originate at arbitrary world-space locations, is not confined to the narrow band region of the input volume geometry.

Member Typedef Documentation

◆ BoolTreeT

using BoolTreeT = typename TreeT::template ValueConverter<bool>::Type

◆ Index32TreeT

using Index32TreeT = typename TreeT::template ValueConverter<Index32>::Type

◆ Int16TreeT

using Int16TreeT = typename TreeT::template ValueConverter<Int16>::Type

◆ TreeT

using TreeT = typename GridT::TreeType

Constructor & Destructor Documentation

◆ ClosestSurfacePoint()

Member Function Documentation

◆ indexTree()

const Index32TreeT& indexTree ( ) const
inline

Tree accessor.

◆ initialize()

bool initialize ( const GridT &  grid,
float  isovalue = 0.0,
InterrupterT *  interrupter = nullptr 
)

Extract surface points and construct a spatial acceleration structure.

Returns
false if the initialization fails for any reason.
Parameters
grida scalar level set or fog volume
isovaluethe voxel value that determines the surface of the volume The default value of zero works for signed distance fields, while fog volumes require a larger positive value (0.5 is a good initial guess).
interrupterpointer to an object adhering to the util::NullInterrupter interface.

◆ search()

bool search ( const std::vector< Vec3R > &  points,
std::vector< float > &  distances 
)

Compute the distance from each input point to its closest surface point.

Parameters
pointsinput list of points in world space
distancesoutput list of closest surface point distances

◆ searchAndReplace()

bool searchAndReplace ( std::vector< Vec3R > &  points,
std::vector< float > &  distances 
)

Overwrite each input point with its closest surface point.

Parameters
pointsinput/output list of points in world space
distancesoutput list of closest surface point distances

◆ signTree()

const Int16TreeT& signTree ( ) const
inline

Tree accessor.


The documentation for this class was generated from the following file: