HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::util Namespace Reference

Classes

class  CpuTimer
 Simple timer for basic profiling. More...
 
class  FormattedInt
 I/O manipulator that formats integer values with thousands separators. More...
 
class  BaseMaskIterator
 Base class for the bit mask iterators. More...
 
class  OnMaskIterator
 
class  OffMaskIterator
 
class  DenseMaskIterator
 
class  NodeMask
 Bit mask for the internal and leaf nodes of VDB. This is a 64-bit implementation. More...
 
class  NodeMask< 1 >
 Template specialization of NodeMask for Log2Dim=1, i.e. 2^3 nodes. More...
 
class  NodeMask< 2 >
 Template specialization of NodeMask for Log2Dim=2, i.e. 4^3 nodes. More...
 
class  RootNodeMask
 
struct  NullInterrupter
 Dummy NOOP interrupter class defining interface. More...
 
class  PagedArray
 Concurrent, page-based, dynamically-sized linear data structure with O(1) random access and STL-compliant iterators. It is primarily intended for applications that concurrently insert (a possibly unkown number of) elements into a dynamically growing linear array, and fast random access to said elements. More...
 
class  LeafTopologyIntOp
 Functor for use with tools::foreach() to compute the boolean intersection between the value masks of corresponding leaf nodes in two trees. More...
 
class  LeafTopologyDiffOp
 Functor for use with tools::foreach() to compute the boolean difference between the value masks of corresponding leaf nodes in two trees. More...
 

Functions

OPENVDB_API int printBytes (std::ostream &os, uint64_t bytes, const std::string &head="", const std::string &tail="\n", bool exact=false, int width=8, int precision=3)
 
OPENVDB_API int printNumber (std::ostream &os, uint64_t number, const std::string &head="", const std::string &tail="\n", bool exact=true, int width=8, int precision=3)
 
template<typename IntT >
std::ostream & operator<< (std::ostream &os, const FormattedInt< IntT > &n)
 
template<typename IntT >
FormattedInt< IntT > formattedInt (IntT n)
 
template<typename MapType >
void calculateBounds (const MapType &map, const BBoxd &in, BBoxd &out)
 Calculate an axis-aligned bounding box in the given map's domain (e.g., index space) from an axis-aligned bounding box in its range (e.g., world space) More...
 
template<typename MapType >
void calculateBounds (const MapType &map, const Vec3d &center, const Real radius, BBoxd &out)
 Calculate an axis-aligned bounding box in the given map's domain from a spherical bounding box in its range. More...
 
template<>
void calculateBounds< math::NonlinearFrustumMap > (const math::NonlinearFrustumMap &frustum, const Vec3d &center, const Real radius, BBoxd &out)
 Calculate an axis-aligned bounding box in index space from a spherical bounding box in world space. More...
 
Index32 CountOn (Byte v)
 Return the number of on bits in the given 8-bit value. More...
 
Index32 CountOff (Byte v)
 Return the number of off bits in the given 8-bit value. More...
 
Index32 CountOn (Index32 v)
 Return the number of on bits in the given 32-bit value. More...
 
Index32 CountOff (Index32 v)
 Return the number of off bits in the given 32-bit value. More...
 
Index32 CountOn (Index64 v)
 Return the number of on bits in the given 64-bit value. More...
 
Index32 CountOff (Index64 v)
 Return the number of off bits in the given 64-bit value. More...
 
Index32 FindLowestOn (Byte v)
 Return the least significant on bit of the given 8-bit value. More...
 
Index32 FindLowestOn (Index32 v)
 Return the least significant on bit of the given 32-bit value. More...
 
Index32 FindLowestOn (Index64 v)
 Return the least significant on bit of the given 64-bit value. More...
 
Index32 FindHighestOn (Index32 v)
 Return the most significant on bit of the given 32-bit value. More...
 
template<typename T >
bool wasInterrupted (T *i, int percent=-1)
 
template<>
bool wasInterrupted< util::NullInterrupter > (util::NullInterrupter *, int)
 Specialization for NullInterrupter. More...
 
Coord nearestCoord (const Vec3d &voxelCoord)
 Return voxelCoord rounded to the closest integer coordinates. More...
 
template<class TreeType1 , class TreeType2 >
TreeType1::template
ValueConverter< bool >
::Type::Ptr 
leafTopologyIntersection (const TreeType1 &lhs, const TreeType2 &rhs, bool threaded=true)
 Perform a boolean intersection between two leaf nodes' topology masks. More...
 
template<class TreeType1 , class TreeType2 >
TreeType1::template
ValueConverter< bool >
::Type::Ptr 
leafTopologyDifference (const TreeType1 &lhs, const TreeType2 &rhs, bool threaded=true)
 Perform a boolean difference between two leaf nodes' topology masks. More...
 

Variables

OPENVDB_API const Index32 INVALID_IDX
 
OPENVDB_API const Coord COORD_OFFSETS [26]
 coordinate offset table for neighboring voxels More...
 

Function Documentation

template<typename MapType >
void openvdb::OPENVDB_VERSION_NAME::util::calculateBounds ( const MapType &  map,
const BBoxd &  in,
BBoxd &  out 
)
inline

Calculate an axis-aligned bounding box in the given map's domain (e.g., index space) from an axis-aligned bounding box in its range (e.g., world space)

Definition at line 51 of file MapsUtil.h.

template<typename MapType >
void openvdb::OPENVDB_VERSION_NAME::util::calculateBounds ( const MapType &  map,
const Vec3d &  center,
const Real  radius,
BBoxd &  out 
)
inline

Calculate an axis-aligned bounding box in the given map's domain from a spherical bounding box in its range.

find the image of the center of the sphere

Definition at line 86 of file MapsUtil.h.

template<>
void openvdb::OPENVDB_VERSION_NAME::util::calculateBounds< math::NonlinearFrustumMap > ( const math::NonlinearFrustumMap &  frustum,
const Vec3d &  center,
const Real  radius,
BBoxd &  out 
)
inline

Calculate an axis-aligned bounding box in index space from a spherical bounding box in world space.

Note
This specialization is optimized for a frustum map

Definition at line 185 of file MapsUtil.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOff ( Byte  v)
inline

Return the number of off bits in the given 8-bit value.

Definition at line 76 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOff ( Index32  v)
inline

Return the number of off bits in the given 32-bit value.

Definition at line 88 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOff ( Index64  v)
inline

Return the number of off bits in the given 64-bit value.

Definition at line 101 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOn ( Byte  v)
inline

Return the number of on bits in the given 8-bit value.

Definition at line 53 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOn ( Index32  v)
inline

Return the number of on bits in the given 32-bit value.

Definition at line 80 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::CountOn ( Index64  v)
inline

Return the number of on bits in the given 64-bit value.

Definition at line 92 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::FindHighestOn ( Index32  v)
inline

Return the most significant on bit of the given 32-bit value.

Definition at line 151 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::FindLowestOn ( Byte  v)
inline

Return the least significant on bit of the given 8-bit value.

Definition at line 105 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::FindLowestOn ( Index32  v)
inline

Return the least significant on bit of the given 32-bit value.

Definition at line 117 of file NodeMasks.h.

Index32 openvdb::OPENVDB_VERSION_NAME::util::FindLowestOn ( Index64  v)
inline

Return the least significant on bit of the given 64-bit value.

Definition at line 133 of file NodeMasks.h.

template<typename IntT >
FormattedInt<IntT> openvdb::OPENVDB_VERSION_NAME::util::formattedInt ( IntT  n)
Returns
an I/O manipulator that formats the given integer value for output to a stream.

Definition at line 130 of file Formats.h.

template<class TreeType1 , class TreeType2 >
TreeType1::template ValueConverter<bool>::Type::Ptr openvdb::OPENVDB_VERSION_NAME::util::leafTopologyDifference ( const TreeType1 &  lhs,
const TreeType2 &  rhs,
bool  threaded = true 
)
inline

Perform a boolean difference between two leaf nodes' topology masks.

Returns
a pointer to a new, boolean-valued tree containing the non-overlapping voxels from the lhs.

Definition at line 144 of file Util.h.

template<class TreeType1 , class TreeType2 >
TreeType1::template ValueConverter<bool>::Type::Ptr openvdb::OPENVDB_VERSION_NAME::util::leafTopologyIntersection ( const TreeType1 &  lhs,
const TreeType2 &  rhs,
bool  threaded = true 
)
inline

Perform a boolean intersection between two leaf nodes' topology masks.

Returns
a pointer to a new, boolean-valued tree containing the overlapping voxels.

Definition at line 124 of file Util.h.

Coord openvdb::OPENVDB_VERSION_NAME::util::nearestCoord ( const Vec3d &  voxelCoord)
inline

Return voxelCoord rounded to the closest integer coordinates.

Definition at line 56 of file Util.h.

template<typename IntT >
std::ostream& openvdb::OPENVDB_VERSION_NAME::util::operator<< ( std::ostream &  os,
const FormattedInt< IntT > &  n 
)

Definition at line 126 of file Formats.h.

OPENVDB_API int openvdb::OPENVDB_VERSION_NAME::util::printBytes ( std::ostream &  os,
uint64_t  bytes,
const std::string head = "",
const std::string tail = "\n",
bool  exact = false,
int  width = 8,
int  precision = 3 
)

Output a byte count with the correct binary suffix (KB, MB, GB or TB).

Parameters
osthe output stream
bytesthe byte count to be output
heada string to be output before the numeric text
taila string to be output after the numeric text
exactif true, also output the unmodified count, e.g., "4.6 KB (4620 Bytes)"
widtha fixed width for the numeric text
precisionthe number of digits after the decimal point
Returns
0, 1, 2, 3 or 4, denoting the order of magnitude of the count.
OPENVDB_API int openvdb::OPENVDB_VERSION_NAME::util::printNumber ( std::ostream &  os,
uint64_t  number,
const std::string head = "",
const std::string tail = "\n",
bool  exact = true,
int  width = 8,
int  precision = 3 
)

Output a number with the correct SI suffix (thousand, million, billion or trillion)

Parameters
osthe output stream
numberthe number to be output
heada string to be output before the numeric text
taila string to be output after the numeric text
exactif true, also output the unmodified count, e.g., "4.6 Thousand (4620)"
widtha fixed width for the numeric text
precisionthe number of digits after the decimal point
Returns
0, 1, 2, 3 or 4, denoting the order of magnitude of the number.
template<typename T >
bool openvdb::OPENVDB_VERSION_NAME::util::wasInterrupted ( T *  i,
int  percent = -1 
)
inline

This method allows NullInterrupter::wasInterrupted to be compiled out when client code only has a pointer (vs reference) to the interrupter.

Note
This is a free-standing function since C++ doesn't allow for partial template specialization (in client code of the interrupter).

Definition at line 76 of file NullInterrupter.h.

template<>
bool openvdb::OPENVDB_VERSION_NAME::util::wasInterrupted< util::NullInterrupter > ( util::NullInterrupter *  ,
int   
)
inline

Specialization for NullInterrupter.

Definition at line 80 of file NullInterrupter.h.

Variable Documentation

OPENVDB_API const Coord openvdb::OPENVDB_VERSION_NAME::util::COORD_OFFSETS[26]

coordinate offset table for neighboring voxels

OPENVDB_API const Index32 openvdb::OPENVDB_VERSION_NAME::util::INVALID_IDX