Skip to content

Commit a8eb38e

Browse files
Various improvements.
1 parent c2f000f commit a8eb38e

File tree

10 files changed

+41
-26
lines changed

10 files changed

+41
-26
lines changed

openvdb/CHANGES

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ OpenVDB Version History
22
=======================
33

44
Version 2.2.0 - In development
5+
- Added documentation (in the Cookbook) on interpolation, e.g. BoxSamper,
6+
GridSampler and DualGridSampler.
57
- Modified tools::DualGridSampler so it is more consistent with
68
tools::GridSampler.
9+
- Added support to the Combine, Resample, Scatter, Prune and Visualize SOPs
10+
for grids with values of type bool.
11+
- Fixed build issue reported for clang 3.2.
712

8-
API changes:
9-
- tools::DualGridSampler is not longer templated to the target grid type,
13+
API changes:
14+
- tools::DualGridSampler is no longer templated on the target grid type,
1015
and the ValueAccessor is now passed as an argument.
1116

1217
Version 2.1.0 - December 12, 2013

openvdb/doc/changes.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
@htmlonly <a name="v2_2_0_changes"></a>@endhtmlonly
77
@par
88
<B>Version 2.2.0</B> - <I>In development</I>
9+
- Added documentation (in the Cookbook) on interpolation, e.g. BoxSamper,
10+
GridSampler and DualGridSampler.
911
- Modified @vdblink::tools::DualGridSampler DualGridSampler@endlink so
10-
it is more consistent with @vdblink::tools::GridSampler GridSampler@endlink.
12+
it is more consistent with @vdblink::tools::GridSampler GridSampler@endlink.
13+
- Added support to the Combine, Resample, Scatter, Prune and Visualize SOPs
14+
for grids with values of type bool.
15+
- Fixed build issue reported for clang 3.2.
1116

1217
@par
1318
API changes:
1419
- @vdblink::tools::DualGridSampler DualGridSampler@endlink is no longer
15-
templated to the target grid type, and the ValueAccessor is now passed
16-
as an argument.
20+
templated on the target grid type, and the ValueAccessor is now passed
21+
as an argument.
1722

1823
@htmlonly <a name="v2_1_0_changes"></a>@endhtmlonly
1924
@par

openvdb/tools/GridOperators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#ifndef OPENVDB_TOOLS_GRID_OPERATORS_HAS_BEEN_INCLUDED
3737
#define OPENVDB_TOOLS_GRID_OPERATORS_HAS_BEEN_INCLUDED
3838

39-
#include <openvdb/Grid.h>
39+
#include <openvdb/openvdb.h>// for BoolGrid
4040
#include <openvdb/math/Operators.h>
4141
#include <openvdb/util/NullInterrupter.h>
4242
#include <openvdb/tree/LeafManager.h>

openvdb/tree/LeafNodeBool.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,11 @@ class LeafNode<bool, Log2Dim>
641641
};
642642

643643
public:
644-
typedef ValueIter<MaskOnIter, LeafNode, bool> ValueOnIter;
644+
typedef ValueIter<MaskOnIter, LeafNode, const bool> ValueOnIter;
645645
typedef ValueIter<MaskOnIter, const LeafNode, const bool> ValueOnCIter;
646-
typedef ValueIter<MaskOffIter, LeafNode, bool> ValueOffIter;
646+
typedef ValueIter<MaskOffIter, LeafNode, const bool> ValueOffIter;
647647
typedef ValueIter<MaskOffIter, const LeafNode, const bool> ValueOffCIter;
648-
typedef ValueIter<MaskDenseIter, LeafNode, bool> ValueAllIter;
648+
typedef ValueIter<MaskDenseIter, LeafNode, const bool> ValueAllIter;
649649
typedef ValueIter<MaskDenseIter, const LeafNode, const bool> ValueAllCIter;
650650
typedef ChildIter<MaskOnIter, LeafNode> ChildOnIter;
651651
typedef ChildIter<MaskOnIter, const LeafNode> ChildOnCIter;
@@ -1497,9 +1497,9 @@ LeafNode<bool, Log2Dim>::visitActiveBBox(BBoxOp& op) const
14971497
if (op.template descent<LEVEL>()) {
14981498
for (ValueOnCIter i=this->cbeginValueOn(); i; ++i) {
14991499
#ifdef _MSC_VER
1500-
op.operator()<LEVEL>(CoordBBox(i.getCoord(),1));
1500+
op.operator()<LEVEL>(CoordBBox::createCube(i.getCoord(), 1));
15011501
#else
1502-
op.template operator()<LEVEL>(CoordBBox(i.getCoord(),1));
1502+
op.template operator()<LEVEL>(CoordBBox::createCube(i.getCoord(), 1));
15031503
#endif
15041504
}
15051505
} else {

openvdb_houdini/houdini/SOP_OpenVDB_Combine.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,15 @@ SOP_OpenVDB_Combine::cookMySop(OP_Context& context)
409409
UT_String aGridName = aIt.getPrimitiveName(/*default=*/"A");
410410
UT_String bGridName = bIt.getPrimitiveName(/*default=*/"B");
411411

412+
// Name the output grid after the A grid, except (see below) if the A grid is unused.
413+
UT_String outGridName = aIt.getPrimitiveName();
414+
412415
hvdb::GridPtr outGrid;
413416

414417
while (true) {
418+
// If the A grid is unused, name the output grid after the most recent B grid.
419+
if (!needA) outGridName = bIt.getPrimitiveName();
420+
415421
outGrid = combineGrids(op, aGrid, bGrid, aGridName, bGridName, resample);
416422

417423
// When not flattening, quit after one pass.
@@ -432,9 +438,7 @@ SOP_OpenVDB_Combine::cookMySop(OP_Context& context)
432438
if (outGrid) {
433439
// Add a new VDB primitive for the output grid to the output gdp.
434440
GU_PrimVDB::buildFromGrid(*gdp, outGrid,
435-
/*copyAttrsFrom=*/needA ? aVdb : bVdb,
436-
/*copyGridNameFrom=*/needA ? aGridName.toStdString().c_str()
437-
: bGridName.toStdString().c_str());
441+
/*copyAttrsFrom=*/needA ? aVdb : bVdb, outGridName);
438442

439443
// Remove the A grid from the output gdp.
440444
if (aVdb) gdp->destroyPrimitive(*aVdb, /*andPoints=*/true);
@@ -923,7 +927,8 @@ SOP_OpenVDB_Combine::combineGrids(Operation op,
923927
compOp.bGridName = bGridName;
924928
compOp.interrupt = hvdb::Interrupter();
925929

926-
int success = UTvdbProcessTypedGrid(UTvdbGetGridType(needA ? *aGrid : *bGrid), aGrid, compOp);
930+
int success = UTvdbProcessTypedGridTopology(
931+
UTvdbGetGridType(needA ? *aGrid : *bGrid), aGrid, compOp);
927932
if (!success || !compOp.outGrid) {
928933
std::ostringstream ostr;
929934
ostr << "grids " << aGridName << " and " << bGridName

openvdb_houdini/houdini/SOP_OpenVDB_Fill.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ SOP_OpenVDB_Fill::cookMySop(OP_Context& context)
150150
}
151151

152152
GU_PrimVDB* vdbPrim = *it;
153-
GEOvdbProcessTypedGrid(*vdbPrim, fillOp);
153+
GEOvdbProcessTypedGridTopology(*vdbPrim, fillOp);
154154
}
155155
} catch (std::exception& e) {
156156
addError(SOP_MESSAGE, e.what());

openvdb_houdini/houdini/SOP_OpenVDB_Prune.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ SOP_OpenVDB_Prune::cookMySop(OP_Context& context)
207207
}
208208

209209
GU_PrimVDB* vdbPrim = *it;
210-
GEOvdbProcessTypedGrid(*vdbPrim, pruneOp);
210+
GEOvdbProcessTypedGridTopology(*vdbPrim, pruneOp);
211211
}
212212
} catch (std::exception& e) {
213213
addError(SOP_MESSAGE, e.what());

openvdb_houdini/houdini/SOP_OpenVDB_Resample.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,13 @@ SOP_OpenVDB_Resample::cookMySop(OP_Context& context)
412412

413413
if (samplingOrder == 0) {
414414
hvdb::GridResampleToMatchOp<openvdb::tools::PointSampler> op(outGrid);
415-
GEOvdbProcessTypedGrid(*vdb, op);
415+
GEOvdbProcessTypedGridTopology(*vdb, op);
416416
} else if (samplingOrder == 1) {
417417
hvdb::GridResampleToMatchOp<openvdb::tools::BoxSampler> op(outGrid);
418-
GEOvdbProcessTypedGrid(*vdb, op);
418+
GEOvdbProcessTypedGridTopology(*vdb, op);
419419
} else if (samplingOrder == 2) {
420420
hvdb::GridResampleToMatchOp<openvdb::tools::QuadraticSampler> op(outGrid);
421-
GEOvdbProcessTypedGrid(*vdb, op);
421+
GEOvdbProcessTypedGridTopology(*vdb, op);
422422
}
423423
}
424424

@@ -452,13 +452,13 @@ SOP_OpenVDB_Resample::cookMySop(OP_Context& context)
452452

453453
if (samplingOrder == 0) {
454454
hvdb::GridTransformOp<openvdb::tools::PointSampler> op(outGrid, xform);
455-
GEOvdbProcessTypedGrid(*vdb, op);
455+
GEOvdbProcessTypedGridTopology(*vdb, op);
456456
} else if (samplingOrder == 1) {
457457
hvdb::GridTransformOp<openvdb::tools::BoxSampler> op(outGrid, xform);
458-
GEOvdbProcessTypedGrid(*vdb, op);
458+
GEOvdbProcessTypedGridTopology(*vdb, op);
459459
} else if (samplingOrder == 2) {
460460
hvdb::GridTransformOp<openvdb::tools::QuadraticSampler> op(outGrid, xform);
461-
GEOvdbProcessTypedGrid(*vdb, op);
461+
GEOvdbProcessTypedGridTopology(*vdb, op);
462462
}
463463
}
464464
}

openvdb_houdini/houdini/SOP_OpenVDB_Scatter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ SOP_OpenVDB_Scatter::cookMySop(OP_Context& context)
352352
if (interior && isSignedDistance) {
353353
processLSInterior(gridType, grid, scatter);
354354
} else {
355-
UTvdbProcessTypedGrid(gridType, grid, scatter);
355+
UTvdbProcessTypedGridTopology(gridType, grid, scatter);
356356
}
357357

358358
if (verbose) scatter.print(gridName);
@@ -371,7 +371,7 @@ SOP_OpenVDB_Scatter::cookMySop(OP_Context& context)
371371
if (interior && isSignedDistance) {
372372
processLSInterior(gridType, grid, scatter);
373373
} else {
374-
UTvdbProcessTypedGrid(gridType, grid, scatter);
374+
UTvdbProcessTypedGridTopology(gridType, grid, scatter);
375375
}
376376

377377
if (verbose) scatter.print(gridName);

openvdb_houdini/houdini/SOP_OpenVDB_Visualize.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ SOP_OpenVDB_Visualize::cookMySop(OP_Context& context)
888888
VDBTopologyVisualizer draw(*gdp, nodeOptions, tileOptions,
889889
voxelOptions, ignorestaggered, &boss);
890890

891-
GEOvdbProcessTypedGrid(*vdb, draw);
891+
GEOvdbProcessTypedGridTopology(*vdb, draw);
892892
}
893893

894894
if (showFrustum) {

0 commit comments

Comments
 (0)