Class VoxelsAssignerFactory

Object
VoxelsAssignerFactory

public class VoxelsAssignerFactory extends Object
Creates VoxelsAssigner for buffers of different types.
Author:
Owen Feehan
  • Method Details

    • createUnsignedByte

      public static VoxelsAssigner createUnsignedByte(Voxels<UnsignedByteBuffer> voxels, int valueToAssign)
      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)
      Parameters:
      voxels - the voxels on which arithmetic is to be performed.
      valueToAssign - the voxel-value to assign.
      Returns:
      a newly created assigner.
    • createUnsignedInt

      public static VoxelsAssigner createUnsignedInt(Voxels<UnsignedIntBuffer> voxels, int valueToAssign)
      Parameters:
      voxels - the voxels on which arithmetic is to be performed.
      valueToAssign - the voxel-value to assign.
      Returns:
      a newly created assigner.
    • createFloat

      public static VoxelsAssigner createFloat(Voxels<FloatBuffer> voxels, int valueToAssign)
      Create a VoxelsAssigner for a FloatBuffer.
      Parameters:
      voxels - the voxels on which arithmetic is to be performed.
      valueToAssign - the voxel-value to assign.
      Returns:
      a newly created assigner.
    • shiftBackBy

      public static VoxelsAssigner shiftBackBy(VoxelsAssigner voxelsAssigner, ReadableTuple3i shift)
      Shifts all coordinates backwards before passing to another VoxelsAssigner.

      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.