Skip to content

Commit f896bd6

Browse files
committed
Removed ABI <= 6 branching which is no longer supported
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent eca97bf commit f896bd6

File tree

12 files changed

+2
-96
lines changed

12 files changed

+2
-96
lines changed

nanovdb/nanovdb/util/NanoToOpenVDB.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,7 @@ NanoToOpenVDB<T>::operator()(const NanoGrid<T>& grid, int /*verbose*/)
132132
for (uint32_t i=0; i<data->mTableSize; ++i) {
133133
auto *tile = data->tile(i);
134134
if (tile->isChild()) {
135-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
136135
root.addChild( this->process( data->getChild(tile)) );
137-
#else// hack since RootNode::addChild is not available in older versions
138-
root.addTile(tile->origin(), root.background(), false);//dummy tile
139-
auto it = root.beginChildAll();
140-
while(it.getCoord() != tile->origin()) ++it;// find tile
141-
it.setChild(this->process( data->getChild(tile)) );//replace tile with child
142-
#endif
143136
} else {
144137
root.addTile(tile->origin(), tile->value, tile->state);
145138
}

nanovdb/nanovdb/util/OpenToNanoVDB.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,7 @@ GridHandle<BufferT> OpenToNanoVDB<OpenBuildT, NanoBuildT, OracleT, BufferT>::
513513
mArray0.clear();
514514
mArray1.clear();
515515
mArray2.clear();
516-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
517516
std::vector<uint32_t> nodeCount = openTree.nodeCount();
518-
#else
519-
std::vector<uint32_t> nodeCount(openTree.treeDepth());
520-
for (auto it = openTree.cbeginNode(); it; ++it) {
521-
++(nodeCount[it.getDepth()]);
522-
}
523-
#endif
524517
mArray0.reserve(nodeCount[0]);
525518
mArray1.reserve(nodeCount[1]);
526519
mArray2.reserve(nodeCount[2]);

openvdb/openvdb/Grid.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class OPENVDB_API GridBase: public MetaMap
9999
/// transform are deep copies of this grid's and whose tree is default-constructed.
100100
virtual GridBase::Ptr copyGridWithNewTree() const = 0;
101101

102-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
103102
/// @brief Return a new grid of the same type as this grid whose tree and transform
104103
/// is shared with this grid and whose metadata is provided as an argument.
105104
virtual GridBase::ConstPtr copyGridReplacingMetadata(const MetaMap& meta) const = 0;
@@ -113,7 +112,6 @@ class OPENVDB_API GridBase: public MetaMap
113112
/// @throw ValueError if the transform pointer is null
114113
virtual GridBase::ConstPtr copyGridReplacingMetadataAndTransform(const MetaMap& meta,
115114
math::Transform::Ptr xform) const = 0;
116-
#endif
117115

118116
/// Return a new grid whose metadata, transform and tree are deep copies of this grid's.
119117
virtual GridBase::Ptr deepCopyGrid() const = 0;
@@ -485,11 +483,9 @@ class OPENVDB_API GridBase: public MetaMap
485483
/// @brief Initialize with an identity linear transform.
486484
GridBase(): mTransform(math::Transform::createLinearTransform()) {}
487485

488-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
489486
/// @brief Initialize with metadata and a transform.
490487
/// @throw ValueError if the transform pointer is null
491488
GridBase(const MetaMap& meta, math::Transform::Ptr xform);
492-
#endif
493489

494490
/// @brief Deep copy another grid's metadata and transform.
495491
GridBase(const GridBase& other): MetaMap(other), mTransform(other.mTransform->copy()) {}
@@ -675,7 +671,6 @@ class Grid: public GridBase
675671
/// @name Copying
676672
/// @{
677673

678-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
679674
/// @brief Return a new grid of the same type as this grid whose tree and transform
680675
/// is shared with this grid and whose metadata is provided as an argument.
681676
ConstPtr copyReplacingMetadata(const MetaMap& meta) const;
@@ -703,7 +698,6 @@ class Grid: public GridBase
703698
/// @throw ValueError if the transform pointer is null
704699
GridBase::ConstPtr copyGridReplacingMetadataAndTransform(const MetaMap& meta,
705700
math::Transform::Ptr xform) const override;
706-
#endif
707701

708702
/// @brief Return a new grid whose metadata, transform and tree are deep copies of this grid's.
709703
Ptr deepCopy() const { return Ptr(new Grid(*this)); }
@@ -988,10 +982,8 @@ tools::minMax(grid->tree()). Use threaded = false for serial execution")
988982

989983

990984
private:
991-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
992985
/// Deep copy metadata, but share tree and transform.
993986
Grid(TreePtrType tree, const MetaMap& meta, math::Transform::Ptr xform);
994-
#endif
995987

996988
/// Helper function for use with registerGrid()
997989
static GridBase::Ptr factory() { return Grid::create(); }
@@ -1190,14 +1182,12 @@ struct HasMultiPassIO<Grid<TreeType>> {
11901182

11911183
////////////////////////////////////////
11921184

1193-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
11941185
inline GridBase::GridBase(const MetaMap& meta, math::Transform::Ptr xform)
11951186
: MetaMap(meta)
11961187
, mTransform(xform)
11971188
{
11981189
if (!xform) OPENVDB_THROW(ValueError, "Transform pointer is null");
11991190
}
1200-
#endif
12011191

12021192
template<typename GridType>
12031193
inline typename GridType::Ptr
@@ -1275,15 +1265,13 @@ inline Grid<TreeT>::Grid(TreePtrType tree): mTree(tree)
12751265
}
12761266

12771267

1278-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
12791268
template<typename TreeT>
12801269
inline Grid<TreeT>::Grid(TreePtrType tree, const MetaMap& meta, math::Transform::Ptr xform):
12811270
GridBase(meta, xform),
12821271
mTree(tree)
12831272
{
12841273
if (!tree) OPENVDB_THROW(ValueError, "Tree pointer is null");
12851274
}
1286-
#endif
12871275

12881276

12891277
template<typename TreeT>
@@ -1366,7 +1354,6 @@ Grid<TreeT>::copy() const
13661354
}
13671355

13681356

1369-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
13701357
template<typename TreeT>
13711358
inline typename Grid<TreeT>::ConstPtr
13721359
Grid<TreeT>::copyReplacingMetadata(const MetaMap& meta) const
@@ -1392,7 +1379,6 @@ Grid<TreeT>::copyReplacingMetadataAndTransform(const MetaMap& meta,
13921379
TreePtrType treePtr = ConstPtrCast<TreeT>(this->constTreePtr());
13931380
return ConstPtr{new Grid<TreeT>{treePtr, meta, xform}};
13941381
}
1395-
#endif
13961382

13971383

13981384
template<typename TreeT>
@@ -1427,7 +1413,6 @@ Grid<TreeT>::copyGrid() const
14271413
return this->copy();
14281414
}
14291415

1430-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
14311416
template<typename TreeT>
14321417
inline GridBase::ConstPtr
14331418
Grid<TreeT>::copyGridReplacingMetadata(const MetaMap& meta) const
@@ -1449,7 +1434,6 @@ Grid<TreeT>::copyGridReplacingMetadataAndTransform(const MetaMap& meta,
14491434
{
14501435
return this->copyReplacingMetadataAndTransform(meta, xform);
14511436
}
1452-
#endif
14531437

14541438
template<typename TreeT>
14551439
inline GridBase::Ptr

openvdb/openvdb/points/AttributeArray.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,13 @@ AttributeArray::ScopedRegistryLock::ScopedRegistryLock()
5151
// AttributeArray implementation
5252

5353

54-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
5554
AttributeArray::AttributeArray(const AttributeArray& rhs)
5655
: AttributeArray(rhs, tbb::spin_mutex::scoped_lock(rhs.mMutex))
5756
{
5857
}
5958

6059

6160
AttributeArray::AttributeArray(const AttributeArray& rhs, const tbb::spin_mutex::scoped_lock&)
62-
#else
63-
AttributeArray::AttributeArray(const AttributeArray& rhs)
64-
#endif
6561
: mIsUniform(rhs.mIsUniform)
6662
, mFlags(rhs.mFlags)
6763
, mUsePagedRead(rhs.mUsePagedRead)

openvdb/openvdb/points/AttributeArray.h

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,7 @@ class OPENVDB_API AttributeArray
366366
bool rangeChecking = true);
367367

368368
protected:
369-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
370369
AttributeArray(const AttributeArray& rhs, const tbb::spin_mutex::scoped_lock&);
371-
#endif
372370

373371
/// @brief Specify whether this attribute has a constant stride or not.
374372
void setConstantStride(bool state);
@@ -544,7 +542,7 @@ class TypedAttributeArray final: public AttributeArray
544542
/// Default constructor, always constructs a uniform attribute.
545543
explicit TypedAttributeArray(Index n = 1, Index strideOrTotalSize = 1, bool constantStride = true,
546544
const ValueType& uniformValue = zeroVal<ValueType>());
547-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
545+
548546
/// Deep copy constructor.
549547
/// @note This method is thread-safe (as of ABI=7) for concurrently reading from the
550548
/// source attribute array while being deep-copied. Specifically, this means that the
@@ -555,12 +553,7 @@ class TypedAttributeArray final: public AttributeArray
555553
/// Deep copy constructor.
556554
OPENVDB_DEPRECATED_MESSAGE("Use copy-constructor without unused bool parameter")
557555
TypedAttributeArray(const TypedAttributeArray&, bool /*unused*/);
558-
#else
559-
/// Deep copy constructor.
560-
/// @note This method is not thread-safe for reading or writing, use
561-
/// TypedAttributeArray::copy() to ensure thread-safety when reading concurrently.
562-
TypedAttributeArray(const TypedAttributeArray&, bool uncompress = false);
563-
#endif
556+
564557
/// Deep copy assignment operator.
565558
/// @note this operator is thread-safe.
566559
TypedAttributeArray& operator=(const TypedAttributeArray&);
@@ -762,9 +755,7 @@ class TypedAttributeArray final: public AttributeArray
762755
private:
763756
friend class ::TestAttributeArray;
764757

765-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
766758
TypedAttributeArray(const TypedAttributeArray&, const tbb::spin_mutex::scoped_lock&);
767-
#endif
768759

769760
/// Load data from memory-mapped file.
770761
inline void doLoad() const;
@@ -1132,7 +1123,6 @@ TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray(
11321123
}
11331124

11341125

1135-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
11361126
template<typename ValueType_, typename Codec_>
11371127
TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray(const TypedAttributeArray& rhs)
11381128
: TypedAttributeArray(rhs, tbb::spin_mutex::scoped_lock(rhs.mMutex))
@@ -1144,11 +1134,6 @@ template<typename ValueType_, typename Codec_>
11441134
TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray(const TypedAttributeArray& rhs,
11451135
const tbb::spin_mutex::scoped_lock& lock)
11461136
: AttributeArray(rhs, lock)
1147-
#else
1148-
template<typename ValueType_, typename Codec_>
1149-
TypedAttributeArray<ValueType_, Codec_>::TypedAttributeArray(const TypedAttributeArray& rhs, bool)
1150-
: AttributeArray(rhs)
1151-
#endif
11521137
, mSize(rhs.mSize)
11531138
, mStrideOrTotalSize(rhs.mStrideOrTotalSize)
11541139
{
@@ -1259,9 +1244,6 @@ template<typename ValueType_, typename Codec_>
12591244
AttributeArray::Ptr
12601245
TypedAttributeArray<ValueType_, Codec_>::copy() const
12611246
{
1262-
#if OPENVDB_ABI_VERSION_NUMBER < 7
1263-
tbb::spin_mutex::scoped_lock lock(mMutex);
1264-
#endif
12651247
return AttributeArray::Ptr(new TypedAttributeArray<ValueType, Codec>(*this));
12661248
}
12671249

openvdb/openvdb/tree/Tree.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,10 @@ class OPENVDB_API TreeBase
109109
virtual Index treeDepth() const = 0;
110110
/// Return the number of leaf nodes.
111111
virtual Index32 leafCount() const = 0;
112-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
113112
/// Return a vector with node counts. The number of nodes of type NodeType
114113
/// is given as element NodeType::LEVEL in the return vector. Thus, the size
115114
/// of this vector corresponds to the height (or depth) of this tree.
116115
virtual std::vector<Index32> nodeCount() const = 0;
117-
#endif
118116
/// Return the number of non-leaf nodes.
119117
virtual Index32 nonLeafCount() const = 0;
120118
/// Return the number of active voxels stored in leaf nodes.
@@ -336,7 +334,6 @@ class Tree: public TreeBase
336334
Index treeDepth() const override { return DEPTH; }
337335
/// Return the number of leaf nodes.
338336
Index32 leafCount() const override { return mRoot.leafCount(); }
339-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
340337
/// Return a vector with node counts. The number of nodes of type NodeType
341338
/// is given as element NodeType::LEVEL in the return vector. Thus, the size
342339
/// of this vector corresponds to the height (or depth) of this tree.
@@ -346,7 +343,6 @@ class Tree: public TreeBase
346343
mRoot.nodeCount( vec );
347344
return vec;// Named Return Value Optimization
348345
}
349-
#endif
350346
/// Return the number of non-leaf nodes.
351347
Index32 nonLeafCount() const override { return mRoot.nonLeafCount(); }
352348
/// Return the number of active voxels stored in leaf nodes.
@@ -2093,14 +2089,8 @@ Tree<RootNodeType>::print(std::ostream& os, int verboseLevel) const
20932089
maxVal = extrema.max();
20942090
}
20952091

2096-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
20972092
const auto nodeCount = this->nodeCount();//fast
20982093
const Index32 leafCount = nodeCount.front();// leaf is the first element
2099-
#else
2100-
std::vector<Index64> nodeCount(dims.size());
2101-
for (NodeCIter it = cbeginNode(); it; ++it) ++(nodeCount[it.getDepth()]);//slow
2102-
const Index64 leafCount = *nodeCount.rbegin();// leaf is the last element
2103-
#endif
21042094
assert(dims.size() == nodeCount.size());
21052095

21062096
Index64 totalNodeCount = 0;
@@ -2110,11 +2100,7 @@ Tree<RootNodeType>::print(std::ostream& os, int verboseLevel) const
21102100
os << " Root(1 x " << mRoot.getTableSize() << ")";
21112101
if (dims.size() >= 2) {
21122102
for (size_t i = 1, N = dims.size() - 1; i < N; ++i) {
2113-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
21142103
os << ", Internal(" << util::formattedInt(nodeCount[N - i]);
2115-
#else
2116-
os << ", Internal(" << util::formattedInt(nodeCount[i]);
2117-
#endif
21182104
os << " x " << (1 << dims[i]) << "^3)";
21192105
}
21202106
os << ", Leaf(" << util::formattedInt(leafCount);

openvdb/openvdb/unittest/TestGrid.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ class ProxyTree: public openvdb::TreeBase
8484

8585
openvdb::Index treeDepth() const override { return 0; }
8686
openvdb::Index leafCount() const override { return 0; }
87-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
8887
std::vector<openvdb::Index32> nodeCount() const override
8988
{ return std::vector<openvdb::Index32>(DEPTH, 0); }
90-
#endif
9189
openvdb::Index nonLeafCount() const override { return 0; }
9290
openvdb::Index64 activeVoxelCount() const override { return 0UL; }
9391
openvdb::Index64 inactiveVoxelCount() const override { return 0UL; }
@@ -266,7 +264,6 @@ TEST_F(TestGrid, testCopyGrid)
266264
ASSERT_DOUBLES_EXACTLY_EQUAL(fillValue1, tree1.getValue(changeCoord));
267265
ASSERT_DOUBLES_EXACTLY_EQUAL(1.0f, tree2.getValue(changeCoord));
268266

269-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
270267
// shallow-copy a const grid but supply a new transform and meta map
271268
EXPECT_EQ(1.0, grid1->transform().voxelSize().x());
272269
EXPECT_EQ(size_t(0), grid1->metaCount());
@@ -285,7 +282,6 @@ TEST_F(TestGrid, testCopyGrid)
285282
EXPECT_EQ(size_t(1), grid3->metaCount());
286283
EXPECT_EQ(Index(2), tree3.leafCount());
287284
EXPECT_EQ(long(3), constGrid1->constTreePtr().use_count());
288-
#endif
289285
}
290286

291287

openvdb/openvdb/unittest/TestNodeVisitor.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class TestNodeVisitor: public ::testing::Test
1212
};
1313

1414

15-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
1615
struct NodeCountOp
1716
{
1817
template <typename NodeT>
@@ -45,7 +44,6 @@ TEST_F(TestNodeVisitor, testNodeCount)
4544
EXPECT_EQ(nodeCount1[i], nodeCount2[i]);
4645
}
4746
}
48-
#endif // OPENVDB_ABI_VERSION_NUMBER >= 7
4947

5048

5149
template <typename TreeT>
@@ -114,7 +112,6 @@ TEST_F(TestNodeVisitor, testDepthFirst)
114112
}
115113

116114

117-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
118115
template <typename TreeT>
119116
struct StoreOriginsOp
120117
{
@@ -176,7 +173,6 @@ TEST_F(TestNodeVisitor, testOriginArray)
176173

177174
EXPECT_EQ(idx, origins.size());
178175
}
179-
#endif // OPENVDB_ABI_VERSION_NUMBER >= 7
180176

181177

182178
template <typename TreeType>

openvdb/openvdb/unittest/TestTree.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,7 +2763,6 @@ TEST_F(TestTree, testStealNode)
27632763
}
27642764
}
27652765

2766-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
27672766
TEST_F(TestTree, testNodeCount)
27682767
{
27692768
//openvdb::util::CpuTimer timer;// use for benchmark test
@@ -2791,7 +2790,6 @@ TEST_F(TestTree, testNodeCount)
27912790
EXPECT_EQ(tree.leafCount(), nodeCount2.front());// leaf nodes
27922791
for (size_t i=0; i<nodeCount2.size(); ++i) EXPECT_EQ( nodeCount1[i], nodeCount2[i]);
27932792
}
2794-
#endif
27952793

27962794
TEST_F(TestTree, testRootNode)
27972795
{

openvdb_houdini/openvdb_houdini/ParmFactory.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,7 @@ class OPENVDB_HOUDINI_API OpFactory
404404
ParmList& parms, OP_OperatorTable& table, OpFlavor flavor = SOP);
405405

406406
/// Register the operator.
407-
#if OPENVDB_ABI_VERSION_NUMBER >= 7
408407
virtual ~OpFactory();
409-
#else
410-
~OpFactory();
411-
#endif
412408

413409
OpFactory(const OpFactory&) = delete;
414410
OpFactory& operator=(const OpFactory&) = delete;

0 commit comments

Comments
 (0)