Skip to content

Commit 2d4f31c

Browse files
authored
Merge pull request #1493 from danrbailey/remove_deprecated_methods
Remove all functionality deprecated prior to VDB 9.0
2 parents a19b08b + 022c62d commit 2d4f31c

File tree

15 files changed

+6
-1537
lines changed

15 files changed

+6
-1537
lines changed

openvdb/openvdb/tools/FindActiveValues.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,6 @@ class FindActiveValues
179179
/// between active tiles in the tree and the specified bounding box.
180180
std::vector<TileDataT> activeTiles(const CoordBBox &bbox) const;
181181

182-
OPENVDB_DEPRECATED_MESSAGE("Use anyActiveValues() instead") inline bool any(const CoordBBox &bbox, bool useAccessor = false) const
183-
{
184-
return this->anyActiveValues(bbox, useAccessor);
185-
}
186-
OPENVDB_DEPRECATED_MESSAGE("Use noActiveValues() instead") inline bool none(const CoordBBox &bbox, bool useAccessor = false) const
187-
{
188-
return this->noActiveValues(bbox, useAccessor);
189-
}
190-
191182
private:
192183

193184
// Cleans up internal data structures

openvdb/openvdb/tools/Morphology.h

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,97 +1182,6 @@ void erodeActiveValues(TreeOrLeafManagerT& treeOrLeafM,
11821182
}
11831183

11841184

1185-
/////////////////////////////////////////////////////////////////////
1186-
/////////////////////////////////////////////////////////////////////
1187-
1188-
1189-
/// @brief Topologically dilate all leaf-level active voxels in a tree
1190-
/// using one of three nearest neighbor connectivity patterns.
1191-
/// @warning This method is NOT multi-threaded and ignores active tiles!
1192-
///
1193-
/// @param tree tree to be dilated
1194-
/// @param iterations number of iterations to apply the dilation
1195-
/// @param nn connectivity pattern of the dilation: either
1196-
/// face-adjacent (6 nearest neighbors), face- and edge-adjacent
1197-
/// (18 nearest neighbors) or face-, edge- and vertex-adjacent (26
1198-
/// nearest neighbors).
1199-
///
1200-
/// @note The values of any voxels are unchanged.
1201-
template<typename TreeType>
1202-
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::dilateActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
1203-
inline void dilateVoxels(TreeType& tree,
1204-
int iterations = 1,
1205-
NearestNeighbors nn = NN_FACE)
1206-
{
1207-
if (iterations <= 0) return;
1208-
morphology::Morphology<TreeType> morph(tree);
1209-
morph.setThreaded(false); // backwards compatible
1210-
// This will also sync the leaf manager
1211-
morph.dilateVoxels(static_cast<size_t>(iterations), nn, /*prune=*/false);
1212-
}
1213-
1214-
/// @brief Topologically dilate all leaf-level active voxels in a tree
1215-
/// using one of three nearest neighbor connectivity patterns.
1216-
/// @warning This method is NOT multi-threaded and ignores active tiles!
1217-
///
1218-
/// @param manager LeafManager containing the tree to be dilated.
1219-
/// On exit it is updated to include all the leaf
1220-
/// nodes of the dilated tree.
1221-
/// @param iterations number of iterations to apply the dilation
1222-
/// @param nn connectivity pattern of the dilation: either
1223-
/// face-adjacent (6 nearest neighbors), face- and edge-adjacent
1224-
/// (18 nearest neighbors) or face-, edge- and vertex-adjacent (26
1225-
/// nearest neighbors).
1226-
///
1227-
/// @note The values of any voxels are unchanged.
1228-
template<typename TreeType>
1229-
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::dilateActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
1230-
inline void dilateVoxels(tree::LeafManager<TreeType>& manager,
1231-
int iterations = 1,
1232-
NearestNeighbors nn = NN_FACE)
1233-
{
1234-
if (iterations <= 0) return;
1235-
morphology::Morphology<TreeType> morph(manager);
1236-
morph.setThreaded(false);
1237-
morph.dilateVoxels(static_cast<size_t>(iterations), nn, /*prune=*/false);
1238-
}
1239-
1240-
//@{
1241-
/// @brief Topologically erode all leaf-level active voxels in the given tree.
1242-
/// @details That is, shrink the set of active voxels by @a iterations voxels
1243-
/// in the +x, -x, +y, -y, +z and -z directions, but don't change the values
1244-
/// of any voxels, only their active states.
1245-
/// @todo Currently operates only on leaf voxels; need to extend to tiles.
1246-
template<typename TreeType>
1247-
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::erodeActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
1248-
inline void erodeVoxels(TreeType& tree,
1249-
int iterations=1,
1250-
NearestNeighbors nn = NN_FACE)
1251-
{
1252-
if (iterations > 0) {
1253-
morphology::Morphology<TreeType> morph(tree);
1254-
morph.setThreaded(true);
1255-
morph.erodeVoxels(static_cast<size_t>(iterations), nn, /*prune=*/false);
1256-
}
1257-
1258-
tools::pruneLevelSet(tree); // matches old behaviour
1259-
}
1260-
1261-
template<typename TreeType>
1262-
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::erodeActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
1263-
inline void erodeVoxels(tree::LeafManager<TreeType>& manager,
1264-
int iterations = 1,
1265-
NearestNeighbors nn = NN_FACE)
1266-
{
1267-
if (iterations <= 0) return;
1268-
morphology::Morphology<TreeType> morph(manager);
1269-
morph.setThreaded(true);
1270-
morph.erodeVoxels(static_cast<size_t>(iterations), nn, /*prune=*/false);
1271-
tools::pruneLevelSet(manager.tree()); // matches old behaviour
1272-
}
1273-
//@}
1274-
1275-
12761185
////////////////////////////////////////
12771186

12781187

openvdb/openvdb/tree/InternalNode.h

Lines changed: 0 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -568,25 +568,6 @@ class InternalNode
568568
template<typename CombineOp, typename OtherValueType>
569569
void combine2(const InternalNode& other, const OtherValueType&, bool valIsActive, CombineOp&);
570570

571-
/// @brief Calls the templated functor BBoxOp with bounding box
572-
/// information for all active tiles and leaf nodes in this node.
573-
/// An additional level argument is provided for each callback.
574-
///
575-
/// @note The bounding boxes are guaranteed to be non-overlapping.
576-
template<typename BBoxOp> void visitActiveBBox(BBoxOp&) const;
577-
578-
template<typename VisitorOp> void visit(VisitorOp&);
579-
template<typename VisitorOp> void visit(VisitorOp&) const;
580-
581-
template<typename OtherNodeType, typename VisitorOp>
582-
void visit2Node(OtherNodeType& other, VisitorOp&);
583-
template<typename OtherNodeType, typename VisitorOp>
584-
void visit2Node(OtherNodeType& other, VisitorOp&) const;
585-
template<typename IterT, typename VisitorOp>
586-
void visit2(IterT& otherIter, VisitorOp&, bool otherIsLHS = false);
587-
template<typename IterT, typename VisitorOp>
588-
void visit2(IterT& otherIter, VisitorOp&, bool otherIsLHS = false) const;
589-
590571
/// Set all voxels that lie outside the given axis-aligned box to the background.
591572
void clip(const CoordBBox&, const ValueType& background);
592573

@@ -791,17 +772,6 @@ class InternalNode
791772
void resetChildNode(Index i, ChildNodeType* child);//checks for an existing child
792773
ChildNodeType* unsetChildNode(Index i, const ValueType& value);
793774

794-
template<typename NodeT, typename VisitorOp, typename ChildAllIterT>
795-
static inline void doVisit(NodeT&, VisitorOp&);
796-
797-
template<typename NodeT, typename OtherNodeT, typename VisitorOp,
798-
typename ChildAllIterT, typename OtherChildAllIterT>
799-
static inline void doVisit2Node(NodeT&, OtherNodeT&, VisitorOp&);
800-
801-
template<typename NodeT, typename VisitorOp,
802-
typename ChildAllIterT, typename OtherChildAllIterT>
803-
static inline void doVisit2(NodeT&, OtherChildAllIterT&, VisitorOp&, bool otherIsLHS);
804-
805775
///@{
806776
/// @brief Returns a pointer to the child node at the linear offset n.
807777
/// @warning This protected method assumes that a child node exists at
@@ -2886,173 +2856,6 @@ InternalNode<ChildT, Log2Dim>::combine2(const InternalNode& other, const OtherVa
28862856
////////////////////////////////////////
28872857

28882858

2889-
template<typename ChildT, Index Log2Dim>
2890-
template<typename BBoxOp>
2891-
inline void
2892-
InternalNode<ChildT, Log2Dim>::visitActiveBBox(BBoxOp& op) const
2893-
{
2894-
for (ValueOnCIter i = this->cbeginValueOn(); i; ++i) {
2895-
op.template operator()<LEVEL>(CoordBBox::createCube(i.getCoord(), ChildNodeType::DIM));
2896-
}
2897-
if (op.template descent<LEVEL>()) {
2898-
for (ChildOnCIter i = this->cbeginChildOn(); i; ++i) i->visitActiveBBox(op);
2899-
} else {
2900-
for (ChildOnCIter i = this->cbeginChildOn(); i; ++i) {
2901-
op.template operator()<LEVEL>(i->getNodeBoundingBox());
2902-
}
2903-
}
2904-
}
2905-
2906-
2907-
template<typename ChildT, Index Log2Dim>
2908-
template<typename VisitorOp>
2909-
inline void
2910-
InternalNode<ChildT, Log2Dim>::visit(VisitorOp& op)
2911-
{
2912-
doVisit<InternalNode, VisitorOp, ChildAllIter>(*this, op);
2913-
}
2914-
2915-
2916-
template<typename ChildT, Index Log2Dim>
2917-
template<typename VisitorOp>
2918-
inline void
2919-
InternalNode<ChildT, Log2Dim>::visit(VisitorOp& op) const
2920-
{
2921-
doVisit<const InternalNode, VisitorOp, ChildAllCIter>(*this, op);
2922-
}
2923-
2924-
2925-
template<typename ChildT, Index Log2Dim>
2926-
template<typename NodeT, typename VisitorOp, typename ChildAllIterT>
2927-
inline void
2928-
InternalNode<ChildT, Log2Dim>::doVisit(NodeT& self, VisitorOp& op)
2929-
{
2930-
typename NodeT::ValueType val;
2931-
for (ChildAllIterT iter = self.beginChildAll(); iter; ++iter) {
2932-
if (op(iter)) continue;
2933-
if (typename ChildAllIterT::ChildNodeType* child = iter.probeChild(val)) {
2934-
child->visit(op);
2935-
}
2936-
}
2937-
}
2938-
2939-
2940-
////////////////////////////////////////
2941-
2942-
2943-
template<typename ChildT, Index Log2Dim>
2944-
template<typename OtherNodeType, typename VisitorOp>
2945-
inline void
2946-
InternalNode<ChildT, Log2Dim>::visit2Node(OtherNodeType& other, VisitorOp& op)
2947-
{
2948-
doVisit2Node<InternalNode, OtherNodeType, VisitorOp, ChildAllIter,
2949-
typename OtherNodeType::ChildAllIter>(*this, other, op);
2950-
}
2951-
2952-
2953-
template<typename ChildT, Index Log2Dim>
2954-
template<typename OtherNodeType, typename VisitorOp>
2955-
inline void
2956-
InternalNode<ChildT, Log2Dim>::visit2Node(OtherNodeType& other, VisitorOp& op) const
2957-
{
2958-
doVisit2Node<const InternalNode, OtherNodeType, VisitorOp, ChildAllCIter,
2959-
typename OtherNodeType::ChildAllCIter>(*this, other, op);
2960-
}
2961-
2962-
2963-
template<typename ChildT, Index Log2Dim>
2964-
template<
2965-
typename NodeT,
2966-
typename OtherNodeT,
2967-
typename VisitorOp,
2968-
typename ChildAllIterT,
2969-
typename OtherChildAllIterT>
2970-
inline void
2971-
InternalNode<ChildT, Log2Dim>::doVisit2Node(NodeT& self, OtherNodeT& other, VisitorOp& op)
2972-
{
2973-
// Allow the two nodes to have different ValueTypes, but not different dimensions.
2974-
static_assert(OtherNodeT::NUM_VALUES == NodeT::NUM_VALUES,
2975-
"visit2() requires nodes to have the same dimensions");
2976-
static_assert(OtherNodeT::LEVEL == NodeT::LEVEL,
2977-
"visit2() requires nodes to be at the same tree level");
2978-
2979-
typename NodeT::ValueType val;
2980-
typename OtherNodeT::ValueType otherVal;
2981-
2982-
ChildAllIterT iter = self.beginChildAll();
2983-
OtherChildAllIterT otherIter = other.beginChildAll();
2984-
2985-
for ( ; iter && otherIter; ++iter, ++otherIter)
2986-
{
2987-
const size_t skipBranch = static_cast<size_t>(op(iter, otherIter));
2988-
2989-
typename ChildAllIterT::ChildNodeType* child =
2990-
(skipBranch & 1U) ? nullptr : iter.probeChild(val);
2991-
typename OtherChildAllIterT::ChildNodeType* otherChild =
2992-
(skipBranch & 2U) ? nullptr : otherIter.probeChild(otherVal);
2993-
2994-
if (child != nullptr && otherChild != nullptr) {
2995-
child->visit2Node(*otherChild, op);
2996-
} else if (child != nullptr) {
2997-
child->visit2(otherIter, op);
2998-
} else if (otherChild != nullptr) {
2999-
otherChild->visit2(iter, op, /*otherIsLHS=*/true);
3000-
}
3001-
}
3002-
}
3003-
3004-
3005-
////////////////////////////////////////
3006-
3007-
3008-
template<typename ChildT, Index Log2Dim>
3009-
template<typename OtherChildAllIterType, typename VisitorOp>
3010-
inline void
3011-
InternalNode<ChildT, Log2Dim>::visit2(OtherChildAllIterType& otherIter,
3012-
VisitorOp& op, bool otherIsLHS)
3013-
{
3014-
doVisit2<InternalNode, VisitorOp, ChildAllIter, OtherChildAllIterType>(
3015-
*this, otherIter, op, otherIsLHS);
3016-
}
3017-
3018-
3019-
template<typename ChildT, Index Log2Dim>
3020-
template<typename OtherChildAllIterType, typename VisitorOp>
3021-
inline void
3022-
InternalNode<ChildT, Log2Dim>::visit2(OtherChildAllIterType& otherIter,
3023-
VisitorOp& op, bool otherIsLHS) const
3024-
{
3025-
doVisit2<const InternalNode, VisitorOp, ChildAllCIter, OtherChildAllIterType>(
3026-
*this, otherIter, op, otherIsLHS);
3027-
}
3028-
3029-
3030-
template<typename ChildT, Index Log2Dim>
3031-
template<typename NodeT, typename VisitorOp, typename ChildAllIterT, typename OtherChildAllIterT>
3032-
inline void
3033-
InternalNode<ChildT, Log2Dim>::doVisit2(NodeT& self, OtherChildAllIterT& otherIter,
3034-
VisitorOp& op, bool otherIsLHS)
3035-
{
3036-
if (!otherIter) return;
3037-
3038-
const size_t skipBitMask = (otherIsLHS ? 2U : 1U);
3039-
3040-
typename NodeT::ValueType val;
3041-
for (ChildAllIterT iter = self.beginChildAll(); iter; ++iter) {
3042-
const size_t skipBranch = static_cast<size_t>(
3043-
otherIsLHS ? op(otherIter, iter) : op(iter, otherIter));
3044-
3045-
typename ChildAllIterT::ChildNodeType* child =
3046-
(skipBranch & skipBitMask) ? nullptr : iter.probeChild(val);
3047-
3048-
if (child != nullptr) child->visit2(otherIter, op, otherIsLHS);
3049-
}
3050-
}
3051-
3052-
3053-
////////////////////////////////////////
3054-
3055-
30562859
template<typename ChildT, Index Log2Dim>
30572860
inline void
30582861
InternalNode<ChildT, Log2Dim>::writeBuffers(std::ostream& os, bool toHalf) const

openvdb/openvdb/tree/LeafManager.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -535,42 +535,6 @@ class LeafManager
535535
transform.run(this->leafRange(grainSize), threaded);
536536
}
537537

538-
template<typename ArrayT>
539-
OPENVDB_DEPRECATED_MESSAGE("Use Tree::getNodes()") void getNodes(ArrayT& array)
540-
{
541-
using T = typename ArrayT::value_type;
542-
static_assert(std::is_pointer<T>::value, "argument to getNodes() must be a pointer array");
543-
using LeafT = typename std::conditional<std::is_const<
544-
typename std::remove_pointer<T>::type>::value, const LeafType, LeafType>::type;
545-
546-
OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
547-
if (std::is_same<T, LeafT*>::value) {
548-
array.resize(mLeafCount);
549-
for (size_t i=0; i<mLeafCount; ++i) array[i] = reinterpret_cast<T>(mLeafs[i]);
550-
} else {
551-
mTree->getNodes(array);
552-
}
553-
OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
554-
}
555-
556-
template<typename ArrayT>
557-
OPENVDB_DEPRECATED_MESSAGE("Use Tree::getNodes()") void getNodes(ArrayT& array) const
558-
{
559-
using T = typename ArrayT::value_type;
560-
static_assert(std::is_pointer<T>::value, "argument to getNodes() must be a pointer array");
561-
static_assert(std::is_const<typename std::remove_pointer<T>::type>::value,
562-
"argument to getNodes() must be an array of const node pointers");
563-
564-
OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
565-
if (std::is_same<T, const LeafType*>::value) {
566-
array.resize(mLeafCount);
567-
for (size_t i=0; i<mLeafCount; ++i) array[i] = reinterpret_cast<T>(mLeafs[i]);
568-
} else {
569-
mTree->getNodes(array);
570-
}
571-
OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
572-
}
573-
574538
/// @brief Generate a linear array of prefix sums of offsets into the
575539
/// active voxels in the leafs. So @a offsets[n]+m is the offset to the
576540
/// mth active voxel in the nth leaf node (useful for

0 commit comments

Comments
 (0)