Checks if all the absolute values in the SparseBlock are greater than some number. Useful for making narrow band levelsets Used by SparseField::releaseBlocks().
More...
template<
typename Data_T>
struct Sparse::CheckMaxAbs< Data_T >
Checks if all the absolute values in the SparseBlock are greater than some number. Useful for making narrow band levelsets Used by SparseField::releaseBlocks().
Definition at line 811 of file SparseField.h.
◆ CheckMaxAbs()
◆ check()
Checks whether a given block can be released. It's safe to assume that the block is allocated if this functor is called.
- Parameters
-
block | Reference to the block to check |
retEmptyValue | If the block is to be removed, store the "empty value" that replaces it in this variable |
validSize | Number of voxels per dim within field data window |
blockSize | Number of voxels actually allocated per dim |
- Returns
- Whether or not the supplied block can be released.
Definition at line 825 of file SparseField.h.
827 {
828
830
832 size_t len = blockSize.x * blockSize.y * blockSize.z;
833
835
836 for (
size_t i = 0;
i <
len;
i++) {
839 break;
840 }
841 }
842 } else {
843
844 int x=0, y=0, z=0;
845 for (
size_t i = 0;
i <
len;
i++, x++) {
846 if (x >= blockSize.x) {
847 x = 0;
848 ++y;
849 if (y >= blockSize.y) {
850 y = 0;
851 ++z;
852 }
853 }
855 continue;
856 }
859 break;
860 }
861 }
862 }
863
866 return true;
867 } else {
868 return false;
869 }
870 }
References FIELD3D_MTX_T, and Sparse::CheckMaxAbs< Data_T >::m_maxValue.
◆ m_maxValue
The documentation for this struct was generated from the following file: