Class VoxelsAssignerFactory
Object
VoxelsAssignerFactory
Creates
VoxelsAssigner for buffers of different types.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic VoxelsAssignercreateFloat(Voxels<FloatBuffer> voxels, int valueToAssign) Create aVoxelsAssignerfor aFloatBuffer.static VoxelsAssignercreateUnsignedByte(Voxels<UnsignedByteBuffer> voxels, int valueToAssign) Create aVoxelsAssignerfor aUnsignedByteBuffer.static VoxelsAssignercreateUnsignedInt(Voxels<UnsignedIntBuffer> voxels, int valueToAssign) Create a aVoxelsAssignerfor aUnsignedIntBuffer.static VoxelsAssignercreateUnsignedShort(Voxels<UnsignedShortBuffer> voxels, int valueToAssign) Create aVoxelsAssignerfor aUnsignedShortBuffer.static VoxelsAssignershiftBackBy(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 aVoxelsAssignerfor 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 aVoxelsAssignerfor 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 aVoxelsAssignerfor 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 aVoxelsAssignerfor 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
BoundedVoxelsto 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.
-