OpenVDB  2.3.0
RayIntersector.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 //
57 
58 
59 #ifndef OPENVDB_TOOLS_RAYINTERSECTOR_HAS_BEEN_INCLUDED
60 #define OPENVDB_TOOLS_RAYINTERSECTOR_HAS_BEEN_INCLUDED
61 
62 #include <openvdb/math/DDA.h>
63 #include <openvdb/math/Math.h>
64 #include <openvdb/math/Ray.h>
65 #include <openvdb/math/Stencils.h>
66 #include <openvdb/Grid.h>
67 #include <openvdb/Types.h>
68 #include "Morphology.h"
69 #include <boost/utility.hpp>
70 #include <boost/type_traits/is_floating_point.hpp>
71 
72 
73 namespace openvdb {
75 namespace OPENVDB_VERSION_NAME {
76 namespace tools {
77 
78 // Helper class that implements the actual search of the zero-crossing
79 // of the level set along the direction of a ray. This particular
80 // implementation uses iterative linear search.
81 template<typename GridT, int Iterations = 0, typename RealT = double>
83 
84 
86 
87 
105 template<typename GridT,
106  typename SearchImplT = LinearSearchImpl<GridT>,
107  int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL,
108  typename RayT = math::Ray<Real> >
110 {
111 public:
112  typedef GridT GridType;
113  typedef RayT RayType;
114  typedef typename RayT::RealType RealType;
115  typedef typename RayT::Vec3T Vec3Type;
116  typedef typename GridT::ValueType ValueT;
117  typedef typename GridT::TreeType TreeT;
118 
119  BOOST_STATIC_ASSERT( NodeLevel >= -1 && NodeLevel < int(TreeT::DEPTH)-1);
120  BOOST_STATIC_ASSERT(boost::is_floating_point<ValueT>::value);
121 
125  LevelSetRayIntersector(const GridT& grid, const ValueT& isoValue = zeroVal<ValueT>())
126  : mTester(grid, isoValue)
127  {
128  if (!grid.hasUniformVoxels() ) {
130  "LevelSetRayIntersector only supports uniform voxels!");
131  }
132  if (grid.getGridClass() != GRID_LEVEL_SET) {
134  "LevelSetRayIntersector only supports level sets!"
135  "\nUse Grid::setGridClass(openvdb::GRID_LEVEL_SET)");
136  }
137  }
138 
140  const ValueT& getIsoValue() const { return mTester.getIsoValue(); }
141 
144  bool intersectsIS(const RayType& iRay) const
145  {
146  if (!mTester.setIndexRay(iRay)) return false;//missed bbox
148  }
149 
154  bool intersectsIS(const RayType& iRay, Real &iTime) const
155  {
156  if (!mTester.setIndexRay(iRay)) return false;//missed bbox
157  iTime = mTester.getIndexTime();
159  }
160 
165  bool intersectsIS(const RayType& iRay, Vec3Type& xyz) const
166  {
167  if (!mTester.setIndexRay(iRay)) return false;//missed bbox
168  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
169  mTester.getIndexPos(xyz);
170  return true;
171  }
172 
179  bool intersectsIS(const RayType& iRay, Vec3Type& xyz, Real &iTime) const
180  {
181  if (!mTester.setIndexRay(iRay)) return false;//missed bbox
182  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
183  mTester.getIndexPos(xyz);
184  iTime = mTester.getIndexTime();
185  return true;
186  }
187 
190  bool intersectsWS(const RayType& wRay) const
191  {
192  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
194  }
195 
200  bool intersectsWS(const RayType& wRay, Real &wTime) const
201  {
202  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
203  wTime = mTester.getWorldTime();
205  }
206 
211  bool intersectsWS(const RayType& wRay, Vec3Type& world) const
212  {
213  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
214  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
215  mTester.getWorldPos(world);
216  return true;
217  }
218 
225  bool intersectsWS(const RayType& wRay, Vec3Type& world, Real &wTime) const
226  {
227  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
228  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
229  mTester.getWorldPos(world);
230  wTime = mTester.getWorldTime();
231  return true;
232  }
233 
240  bool intersectsWS(const RayType& wRay, Vec3Type& world, Vec3Type& normal) const
241  {
242  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
243  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
244  mTester.getWorldPosAndNml(world, normal);
245  return true;
246  }
247 
256  bool intersectsWS(const RayType& wRay, Vec3Type& world, Vec3Type& normal, Real &wTime) const
257  {
258  if (!mTester.setWorldRay(wRay)) return false;//missed bbox
259  if (!math::LevelSetHDDA<TreeT, NodeLevel>::test(mTester)) return false;//missed level set
260  mTester.getWorldPosAndNml(world, normal);
261  wTime = mTester.getWorldTime();
262  return true;
263  }
264 
265 private:
266 
267  mutable SearchImplT mTester;
268 
269 };// LevelSetRayIntersector
270 
271 
273 
274 
300 template<typename GridT,
301  int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL,
302  typename RayT = math::Ray<Real> >
304 {
305 public:
306  typedef GridT GridType;
307  typedef RayT RayType;
308  typedef typename RayT::RealType RealType;
309  typedef typename GridT::TreeType::RootNodeType RootType;
311 
312  BOOST_STATIC_ASSERT( NodeLevel >= 0 && NodeLevel < int(TreeT::DEPTH)-1);
313 
322  VolumeRayIntersector(const GridT& grid, int dilationCount = 0)
323  : mIsMaster(true)
324  , mTree(new TreeT(grid.tree(), false, TopologyCopy()))
325  , mGrid(&grid)
326  , mAccessor(*mTree)
327  {
328  if (!grid.hasUniformVoxels() ) {
330  "VolumeRayIntersector only supports uniform voxels!");
331  }
332  if ( grid.empty() ) {
333  OPENVDB_THROW(RuntimeError, "LinearSearchImpl does not supports empty grids");
334  }
335 
336  // Dilate active voxels to better account for the size of interpolation kernels
337  tools::dilateVoxels(*mTree, dilationCount);
338 
339  mTree->root().evalActiveBoundingBox(mBBox, /*visit individual voxels*/false);
340 
341  mBBox.max().offset(1);//padding so the bbox of a node becomes (origin,origin + node_dim)
342  }
343 
351  VolumeRayIntersector(const GridT& grid, const math::CoordBBox& bbox)
352  : mIsMaster(true)
353  , mTree(new TreeT(grid.tree(), false, TopologyCopy()))
354  , mGrid(&grid)
355  , mAccessor(*mTree)
356  , mBBox(bbox)
357  {
358  if (!grid.hasUniformVoxels() ) {
360  "VolumeRayIntersector only supports uniform voxels!");
361  }
362  if ( grid.empty() ) {
363  OPENVDB_THROW(RuntimeError, "LinearSearchImpl does not supports empty grids");
364  }
365  }
366 
373  : mIsMaster(false)
374  , mTree(other.mTree)//shallow copy
375  , mGrid(other.mGrid)//shallow copy
376  , mAccessor(*mTree)//deep copy
377  , mRay(other.mRay)//deep copy
378  , mTmax(other.mTmax)//deep copy
379  , mBBox(other.mBBox)//deep copy
380  {
381  }
382 
384  ~VolumeRayIntersector() { if (mIsMaster) delete mTree; }
385 
391  inline bool setIndexRay(const RayT& iRay)
392  {
393  mRay = iRay;
394  const bool hit = mRay.clip(mBBox);
395  if (hit) mTmax = mRay.t1();
396  return hit;
397  }
398 
410  inline bool setWorldRay(const RayT& wRay)
411  {
412  return this->setIndexRay(wRay.worldToIndex(*mGrid));
413  }
414 
415  inline typename RayT::TimeSpan march()
416  {
417  const typename RayT::TimeSpan t = mHDDA.march(mRay, mAccessor);
418  if (t.t1>0) mRay.setTimes(t.t1 + math::Delta<RealType>::value(), mTmax);
419  return t;
420  }
421 
433  inline bool march(Real& t0, Real& t1)
434  {
435  const typename RayT::TimeSpan t = this->march();
436  t.get(t0, t1);
437  return t.valid();
438  }
439 
440  inline void hits(std::vector<typename RayT::TimeSpan>& list)
441  {
442  mHDDA.hits(mRay, mAccessor, list);
443  }
444 
447  inline Vec3R getIndexPos(Real time) const { return mRay(time); }
448 
451  inline Vec3R getWorldPos(Real time) const { return mGrid->indexToWorld(mRay(time)); }
452 
453  inline Real getWorldTime(Real time) const
454  {
455  return time*mGrid->transform().baseMap()->applyJacobian(mRay.dir()).length();
456  }
457 
459  const GridT& grid() const { return *mGrid; }
460 
463  const TreeT& tree() const { return *mTree; }
464 
466  const math::CoordBBox& bbox() const { return mBBox; }
467 
472  void print(std::ostream& os = std::cout, int verboseLevel = 1)
473  {
474  if (verboseLevel>0) {
475  os << "BBox: " << mBBox << std::endl;
476  if (verboseLevel==2) {
477  mTree->print(os, 1);
478  } else if (verboseLevel>2) {
479  mTree->print(os, 2);
480  }
481  }
482  }
483 
484 private:
485 
486  typedef typename tree::ValueAccessor<const TreeT> AccessorT;
487 
488  const bool mIsMaster;
489  TreeT* mTree;
490  const GridT* mGrid;
491  AccessorT mAccessor;
492  RayT mRay;
493  Real mTmax;
494  math::CoordBBox mBBox;
496 
497 };// VolumeRayIntersector
498 
499 
501 
502 
526 template<typename GridT, int Iterations, typename RealT>
527 class LinearSearchImpl
528 {
529 public:
531  typedef typename GridT::ValueType ValueT;
532  typedef typename GridT::ConstAccessor AccessorT;
534  typedef typename StencilT::Vec3Type Vec3T;
535 
539  LinearSearchImpl(const GridT& grid, const ValueT& isoValue = zeroVal<ValueT>())
540  : mStencil(grid),
541  mIsoValue(isoValue),
542  mMinValue(isoValue-2*grid.voxelSize()[0]),
543  mMaxValue(isoValue+2*grid.voxelSize()[0])
544  {
545  if ( grid.empty() ) {
546  OPENVDB_THROW(RuntimeError, "LinearSearchImpl does not supports empty grids");
547  }
548  if (mIsoValue<= -grid.background() ||
549  mIsoValue>= grid.background() ){
550  OPENVDB_THROW(ValueError, "The iso-value must be inside the narrow-band!");
551  }
552  grid.tree().root().evalActiveBoundingBox(mBBox, /*visit individual voxels*/false);
553  }
554 
556  const ValueT& getIsoValue() const { return mIsoValue; }
557 
561  inline bool setIndexRay(const RayT& iRay)
562  {
563  mRay = iRay;
564  return mRay.clip(mBBox);//did it hit the bbox
565  }
566 
570  inline bool setWorldRay(const RayT& wRay)
571  {
572  mRay = wRay.worldToIndex(mStencil.grid());
573  return mRay.clip(mBBox);//did it hit the bbox
574  }
575 
578  inline void getIndexPos(Vec3d& xyz) const { xyz = mRay(mTime); }
579 
582  inline void getWorldPos(Vec3d& xyz) const { xyz = mStencil.grid().indexToWorld(mRay(mTime)); }
583 
587  inline void getWorldPosAndNml(Vec3d& xyz, Vec3d& nml)
588  {
589  this->getIndexPos(xyz);
590  mStencil.moveTo(xyz);
591  nml = mStencil.gradient(xyz);
592  nml.normalize();
593  xyz = mStencil.grid().indexToWorld(xyz);
594  }
595 
597  inline RealT getIndexTime() const { return mTime; }
598 
600  inline RealT getWorldTime() const
601  {
602  return mTime*mStencil.grid().transform().baseMap()->applyJacobian(mRay.dir()).length();
603  }
604 
605 private:
606 
609  inline void init(RealT t0)
610  {
611  mT[0] = t0;
612  mV[0] = this->interpValue(t0);
613  }
614 
615  inline void setRange(RealT t0, RealT t1) { mRay.setTimes(t0, t1); }
616 
618  inline const RayT& ray() const { return mRay; }
619 
621  template <typename NodeT>
622  inline bool hasNode(const Coord& ijk)
623  {
624  return mStencil.accessor().template probeConstNode<NodeT>(ijk) != NULL;
625  }
626 
632  inline bool operator()(const Coord& ijk, RealT time)
633  {
634  ValueT V;
635  if (mStencil.accessor().probeValue(ijk, V) &&//within narrow band
636  V>mMinValue && V<mMaxValue) {// and close to iso-value?
637  mT[1] = time;
638  mV[1] = this->interpValue(time);
639  if (math::ZeroCrossing(mV[0], mV[1])) {
640  mTime = this->interpTime();
642  for (int n=0; Iterations>0 && n<Iterations; ++n) {//resolved at compile-time
643  V = this->interpValue(mTime);
644  const int m = math::ZeroCrossing(mV[0], V) ? 1 : 0;
645  mV[m] = V;
646  mT[m] = mTime;
647  mTime = this->interpTime();
648  }
650  return true;
651  }
652  mT[0] = mT[1];
653  mV[0] = mV[1];
654  }
655  return false;
656  }
657 
658  inline RealT interpTime()
659  {
660  assert(math::isApproxLarger(mT[1], mT[0], 1e-6));
661  return mT[0]+(mT[1]-mT[0])*mV[0]/(mV[0]-mV[1]);
662  }
663 
664  inline RealT interpValue(RealT time)
665  {
666  const Vec3R pos = mRay(time);
667  mStencil.moveTo(pos);
668  return mStencil.interpolation(pos) - mIsoValue;
669  }
670 
671  template<typename, int> friend struct math::LevelSetHDDA;
672 
673  RayT mRay;
674  StencilT mStencil;
675  RealT mTime;//time of intersection
676  ValueT mV[2];
677  RealT mT[2];
678  const ValueT mIsoValue, mMinValue, mMaxValue;
679  math::CoordBBox mBBox;
680 };// LinearSearchImpl
681 
682 } // namespace tools
683 } // namespace OPENVDB_VERSION_NAME
684 } // namespace openvdb
685 
686 #endif // OPENVDB_TOOLS_RAYINTERSECTOR_HAS_BEEN_INCLUDED
687 
688 // Copyright (c) 2012-2013 DreamWorks Animation LLC
689 // All rights reserved. This software is distributed under the
690 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
StencilT::Vec3Type Vec3T
Definition: RayIntersector.h:534
GridT::TreeType TreeT
Definition: RayIntersector.h:117
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:229
VolumeRayIntersector(const GridT &grid, const math::CoordBBox &bbox)
Grid and BBox constructor.
Definition: RayIntersector.h:351
Definition: Tree.h:178
bool isApproxLarger(const Type &a, const Type &b, const Type &tolerance)
Return true if a is larger than b to within the given tolerance, i.e., if b - a < tolerance...
Definition: Math.h:342
math::Vec3< Real > Vec3R
Definition: Types.h:75
Real getWorldTime(Real time) const
Definition: RayIntersector.h:453
Implements linear iterative search for an iso-value of the level set along along the direction of the...
Definition: RayIntersector.h:82
math::Ray< RealT > RayT
Definition: RayIntersector.h:530
const TreeT & tree() const
Return a const reference to the (potentially dilated) bool tree used to accelerate the ray marching...
Definition: RayIntersector.h:463
GridT::ValueType ValueT
Definition: RayIntersector.h:531
bool ZeroCrossing(const Type &a, const Type &b)
Return true if the interval [a, b] includes zero, i.e., if either a or b is zero or if they have diff...
Definition: Math.h:645
GridT::ConstAccessor AccessorT
Definition: RayIntersector.h:532
Vec3R getIndexPos(Real time) const
Return the floating-point index position along the current index ray at the specified time...
Definition: RayIntersector.h:447
bool clip(const Vec3T &center, RealT radius)
Return true if this ray intersects the specified sphere.
Definition: Ray.h:244
RayT::TimeSpan march()
Definition: RayIntersector.h:415
RealT getWorldTime() const
Return the time of intersection along the world ray.
Definition: RayIntersector.h:600
RayT RayType
Definition: RayIntersector.h:113
math::BoxStencil< GridT > StencilT
Definition: RayIntersector.h:533
GridT::TreeType::RootNodeType RootType
Definition: RayIntersector.h:309
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:97
Ray worldToIndex(const GridType &grid) const
Return a new ray in the index space of the specified grid, assuming the existing ray is represented i...
Definition: Ray.h:198
RayT::Vec3T Vec3Type
Definition: RayIntersector.h:115
VolumeRayIntersector(const GridT &grid, int dilationCount=0)
Grid constructor.
Definition: RayIntersector.h:322
Delta for small floating-point offsets.
Definition: Math.h:123
Definition: Exceptions.h:88
bool intersectsIS(const RayType &iRay, Real &iTime) const
Return true if the index-space ray intersects the level set.
Definition: RayIntersector.h:154
bool intersectsWS(const RayType &wRay, Vec3Type &world, Real &wTime) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:225
RealT getIndexTime() const
Return the time of intersection along the index ray.
Definition: RayIntersector.h:597
Definition: Types.h:170
bool intersectsWS(const RayType &wRay, Vec3Type &world, Vec3Type &normal) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:240
Helper class that implements Hierarchical Digital Differential Analyzers and is specialized for ray i...
Definition: DDA.h:170
bool setIndexRay(const RayT &iRay)
Return false if the index ray misses the bbox of the grid.
Definition: RayIntersector.h:391
RayT::RealType RealType
Definition: RayIntersector.h:114
const ValueT & getIsoValue() const
Return the iso-value used for ray-intersections.
Definition: RayIntersector.h:556
LevelSetRayIntersector(const GridT &grid, const ValueT &isoValue=zeroVal< ValueT >())
Constructor.
Definition: RayIntersector.h:125
GridT::ValueType ValueT
Definition: RayIntersector.h:116
#define OPENVDB_VERSION_NAME
Definition: version.h:45
bool intersectsWS(const RayType &wRay, Vec3Type &world) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:211
void getWorldPosAndNml(Vec3d &xyz, Vec3d &nml)
Get the intersection point and normal in world space.
Definition: RayIntersector.h:587
void getWorldPos(Vec3d &xyz) const
Get the intersection point in world space.
Definition: RayIntersector.h:582
const GridT & grid() const
Return a const reference to the input grid.
Definition: RayIntersector.h:459
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
Definition: Platform.h:121
bool setIndexRay(const RayT &iRay)
Return false the ray misses the bbox of the grid.
Definition: RayIntersector.h:561
RayT RayType
Definition: RayIntersector.h:307
const math::CoordBBox & bbox() const
Return a const reference to the BBOX of the grid.
Definition: RayIntersector.h:466
bool march(Real &t0, Real &t1)
Return true if the ray intersects active values, i.e. either active voxels or tiles. Only when a hit is detected are t0 and t1 updated with the corresponding entry and exit times along the INDEX ray!
Definition: RayIntersector.h:433
const ValueT & getIsoValue() const
Return the iso-value used for ray-intersections.
Definition: RayIntersector.h:140
bool intersectsWS(const RayType &wRay, Vec3Type &world, Vec3Type &normal, Real &wTime) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:256
Vec3< double > Vec3d
Definition: Vec3.h:625
bool intersectsWS(const RayType &wRay, Real &wTime) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:200
void getIndexPos(Vec3d &xyz) const
Get the intersection point in index space.
Definition: RayIntersector.h:578
Definition: Exceptions.h:86
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
Definition: Platform.h:122
VolumeRayIntersector(const VolumeRayIntersector &other)
Shallow copy constructor.
Definition: RayIntersector.h:372
LinearSearchImpl(const GridT &grid, const ValueT &isoValue=zeroVal< ValueT >())
Constructor from a grid.
Definition: RayIntersector.h:539
double Real
Definition: Types.h:63
bool intersectsIS(const RayType &iRay) const
Return true if the index-space ray intersects the level set.
Definition: RayIntersector.h:144
bool intersectsIS(const RayType &iRay, Vec3Type &xyz) const
Return true if the index-space ray intersects the level set.
Definition: RayIntersector.h:165
GridT GridType
Definition: RayIntersector.h:112
RayT::RealType RealType
Definition: RayIntersector.h:308
Vec3R getWorldPos(Real time) const
Return the floating-point world position along the current index ray at the specified time...
Definition: RayIntersector.h:451
This class provides the public API for intersecting a ray with a narrow-band level set...
Definition: RayIntersector.h:109
void print(std::ostream &os=std::cout, int verboseLevel=1)
Print bbox, statistics, memory usage and other information.
Definition: RayIntersector.h:472
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
GridT GridType
Definition: RayIntersector.h:306
bool intersectsIS(const RayType &iRay, Vec3Type &xyz, Real &iTime) const
Return true if the index-space ray intersects the level set.
Definition: RayIntersector.h:179
This class provides the public API for intersecting a ray with a generic (e.g. density) volume...
Definition: RayIntersector.h:303
Definition: Types.h:380
OPENVDB_STATIC_SPECIALIZATION void dilateVoxels(TreeType &tree, int count=1)
Definition: Morphology.h:364
bool intersectsWS(const RayType &wRay) const
Return true if the world-space ray intersects the level set.
Definition: RayIntersector.h:190
void hits(std::vector< typename RayT::TimeSpan > &list)
Definition: RayIntersector.h:440
tree::Tree< typename RootType::template ValueConverter< bool >::Type > TreeT
Definition: RayIntersector.h:310
bool setWorldRay(const RayT &wRay)
Return false the ray misses the bbox of the grid.
Definition: RayIntersector.h:570
Helper class that implements Hierarchical Digital Differential Analyzers for ray intersections agains...
Definition: DDA.h:209
Definition: Ray.h:53
~VolumeRayIntersector()
Destructor.
Definition: RayIntersector.h:384
bool setWorldRay(const RayT &wRay)
Return false if the world ray misses the bbox of the grid.
Definition: RayIntersector.h:410