Class IndexByRegion<T>

Object
IndexByRegion<T>
Type Parameters:
T - The type of the voxel partition

public class IndexByRegion<T> extends Object
An index structure that organizes voxel partitions by region and slice.
  • Constructor Details

    • IndexByRegion

      public IndexByRegion(VoxelPartitionFactory<T> factory, int numberRegions, int numberSlices)
      Constructs an IndexByRegion with a specified number of regions and slices.
      Parameters:
      factory - The factory to create voxel partitions
      numberRegions - The number of regions
      numberSlices - The number of slices per region
  • Method Details

    • getForAllSlices

      public T getForAllSlices(int regionID)
      Gets the combined voxel partition for all slices in a region. This method should only be used for read-only operations to maintain integrity with the combined list.
      Parameters:
      regionID - The ID of the region
      Returns:
      The combined voxel partition for the region
    • getForSlice

      public T getForSlice(int regionID, int sliceID)
      Gets the voxel partition for a specific slice in a region. This method should only be used for read-only operations to maintain integrity with the combined list.
      Parameters:
      regionID - The ID of the region
      sliceID - The ID of the slice
      Returns:
      The voxel partition for the specified region and slice
    • addToVoxelList

      public void addToVoxelList(int regionID, int sliceID, int val)
      Adds a value to the voxel list for a specific region and slice.
      Parameters:
      regionID - The ID of the region
      sliceID - The ID of the slice
      val - The value to add
    • cleanUp

      public void cleanUp(VoxelPartitionFactory<T> factory)
      Cleans up the voxel partitions using the provided factory.
      Parameters:
      factory - The factory to use for cleanup
    • numSlices

      public int numSlices()
      Gets the number of slices in each region.
      Returns:
      The number of slices