Skip to content

Commit c5a1313

Browse files
authored
Merge pull request #1492 from danrbailey/remove_string_grids
Remove string grids
2 parents 9ab6fa3 + 36b119b commit c5a1313

File tree

6 files changed

+14
-41
lines changed

6 files changed

+14
-41
lines changed

doc/examplecode.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,6 @@ void processTypedGrid(openvdb::GridBase::Ptr grid, OpType& op)
11991199
else if (grid->isType<openvdb::Vec3IGrid>()) CALL_OP(openvdb::Vec3IGrid);
12001200
else if (grid->isType<openvdb::Vec3SGrid>()) CALL_OP(openvdb::Vec3SGrid);
12011201
else if (grid->isType<openvdb::Vec3DGrid>()) CALL_OP(openvdb::Vec3DGrid);
1202-
else if (grid->isType<openvdb::StringGrid>()) CALL_OP(openvdb::StringGrid);
12031202

12041203
#undef CALL_OP
12051204
}
@@ -1221,11 +1220,6 @@ struct PruneOp {
12211220
{
12221221
grid->tree().prune(typename GridType::ValueType(tolerance));
12231222
}
1224-
// Overload to handle string-valued grids
1225-
void operator()(openvdb::StringGrid::Ptr grid) const
1226-
{
1227-
grid->tree().prune();
1228-
}
12291223
};
12301224

12311225
// Read all grids from a file.

openvdb/openvdb/openvdb.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ initialize()
7878
GridBase::clearRegistry();
7979
GridTypes::foreach<RegisterGrid>();
8080

81-
// @note String grids types are deprecated but we still register them
82-
// as supported serializable types for backward compatibility. This
83-
// will likely be removed in a future major version
84-
OPENVDB_NO_DEPRECATION_WARNING_BEGIN
85-
StringGrid::registerGrid();
86-
OPENVDB_NO_DEPRECATION_WARNING_END
87-
8881
// Register types associated with point index grids.
8982
Metadata::registerType(typeNameAsString<PointIndex32>(), Int32Metadata::createMetadata);
9083
Metadata::registerType(typeNameAsString<PointIndex64>(), Int64Metadata::createMetadata);

openvdb/openvdb/openvdb.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,6 @@ using MetaTypes = TypeList<
221221
io::DelayedLoadMetadata>;
222222

223223

224-
// Deprecated types
225-
/// @note Customizing the type of a VDB tree to an arbitrary class is still
226-
/// supported however std::string Trees will, in the future, no longer be
227-
/// provided as a native type by OpenVDB.
228-
using StringTree OPENVDB_DEPRECATED_MESSAGE("Support for std::string Trees "
229-
"as a native type will be dropped in future versions. Please feedback with any concerns.")
230-
= tree::Tree4<std::string, 5, 4, 3>::Type;
231-
using StringGrid OPENVDB_DEPRECATED_MESSAGE("Support for std::string Grids "
232-
"as a native type will be dropped in future versions. Please feedback with any concerns.")
233-
= Grid<tree::Tree4<std::string, 5, 4, 3>::Type>;
234-
235224
} // namespace OPENVDB_VERSION_NAME
236225
} // namespace openvdb
237226

openvdb/openvdb/unittest/TestInit.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ TEST_F(TestInit, test)
4545
EXPECT_TRUE(DoubleGrid::isRegistered());
4646
EXPECT_TRUE(Int32Grid::isRegistered());
4747
EXPECT_TRUE(Int64Grid::isRegistered());
48-
OPENVDB_NO_DEPRECATION_WARNING_BEGIN
49-
EXPECT_TRUE(StringGrid::isRegistered());
50-
OPENVDB_NO_DEPRECATION_WARNING_END
5148
EXPECT_TRUE(Vec3IGrid::isRegistered());
5249
EXPECT_TRUE(Vec3SGrid::isRegistered());
5350
EXPECT_TRUE(Vec3DGrid::isRegistered());
@@ -78,9 +75,6 @@ OPENVDB_NO_DEPRECATION_WARNING_END
7875
EXPECT_TRUE(!DoubleGrid::isRegistered());
7976
EXPECT_TRUE(!Int32Grid::isRegistered());
8077
EXPECT_TRUE(!Int64Grid::isRegistered());
81-
OPENVDB_NO_DEPRECATION_WARNING_BEGIN
82-
EXPECT_TRUE(!StringGrid::isRegistered());
83-
OPENVDB_NO_DEPRECATION_WARNING_END
8478
EXPECT_TRUE(!Vec3IGrid::isRegistered());
8579
EXPECT_TRUE(!Vec3SGrid::isRegistered());
8680
EXPECT_TRUE(!Vec3DGrid::isRegistered());

openvdb_ax/openvdb_ax/test/compiler/TestVolumeExecutable.cc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,13 @@ TestVolumeExecutable::testActiveTileStreaming()
578578
}
579579

580580
// test spatially varying voxelization for string grids which use specialized implementations
581+
// Note: StringGrids are no longer registered by default
581582
{
582-
OPENVDB_NO_DEPRECATION_WARNING_BEGIN
583-
openvdb::StringGrid grid;
583+
using StringTree = openvdb::tree::Tree4<std::string, 5, 4, 3>::Type;
584+
using StringGrid = openvdb::Grid<openvdb::tree::Tree4<std::string, 5, 4, 3>::Type>;
585+
StringGrid grid;
584586
grid.setName("test");
585-
openvdb::StringTree& tree = grid.tree();
587+
StringTree& tree = grid.tree();
586588
tree.addTile(2, openvdb::Coord(NodeT1::DIM*0, 0, 0), "foo", /*active*/true); // NodeT1 tile
587589
tree.addTile(2, openvdb::Coord(NodeT1::DIM*1, 0, 0), "foo", /*active*/true); // NodeT1 tile
588590
tree.addTile(2, openvdb::Coord(NodeT1::DIM*2, 0, 0), "foo", /*active*/true); // NodeT1 tile
@@ -599,14 +601,14 @@ OPENVDB_NO_DEPRECATION_WARNING_BEGIN
599601
executable->getActiveTileStreaming("empty", openvdb::ax::ast::tokens::CoreType::FLOAT));
600602
executable->getTreeExecutionLevel(min,max);
601603
CPPUNIT_ASSERT_EQUAL(openvdb::Index(0), min);
602-
CPPUNIT_ASSERT_EQUAL(openvdb::Index(openvdb::StringTree::DEPTH-1), max);
604+
CPPUNIT_ASSERT_EQUAL(openvdb::Index(StringTree::DEPTH-1), max);
603605

604606
executable->execute(grid);
605607

606608
const openvdb::Index64 face = NodeT1::DIM * NodeT1::DIM; // face voxel count of NodeT2 x==0
607609
const openvdb::Index64 leafs = // expected leaf nodes that need to be created
608-
(face * openvdb::StringTree::LeafNodeType::DIM) /
609-
openvdb::StringTree::LeafNodeType::NUM_VOXELS;
610+
(face * StringTree::LeafNodeType::DIM) /
611+
StringTree::LeafNodeType::NUM_VOXELS;
610612

611613
// number of child nodes in NodeT1;
612614
const openvdb::Index64 n1ChildAxisCount = NodeT1::DIM / NodeT1::getChildDim();
@@ -618,10 +620,10 @@ OPENVDB_NO_DEPRECATION_WARNING_BEGIN
618620

619621
CPPUNIT_ASSERT_EQUAL(openvdb::Index32(leafs), tree.leafCount());
620622
CPPUNIT_ASSERT_EQUAL(openvdb::Index64(tiles), tree.activeTileCount());
621-
CPPUNIT_ASSERT_EQUAL(int(openvdb::StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*1, 0, 0)));
622-
CPPUNIT_ASSERT_EQUAL(int(openvdb::StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*2, 0, 0)));
623-
CPPUNIT_ASSERT_EQUAL(int(openvdb::StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*3, 0, 0)));
624-
CPPUNIT_ASSERT_EQUAL(int(openvdb::StringTree::DEPTH-2), tree.getValueDepth(openvdb::Coord(NodeT2::DIM)));
623+
CPPUNIT_ASSERT_EQUAL(int(StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*1, 0, 0)));
624+
CPPUNIT_ASSERT_EQUAL(int(StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*2, 0, 0)));
625+
CPPUNIT_ASSERT_EQUAL(int(StringTree::DEPTH-3), tree.getValueDepth(openvdb::Coord(NodeT1::DIM*3, 0, 0)));
626+
CPPUNIT_ASSERT_EQUAL(int(StringTree::DEPTH-2), tree.getValueDepth(openvdb::Coord(NodeT2::DIM)));
625627
CPPUNIT_ASSERT_EQUAL((openvdb::Index64(NodeT1::NUM_VOXELS)*4) +
626628
openvdb::Index64(NodeT0::NUM_VOXELS), tree.activeVoxelCount());
627629

@@ -630,7 +632,6 @@ OPENVDB_NO_DEPRECATION_WARNING_BEGIN
630632
if (coord.x() == 0) CPPUNIT_ASSERT_EQUAL(*it, std::string("bar"));
631633
else CPPUNIT_ASSERT_EQUAL(*it, std::string("foo"));
632634
});
633-
OPENVDB_NO_DEPRECATION_WARNING_END
634635
}
635636

636637
// test streaming with an OFF iterator (no streaming behaviour) and an ALL iterator (streaming behaviour for ON values only)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
API Changes:
2+
- StringGrid and StringTrees have been removed.

0 commit comments

Comments
 (0)