Interface SliceBufferIndex<T>
- Type Parameters:
T- buffer-type
public interface SliceBufferIndex<T>
A container with voxel-buffers for each z-slice.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionextent()The size of each buffer.default voiditerateOverSlices(Consumer<VoxelBuffer<T>> sliceConsumer) CallssliceConsumeronce for each slice with the respective buffer.default voidCallsprocessfor each offset in each slice.voidreplaceSlice(int z, VoxelBuffer<T> sliceToAssign) Replaces the voxels for a particular z-slice.slice(int z) AVoxelBuffercorresponding to a particular z-slice.default TsliceBuffer(int z) The underlying buffer corresponding to a particular z-slice.
-
Method Details
-
slice
AVoxelBuffercorresponding to a particular z-slice.- Parameters:
z- the index (beginning at 0) of all z-slices.- Returns:
- the corresponding buffer for
z.
-
sliceBuffer
The underlying buffer corresponding to a particular z-slice.- Parameters:
z- the index (beginning at 0) of all z-slices.- Returns:
- the corresponding buffer for
z.
-
replaceSlice
Replaces the voxels for a particular z-slice.- Parameters:
z- the index of z-slice to replace.sliceToAssign- the voxels for the new slice to assign.
-
extent
Extent extent()The size of each buffer.- Returns:
- the size.
-
iterateOverSlices
CallssliceConsumeronce for each slice with the respective buffer.This occurs sequentially from 0 (inclusive) to
z()(exclusive).- Parameters:
sliceConsumer- called for each index (z-value).
-
iterateOverSlicesAndOffsets
Callsprocessfor each offset in each slice.This occurs sequentially from 0 (inclusive) to
extent.z()(exclusive) and from 0 (inclusive) toextent.x() * extent.y()(exclusive) for the offsets.- Parameters:
process- called for each offset on each slice.
-