OpenVDB 3.2.0

Diagnostics.h
Go to the documentation of this file.
1 //
3 // Copyright (c) 2012-2016 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 //
38 #ifndef OPENVDB_TOOLS_DIAGNOSTICS_HAS_BEEN_INCLUDED
39 #define OPENVDB_TOOLS_DIAGNOSTICS_HAS_BEEN_INCLUDED
40
41 #include <openvdb/Grid.h>
42 #include <openvdb/math/Math.h>
43 #include <openvdb/math/Vec3.h>
44 #include <openvdb/math/Stencils.h>
45 #include <openvdb/math/Operators.h>
46 #include <openvdb/tree/LeafManager.h>
47 #include <tbb/blocked_range.h>
48 #include <tbb/parallel_reduce.h>
49 #include <set>
50 #include <boost/math/special_functions/fpclassify.hpp>
51 #include <boost/utility/enable_if.hpp>
52
53 namespace openvdb {
54 OPENVDB_USE_VERSION_NAMESPACE
55 namespace OPENVDB_VERSION_NAME {
56 namespace tools {
57
59
85 template<class GridType>
86 std::string
87 checkLevelSet(const GridType& grid, size_t number=9);
88
90
109 template<class GridType>
110 std::string
111 checkFogVolume(const GridType& grid, size_t number=6);
112
114
121 template<class GridType>
122 bool
123 uniqueInactiveValues(const GridType& grid,
124 std::vector<typename GridType::ValueType>& values, size_t numValues);
125
126
128
130 template <typename GridT,
131 typename TreeIterT = typename GridT::ValueOnCIter>
132 struct CheckNan
133 {
134 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
135 typedef TreeIterT TileIterT;
136 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
137 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
138
140 CheckNan() {}
141
143 inline bool operator()(const ElementType& v) const { return boost::math::isnan(v); }
144
146 template <typename T>
147 inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
148 operator()(const T& v) const
149 {
150 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;//should unroll
151 return false;
152 }
153
155 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
156
158 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
159
161 std::string str() const { return "NaN"; }
162
163 };// CheckNan
164
166
168 template <typename GridT,
169 typename TreeIterT = typename GridT::ValueOnCIter>
170 struct CheckInf
171 {
172 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
173 typedef TreeIterT TileIterT;
174 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
175 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
176
178 CheckInf() {}
179
181 inline bool operator()(const ElementType& v) const { return boost::math::isinf(v); }
182
184 template <typename T> inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
185 operator()(const T& v) const
186 {
187 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
188 return false;
189 }
190
192 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
193
195 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
196
198 std::string str() const { return "infinite"; }
199 };// CheckInf
200
202
204 template <typename GridT,
205 typename TreeIterT = typename GridT::ValueOnCIter>
206 struct CheckFinite
207 {
208 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
209 typedef TreeIterT TileIterT;
210 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
211 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
212
214 CheckFinite() {}
215
217 inline bool operator()(const ElementType& v) const { return !boost::math::isfinite(v); }
218
220 template <typename T>
221 inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
222 operator()(const T& v) const {
223 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
224 return false;
225 }
226
228 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
229
231 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
232
234 std::string str() const { return "not finite"; }
235 };// CheckFinite
236
238
241 template <typename GridT,
242 typename TreeIterT = typename GridT::ValueOffCIter>
243 struct CheckMagnitude
244 {
245 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
246 typedef TreeIterT TileIterT;
247 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
248 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
249
251 CheckMagnitude(const ElementType& a,
252 const ElementType& t = math::Tolerance<ElementType>::value())
253 : absVal(math::Abs(a)), tolVal(math::Abs(t))
254 {
255 }
256
259 inline bool operator()(const ElementType& v) const
260 {
261 return math::Abs(math::Abs(v) - absVal) > tolVal;
262 }
263
265 template <typename T> inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
266 operator()(const T& v) const
267 {
268 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
269 return false;
270 }
271
273 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
274
276 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
277
279 std::string str() const
280 {
281 std::ostringstream ss;
282 ss << "not equal to +/-"<<absVal<<" with a tolerance of "<<tolVal;
283 return ss.str();
284 }
285
286 const ElementType absVal, tolVal;
287 };// CheckMagnitude
288
290
292 template <typename GridT,
293 bool MinInclusive = true,//is min part of the range?
294 bool MaxInclusive = true,//is max part of the range?
295 typename TreeIterT = typename GridT::ValueOnCIter>
296 struct CheckRange
297 {
298 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
299 typedef TreeIterT TileIterT;
300 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
301 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
302
303 // @brief Constructor taking a range to be tested against.
304 CheckRange(const ElementType& _min, const ElementType& _max) : minVal(_min), maxVal(_max)
305 {
306 if (minVal > maxVal) {
307 OPENVDB_THROW(ValueError, "CheckRange: Invalid range (min > max)");
308 }
309 }
310
312 inline bool operator()(const ElementType& v) const
313 {
314 return (MinInclusive ? v<minVal : v<=minVal) ||
315 (MaxInclusive ? v>maxVal : v>=maxVal);
316 }
317
319 template <typename T>
320 inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
321 operator()(const T& v) const {
322 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
323 return false;
324 }
325
327 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
328
330 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
331
333 std::string str() const
334 {
335 std::ostringstream ss;
336 ss << "outside the value range " << (MinInclusive ? "[" : "]")
337 << minVal << "," << maxVal << (MaxInclusive ? "]" : "[");
338 return ss.str();
339 }
340
341 const ElementType minVal, maxVal;
342 };// CheckRange
343
345
347 template <typename GridT,
348 typename TreeIterT = typename GridT::ValueOnCIter>
349 struct CheckMin
350 {
351 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
352 typedef TreeIterT TileIterT;
353 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
354 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
355
356 // @brief Constructor taking a minimum to be tested against.
357 CheckMin(const ElementType& _min) : minVal(_min) {}
358
360 inline bool operator()(const ElementType& v) const { return v<minVal; }
361
363 template <typename T>
364 inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
365 operator()(const T& v) const {
366 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
367 return false;
368 }
369
371 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
372
374 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
375
377 std::string str() const
378 {
379 std::ostringstream ss;
380 ss << "smaller than "<<minVal;
381 return ss.str();
382 }
383
384 const ElementType minVal;
385 };// CheckMin
386
388
390 template <typename GridT,
391 typename TreeIterT = typename GridT::ValueOnCIter>
392 struct CheckMax
393 {
394 typedef typename VecTraits<typename GridT::ValueType>::ElementType ElementType;
395 typedef TreeIterT TileIterT;
396 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
397 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
398
400 CheckMax(const ElementType& _max) : maxVal(_max) {}
401
403 inline bool operator()(const ElementType& v) const { return v>maxVal; }
404
406 template <typename T>
407 inline typename boost::enable_if_c<VecTraits<T>::IsVec, bool>::type
408 operator()(const T& v) const {
409 for (int i=0; i<VecTraits<T>::Size; ++i) if ((*this)(v[i])) return true;
410 return false;
411 }
412
414 bool operator()(const TreeIterT &iter) const { return (*this)(*iter); }
415
417 bool operator()(const VoxelIterT &iter) const { return (*this)(*iter); }
418
420 std::string str() const
421 {
422 std::ostringstream ss;
423 ss << "larger than "<<maxVal;
424 return ss.str();
425 }
426
427 const ElementType maxVal;
428 };// CheckMax
429
431
436 template<typename GridT,
437 typename TreeIterT = typename GridT::ValueOnCIter,
438 math::BiasedGradientScheme GradScheme = math::FIRST_BIAS>//math::WENO5_BIAS>
439 struct CheckNormGrad
440 {
441 typedef typename GridT::ValueType ValueType;
442 BOOST_STATIC_ASSERT(boost::is_floating_point<ValueType>::value);
443 typedef TreeIterT TileIterT;
444 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
445 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
446 typedef typename GridT::ConstAccessor AccT;
447
449 CheckNormGrad(const GridT& grid, const ValueType& _min, const ValueType& _max)
450 : acc(grid.getConstAccessor())
451 , invdx2(ValueType(1.0/math::Pow2(grid.voxelSize()[0])))
452 , minVal2(_min*_min)
453 , maxVal2(_max*_max)
454 {
455 if ( !grid.hasUniformVoxels() ) {
456 OPENVDB_THROW(ValueError, "CheckNormGrad: The transform must have uniform scale");
457 }
458 if (_min > _max) {
459 OPENVDB_THROW(ValueError, "CheckNormGrad: Invalid range (min > max)");
460 }
461 }
462
463 CheckNormGrad(const CheckNormGrad& other)
464 : acc(other.acc.tree())
465 , invdx2(other.invdx2)
466 , minVal2(other.minVal2)
467 , maxVal2(other.maxVal2)
468 {
469 }
470
472 inline bool operator()(const ValueType& v) const { return v<minVal2 || v>maxVal2; }
473
476 inline bool operator()(const TreeIterT&) const { return (*this)(ValueType(0)); }
477
480 inline bool operator()(const VoxelIterT &iter) const
481 {
482 const Coord ijk = iter.getCoord();
483 return (*this)(invdx2 * math::ISGradientNormSqrd<GradScheme>::result(acc, ijk));
484 }
485
487 std::string str() const
488 {
489 std::ostringstream ss;
490 ss << "outside the range of NormGrad ["<<math::Sqrt(minVal2)<<","<<math::Sqrt(maxVal2)<<"]";
491 return ss.str();
492 }
493
494 AccT acc;
495 const ValueType invdx2, minVal2, maxVal2;
496 };// CheckNormGrad
497
499
504 template<typename GridT,
505 typename TreeIterT = typename GridT::ValueOnCIter,
506 typename StencilT = math::WenoStencil<GridT> >//math::GradStencil<GridT>
507 struct CheckEikonal
508 {
509 typedef typename GridT::ValueType ValueType;
510 BOOST_STATIC_ASSERT(boost::is_floating_point<ValueType>::value);
511 typedef TreeIterT TileIterT;
512 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
513 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
514
516 CheckEikonal(const GridT& grid, const ValueType& _min, const ValueType& _max)
517 : stencil(grid), minVal(_min), maxVal(_max)
518 {
519 if ( !grid.hasUniformVoxels() ) {
520 OPENVDB_THROW(ValueError, "CheckEikonal: The transform must have uniform scale");
521 }
522 if (minVal > maxVal) {
523 OPENVDB_THROW(ValueError, "CheckEikonal: Invalid range (min > max)");
524 }
525 }
526
527 CheckEikonal(const CheckEikonal& other)
528 : stencil(other.stencil.grid()), minVal(other.minVal), maxVal(other.maxVal)
529 {
530 }
531
533 inline bool operator()(const ValueType& v) const { return v<minVal || v>maxVal; }
534
537 inline bool operator()(const TreeIterT&) const { return (*this)(ValueType(0)); }
538
541 inline bool operator()(const VoxelIterT &iter) const
542 {
543 stencil.moveTo(iter);
544 if (!stencil.zeroCrossing()) return false;
545 return (*this)(stencil.normSqGrad());
546 }
547
549 std::string str() const
550 {
551 std::ostringstream ss;
552 ss << "outside the range of NormGrad ["<<minVal<<","<<maxVal<<"]";
553 return ss.str();
554 }
555
556 mutable StencilT stencil;
557 const ValueType minVal, maxVal;
558 };// CheckEikonal
559
561
563 template<typename GridT,
564 typename TreeIterT = typename GridT::ValueOnCIter,
565 math::DScheme DiffScheme = math::CD_2ND>
566 struct CheckDivergence
567 {
568 typedef typename GridT::ValueType ValueType;
569 typedef typename VecTraits<ValueType>::ElementType ElementType;
570 BOOST_STATIC_ASSERT(boost::is_floating_point<ElementType>::value);
571 typedef TreeIterT TileIterT;
572 typedef typename tree::IterTraits<typename TreeIterT::NodeT, typename TreeIterT::ValueIterT>
573 ::template NodeConverter<typename GridT::TreeType::LeafNodeType>::Type VoxelIterT;
574 typedef typename GridT::ConstAccessor AccT;
575
577 CheckDivergence(const GridT& grid,
578 const ValueType& _min,
579 const ValueType& _max)
580 : acc(grid.getConstAccessor())
581 , invdx(ValueType(1.0/grid.voxelSize()[0]))
582 , minVal(_min)
583 , maxVal(_max)
584 {
585 if ( !grid.hasUniformVoxels() ) {
586 OPENVDB_THROW(ValueError, "CheckDivergence: The transform must have uniform scale");
587 }
588 if (minVal > maxVal) {
589 OPENVDB_THROW(ValueError, "CheckDivergence: Invalid range (min > max)");
590 }
591 }
593 inline bool operator()(const ElementType& v) const { return v<minVal || v>maxVal; }
594
597 inline bool operator()(const TreeIterT&) const { return (*this)(ElementType(0)); }
598
601 inline bool operator()(const VoxelIterT &iter) const
602 {
603 const Coord ijk = iter.getCoord();
604 return (*this)(invdx * math::ISDivergence<DiffScheme>::result(acc, ijk));
605 }
606
608 std::string str() const
609 {
610 std::ostringstream ss;
611 ss << "outside the range of divergence ["<<minVal<<","<<maxVal<<"]";
612 return ss.str();
613 }
614
615 AccT acc;
616 const ValueType invdx, minVal, maxVal;
617 };// CheckDivergence
618
620
623 template <typename GridT>
624 class Diagnose
625 {
626 public:
627 typedef typename GridT::template ValueConverter<bool>::Type MaskType;
628
629 Diagnose(const GridT& grid) : mGrid(&grid), mMask(new MaskType()), mCount(0)
630 {
631 mMask->setTransform(grid.transformPtr()->copy());
632 }
633
634 template <typename CheckT>
635 std::string check(const CheckT& check,
636 bool updateMask = false,
637 bool checkVoxels = true,
638 bool checkTiles = true,
639 bool checkBackground = true)
640 {
641 typename MaskType::TreeType* mask = updateMask ? &(mMask->tree()) : NULL;
642 CheckValues<CheckT> cc(mask, mGrid, check);
643 std::ostringstream ss;
644 if (checkBackground) ss << cc.checkBackground();
645 if (checkTiles) ss << cc.checkTiles();
646 if (checkVoxels) ss << cc.checkVoxels();
647 mCount += cc.mCount;
648 return ss.str();
649 }
650
652 typename MaskType::ConstPtr mask() const { return mMask; }
656 typename MaskType::Ptr mask() { return mMask; }
658
661 Index64 valueCount() const { return mMask->activeVoxelCount(); }
662
666 Index64 failureCount() const { return mCount; }
667
669 const GridT& grid() const { return *mGrid; }
670
672 void clear() { mMask = new MaskType(); mCount = 0; }
673
674 private:
675 // disallow copy construction and copy by assignment!
676 Diagnose(const Diagnose&);// not implemented
677 Diagnose& operator=(const Diagnose&);// not implemented
678
679 const GridT* mGrid;
680 typename MaskType::Ptr mMask;
681 Index64 mCount;
682
684 template <typename CheckT>
685 struct CheckValues
686 {
687 typedef typename MaskType::TreeType MaskT;
688 typedef typename GridT::TreeType::LeafNodeType LeafT;
689 typedef typename tree::LeafManager<const typename GridT::TreeType> LeafManagerT;
690 const bool mOwnsMask;
691 MaskT* mMask;
692 const GridT* mGrid;
693 const CheckT mCheck;
694 Index64 mCount;
695
696 CheckValues(MaskT* mask, const GridT* grid, const CheckT& check)
697 : mOwnsMask(false)
698 , mMask(mask)
699 , mGrid(grid)
700 , mCheck(check)
701 , mCount(0)
702 {
703 }
704 CheckValues(CheckValues& other, tbb::split)
705 : mOwnsMask(true)
706 , mMask(other.mMask ? new MaskT() : NULL)
707 , mGrid(other.mGrid)
708 , mCheck(other.mCheck)
709 , mCount(0)
710 {
711 }
712 ~CheckValues() { if (mOwnsMask) delete mMask; }
713
714 std::string checkBackground()
715 {
716 std::ostringstream ss;
717 if (mCheck(mGrid->background())) {
718 ++mCount;
719 ss << "Background is " + mCheck.str() << std::endl;
720 }
721 return ss.str();
722 }
723
724 std::string checkTiles()
725 {
726 std::ostringstream ss;
727 const Index64 n = mCount;
728 typename CheckT::TileIterT i(mGrid->tree());
729 for (i.setMaxDepth(GridT::TreeType::RootNodeType::LEVEL - 1); i; ++i) {
730 if (mCheck(i)) {
731 ++mCount;
732 if (mMask) mMask->fill(i.getBoundingBox(), true, true);
733 }
734 }
735 if (const Index64 m = mCount - n) {
736 ss << m << " tile" << (m==1 ? " is " : "s are ") + mCheck.str() << std::endl;
737 }
738 return ss.str();
739 }
740
741 std::string checkVoxels()
742 {
743 std::ostringstream ss;
744 LeafManagerT leafs(mGrid->tree());
745 const Index64 n = mCount;
746 tbb::parallel_reduce(leafs.leafRange(), *this);
747 if (const Index64 m = mCount - n) {
748 ss << m << " voxel" << (m==1 ? " is " : "s are ") + mCheck.str() << std::endl;
749 }
750 return ss.str();
751 }
752
753 void operator()(const typename LeafManagerT::LeafRange& r)
754 {
755 typedef typename CheckT::VoxelIterT VoxelIterT;
756 if (mMask) {
757 for (typename LeafManagerT::LeafRange::Iterator i=r.begin(); i; ++i) {
758 typename MaskT::LeafNodeType* maskLeaf = NULL;
759 for (VoxelIterT j = tree::IterTraits<LeafT, VoxelIterT>::begin(*i); j; ++j) {
760 if (mCheck(j)) {
761 ++mCount;
762 if (maskLeaf == NULL) maskLeaf = mMask->touchLeaf(j.getCoord());
763 maskLeaf->setValueOn(j.pos(), true);
764 }
765 }
766 }
767 } else {
768 for (typename LeafManagerT::LeafRange::Iterator i=r.begin(); i; ++i) {
769 for (VoxelIterT j = tree::IterTraits<LeafT, VoxelIterT>::begin(*i); j; ++j) {
770 if (mCheck(j)) ++mCount;
771 }
772 }
773 }
774 }
775 void join(const CheckValues& other)
776 {
777 if (mMask) mMask->merge(*(other.mMask), openvdb::MERGE_ACTIVE_STATES_AND_NODES);
778 mCount += other.mCount;
779 }
780 };//End of private class CheckValues
781
782 };// End of public class Diagnose
783
784
786
790 template<class GridType>
791 class CheckLevelSet
792 {
793 public:
794 typedef typename GridType::ValueType ValueType;
795 typedef typename GridType::template ValueConverter<bool>::Type MaskType;
796
797 CheckLevelSet(const GridType& grid) : mDiagnose(grid) {}
798
800 typename MaskType::ConstPtr mask() const { return mDiagnose.mask(); }
804 typename MaskType::Ptr mask() { return mDiagnose.mask(); }
806
809 Index64 valueCount() const { return mDiagnose.valueCount(); }
810
814 Index64 failureCount() const { return mDiagnose.failureCount(); }
815
817 const GridType& grid() const { return mDiagnose.grid(); }
818
820 void clear() { mDiagnose.clear(); }
821
825 static std::string checkValueType()
826 {
827 static const bool test = boost::is_floating_point<ValueType>::value;
828 return test ? "" : "Value type is not floating point\n";
829 }
830
834 std::string checkClassType() const
835 {
836 const bool test = mDiagnose.grid().getGridClass() == GRID_LEVEL_SET;
837 return test ? "" : "Class type is not \"GRID_LEVEL_SET\"\n";
838 }
839
843 std::string checkTransform() const
844 {
845 return mDiagnose.grid().hasUniformVoxels() ? "" : "Does not have uniform voxels\n";
846 }
847
852 std::string checkBackground(Real halfWidth = LEVEL_SET_HALF_WIDTH) const
853 {
854 const Real w = mDiagnose.grid().background() / mDiagnose.grid().voxelSize()[0];
855 if (w < halfWidth) {
856 std::ostringstream ss;
857 ss << "The background value ("<< mDiagnose.grid().background()<<") is less than "
858 << halfWidth << " voxel units\n";
859 return ss.str();
860 }
861 return "";
862 }
863
867 std::string checkTiles() const
868 {
869 const bool test = mDiagnose.grid().tree().hasActiveTiles();
870 return test ? "Has active tile values\n" : "";
871 }
872
876 std::string checkFinite(bool updateMask = false)
877 {
878 CheckFinite<GridType,typename GridType::ValueAllCIter> c;
879 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/true, /*background*/true);
880 }
881
885 std::string checkRange(bool updateMask = false)
886 {
887 const ValueType& background = mDiagnose.grid().background();
888 CheckRange<GridType> c(-background, background);
889 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/false, /*background*/false);
890 }
891
896 std::string checkInactiveValues(bool updateMask = false)
897 {
898 const ValueType& background = mDiagnose.grid().background();
899 CheckMagnitude<GridType, typename GridType::ValueOffCIter> c(background);
900 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/true, /*background*/false);
901 }
902
907 std::string checkEikonal(bool updateMask = false, ValueType minV = 0.5, ValueType maxV = 1.5)
908 {
909 CheckEikonal<GridType> c(mDiagnose.grid(), minV, maxV);
910 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/false, /*background*/false);
911 }
912
930 std::string check(size_t n=9, bool updateMask = false)
931 {
932 std::string str = this->checkValueType();
933 if (str.empty() && n>1) str = this->checkClassType();
934 if (str.empty() && n>2) str = this->checkTransform();
935 if (str.empty() && n>3) str = this->checkBackground();
936 if (str.empty() && n>4) str = this->checkTiles();
937 if (str.empty() && n>5) str = this->checkFinite(updateMask);
938 if (str.empty() && n>6) str = this->checkRange(updateMask);
939 if (str.empty() && n>7) str = this->checkInactiveValues(updateMask);
940 if (str.empty() && n>8) str = this->checkEikonal(updateMask);
941 return str;
942 }
943
944 private:
945 // disallow copy construction and copy by assignment!
946 CheckLevelSet(const CheckLevelSet&);// not implemented
947 CheckLevelSet& operator=(const CheckLevelSet&);// not implemented
948
949 // Member data
950 Diagnose<GridType> mDiagnose;
951 };// CheckLevelSet
952
953 template<class GridType>
954 std::string
955 checkLevelSet(const GridType& grid, size_t n)
956 {
957 CheckLevelSet<GridType> c(grid);
958 return c.check(n, false);
959 }
960
962
966 template<class GridType>
967 class CheckFogVolume
968 {
969 public:
970 typedef typename GridType::ValueType ValueType;
971 typedef typename GridType::template ValueConverter<bool>::Type MaskType;
972
973 CheckFogVolume(const GridType& grid) : mDiagnose(grid) {}
974
976 typename MaskType::ConstPtr mask() const { return mDiagnose.mask(); }
980 typename MaskType::Ptr mask() { return mDiagnose.mask(); }
982
985 Index64 valueCount() const { return mDiagnose.valueCount(); }
986
990 Index64 failureCount() const { return mDiagnose.failureCount(); }
991
993 const GridType& grid() const { return mDiagnose.grid(); }
994
996 void clear() { mDiagnose.clear(); }
997
1001 static std::string checkValueType()
1002 {
1003 static const bool test = boost::is_floating_point<ValueType>::value;
1004 return test ? "" : "Value type is not floating point";
1005 }
1006
1010 std::string checkClassType() const
1011 {
1012 const bool test = mDiagnose.grid().getGridClass() == GRID_FOG_VOLUME;
1013 return test ? "" : "Class type is not \"GRID_LEVEL_SET\"";
1014 }
1015
1019 std::string checkBackground() const
1020 {
1021 if (!math::isApproxZero(mDiagnose.grid().background())) {
1022 std::ostringstream ss;
1023 ss << "The background value ("<< mDiagnose.grid().background()<<") is not zero";
1024 return ss.str();
1025 }
1026 return "";
1027 }
1028
1032 std::string checkFinite(bool updateMask = false)
1033 {
1034 CheckFinite<GridType,typename GridType::ValueAllCIter> c;
1035 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/true, /*background*/true);
1036 }
1037
1041 std::string checkInactiveValues(bool updateMask = false)
1042 {
1043 CheckMagnitude<GridType, typename GridType::ValueOffCIter> c(0);
1044 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/true, /*background*/true);
1045 }
1046
1051 std::string checkRange(bool updateMask = false)
1052 {
1053 CheckRange<GridType> c(0, 1);
1054 return mDiagnose.check(c, updateMask, /*voxel*/true, /*tiles*/true, /*background*/false);
1055 }
1056
1069 std::string check(size_t n=6, bool updateMask = false)
1070 {
1071 std::string str = this->checkValueType();
1072 if (str.empty() && n>1) str = this->checkClassType();
1073 if (str.empty() && n>2) str = this->checkBackground();
1074 if (str.empty() && n>3) str = this->checkFinite(updateMask);
1075 if (str.empty() && n>4) str = this->checkInactiveValues(updateMask);
1076 if (str.empty() && n>5) str = this->checkRange(updateMask);
1077 return str;
1078 }
1079
1080 private:
1081 // disallow copy construction and copy by assignment!
1082 CheckFogVolume(const CheckFogVolume&);// not implemented
1083 CheckFogVolume& operator=(const CheckFogVolume&);// not implemented
1084
1085 // Member data
1086 Diagnose<GridType> mDiagnose;
1087 };// CheckFogVolume
1088
1089 template<class GridType>
1090 std::string
1091 checkFogVolume(const GridType& grid, size_t n)
1092 {
1093 CheckFogVolume<GridType> c(grid);
1094 return c.check(n, false);
1095 }
1096
1097
1099
1100 // Internal utility objects and implementation details
1101
1102
1103 namespace diagnostics_internal {
1104
1105
1106 template<typename TreeType>
1107 class InactiveVoxelValues
1108 {
1109 public:
1110 typedef tree::LeafManager<TreeType> LeafArray;
1111 typedef typename TreeType::ValueType ValueType;
1112 typedef std::set<ValueType> SetType;
1113
1114 InactiveVoxelValues(LeafArray&, size_t numValues);
1115
1116 void runParallel();
1117 void runSerial();
1118
1119 void getInactiveValues(SetType&) const;
1120
1121 inline InactiveVoxelValues(const InactiveVoxelValues<TreeType>&, tbb::split);
1122 inline void operator()(const tbb::blocked_range<size_t>&);
1123 inline void join(const InactiveVoxelValues<TreeType>&);
1124
1125 private:
1126 LeafArray& mLeafArray;
1127 SetType mInactiveValues;
1128 size_t mNumValues;
1129 };// InactiveVoxelValues
1130
1131 template<typename TreeType>
1132 InactiveVoxelValues<TreeType>::InactiveVoxelValues(LeafArray& leafs, size_t numValues)
1133 : mLeafArray(leafs)
1134 , mInactiveValues()
1135 , mNumValues(numValues)
1136 {
1137 }
1138
1139 template <typename TreeType>
1140 inline
1141 InactiveVoxelValues<TreeType>::InactiveVoxelValues(
1142 const InactiveVoxelValues<TreeType>& rhs, tbb::split)
1143 : mLeafArray(rhs.mLeafArray)
1144 , mInactiveValues()
1145 , mNumValues(rhs.mNumValues)
1146 {
1147 }
1148
1149 template<typename TreeType>
1150 void
1151 InactiveVoxelValues<TreeType>::runParallel()
1152 {
1153 tbb::parallel_reduce(mLeafArray.getRange(), *this);
1154 }
1155
1156
1157 template<typename TreeType>
1158 void
1159 InactiveVoxelValues<TreeType>::runSerial()
1160 {
1161 (*this)(mLeafArray.getRange());
1162 }
1163
1164
1165 template<typename TreeType>
1166 inline void
1167 InactiveVoxelValues<TreeType>::operator()(const tbb::blocked_range<size_t>& range)
1168 {
1169 typename TreeType::LeafNodeType::ValueOffCIter iter;
1170
1171 for (size_t n = range.begin(); n < range.end() && !tbb::task::self().is_cancelled(); ++n) {
1172 for (iter = mLeafArray.leaf(n).cbeginValueOff(); iter; ++iter) {
1173 mInactiveValues.insert(iter.getValue());
1174 }
1175
1176 if (mInactiveValues.size() > mNumValues) {
1177 tbb::task::self().cancel_group_execution();
1178 }
1179 }
1180 }
1181
1182 template<typename TreeType>
1183 inline void
1184 InactiveVoxelValues<TreeType>::join(const InactiveVoxelValues<TreeType>& rhs)
1185 {
1186 mInactiveValues.insert(rhs.mInactiveValues.begin(), rhs.mInactiveValues.end());
1187 }
1188
1189 template<typename TreeType>
1190 inline void
1191 InactiveVoxelValues<TreeType>::getInactiveValues(SetType& values) const
1192 {
1193 values.insert(mInactiveValues.begin(), mInactiveValues.end());
1194 }
1195
1196
1198
1199
1200 template<typename TreeType>
1201 class InactiveTileValues
1202 {
1203 public:
1204 typedef tree::IteratorRange<typename TreeType::ValueOffCIter> IterRange;
1205 typedef typename TreeType::ValueType ValueType;
1206 typedef std::set<ValueType> SetType;
1207
1208 InactiveTileValues(size_t numValues);
1209
1210 void runParallel(IterRange&);
1211 void runSerial(IterRange&);
1212
1213 void getInactiveValues(SetType&) const;
1214
1215 inline InactiveTileValues(const InactiveTileValues<TreeType>&, tbb::split);
1216 inline void operator()(IterRange&);
1217 inline void join(const InactiveTileValues<TreeType>&);
1218
1219 private:
1220 SetType mInactiveValues;
1221 size_t mNumValues;
1222 };
1223
1224
1225 template<typename TreeType>
1226 InactiveTileValues<TreeType>::InactiveTileValues(size_t numValues)
1227 : mInactiveValues()
1228 , mNumValues(numValues)
1229 {
1230 }
1231
1232 template <typename TreeType>
1233 inline
1234 InactiveTileValues<TreeType>::InactiveTileValues(
1235 const InactiveTileValues<TreeType>& rhs, tbb::split)
1236 : mInactiveValues()
1237 , mNumValues(rhs.mNumValues)
1238 {
1239 }
1240
1241 template<typename TreeType>
1242 void
1243 InactiveTileValues<TreeType>::runParallel(IterRange& range)
1244 {
1245 tbb::parallel_reduce(range, *this);
1246 }
1247
1248
1249 template<typename TreeType>
1250 void
1251 InactiveTileValues<TreeType>::runSerial(IterRange& range)
1252 {
1253 (*this)(range);
1254 }
1255
1256
1257 template<typename TreeType>
1258 inline void
1259 InactiveTileValues<TreeType>::operator()(IterRange& range)
1260 {
1261 for (; range && !tbb::task::self().is_cancelled(); ++range) {
1262 typename TreeType::ValueOffCIter iter = range.iterator();
1263 for (; iter; ++iter) {
1264 mInactiveValues.insert(iter.getValue());
1265 }
1266
1267 if (mInactiveValues.size() > mNumValues) {
1268 tbb::task::self().cancel_group_execution();
1269 }
1270 }
1271 }
1272
1273 template<typename TreeType>
1274 inline void
1275 InactiveTileValues<TreeType>::join(const InactiveTileValues<TreeType>& rhs)
1276 {
1277 mInactiveValues.insert(rhs.mInactiveValues.begin(), rhs.mInactiveValues.end());
1278 }
1279
1280 template<typename TreeType>
1281 inline void
1282 InactiveTileValues<TreeType>::getInactiveValues(SetType& values) const
1283 {
1284 values.insert(mInactiveValues.begin(), mInactiveValues.end());
1285 }
1286
1287 } // namespace diagnostics_internal
1288
1289
1291
1292
1293 template<class GridType>
1294 bool
1295 uniqueInactiveValues(const GridType& grid,
1296 std::vector<typename GridType::ValueType>& values, size_t numValues)
1297 {
1298
1299 typedef typename GridType::TreeType TreeType;
1300 typedef typename GridType::ValueType ValueType;
1301 typedef std::set<ValueType> SetType;
1302
1303 SetType uniqueValues;
1304
1305 { // Check inactive voxels
1306 TreeType& tree = const_cast<TreeType&>(grid.tree());
1307 tree::LeafManager<TreeType> leafs(tree);
1308 diagnostics_internal::InactiveVoxelValues<TreeType> voxelOp(leafs, numValues);
1309 voxelOp.runParallel();
1310 voxelOp.getInactiveValues(uniqueValues);
1311 }
1312
1313 // Check inactive tiles
1314 if (uniqueValues.size() <= numValues) {
1315 typename TreeType::ValueOffCIter iter(grid.tree());
1316 iter.setMaxDepth(TreeType::ValueAllIter::LEAF_DEPTH - 1);
1317 diagnostics_internal::InactiveTileValues<TreeType> tileOp(numValues);
1318
1319 tree::IteratorRange<typename TreeType::ValueOffCIter> range(iter);
1320 tileOp.runParallel(range);
1321
1322 tileOp.getInactiveValues(uniqueValues);
1323 }
1324
1325 values.clear();
1326 values.reserve(uniqueValues.size());
1327
1328 typename SetType::iterator it = uniqueValues.begin();
1329 for ( ; it != uniqueValues.end(); ++it) {
1330 values.push_back(*it);
1331 }
1332
1333 return values.size() <= numValues;
1334 }
1335
1336 } // namespace tools
1337 } // namespace OPENVDB_VERSION_NAME
1338 } // namespace openvdb
1339
1340 #endif // OPENVDB_TOOLS_DIAGNOSTICS_HAS_BEEN_INCLUDED
1341
1342 // Copyright (c) 2012-2016 DreamWorks Animation LLC
1343 // All rights reserved. This software is distributed under the
1344 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
openvdb::v3_2_0::tools::CheckRange::minVal
const ElementType minVal
Definition: Diagnostics.h:341
openvdb::v3_2_0::tools::CheckFogVolume::checkFinite
std::string checkFinite(bool updateMask=false)
Return a nonempty message if any of the values are not finite. i.e. NaN or inf.
Definition: Diagnostics.h:1032
openvdb::v3_2_0::tools::CheckMax::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:397
openvdb::v3_2_0::GRID_FOG_VOLUME
Definition: Types.h:214
openvdb::v3_2_0::math::Abs
Coord Abs(const Coord &xyz)
Definition: Coord.h:247
openvdb::v3_2_0::tools::CheckEikonal::ValueType
GridT::ValueType ValueType
Definition: Diagnostics.h:509
openvdb::v3_2_0::tools::CheckNan::operator()
bool operator()(const ElementType &v) const
Return true if the scalar value is NaN.
Definition: Diagnostics.h:143
openvdb::v3_2_0::tools::CheckNormGrad::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:445
openvdb::v3_2_0::tools::CheckMagnitude::operator()
bool operator()(const ElementType &v) const
Definition: Diagnostics.h:259
openvdb::v3_2_0::tools::CheckRange::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:299
openvdb::v3_2_0::math::ISGradientNormSqrd
Definition: Operators.h:253
Vec3.h
openvdb::v3_2_0::tools::CheckMin::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the tile at the iterator location is smaller than min.
Definition: Diagnostics.h:374
openvdb::v3_2_0::tools::CheckNan
Checks NaN values.
Definition: Diagnostics.h:132
openvdb::v3_2_0::tools::CheckLevelSet::valueCount
Index64 valueCount() const
Return the number of values (i.e. background, tiles or voxels) that have failed one or more checks...
Definition: Diagnostics.h:809
openvdb::v3_2_0::tools::CheckInf::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:173
openvdb::v3_2_0::tools::CheckDivergence::ElementType
VecTraits< ValueType >::ElementType ElementType
Definition: Diagnostics.h:569
openvdb::v3_2_0::tools::CheckLevelSet::MaskType
GridType::template ValueConverter< bool >::Type MaskType
Definition: Diagnostics.h:795
openvdb::v3_2_0::tools::checkLevelSet
std::string checkLevelSet(const GridType &grid, size_t number=9)
Perform checks on a grid to see if it is a valid symmetric, narrow-band level set.
Definition: Diagnostics.h:955
Math.h
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
openvdb::v3_2_0::math::WenoStencil
This is a special 19-point stencil that supports optimal fifth-order WENO upwinding, second-order central differencing, Laplacian, and zero-crossing test.
Definition: Stencils.h:1332
openvdb::v3_2_0::tools::CheckDivergence::AccT
GridT::ConstAccessor AccT
Definition: Diagnostics.h:574
openvdb::v3_2_0::math::Sqrt
float Sqrt(float x)
Return the square root of a floating-point value.
Definition: Math.h:727
openvdb::v3_2_0::tree::LeafManager::getRange
RangeType getRange(size_t grainsize=1) const
Return a tbb::blocked_range of leaf array indices.
Definition: LeafManager.h:378
openvdb::v3_2_0::VecTraits::ElementType
T ElementType
Definition: Types.h:151
openvdb::v3_2_0::tools::CheckMagnitude::CheckMagnitude
CheckMagnitude(const ElementType &a, const ElementType &t=math::Tolerance< ElementType >::value())
Default constructor.
Definition: Diagnostics.h:251
openvdb::v3_2_0::tools::CheckMax::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the voxel at the iterator location is larger than max.
Definition: Diagnostics.h:417
openvdb::v3_2_0::tools::uniqueInactiveValues
bool uniqueInactiveValues(const GridType &grid, std::vector< typename GridType::ValueType > &values, size_t numValues)
Threaded method to find unique inactive values.
Definition: Diagnostics.h:1295
openvdb::v3_2_0::tools::CheckLevelSet::checkValueType
static std::string checkValueType()
Return a nonempty message if the grid&#39;s value type is a floating point.
Definition: Diagnostics.h:825
openvdb::v3_2_0::tools::CheckRange::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are out of range.
Definition: Diagnostics.h:321
openvdb::v3_2_0::tools::CheckInf::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the tile at the iterator location is infinite.
Definition: Diagnostics.h:195
openvdb::v3_2_0::math::Pow2
Type Pow2(Type x)
Return .
Definition: Math.h:514
openvdb::v3_2_0::tools::Diagnose::valueCount
Index64 valueCount() const
Return the number of values (i.e. background, tiles or voxels) that have failed one or more checks...
Definition: Diagnostics.h:661
openvdb::v3_2_0::tools::CheckEikonal::CheckEikonal
CheckEikonal(const CheckEikonal &other)
Definition: Diagnostics.h:527
openvdb::v3_2_0::tools::CheckEikonal::operator()
bool operator()(const ValueType &v) const
Return true if the value is smaller than min or larger than max.
Definition: Diagnostics.h:533
openvdb::v3_2_0::tools::CheckLevelSet
Class that performs various types of checks on narrow-band level sets.
Definition: Diagnostics.h:791
OPENVDB_THROW
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:97
openvdb::v3_2_0::tools::CheckMax::operator()
bool operator()(const TreeIterT &iter) const
Return true if the tile at the iterator location is larger than max.
Definition: Diagnostics.h:414
openvdb::v3_2_0::tools::CheckFinite::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:234
openvdb::v3_2_0::tools::CheckEikonal::stencil
StencilT stencil
Definition: Diagnostics.h:556
openvdb::v3_2_0::math::FIRST_BIAS
Definition: FiniteDifference.h:194
openvdb::v3_2_0::LEVEL_SET_HALF_WIDTH
static const Real LEVEL_SET_HALF_WIDTH
Definition: Types.h:219
openvdb::v3_2_0::tools::CheckLevelSet::mask
MaskType::Ptr mask()
Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more check...
Definition: Diagnostics.h:804
openvdb::v3_2_0::tools::CheckLevelSet::check
std::string check(size_t n=9, bool updateMask=false)
Return a nonempty message if an error or issue is detected. Only runs tests with a number lower than ...
Definition: Diagnostics.h:930
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::operator()
void operator()(IterRange &)
Definition: Diagnostics.h:1259
openvdb::v3_2_0::tools::CheckFinite::CheckFinite
CheckFinite()
Default constructor.
Definition: Diagnostics.h:214
openvdb::v3_2_0::tree::LeafManager
This class manages a linear array of pointers to a given tree&#39;s leaf nodes, as well as optional auxil...
Definition: LeafManager.h:115
openvdb::v3_2_0::tools::CheckNormGrad
Checks the norm of the gradient against a range, i.e. .
Definition: Diagnostics.h:439
openvdb::v3_2_0::tools::CheckMagnitude::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are infinite.
Definition: Diagnostics.h:266
openvdb::v3_2_0::tools::CheckMin::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are smaller than min.
Definition: Diagnostics.h:365
openvdb::v3_2_0::tools::CheckFogVolume::check
std::string check(size_t n=6, bool updateMask=false)
Return a nonempty message if an error or issue is detected. Only runs tests with a number lower than ...
Definition: Diagnostics.h:1069
openvdb::v3_2_0::tools::Diagnose
Performs multithreaded diagnostics of a grid.
Definition: Diagnostics.h:624
openvdb::v3_2_0::math::Coord
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:47
openvdb::v3_2_0::tools::Diagnose::clear
void clear()
Clear the mask and error counter.
Definition: Diagnostics.h:672
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::SetType
std::set< ValueType > SetType
Definition: Diagnostics.h:1112
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::join
void join(const InactiveTileValues< TreeType > &)
Definition: Diagnostics.h:1275
openvdb::v3_2_0::tools::CheckEikonal::operator()
bool operator()(const TreeIterT &) const
Return true if zero is outside the range.
Definition: Diagnostics.h:537
openvdb::v3_2_0::tools::CheckInf::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:172
openvdb::v3_2_0::tools::CheckInf::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are infinite.
Definition: Diagnostics.h:185
openvdb::v3_2_0::tools::CheckNormGrad::AccT
GridT::ConstAccessor AccT
Definition: Diagnostics.h:446
openvdb::v3_2_0::tools::CheckFogVolume::clear
void clear()
Clear the mask and error counter.
Definition: Diagnostics.h:996
openvdb::v3_2_0::math::DScheme
DScheme
Different discrete schemes used in the first derivatives.
Definition: FiniteDifference.h:59
openvdb::v3_2_0::tools::checkFogVolume
std::string checkFogVolume(const GridType &grid, size_t number=6)
Perform checks on a grid to see if it is a valid fog volume.
Definition: Diagnostics.h:1091
openvdb::v3_2_0::tools::CheckFogVolume::checkClassType
std::string checkClassType() const
Return a nonempty message if the grid&#39;s class is a level set.
Definition: Diagnostics.h:1010
openvdb::v3_2_0::tools::CheckLevelSet::checkTiles
std::string checkTiles() const
Return a nonempty message if the grid has no active tile values.
Definition: Diagnostics.h:867
openvdb::v3_2_0::tools::CheckMagnitude
Check that the magnitude of a value, a, is close to a fixed magnitude, b, given a fixed tolerance c...
Definition: Diagnostics.h:243
openvdb::v3_2_0::tools::CheckFogVolume::checkValueType
static std::string checkValueType()
Return a nonempty message if the grid&#39;s value type is a floating point.
Definition: Diagnostics.h:1001
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::LeafArray
tree::LeafManager< TreeType > LeafArray
Definition: Diagnostics.h:1110
openvdb::v3_2_0::tools::Diagnose::Diagnose
Diagnose(const GridT &grid)
Definition: Diagnostics.h:629
openvdb::v3_2_0::tools::CheckEikonal::CheckEikonal
CheckEikonal(const GridT &grid, const ValueType &_min, const ValueType &_max)
Constructor taking a grid and a range to be tested against.
Definition: Diagnostics.h:516
openvdb::v3_2_0::tools::CheckNormGrad::operator()
bool operator()(const ValueType &v) const
Return true if the value is smaller than min or larger than max.
Definition: Diagnostics.h:472
openvdb::v3_2_0::tools::CheckRange::CheckRange
CheckRange(const ElementType &_min, const ElementType &_max)
Definition: Diagnostics.h:304
openvdb::v3_2_0::tools::CheckLevelSet::CheckLevelSet
CheckLevelSet(const GridType &grid)
Definition: Diagnostics.h:797
openvdb::v3_2_0::tools::CheckFinite::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are NaN or infinite.
Definition: Diagnostics.h:222
openvdb::v3_2_0::tools::CheckMax::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:420
openvdb::v3_2_0::Real
double Real
Definition: Types.h:64
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::ValueType
TreeType::ValueType ValueType
Definition: Diagnostics.h:1205
openvdb::v3_2_0::tools::CheckNan::operator()
bool operator()(const TreeIterT &iter) const
Return true if the tile at the iterator location is NaN.
Definition: Diagnostics.h:155
openvdb::v3_2_0::tools::CheckLevelSet::checkFinite
std::string checkFinite(bool updateMask=false)
Return a nonempty message if any of the values are not finite. i.e. NaN or inf.
Definition: Diagnostics.h:876
openvdb::v3_2_0::tools::CheckFogVolume::checkBackground
std::string checkBackground() const
Return a nonempty message if the background value is not zero.
Definition: Diagnostics.h:1019
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::ValueType
TreeType::ValueType ValueType
Definition: Diagnostics.h:1111
openvdb::v3_2_0::tools::CheckRange::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the tile at the iterator location is out of range.
Definition: Diagnostics.h:330
openvdb::v3_2_0::tools::CheckNormGrad::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the norm of the gradient at a voxel location of the iterator is out of range...
Definition: Diagnostics.h:480
openvdb::v3_2_0::tools::CheckNan::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:137
openvdb::v3_2_0::Index64
uint64_t Index64
Definition: Types.h:57
openvdb::v3_2_0::tools::CheckDivergence::acc
AccT acc
Definition: Diagnostics.h:615
openvdb::v3_2_0::tools::CheckLevelSet::checkEikonal
std::string checkEikonal(bool updateMask=false, ValueType minV=0.5, ValueType maxV=1.5)
Return a nonempty message if the norm of the gradient of the active voxels is out of the range minV t...
Definition: Diagnostics.h:907
openvdb::v3_2_0::tools::CheckDivergence::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the divergence at a voxel location of the iterator is out of range.
Definition: Diagnostics.h:601
openvdb::v3_2_0::tools::CheckMax::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
Return true if any of the vector components are larger than max.
Definition: Diagnostics.h:408
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
Definition: version.h:43
openvdb::v3_2_0::tools::CheckNan::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:161
openvdb::v3_2_0::tools::CheckNormGrad::ValueType
GridT::ValueType ValueType
Definition: Diagnostics.h:441
openvdb::v3_2_0::tools::CheckFinite::operator()
bool operator()(const TreeIterT &iter) const
Return true if the tile at the iterator location is NaN or infinite.
Definition: Diagnostics.h:228
openvdb::v3_2_0::tools::CheckFogVolume::mask
MaskType::Ptr mask()
Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more check...
Definition: Diagnostics.h:980
openvdb::v3_2_0::tools::CheckLevelSet::failureCount
Index64 failureCount() const
Return total number of failed checks.
Definition: Diagnostics.h:814
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::getInactiveValues
void getInactiveValues(SetType &) const
Definition: Diagnostics.h:1282
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::SetType
std::set< ValueType > SetType
Definition: Diagnostics.h:1206
openvdb::v3_2_0::tools::CheckRange::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:301
openvdb::v3_2_0::tools::CheckRange::operator()
bool operator()(const ElementType &v) const
Return true if the value is smaller than min or larger than max.
Definition: Diagnostics.h:312
openvdb::v3_2_0::tools::CheckEikonal::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:549
openvdb::v3_2_0::tools::CheckFogVolume::CheckFogVolume
CheckFogVolume(const GridType &grid)
Definition: Diagnostics.h:973
openvdb::v3_2_0::tools::CheckFinite::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:208
openvdb::v3_2_0::tools::CheckMax::maxVal
const ElementType maxVal
Definition: Diagnostics.h:427
openvdb::v3_2_0::tree::IteratorRange
Definition: TreeIterator.h:1339
openvdb::v3_2_0::tools::CheckMax::CheckMax
CheckMax(const ElementType &_max)
Constructor taking a maximum to be tested against.
Definition: Diagnostics.h:400
openvdb::v3_2_0::tools::CheckDivergence
Checks the divergence against a range.
Definition: Diagnostics.h:566
openvdb::v3_2_0::tools::CheckNormGrad::CheckNormGrad
CheckNormGrad(const CheckNormGrad &other)
Definition: Diagnostics.h:463
openvdb::v3_2_0::tools::CheckInf::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:198
openvdb::v3_2_0::tools::CheckMax::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:395
openvdb::v3_2_0::tools::CheckNan::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:134
openvdb::v3_2_0::tools::CheckInf::operator()
bool operator()(const TreeIterT &iter) const
Return true if the tile at the iterator location is infinite.
Definition: Diagnostics.h:192
openvdb::v3_2_0::tools::CheckMin::operator()
bool operator()(const ElementType &v) const
Return true if the value is smaller than min.
Definition: Diagnostics.h:360
openvdb::v3_2_0::tools::CheckFogVolume::grid
const GridType & grid() const
Return a const reference to the grid.
Definition: Diagnostics.h:993
openvdb::v3_2_0::tools::CheckMagnitude::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the tile at the iterator location is infinite.
Definition: Diagnostics.h:276
openvdb::v3_2_0::tools::CheckMagnitude::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:245
openvdb::v3_2_0::tools::CheckMin::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:351
openvdb::v3_2_0::tools::CheckMax::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:394
openvdb
Definition: Exceptions.h:39
openvdb::v3_2_0::math::BiasedGradientScheme
BiasedGradientScheme
Biased Gradients are limited to non-centered differences.
Definition: FiniteDifference.h:192
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::join
void join(const InactiveVoxelValues< TreeType > &)
Definition: Diagnostics.h:1184
openvdb::v3_2_0::math::Tolerance
Tolerance for floating-point comparison.
Definition: Math.h:125
openvdb::v3_2_0::tools::CheckDivergence::CheckDivergence
CheckDivergence(const GridT &grid, const ValueType &_min, const ValueType &_max)
Constructor taking a grid and a range to be tested against.
Definition: Diagnostics.h:577
openvdb::v3_2_0::tools::CheckLevelSet::checkClassType
std::string checkClassType() const
Return message if the grid&#39;s class is a level set.
Definition: Diagnostics.h:834
openvdb::v3_2_0::tools::CheckInf::CheckInf
CheckInf()
Default constructor.
Definition: Diagnostics.h:178
openvdb::v3_2_0::tools::CheckNormGrad::acc
AccT acc
Definition: Diagnostics.h:494
openvdb::v3_2_0::tools::CheckLevelSet::ValueType
GridType::ValueType ValueType
Definition: Diagnostics.h:794
openvdb::v3_2_0::tools::CheckMagnitude::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:246
openvdb::v3_2_0::tools::CheckRange::ElementType
VecTraits< typename GridT::ValueType >::ElementType ElementType
Definition: Diagnostics.h:298
openvdb::v3_2_0::tools::CheckLevelSet::grid
const GridType & grid() const
Return a const reference to the grid.
Definition: Diagnostics.h:817
openvdb::v3_2_0::tools::CheckEikonal
Checks the norm of the gradient at zero-crossing voxels against a range.
Definition: Diagnostics.h:507
openvdb::v3_2_0::tools::CheckEikonal::minVal
const ValueType minVal
Definition: Diagnostics.h:557
openvdb::v3_2_0::tools::CheckNan::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the voxel at the iterator location is NaN.
Definition: Diagnostics.h:158
openvdb::v3_2_0::tools::CheckMagnitude::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:248
openvdb::v3_2_0::tree::IterTraits
Definition: TreeIterator.h:106
openvdb::v3_2_0::tools::CheckDivergence::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:571
openvdb::v3_2_0::tools::CheckFogVolume::checkInactiveValues
std::string checkInactiveValues(bool updateMask=false)
Return a nonempty message if any of the inactive values are not zero.
Definition: Diagnostics.h:1041
openvdb::v3_2_0::tools::CheckDivergence::operator()
bool operator()(const ElementType &v) const
Return true if the value is smaller than min or larger than max.
Definition: Diagnostics.h:593
openvdb::v3_2_0::tools::CheckInf
Checks for infinite values, e.g. 1/0 or -1/0.
Definition: Diagnostics.h:170
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues
Definition: Diagnostics.h:1201
openvdb::v3_2_0::tree::IteratorRange::iterator
const IterT & iterator() const
Return a reference to this range&#39;s iterator.
Definition: TreeIterator.h:1360
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::IterRange
tree::IteratorRange< typename TreeType::ValueOffCIter > IterRange
Definition: Diagnostics.h:1204
openvdb::v3_2_0::tools::CheckMin::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:354
openvdb::v3_2_0::tools::CheckMin
Checks a value against a minimum.
Definition: Diagnostics.h:349
openvdb::v3_2_0::tools::CheckFinite::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the tile at the iterator location is NaN or infinite.
Definition: Diagnostics.h:231
openvdb::v3_2_0::tools::CheckMax
Checks a value against a maximum.
Definition: Diagnostics.h:392
openvdb::v3_2_0::tools::CheckMax::operator()
bool operator()(const ElementType &v) const
Return true if the value is larger than max.
Definition: Diagnostics.h:403
openvdb::v3_2_0::math::CD_2ND
Definition: FiniteDifference.h:62
openvdb::v3_2_0::tools::CheckDivergence::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:608
openvdb::v3_2_0::tools::CheckNan::CheckNan
CheckNan()
Default constructor.
Definition: Diagnostics.h:140
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::getInactiveValues
void getInactiveValues(SetType &) const
Definition: Diagnostics.h:1191
openvdb::v3_2_0::tools::CheckEikonal::operator()
bool operator()(const VoxelIterT &iter) const
Return true if the norm of the gradient at a zero-crossing voxel location of the iterator is out of r...
Definition: Diagnostics.h:541
openvdb::v3_2_0::tools::CheckRange::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:333
openvdb::v3_2_0::tools::Diagnose::failureCount
Index64 failureCount() const
Return total number of failed checks.
Definition: Diagnostics.h:666
openvdb::v3_2_0::tools::CheckRange::operator()
bool operator()(const TreeIterT &iter) const
Return true if the voxel at the iterator location is out of range.
Definition: Diagnostics.h:327
openvdb::v3_2_0::tools::CheckLevelSet::checkInactiveValues
std::string checkInactiveValues(bool updateMask=false)
Return a nonempty message if the the inactive values do not have a magnitude equal to the background ...
Definition: Diagnostics.h:896
openvdb::v3_2_0::tools::CheckFogVolume::ValueType
GridType::ValueType ValueType
Definition: Diagnostics.h:970
openvdb::v3_2_0::MERGE_ACTIVE_STATES_AND_NODES
Definition: Types.h:267
openvdb::v3_2_0::tools::CheckFinite::operator()
bool operator()(const ElementType &v) const
Return true if the value is NOT finite, i.e. it&#39;s NaN or infinite.
Definition: Diagnostics.h:217
openvdb::v3_2_0::tools::Diagnose::MaskType
GridT::template ValueConverter< bool >::Type MaskType
Definition: Diagnostics.h:627
openvdb::v3_2_0::tools::CheckFinite::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:211
openvdb::v3_2_0::tree::LeafManager::leaf
LeafType & leaf(size_t leafIdx) const
Return a pointer to the leaf node at index leafIdx in the array.
Definition: LeafManager.h:354
Grid.h
openvdb::v3_2_0::tools::CheckEikonal::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:513
openvdb::v3_2_0::tools::CheckDivergence::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:573
openvdb::v3_2_0::ValueError
Definition: Exceptions.h:88
openvdb::v3_2_0::tools::CheckNormGrad::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:487
openvdb::v3_2_0::tools::CheckFogVolume
Class that performs various types of checks on fog volumes.
Definition: Diagnostics.h:967
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::runParallel
void runParallel()
Definition: Diagnostics.h:1151
openvdb::v3_2_0::math::ISDivergence
Divergence operator defined in index space using various first derivative schemes.
Definition: Operators.h:495
openvdb::v3_2_0::tools::CheckMin::minVal
const ElementType minVal
Definition: Diagnostics.h:384
openvdb::v3_2_0::tools::CheckLevelSet::clear
void clear()
Clear the mask and error counter.
Definition: Diagnostics.h:820
openvdb::v3_2_0::tools::CheckInf::operator()
bool operator()(const ElementType &v) const
Return true if the value is infinite.
Definition: Diagnostics.h:181
openvdb::v3_2_0::math::isApproxZero
bool isApproxZero(const Type &x)
Return true if x is equal to zero to within the default floating-point comparison tolerance...
Definition: Math.h:336
openvdb::v3_2_0::tools::CheckMagnitude::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:279
Stencils.h
Defines various finite difference stencils by means of the "curiously recurring template pattern" on ...
openvdb::v3_2_0::tools::CheckMin::CheckMin
CheckMin(const ElementType &_min)
Definition: Diagnostics.h:357
openvdb::v3_2_0::tools::CheckMagnitude::operator()
bool operator()(const TreeIterT &iter) const
Return true if the tile at the iterator location is infinite.
Definition: Diagnostics.h:273
openvdb::v3_2_0::tools::CheckLevelSet::checkBackground
std::string checkBackground(Real halfWidth=LEVEL_SET_HALF_WIDTH) const
Return a nonempty message if the background value is larger than or equal to the halfWidth*voxelSize...
Definition: Diagnostics.h:852
openvdb::v3_2_0::tools::CheckNormGrad::operator()
bool operator()(const TreeIterT &) const
Return true if zero is outside the range.
Definition: Diagnostics.h:476
openvdb::v3_2_0::tools::CheckFogVolume::checkRange
std::string checkRange(bool updateMask=false)
Return a nonempty message if the active voxel values are out-of-range, i.e. not in the range [0...
Definition: Diagnostics.h:1051
openvdb::v3_2_0::tools::CheckEikonal::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:511
openvdb::v3_2_0::tools::CheckLevelSet::checkRange
std::string checkRange(bool updateMask=false)
Return a nonempty message if the active voxel values are out-of-range.
Definition: Diagnostics.h:885
openvdb::v3_2_0::tools::CheckNormGrad::minVal2
const ValueType minVal2
Definition: Diagnostics.h:495
openvdb::v3_2_0::GRID_LEVEL_SET
Definition: Types.h:213
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
openvdb::v3_2_0::tools::CheckFinite
Checks for both NaN and inf values, i.e. any value that is not finite.
Definition: Diagnostics.h:206
openvdb::v3_2_0::tools::CheckMin::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:352
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues
Definition: Diagnostics.h:1107
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::runSerial
void runSerial(IterRange &)
Definition: Diagnostics.h:1251
LeafManager.h
A LeafManager manages a linear array of pointers to a given tree&#39;s leaf nodes, as well as optional au...
openvdb::v3_2_0::tools::CheckFinite::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:209
openvdb::v3_2_0::tools::CheckDivergence::operator()
bool operator()(const TreeIterT &) const
Return true if zero is outside the range.
Definition: Diagnostics.h:597
openvdb::v3_2_0::tools::CheckInf::VoxelIterT
tree::IterTraits< typename TreeIterT::NodeT, typename TreeIterT::ValueIterT >::template NodeConverter< typename GridT::TreeType::LeafNodeType >::Type VoxelIterT
Definition: Diagnostics.h:175
openvdb::v3_2_0::tools::Diagnose::check
std::string check(const CheckT &check, bool updateMask=false, bool checkVoxels=true, bool checkTiles=true, bool checkBackground=true)
Definition: Diagnostics.h:635
openvdb::v3_2_0::tools::CheckNan::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:135
openvdb::v3_2_0::tools::CheckMin::operator()
bool operator()(const TreeIterT &iter) const
Return true if the voxel at the iterator location is smaller than min.
Definition: Diagnostics.h:371
openvdb::v3_2_0::tools::CheckNormGrad::CheckNormGrad
CheckNormGrad(const GridT &grid, const ValueType &_min, const ValueType &_max)
Constructor taking a grid and a range to be tested against.
Definition: Diagnostics.h:449
openvdb::v3_2_0::tools::CheckLevelSet::checkTransform
std::string checkTransform() const
Return a nonempty message if the grid&#39;s transform does not have uniform scaling.
Definition: Diagnostics.h:843
openvdb::v3_2_0::tools::CheckNormGrad::TileIterT
TreeIterT TileIterT
Definition: Diagnostics.h:443
openvdb::v3_2_0::tools::CheckDivergence::ValueType
GridT::ValueType ValueType
Definition: Diagnostics.h:568
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::runSerial
void runSerial()
Definition: Diagnostics.h:1159
openvdb::v3_2_0::tools::CheckFogVolume::failureCount
Index64 failureCount() const
Return total number of failed checks.
Definition: Diagnostics.h:990
openvdb::v3_2_0::tools::Diagnose::mask
MaskType::Ptr mask()
Return a boolean mask of all the values (i.e. tiles and/or voxels) that have failed one or more check...
Definition: Diagnostics.h:656
openvdb::v3_2_0::tools::CheckMagnitude::tolVal
const ElementType tolVal
Definition: Diagnostics.h:286
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::InactiveTileValues
InactiveTileValues(size_t numValues)
Definition: Diagnostics.h:1226
openvdb::v3_2_0::tools::Diagnose::grid
const GridT & grid() const
Return a const reference to the grid.
Definition: Diagnostics.h:669
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::operator()
void operator()(const tbb::blocked_range< size_t > &)
Definition: Diagnostics.h:1167
openvdb::v3_2_0::tools::diagnostics_internal::InactiveVoxelValues::InactiveVoxelValues
InactiveVoxelValues(LeafArray &, size_t numValues)
Definition: Diagnostics.h:1132
openvdb::v3_2_0::tools::diagnostics_internal::InactiveTileValues::runParallel
void runParallel(IterRange &)
Definition: Diagnostics.h:1243
openvdb::v3_2_0::tools::CheckFogVolume::valueCount
Index64 valueCount() const
Return the number of values (i.e. background, tiles or voxels) that have failed one or more checks...
Definition: Diagnostics.h:985
openvdb::v3_2_0::tools::CheckRange
Checks a value against a range.
Definition: Diagnostics.h:296
openvdb::v3_2_0::tools::CheckMin::str
std::string str() const
Return a string describing a failed check.
Definition: Diagnostics.h:377
Operators.h
openvdb::v3_2_0::tools::CheckNan::operator()
boost::enable_if_c< VecTraits< T >::IsVec, bool >::type operator()(const T &v) const
This allows for vector values to be checked component-wise.
Definition: Diagnostics.h:148
openvdb::v3_2_0::tools::CheckFogVolume::MaskType
GridType::template ValueConverter< bool >::Type MaskType
Definition: Diagnostics.h:971
openvdb::v3_2_0::tools::CheckDivergence::minVal
const ValueType minVal
Definition: Diagnostics.h:616