Field3D
|
Storage for one individual block of a SparseField. More...
#include <SparseField.h>
Public Member Functions | |
void | clear () |
Remove data. | |
void | copy (const SparseBlock &other, size_t n) |
Copy data from another block. | |
void | resize (int n) |
Alloc data. | |
SparseBlock () | |
Ctor. | |
Data_T & | value (int i, int j, int k, int blockOrder) |
Gets the value of a given voxel. | |
const Data_T & | value (int i, int j, int k, int blockOrder) const |
Gets the const value of a given voxel. | |
~SparseBlock () | |
Dtor. | |
Public Attributes | |
Data_T * | data |
Pointer to data. Null if block is unallocated. | |
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. | |
bool | isAllocated |
Whether the block is allocated or not. | |
Private Member Functions | |
const SparseBlock & | operator= (const SparseBlock &) |
Non-copyable. | |
SparseBlock (const SparseBlock &) | |
Non-copyable. | |
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. | |
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 |
|
private |
Non-copyable.
|
inline |
Gets the value of a given voxel.
Definition at line 249 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data, and FIELD3D_MTX_T.
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.
References Sparse::SparseBlock< Data_T >::data, and FIELD3D_MTX_T.
|
inline |
Alloc data.
Definition at line 259 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data, Sparse::SparseBlock< Data_T >::emptyValue, FIELD3D_MTX_T, Sparse::SparseBlock< Data_T >::isAllocated, and Sparse::SparseBlock< Data_T >::ms_resizeMutex.
Referenced by Sparse::SparseBlock< Data_T >::copy().
|
inline |
Remove data.
Definition at line 273 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::data, FIELD3D_MTX_T, and Sparse::SparseBlock< Data_T >::ms_resizeMutex.
Referenced by Sparse::SparseBlock< Data_T >::copy().
|
inline |
Copy data from another block.
Definition at line 285 of file SparseField.h.
References Sparse::SparseBlock< Data_T >::clear(), Sparse::SparseBlock< Data_T >::data, FIELD3D_MTX_T, and Sparse::SparseBlock< Data_T >::resize().
|
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 >::blockIsAllocated(), SparseField< Data_T >::copySparseField(), and Sparse::SparseBlock< Data_T >::resize().
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(), and Sparse::SparseBlock< Data_T >::resize().
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::SparseBlock< Data_T >::clear(), Sparse::SparseBlock< Data_T >::copy(), Sparse::SparseBlock< Data_T >::resize(), Sparse::SparseBlock< Data_T >::value(), Sparse::SparseBlock< Data_T >::value(), and Sparse::SparseBlock< Data_T >::~SparseBlock().
|
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.
Referenced by Sparse::SparseBlock< Data_T >::clear(), and Sparse::SparseBlock< Data_T >::resize().