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...
#include <SparseField.h>
|
bool | check (const SparseBlock< Data_T > &block, Data_T &retEmptyValue, const V3i &validSize, const V3i &blockSize) |
| Checks whether a given block can be released. It's safe to assume that the block is allocated if this functor is called. More...
|
|
| CheckMaxAbs (Data_T maxValue) |
| Constructor. Takes max value. 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 798 of file SparseField.h.
template<typename Data_T >
template<typename Data_T >
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 812 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data.
816 Data_T first = block.data[0];
818 bool allGreater =
true;
819 size_t len = blockSize.x * blockSize.y * blockSize.z;
821 if (validSize == blockSize) {
823 for (
size_t i = 0; i < len; i++) {
824 if (isAnyLess<Data_T>(block.data[i],
m_maxValue)) {
832 for (
size_t i = 0; i < len; i++, x++) {
833 if (x >= blockSize.x) {
836 if (y >= blockSize.y) {
841 if (x >= validSize.x || y >= validSize.y || z >= validSize.z) {
844 if (isAnyLess<Data_T>(block.data[i],
m_maxValue)) {
852 retEmptyValue = first;
template<typename Data_T >
The documentation for this struct was generated from the following file: