Class IterateVoxelsNeighbors

Object
IterateVoxelsNeighbors

public class IterateVoxelsNeighbors extends Object
Utilities for iterating over the neighboring voxels to a given point.
Author:
Owen Feehan
  • Method Details

    • callEachPointInNeighborhood

      public static <T> T callEachPointInNeighborhood(Point3i sourcePoint, Neighborhood neighborhood, boolean do3D, ProcessVoxelNeighbor<T> process, int sourceValue, int sourceOffsetXY)
      Iterate over each point in the neighborhood of an existing point.

      It also sets the source in process.

      Parameters:
      sourcePoint - the point to iterate over its neighborhood.
      neighborhood - a definition of what constitutes the neighborhood.
      do3D - whether to iterate in 2D or 3D.
      process - is called for each voxel in the neighborhood of the source-point.
      sourceValue - the value in the source buffer at sourcePoint.
      sourceOffsetXY - the offset of the source buffer corresponding to sourcePoint.
      Returns:
      the result after processing each point in the neighborhood.