OpenVDB  2.0.0
LevelSetTracker.h
Go to the documentation of this file.
1 //
3 // Copyright (c) 2012-2013 DreamWorks Animation LLC
4 //
5 // All rights reserved. This software is distributed under the
6 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
7 //
8 // Redistributions of source code must retain the above copyright
9 // and license notice and the following restrictions and disclaimer.
10 //
11 // * Neither the name of DreamWorks Animation nor the names of
12 // its contributors may be used to endorse or promote products derived
13 // from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
27 // LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
28 //
30 //
38 
39 #ifndef OPENVDB_TOOLS_LEVEL_SET_TRACKER_HAS_BEEN_INCLUDED
40 #define OPENVDB_TOOLS_LEVEL_SET_TRACKER_HAS_BEEN_INCLUDED
41 
42 #include <tbb/parallel_reduce.h>
43 #include <tbb/parallel_for.h>
44 #include <boost/bind.hpp>
45 #include <boost/function.hpp>
46 #include <boost/type_traits/is_floating_point.hpp>
47 #include <openvdb/Types.h>
48 #include <openvdb/math/Math.h>
49 #include <openvdb/math/FiniteDifference.h>
50 #include <openvdb/math/Operators.h>
51 #include <openvdb/math/Stencils.h>
52 #include <openvdb/math/Transform.h>
53 #include <openvdb/Grid.h>
54 #include <openvdb/util/NullInterrupter.h>
55 #include "Morphology.h"//for tools::dilateVoxels
56 
57 namespace openvdb {
59 namespace OPENVDB_VERSION_NAME {
60 namespace tools {
61 
63 template<typename GridT, typename InterruptT = util::NullInterrupter>
65 {
66 public:
67  typedef GridT GridType;
68  typedef typename GridT::TreeType TreeType;
69  typedef typename TreeType::LeafNodeType LeafType;
70  typedef typename TreeType::ValueType ValueType;
71  typedef typename tree::LeafManager<TreeType> LeafManagerType; // leafs + buffers
74  BOOST_STATIC_ASSERT(boost::is_floating_point<ValueType>::value);
75 
77  LevelSetTracker(GridT& grid, InterruptT* interrupt = NULL);
78 
80  LevelSetTracker(const LevelSetTracker& other);
81 
82  virtual ~LevelSetTracker() { if (mIsMaster) delete mLeafs; }
83 
85  void normalize();
86 
89  void track();
90 
92  void prune();
93 
95  math::BiasedGradientScheme getSpatialScheme() const { return mSpatialScheme; }
97  void setSpatialScheme(math::BiasedGradientScheme scheme) { mSpatialScheme = scheme; }
98 
100  math::TemporalIntegrationScheme getTemporalScheme() const { return mTemporalScheme; }
102  void setTemporalScheme(math::TemporalIntegrationScheme scheme) { mTemporalScheme = scheme; }
103 
106  int getNormCount() const { return mNormCount; }
109  void setNormCount(int n) { mNormCount = n; }
110 
112  int getGrainSize() const { return mGrainSize; }
115  void setGrainSize(int grainsize) { mGrainSize = grainsize; }
116 
117  ValueType voxelSize() const { return mDx; }
118 
119  void startInterrupter(const char* msg);
120  void endInterrupter();
122  bool checkInterrupter();
123 
124  const GridType& grid() const { return *mGrid; }
125 
126  LeafManagerType& leafs() { return *mLeafs; }
127  const LeafManagerType& leafs() const { return *mLeafs; }
128 
131  void operator()(const RangeType& r) const
132  {
133  if (mTask) mTask(const_cast<LevelSetTracker*>(this), r);
134  else OPENVDB_THROW(ValueError, "task is undefined - call track(), etc");
135  }
136 
137 private:
138 
139  template<math::BiasedGradientScheme SpatialScheme,
140  math::TemporalIntegrationScheme TemporalScheme>
141  struct Normalizer
142  {
143  Normalizer(LevelSetTracker& tracker): mTracker(tracker), mTask(0) {}
144  void normalize();
145  void operator()(const RangeType& r) const {mTask(const_cast<Normalizer*>(this), r);}
146  typedef typename boost::function<void (Normalizer*, const RangeType&)> FuncType;
147  LevelSetTracker& mTracker;
148  FuncType mTask;
149  void cook(int swapBuffer=0);
150  void euler1(const RangeType& range, ValueType dt, Index resultBuffer);
151  void euler2(const RangeType& range, ValueType dt, ValueType alpha,
152  Index phiBuffer, Index resultBuffer);
153  }; // end of protected Normalizer class
154 
155  typedef typename boost::function<void (LevelSetTracker*, const RangeType&)> FuncType;
156 
157  void trim(const RangeType& r);
158 
159  template<math::BiasedGradientScheme SpatialScheme>
160  void normalize1();
161 
162  template<math::BiasedGradientScheme SpatialScheme,
163  math::TemporalIntegrationScheme TemporalScheme>
164  void normalize2();
165 
166  // Throughout the methods below mLeafs is always assumed to contain
167  // a list of the current LeafNodes! The auxiliary buffers on the
168  // other hand always have to be allocated locally, since some
169  // methods need them and others don't!
170  GridType* mGrid;
171  LeafManagerType* mLeafs;
172  InterruptT* mInterrupter;
173  const ValueType mDx;
174  math::BiasedGradientScheme mSpatialScheme;
175  math::TemporalIntegrationScheme mTemporalScheme;
176  int mNormCount;// Number of iteratations of normalization
177  int mGrainSize;
178  FuncType mTask;
179  const bool mIsMaster;
180 
181  // disallow copy by assignment
182  void operator=(const LevelSetTracker& other) {}
183 
184 }; // end of LevelSetTracker class
185 
186 template<typename GridT, typename InterruptT>
187 LevelSetTracker<GridT, InterruptT>::LevelSetTracker(GridT& grid, InterruptT* interrupt):
188  mGrid(&grid),
189  mLeafs(new LeafManagerType(grid.tree())),
190  mInterrupter(interrupt),
191  mDx(grid.voxelSize()[0]),
192  mSpatialScheme(math::HJWENO5_BIAS),
193  mTemporalScheme(math::TVD_RK1),
194  mNormCount(static_cast<int>(LEVEL_SET_HALF_WIDTH)),
195  mGrainSize(1),
196  mTask(0),
197  mIsMaster(true)// N.B.
198 {
199  if ( !grid.hasUniformVoxels() ) {
201  "The transform must have uniform scale for the LevelSetTracker to function");
202  }
203  if ( grid.getGridClass() != GRID_LEVEL_SET) {
205  "LevelSetTracker only supports level sets!\n"
206  "However, only level sets are guaranteed to work!\n"
207  "Hint: Grid::setGridClass(openvdb::GRID_LEVEL_SET)");
208  }
209 }
210 
211 template<typename GridT, typename InterruptT>
213  mGrid(other.mGrid),
214  mLeafs(other.mLeafs),
215  mInterrupter(other.mInterrupter),
216  mDx(other.mDx),
217  mSpatialScheme(other.mSpatialScheme),
218  mTemporalScheme(other.mTemporalScheme),
219  mNormCount(other.mNormCount),
220  mGrainSize(other.mGrainSize),
221  mTask(other.mTask),
222  mIsMaster(false)// N.B.
223 {
224 }
225 
226 template<typename GridT, typename InterruptT>
227 inline void
229 {
230  this->startInterrupter("Pruning Level Set");
231  // Prune voxels that are too far away from the zero-crossing
232  mTask = boost::bind(&LevelSetTracker::trim, _1, _2);
233  if (mGrainSize>0) {
234  tbb::parallel_for(mLeafs->getRange(mGrainSize), *this);
235  } else {
236  (*this)(mLeafs->getRange());
237  }
238 
239  // Remove inactive nodes from tree
240  mGrid->tree().pruneLevelSet();
241 
242  // The tree topology has changes so rebuild the list of leafs
243  mLeafs->rebuildLeafArray();
244  this->endInterrupter();
245 }
246 
247 template<typename GridT, typename InterruptT>
248 inline void
250 {
251  // Dilate narrow-band (this also rebuilds the leaf array!)
252  tools::dilateVoxels(*mLeafs);
253 
254  // Compute signed distances in dilated narrow-band
255  this->normalize();
256 
257  // Remove voxels that are outside the narrow band
258  this->prune();
259 }
260 
261 template<typename GridT, typename InterruptT>
262 inline void
264 {
265  if (mInterrupter) mInterrupter->start(msg);
266 }
267 
268 template<typename GridT, typename InterruptT>
269 inline void
271 {
272  if (mInterrupter) mInterrupter->end();
273 }
274 
275 template<typename GridT, typename InterruptT>
276 inline bool
278 {
279  if (util::wasInterrupted(mInterrupter)) {
280  tbb::task::self().cancel_group_execution();
281  return false;
282  }
283  return true;
284 }
285 
287 template<typename GridT, typename InterruptT>
288 inline void
289 LevelSetTracker<GridT, InterruptT>::trim(const RangeType& range)
290 {
291  typedef typename LeafType::ValueOnIter VoxelIterT;
292  const_cast<LevelSetTracker*>(this)->checkInterrupter();
293  const ValueType gamma = mGrid->background();
294  for (size_t n=range.begin(), e=range.end(); n != e; ++n) {
295  LeafType &leaf = mLeafs->leaf(n);
296  for (VoxelIterT iter = leaf.beginValueOn(); iter; ++iter) {
297  const ValueType val = *iter;
298  if (val < -gamma)
299  leaf.setValueOff(iter.pos(), -gamma);
300  else if (val > gamma)
301  leaf.setValueOff(iter.pos(), gamma);
302  }
303  }
304 }
305 
306 template<typename GridT, typename InterruptT>
307 inline void
309 {
310  switch (mSpatialScheme) {
311  case math::FIRST_BIAS:
312  this->normalize1<math::FIRST_BIAS >(); break;
313  case math::SECOND_BIAS:
314  this->normalize1<math::SECOND_BIAS >(); break;
315  case math::THIRD_BIAS:
316  this->normalize1<math::THIRD_BIAS >(); break;
317  case math::WENO5_BIAS:
318  this->normalize1<math::WENO5_BIAS >(); break;
319  case math::HJWENO5_BIAS:
320  this->normalize1<math::HJWENO5_BIAS>(); break;
321  default:
322  OPENVDB_THROW(ValueError, "Spatial difference scheme not supported!");
323  }
324 }
325 
326 template<typename GridT, typename InterruptT>
327 template<math::BiasedGradientScheme SpatialScheme>
328 inline void
330 {
331  switch (mTemporalScheme) {
332  case math::TVD_RK1:
333  this->normalize2<SpatialScheme, math::TVD_RK1>(); break;
334  case math::TVD_RK2:
335  this->normalize2<SpatialScheme, math::TVD_RK2>(); break;
336  case math::TVD_RK3:
337  this->normalize2<SpatialScheme, math::TVD_RK3>(); break;
338  default:
339  OPENVDB_THROW(ValueError, "Temporal integration scheme not supported!");
340  }
341 }
342 
343 template<typename GridT, typename InterruptT>
344 template<math::BiasedGradientScheme SpatialScheme,
345  math::TemporalIntegrationScheme TemporalScheme>
346 inline void
347 LevelSetTracker<GridT, InterruptT>::normalize2()
348 {
349  Normalizer<SpatialScheme, TemporalScheme> tmp(*this);
350  tmp.normalize();
351 }
352 
353 template<typename GridT, typename InterruptT>
354 template<math::BiasedGradientScheme SpatialScheme,
355  math::TemporalIntegrationScheme TemporalScheme>
356 inline void
358 normalize()
359 {
361  mTracker.mLeafs->rebuildAuxBuffers(TemporalScheme == math::TVD_RK3 ? 2 : 1);
362 
363  const ValueType dt = (TemporalScheme == math::TVD_RK1 ? ValueType(0.3) :
364  TemporalScheme == math::TVD_RK2 ? ValueType(0.9) : ValueType(1.0))
365  * ValueType(mTracker.voxelSize());
366 
367  for (int n=0, e=mTracker.getNormCount(); n < e; ++n) {
368 
370  switch(TemporalScheme) {//switch is resolved at compile-time
371  case math::TVD_RK1:
372  //std::cerr << "1";
373  // Perform one explicit Euler step: t1 = t0 + dt
374  // Phi_t1(0) = Phi_t0(0) - dt * VdotG_t0(1)
375  mTask = boost::bind(&Normalizer::euler1, _1, _2, dt, /*result=*/1);
376  // Cook and swap buffer 0 and 1 such that Phi_t1(0) and Phi_t0(1)
377  this->cook(1);
378  break;
379  case math::TVD_RK2:
380  //std::cerr << "2";
381  // Perform one explicit Euler step: t1 = t0 + dt
382  // Phi_t1(1) = Phi_t0(0) - dt * VdotG_t0(1)
383  mTask = boost::bind(&Normalizer::euler1, _1, _2, dt, /*result=*/1);
384  // Cook and swap buffer 0 and 1 such that Phi_t1(0) and Phi_t0(1)
385  this->cook(1);
386 
387  // Convex combine explict Euler step: t2 = t0 + dt
388  // Phi_t2(1) = 1/2 * Phi_t0(1) + 1/2 * (Phi_t1(0) - dt * V.Grad_t1(0))
389  mTask = boost::bind(&Normalizer::euler2,
390  _1, _2, dt, ValueType(0.5), /*phi=*/1, /*result=*/1);
391  // Cook and swap buffer 0 and 1 such that Phi_t2(0) and Phi_t1(1)
392  this->cook(1);
393  break;
394  case math::TVD_RK3:
395  //std::cerr << "3";
396  // Perform one explicit Euler step: t1 = t0 + dt
397  // Phi_t1(1) = Phi_t0(0) - dt * VdotG_t0(1)
398  mTask = boost::bind(&Normalizer::euler1, _1, _2, dt, /*result=*/1);
399  // Cook and swap buffer 0 and 1 such that Phi_t1(0) and Phi_t0(1)
400  this->cook(1);
401 
402  // Convex combine explict Euler step: t2 = t0 + dt/2
403  // Phi_t2(2) = 3/4 * Phi_t0(1) + 1/4 * (Phi_t1(0) - dt * V.Grad_t1(0))
404  mTask = boost::bind(&Normalizer::euler2,
405  _1, _2, dt, ValueType(0.75), /*phi=*/1, /*result=*/2);
406  // Cook and swap buffer 0 and 2 such that Phi_t2(0) and Phi_t1(2)
407  this->cook(2);
408 
409  // Convex combine explict Euler step: t3 = t0 + dt
410  // Phi_t3(2) = 1/3 * Phi_t0(1) + 2/3 * (Phi_t2(0) - dt * V.Grad_t2(0)
411  mTask = boost::bind(&Normalizer::euler2,
412  _1, _2, dt, ValueType(1.0/3.0), /*phi=*/1, /*result=*/2);
413  // Cook and swap buffer 0 and 2 such that Phi_t3(0) and Phi_t2(2)
414  this->cook(2);
415  break;
416  default:
417  OPENVDB_THROW(ValueError, "Temporal integration scheme not supported!");
418  }
420  }
421  mTracker.mLeafs->removeAuxBuffers();
422 }
423 
426 template<typename GridT, typename InterruptT>
427 template<math::BiasedGradientScheme SpatialScheme,
428  math::TemporalIntegrationScheme TemporalScheme>
429 inline void
430 LevelSetTracker<GridT,InterruptT>::Normalizer<SpatialScheme, TemporalScheme>::
431 cook(int swapBuffer)
432 {
433  mTracker.startInterrupter("Normalizing Level Set");
434 
435  if (mTracker.getGrainSize()>0) {
436  tbb::parallel_for(mTracker.mLeafs->getRange(mTracker.getGrainSize()), *this);
437  } else {
438  (*this)(mTracker.mLeafs->getRange());
439  }
440 
441  mTracker.mLeafs->swapLeafBuffer(swapBuffer, mTracker.getGrainSize()==0);
442 
443  mTracker.endInterrupter();
444 }
445 
446 
450 template<typename GridT, typename InterruptT>
451 template<math::BiasedGradientScheme SpatialScheme,
452  math::TemporalIntegrationScheme TemporalScheme>
453 inline void
454 LevelSetTracker<GridT,InterruptT>::Normalizer<SpatialScheme, TemporalScheme>::
455 euler1(const RangeType &range, ValueType dt, Index resultBuffer)
456 {
457  typedef math::BIAS_SCHEME<SpatialScheme> Scheme;
458  typedef typename Scheme::template ISStencil<GridType>::StencilType Stencil;
459  typedef typename LeafType::ValueOnCIter VoxelIterT;
460  mTracker.checkInterrupter();
461  const ValueType one(1.0), invDx = one/mTracker.voxelSize();
462  Stencil stencil(mTracker.grid());
463  for (size_t n=range.begin(), e=range.end(); n != e; ++n) {
464  BufferType& result = mTracker.mLeafs->getBuffer(n, resultBuffer);
465  const LeafType& leaf = mTracker.mLeafs->leaf(n);
466  for (VoxelIterT iter = leaf.cbeginValueOn(); iter; ++iter) {
467  stencil.moveTo(iter);
468  const ValueType normSqGradPhi =
470  const ValueType phi0 = stencil.getValue();
471  const ValueType diff = math::Sqrt(normSqGradPhi)*invDx - one;
472  const ValueType S = phi0 / (math::Sqrt(math::Pow2(phi0) + normSqGradPhi));
473  result.setValue(iter.pos(), phi0 - dt * S * diff);
474  }
475  }
476 }
477 
478 template<typename GridT, typename InterruptT>
479 template<math::BiasedGradientScheme SpatialScheme,
480  math::TemporalIntegrationScheme TemporalScheme>
481 inline void
482 LevelSetTracker<GridT,InterruptT>::Normalizer<SpatialScheme, TemporalScheme>::
483 euler2(const RangeType& range, ValueType dt, ValueType alpha, Index phiBuffer, Index resultBuffer)
484 {
485  typedef math::BIAS_SCHEME<SpatialScheme> Scheme;
486  typedef typename Scheme::template ISStencil<GridType>::StencilType Stencil;
487  typedef typename LeafType::ValueOnCIter VoxelIterT;
488  mTracker.checkInterrupter();
489  const ValueType one(1.0), beta = one - alpha, invDx = one/mTracker.voxelSize();
490  Stencil stencil(mTracker.grid());
491  for (size_t n=range.begin(), e=range.end(); n != e; ++n) {
492  const BufferType& phi = mTracker.mLeafs->getBuffer(n, phiBuffer);
493  BufferType& result = mTracker.mLeafs->getBuffer(n, resultBuffer);
494  const LeafType& leaf = mTracker.mLeafs->leaf(n);
495  for (VoxelIterT iter = leaf.cbeginValueOn(); iter; ++iter) {
496  stencil.moveTo(iter);
497  const ValueType normSqGradPhi =
499  const ValueType phi0 = stencil.getValue();
500  const ValueType diff = math::Sqrt(normSqGradPhi)*invDx - one;
501  const ValueType S = phi0 / (math::Sqrt(math::Pow2(phi0) + normSqGradPhi));
502  result.setValue(iter.pos(), alpha*phi[iter.pos()] + beta*(phi0 - dt * S * diff));
503  }
504  }
505 }
506 
507 } // namespace tools
508 } // namespace OPENVDB_VERSION_NAME
509 } // namespace openvdb
510 
511 #endif // OPENVDB_TOOLS_LEVEL_SET_TRACKER_HAS_BEEN_INCLUDED
512 
513 // Copyright (c) 2012-2013 DreamWorks Animation LLC
514 // All rights reserved. This software is distributed under the
515 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
Definition: FiniteDifference.h:264
bool checkInterrupter()
Definition: LevelSetTracker.h:277
Definition: FiniteDifference.h:263
Definition: FiniteDifference.h:195
int getGrainSize() const
Definition: LevelSetTracker.h:112
TemporalIntegrationScheme
Temporal integrations schemes.
Definition: FiniteDifference.h:261
const GridType & grid() const
Definition: LevelSetTracker.h:124
Definition: FiniteDifference.h:198
void setSpatialScheme(math::BiasedGradientScheme scheme)
Set the spatial finite difference scheme.
Definition: LevelSetTracker.h:97
void setNormCount(int n)
Set the number of normalizations performed per track or normalize call.
Definition: LevelSetTracker.h:109
float Sqrt(float x)
Return the square root of a floating-point value.
Definition: Math.h:648
GridType::Ptr normalize(const GridType &grid, bool threaded, InterruptT *interrupt)
Normalize the vectors of the given vector-valued grid.
Definition: GridOperators.h:724
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:97
Definition: FiniteDifference.h:194
Type Pow2(Type x)
Return .
Definition: Math.h:460
void prune()
Remove voxels that are outside the narrow band. (substep of track)
Definition: LevelSetTracker.h:228
TreeType::LeafNodeType LeafType
Definition: LevelSetTracker.h:69
const LeafManagerType & leafs() const
Definition: LevelSetTracker.h:127
Definition: Exceptions.h:86
void operator()(const RangeType &r) const
Public functor called by tbb::parallel_for()
Definition: LevelSetTracker.h:131
void startInterrupter(const char *msg)
Definition: LevelSetTracker.h:263
OPENVDB_STATIC_SPECIALIZATION void dilateVoxels(TreeType &tree, int count=1)
Definition: Morphology.h:338
Definition: FiniteDifference.h:265
static Accessor::ValueType result(const Accessor &grid, const Coord &ijk)
Definition: Operators.h:260
void normalize()
Iterative normalization, i.e. solving the Eikonal equation.
Definition: LevelSetTracker.h:308
Performs multi-threaded interface tracking of narrow band level sets.
Definition: LevelSetTracker.h:64
#define OPENVDB_VERSION_NAME
Definition: version.h:45
tbb::blocked_range< size_t > RangeType
Definition: LeafManager.h:118
math::BiasedGradientScheme getSpatialScheme() const
Definition: LevelSetTracker.h:95
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
Definition: Platform.h:96
ValueType voxelSize() const
Definition: LevelSetTracker.h:117
LeafManagerType::RangeType RangeType
Definition: LevelSetTracker.h:72
CopyConstness< TreeType, NonConstBufferType >::Type BufferType
Definition: LeafManager.h:117
int getNormCount() const
Definition: LevelSetTracker.h:106
math::TemporalIntegrationScheme getTemporalScheme() const
Definition: LevelSetTracker.h:100
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:143
Index32 Index
Definition: Types.h:56
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
Definition: Platform.h:97
Definition: FiniteDifference.h:197
void endInterrupter()
Definition: LevelSetTracker.h:270
GridT::TreeType TreeType
Definition: LevelSetTracker.h:68
Definition: Exceptions.h:88
BiasedGradientScheme
Biased Gradients are limited to non-centered differences.
Definition: FiniteDifference.h:192
Definition: FiniteDifference.h:196
void setTemporalScheme(math::TemporalIntegrationScheme scheme)
Set the spatial finite difference scheme.
Definition: LevelSetTracker.h:102
void track()
Definition: LevelSetTracker.h:249
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:56
LeafManagerType & leafs()
Definition: LevelSetTracker.h:126
TreeType::ValueType ValueType
Definition: LevelSetTracker.h:70
GridT GridType
Definition: LevelSetTracker.h:67
virtual ~LevelSetTracker()
Definition: LevelSetTracker.h:82
This class manages a linear array of pointers to a given tree&#39;s leaf nodes, as well as optional auxil...
Definition: LeafManager.h:109
LeafManagerType::BufferType BufferType
Definition: LevelSetTracker.h:73
void setGrainSize(int grainsize)
Set the grain-size used for multi-threading.
Definition: LevelSetTracker.h:115
tree::LeafManager< TreeType > LeafManagerType
Definition: LevelSetTracker.h:71
LevelSetTracker(GridT &grid, InterruptT *interrupt=NULL)
Main constructor.
Definition: LevelSetTracker.h:187
Definition: Types.h:137
bool wasInterrupted(T *i, int percent=-1)
Definition: NullInterrupter.h:76