Class VoxelsAssignerFactory
Object
VoxelsAssignerFactory
Creates
VoxelsAssigner
for buffers of different types.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic VoxelsAssigner
createFloat
(Voxels<FloatBuffer> voxels, int valueToAssign) Create aVoxelsAssigner
for aFloatBuffer
.static VoxelsAssigner
createUnsignedByte
(Voxels<UnsignedByteBuffer> voxels, int valueToAssign) Create aVoxelsAssigner
for aUnsignedByteBuffer
.static VoxelsAssigner
createUnsignedInt
(Voxels<UnsignedIntBuffer> voxels, int valueToAssign) Create a aVoxelsAssigner
for aUnsignedIntBuffer
.static VoxelsAssigner
createUnsignedShort
(Voxels<UnsignedShortBuffer> voxels, int valueToAssign) Create aVoxelsAssigner
for aUnsignedShortBuffer
.static VoxelsAssigner
shiftBackBy
(VoxelsAssigner voxelsAssigner, ReadableTuple3i shift) Shifts all coordinates backwards before passing to anotherVoxelsAssigner
.
-
Method Details
-
createUnsignedByte
public static VoxelsAssigner createUnsignedByte(Voxels<UnsignedByteBuffer> voxels, int valueToAssign) Create aVoxelsAssigner
for aUnsignedByteBuffer
.- Parameters:
voxels
- the voxels on which arithmetic is to be performed.valueToAssign
- the voxel-value to assign.- Returns:
- a newly created assigner.
-
createUnsignedShort
public static VoxelsAssigner createUnsignedShort(Voxels<UnsignedShortBuffer> voxels, int valueToAssign) Create aVoxelsAssigner
for aUnsignedShortBuffer
.- Parameters:
voxels
- the voxels on which arithmetic is to be performed.valueToAssign
- the voxel-value to assign.- Returns:
- a newly created assigner.
-
createUnsignedInt
Create a aVoxelsAssigner
for aUnsignedIntBuffer
.- Parameters:
voxels
- the voxels on which arithmetic is to be performed.valueToAssign
- the voxel-value to assign.- Returns:
- a newly created assigner.
-
createFloat
Create aVoxelsAssigner
for aFloatBuffer
.- Parameters:
voxels
- the voxels on which arithmetic is to be performed.valueToAssign
- the voxel-value to assign.- Returns:
- a newly created assigner.
-
shiftBackBy
Shifts all coordinates backwards before passing to anotherVoxelsAssigner
.This is useful for translating from global coordinates to relative coordinates e.g. translating the global coordinate systems used in
BoundedVoxels
to relative coordinates for underlying voxel buffer.- Parameters:
voxelsAssigner
- the delegate where the shifted coordinates are passed to.shift
- how much to shift back by.- Returns:
- a newly created assigner that performs a shift after calling the existing assigner.
-