33 #ifndef OPENVDB_TREE_UTIL_HAS_BEEN_INCLUDED
34 #define OPENVDB_TREE_UTIL_HAS_BEEN_INCLUDED
36 #include <openvdb/math/Math.h>
37 #include <openvdb/Types.h>
46 template<
typename ValueType, Index TerminationLevel = 0>
51 template<
typename ChildType>
54 return (ChildType::LEVEL < TerminationLevel) ?
false : this->isConstant(child);
57 template<
typename ChildType>
61 return child.isConstant(value, state, tolerance);
73 template<
typename ValueType>
78 template <
typename ChildType>
82 return child.isInactive();
85 static const bool state =
false;
98 template<
typename ValueType>
103 template <
typename ChildType>
106 child.pruneOp(*
this);
107 if (!child.isInactive())
return false;
112 static const bool state =
false;
121 #endif // OPENVDB_TREE_UTIL_HAS_BEEN_INCLUDED
const ValueType outside
Definition: tree/Util.h:113
const ValueType value
Definition: tree/Util.h:86
ValueType value
Definition: tree/Util.h:65
bool operator()(ChildType &child)
Definition: tree/Util.h:104
T negative(const T &val)
Return the unary negation of the given value.
Definition: Math.h:107
bool isNegative(const Type &x)
Return true if x is less than zero.
Definition: Math.h:306
TolerancePrune(const ValueType &tol)
Definition: tree/Util.h:49
const ValueType tolerance
Definition: tree/Util.h:66
#define OPENVDB_VERSION_NAME
Definition: version.h:45
bool state
Definition: tree/Util.h:64
LevelSetPrune(const ValueType &background)
Definition: tree/Util.h:101
ValueType value
Definition: tree/Util.h:114
Helper class for use with Tree::pruneOp() to replace inactive branches with more memory-efficient ina...
Definition: tree/Util.h:74
bool operator()(ChildType &child)
Definition: tree/Util.h:52
bool operator()(ChildType &child) const
Definition: tree/Util.h:79
Helper class for use with Tree::pruneOp() to replace constant branches (to within the provided tolera...
Definition: tree/Util.h:47
bool isConstant(ChildType &child)
Definition: tree/Util.h:58
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:56
Helper class for use with Tree::pruneOp() to prune any branches whose values are all inactive and rep...
Definition: tree/Util.h:99
InactivePrune(const ValueType &val)
Definition: tree/Util.h:76