Field3D
|
Storage for one individual block of a SparseField. More...
#include <SparseField.h>
Public Member Functions | |
void | clear () |
Remove data. More... | |
void | copy (const SparseBlock &other, size_t n) |
Copy data from another block. More... | |
void | resize (int n) |
Alloc data. More... | |
SparseBlock () | |
Ctor. More... | |
Data_T & | value (int i, int j, int k, int blockOrder) |
Gets the value of a given voxel. More... | |
const Data_T & | value (int i, int j, int k, int blockOrder) const |
Gets the const value of a given voxel. More... | |
~SparseBlock () | |
Dtor. More... | |
Public Attributes | |
Data_T * | data |
Pointer to data. Null if block is unallocated. More... | |
Data_T | emptyValue |
The value to use if the block isn't allocated. We allow setting this per block so that we for example can have different inside/outside values when storing narrow-band levelsets. More... | |
bool | isAllocated |
Whether the block is allocated or not. More... | |
Private Member Functions | |
const SparseBlock & | operator= (const SparseBlock &) |
Non-copyable. More... | |
SparseBlock (const SparseBlock &) | |
Non-copyable. More... | |
Static Private Attributes | |
static boost::mutex | ms_resizeMutex |
Prevents concurrent allocation of blocks. There should be little contention, and this prevents multiple threads from trying to allocate the same field. More... | |
Storage for one individual block of a SparseField.
Definition at line 227 of file SparseField.h.
|
inline |
Ctor.
Definition at line 232 of file SparseField.h.
|
inline |
Dtor.
Definition at line 239 of file SparseField.h.
|
private |
Non-copyable.
|
inline |
Gets the value of a given voxel.
Definition at line 249 of file SparseField.h.
Referenced by SparseField< Data_T >::fastLValue(), SparseField< Data_T >::fastValue(), SparseField< Data_T >::const_iterator::operator*(), SparseField< Data_T >::const_iterator::operator->(), SparseField< Data_T >::const_iterator::setupNextBlock(), and SparseField< Data_T >::iterator::setupNextBlock().
|
inline |
Gets the const value of a given voxel.
Definition at line 255 of file SparseField.h.
|
inline |
Alloc data.
Definition at line 259 of file SparseField.h.
Referenced by SparseField< Data_T >::fastLValue(), and SparseFieldIO::readData().
|
inline |
Remove data.
Definition at line 273 of file SparseField.h.
Referenced by SparseField< Data_T >::copyBlockStates(), and SparseField< Data_T >::deallocBlock().
|
inline |
Copy data from another block.
Definition at line 285 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data, and Sparse::SparseBlock< Data_T >::isAllocated.
Referenced by SparseField< Data_T >::copySparseField().
|
private |
Non-copyable.
bool Sparse::SparseBlock< Data_T >::isAllocated |
Whether the block is allocated or not.
Definition at line 303 of file SparseField.h.
Referenced by SparseField< Data_T >::blockData(), SparseField< Data_T >::blockIsAllocated(), Sparse::SparseBlock< Data_T >::copy(), SparseField< Data_T >::copyBlockStates(), SparseField< Data_T >::copySparseField(), SparseField< Data_T >::deallocBlock(), SparseField< Data_T >::fastLValue(), SparseField< Data_T >::fastValue(), SparseFieldIO::readData(), SparseField< Data_T >::setBlockEmptyValue(), SparseField< Data_T >::const_iterator::setupNextBlock(), SparseField< Data_T >::iterator::setupNextBlock(), and SparseFieldIO::writeInternal().
Data_T Sparse::SparseBlock< Data_T >::emptyValue |
The value to use if the block isn't allocated. We allow setting this per block so that we for example can have different inside/outside values when storing narrow-band levelsets.
Definition at line 308 of file SparseField.h.
Referenced by SparseField< Data_T >::clear(), SparseField< Data_T >::copyBlockStates(), SparseField< Data_T >::copySparseField(), SparseField< Data_T >::deallocBlock(), SparseField< Data_T >::fastValue(), SparseField< Data_T >::getBlockEmptyValue(), SparseFieldIO::readData(), SparseField< Data_T >::setBlockEmptyValue(), SparseField< Data_T >::const_iterator::setupNextBlock(), SparseField< Data_T >::iterator::setupNextBlock(), and SparseFieldIO::writeInternal().
Data_T* Sparse::SparseBlock< Data_T >::data |
Pointer to data. Null if block is unallocated.
Definition at line 311 of file SparseField.h.
Referenced by SparseField< Data_T >::blockData(), Sparse::CheckAllEqual< Data_T >::check(), Sparse::CheckMaxAbs< Data_T >::check(), Sparse::SparseBlock< Data_T >::copy(), and SparseFieldIO::writeInternal().
|
staticprivate |
Prevents concurrent allocation of blocks. There should be little contention, and this prevents multiple threads from trying to allocate the same field.
Definition at line 325 of file SparseField.h.