Skip to content

Commit d6d0386

Browse files
authored
Merge pull request #1079 from Idclip/morph_deprecation_msgs
Improved deprecation messages on dilation and erosion API
2 parents 363c88e + a7ca09b commit d6d0386

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

openvdb/openvdb/tools/Morphology.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ inline void erodeActiveValues(TreeOrLeafManagerT& treeOrLeafM,
11921192
///
11931193
/// @note The values of any voxels are unchanged.
11941194
template<typename TreeType>
1195-
OPENVDB_DEPRECATED
1195+
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::dilateActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
11961196
inline void dilateVoxels(TreeType& tree,
11971197
int iterations = 1,
11981198
NearestNeighbors nn = NN_FACE)
@@ -1219,7 +1219,7 @@ inline void dilateVoxels(TreeType& tree,
12191219
///
12201220
/// @note The values of any voxels are unchanged.
12211221
template<typename TreeType>
1222-
OPENVDB_DEPRECATED
1222+
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::dilateActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
12231223
inline void dilateVoxels(tree::LeafManager<TreeType>& manager,
12241224
int iterations = 1,
12251225
NearestNeighbors nn = NN_FACE)
@@ -1237,7 +1237,7 @@ inline void dilateVoxels(tree::LeafManager<TreeType>& manager,
12371237
/// of any voxels, only their active states.
12381238
/// @todo Currently operates only on leaf voxels; need to extend to tiles.
12391239
template<typename TreeType>
1240-
OPENVDB_DEPRECATED
1240+
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::erodeActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
12411241
inline void erodeVoxels(TreeType& tree,
12421242
int iterations=1,
12431243
NearestNeighbors nn = NN_FACE)
@@ -1252,7 +1252,7 @@ inline void erodeVoxels(TreeType& tree,
12521252
}
12531253

12541254
template<typename TreeType>
1255-
OPENVDB_DEPRECATED
1255+
OPENVDB_DEPRECATED_MESSAGE("Switch to tools::erodeActiveValues. Use tools::IGNORE_TILES to maintain same (but perhaps unintended) behaviour")
12561256
inline void erodeVoxels(tree::LeafManager<TreeType>& manager,
12571257
int iterations = 1,
12581258
NearestNeighbors nn = NN_FACE)

openvdb/openvdb/unittest/TestMorphology.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,3 +683,22 @@ TEST_F(TestMorphology, testPreserveMaskLeafNodes)
683683
EXPECT_EQ(mask.probeConstLeaf({i,i,i}), nodes[i]);
684684
}
685685
}
686+
687+
688+
TEST_F(TestMorphology, testDeprecated)
689+
{
690+
// just test these can be instantiated
691+
692+
OPENVDB_NO_DEPRECATION_WARNING_BEGIN
693+
openvdb::FloatTree tree;
694+
openvdb::tree::LeafManager<openvdb::FloatTree> lm(tree);
695+
696+
openvdb::tools::dilateVoxels(tree, 1);
697+
lm.rebuild();
698+
openvdb::tools::dilateVoxels(lm, 1);
699+
openvdb::tools::erodeVoxels(tree, 1);
700+
701+
lm.rebuild();
702+
openvdb::tools::erodeVoxels(lm, 1);
703+
OPENVDB_NO_DEPRECATION_WARNING_END
704+
}

0 commit comments

Comments
 (0)