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 558 of file SparseField.h.
◆ CheckMaxAbs()
template<typename Data_T >
◆ check()
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 572 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data.
576 Data_T first = block.data[0];
578 bool allGreater =
true;
579 if (validSize == blockSize) {
581 for (
typename std::vector<Data_T>::const_iterator i = block.data.begin();
582 i != block.data.end(); ++i) {
591 for (
typename std::vector<Data_T>::const_iterator i = block.data.begin();
592 i != block.data.end(); ++i, ++x) {
593 if (x >= blockSize.x) {
596 if (y >= blockSize.y) {
601 if (x >= validSize.x || y >= validSize.y || z >= validSize.z) {
612 retEmptyValue = first;
◆ m_maxValue
template<typename Data_T >
The documentation for this struct was generated from the following file: