Loading...
Searching...
No Matches
openvdb::v10_0::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
| Base class for interrupters. 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)
OPENVDB_API int | printTime (std::ostream &os, double milliseconds, const std::string &head="", const std::string &tail="\n", int width=4, int precision=1, int verbose=0)
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).
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.
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.
Index32 | CountOn (Byte v)
| Return the number of on bits in the given 8-bit value.
Index32 | CountOff (Byte v)
| Return the number of off bits in the given 8-bit value.
Index32 | CountOn (Index32 v)
| Return the number of on bits in the given 32-bit value.
Index32 | CountOff (Index32 v)
| Return the number of off bits in the given 32-bit value.
Index32 | CountOn (Index64 v)
| Return the number of on bits in the given 64-bit value.
Index32 | CountOff (Index64 v)
| Return the number of off bits in the given 64-bit value.
Index32 | FindLowestOn (Byte v)
| Return the least significant on bit of the given 8-bit value.
Index32 | FindLowestOn (Index32 v)
| Return the least significant on bit of the given 32-bit value.
Index32 | FindLowestOn (Index64 v)
| Return the least significant on bit of the given 64-bit value.
Index32 | FindHighestOn (Index32 v)
| Return the most significant on bit of the given 32-bit value.
template<typename T>
bool | wasInterrupted (T *i, int percent=-1)
Coord | nearestCoord (const Vec3d &voxelCoord)
| Return voxelCoord rounded to the closest integer coordinates.
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.
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.

## Variables

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

## Function Documentation

## calculateBounds() [1/2]

template<typename MapType>

void 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).

## calculateBounds() [2/2]

template<typename MapType>

void 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.

## calculateBounds< math::NonlinearFrustumMap >()

template<>

void 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

## CountOff() [1/3]

Index32 CountOff | ( | Byte | v | ) |

inline

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

## CountOff() [2/3]

Index32 CountOff | ( | Index32 | v | ) |

inline

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

## CountOff() [3/3]

Index32 CountOff | ( | Index64 | v | ) |

inline

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

## CountOn() [1/3]

Index32 CountOn | ( | Byte | v | ) |

inline

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

## CountOn() [2/3]

Index32 CountOn | ( | Index32 | v | ) |

inline

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

## CountOn() [3/3]

Index32 CountOn | ( | Index64 | v | ) |

inline

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

## FindHighestOn()

Index32 FindHighestOn | ( | Index32 | v | ) |

inline

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

## FindLowestOn() [1/3]

Index32 FindLowestOn | ( | Byte | v | ) |

inline

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

## FindLowestOn() [2/3]

Index32 FindLowestOn | ( | Index32 | v | ) |

inline

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

## FindLowestOn() [3/3]

Index32 FindLowestOn | ( | Index64 | v | ) |

inline

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

## formattedInt()

template<typename IntT>

FormattedInt< IntT > formattedInt | ( | IntT | n | ) |

Returns
  an I/O manipulator that formats the given integer value for output to a stream.

## leafTopologyDifference()

template<class TreeType1, class TreeType2>

TreeType1::template ValueConverter< bool >::Type::Ptr 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.

## leafTopologyIntersection()

template<class TreeType1, class TreeType2>

TreeType1::template ValueConverter< bool >::Type::Ptr 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.

## nearestCoord()

Coord nearestCoord | ( | const Vec3d & | voxelCoord | ) |

inline

Return voxelCoord rounded to the closest integer coordinates.

## operator<<()

template<typename IntT>

std::ostream & operator<< | ( | std::ostream & | os,
|  | const FormattedInt< IntT > & | n )

## printBytes()

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 )

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

Parameters

  os | the output stream
  bytes | the byte count to be output
  head | a string to be output before the numeric text
  tail | a string to be output after the numeric text
  exact | if true, also output the unmodified count, e.g., "4.6 KB (4620 Bytes)"
  width | a fixed width for the numeric text
  precision | the number of digits after the decimal point

Returns
  0, 1, 2, 3 or 4, denoting the order of magnitude of the count.

## printNumber()

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 )

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

Parameters

  os | the output stream
  number | the number to be output
  head | a string to be output before the numeric text
  tail | a string to be output after the numeric text
  exact | if true, also output the unmodified count, e.g., "4.6 Thousand (4620)"
  width | a fixed width for the numeric text
  precision | the number of digits after the decimal point

Returns
  0, 1, 2, 3 or 4, denoting the order of magnitude of the number.

## printTime()

OPENVDB_API int printTime | ( | std::ostream & | os,
|  | double | milliseconds,
|  | const std::string & | head = "",
|  | const std::string & | tail = "\n",
|  | int | width = 4,
|  | int | precision = 1,
|  | int | verbose = 0 )

Output a time in milliseconds with the correct suffix (days, hours, minutes, seconds and milliseconds)

Parameters

  os | the output stream
  milliseconds | the time to be output
  head | a string to be output before the time
  tail | a string to be output after the time
  width | a fixed width for the numeric text
  precision | the number of digits after the decimal point
  verbose | verbose level, 0 is compact format and 1 is long format

Returns
  0, 1, 2, 3, or 4 denoting the order of magnitude of the time.

## wasInterrupted()

template<typename T>

bool wasInterrupted | ( | T * | i,
|  | int | percent = -1 )

inline

This method is primarily for backwards-compatibility as the ability to compile out the call to wasInterrupted() is no longer supported.

## Variable Documentation

## COORD_OFFSETS

OPENVDB_API const Coord COORD_OFFSETS[26]

extern

coordinate offset table for neighboring voxels

## INVALID_IDX

OPENVDB_API const Index32 INVALID_IDX

extern